Note that there are some explanatory texts on larger screens.

plurals
  1. PONeed help for the correct values in a HTTP post (I think)
    text
    copied!<p>So i've never worked with PHP or http posting or anything before, so please excuse me if i'm asking something dumb.</p> <p>Heres a site so I can explain more accurately what I need.</p> <p><a href="http://nycserv.nyc.gov/NYCServWeb/NYCSERVMain" rel="nofollow">http://nycserv.nyc.gov/NYCServWeb/NYCSERVMain</a></p> <p>So I want to write something that will get the resultant page info as if I had hit the "go" button next to where it says "consumer fair violation". After doing a bunch of googling, I think i'm supposed to do HTTP posting, so i've been messing around with PHP and CURl. This is the code i've came up with, although I'm not sure what values i'm supposed to actually post.</p> <pre><code>&lt;?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://nycserv.nyc.gov/NYCServWeb/NYCSERVMain"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, true); $data = array( 'dcadropdownmenu.name' =&gt; 'javascript:consumerAffairsViolationsQuerySetup("GET_CONSUMER_AFFAIRS_VIOLATION_SEARCH_QUERY_SETUP")'); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $output = curl_exec($ch); $info = curl_getinfo($ch); curl_close($ch); print $info; print $output; ?&gt; </code></pre> <p>I'm pretty sure i'm not supposed to be setting dvaddropdowmenu.name, but I dont know what I am supposed to be posting. Any help would be great.</p> <p><strong>UPDATE</strong> So I finally got it to work. The problem i'm having now is how to HTTP post again on the returning page from the original. What I mean, is I got it to return the HTML from the page as if I hit the Go button. Now I need to hit the search button on this returned page. I tried just changing the post variables and exec'ing again, but that didn't work. Any help?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload