Forum Moderators: coopster

Message Too Old, No Replies

Passing post data

         

andrewsmd

5:58 pm on Jan 5, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I need to pass post data straight to a url. Basically what I am trying to do is test my site and I would like to pass a bunch of data via php. Does anyone know how. Here is the information
<form action = "somefile.php" method = "post">
<input type = "radio" name = "option" value = "1">Option 1</radio>
<input type = "radio" name = "option" value = "2">Option 2</radio>
<input type = "submit" name = "submit" value = "submit">
</form>
Basically I would like to insert a bunch of votes for option 1 and the same for option 2. Any suggestions? Thanks,

eelixduppy

6:13 pm on Jan 5, 2009 (gmt 0)



If you are testing your site, wherever you are collecting these votes you can just input the test into there. For instance, if you are storing the votes in a database, you can add test results directly to the database, you wouldn't need to submit each vote individually from the form.

Am I understanding you correctly?

andrewsmd

6:29 pm on Jan 5, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I understand that, I want to put them in through the webpage to test against bots and to see how much overhead the site can take. I would have just put the sql in if I wanted to do it your way. What I am trying to post will be much more complicated than that, I just simplified it so the problem could be easy to read.

eelixduppy

5:32 am on Jan 6, 2009 (gmt 0)



You might be able to use cURL [php.net] to do what you want, then. You'd just have to loop it a few times depending on how many times you wanted to submit the data. I guess you can also do it manually by refreshing a submitted page as to keep submitting the same data over again. I'd go this way, actually, instead of going nuts trying to code a test case.

andrewsmd

1:17 pm on Jan 6, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I used curl actually and figured it out yesterday. Thanks for your help.

eelixduppy

3:38 pm on Jan 6, 2009 (gmt 0)



Cool glad you found your solution. :)