Curl Question - Get A Page With Already Posted Data
I would like to get a page with already posted data. I use such code.
$user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
$ch = curl_init();....
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Using Referal URL, Getting Posted Data, Passing Posted To Include *HELP*
OK.. here is my problem.. I am using PHP as a frontend for executing (actually including) a vb CGI .exe file the include just does the following right now: <?php include("http://localhost/test/make.exe?f=$_GET[f]&f2=$_GET[f2]&step=$_GET[step]"); ?> What I need to do is I have a form that needs to have a "Back" button/link and a "Next" button/link .. If they click on "Back" I want it to pass the "Back" as the say... $GET[do] ... needs to equals "Back" if they click back. If they click "Next" it needs to equals "Next" .. I thought I may be able to detect what URL it is posting from because it is being posted like this: URL This would be fine except I need it to retrieve all the data from the form and I do not know if the PHP would get the data from the entire form if you passed it like this it seems like it would only get the posted info in the link.. Is there a way to make the Links as Buttons or keep them as links and then have the links/buttons submit with the different "Back" or "Next" values? Pls post code on how to do this and I would greatly appreciate it.. This is giving me a headache trying to figure it out! Thanks a lot!
Previous Page/Posted From
I wanna know if there's a way to find out what page/file a form was posted from. Or wich was the prevoius page/file that was linked to the currant page.
Outputting POSTed Data On Error
Got a form, user enters information, presses submit, then info added to my database. however, it checks to see if fields are empty when the button is pressed, if they are empty ive got it to bring up an error to say for example name, postcode empty. but the form comes back with blank fields i want it so if fields are empty form comes back with the fields that have already been filled in.
Reading Data Posted With XMLHttprequest
I'm trying to post a form (using POST not GET) using the xmlHttpRequest object. I cannot work out how to get PHP (4.1.2) to read the data which I'm submitting. Everything works fine if I use GET I can just read it from $_GET. If I use POST nothing appears in $_POST. To try to use the POST method I'm encoding the fields into a URL encoded string and sending it as the parameter to the request.send() function from Javascript. /Something/ is going out because I can see it in the LiveHHTPHeaders extension to Firefox. Presumably it's being received by the server. But how on earth do I get at it!?
Identify Server That Posted Data.
I am looking into the security aspects of a site, and would like to know if there is any way to identify the source of the data that is posted to the php page responsible for processing the data. in other words I only wantt he php code to process the data if the data was posted from a form hosted on my server.
Make Forms Keep Data After Being Posted
I'm trying to set up a simple preview-type thing for my very first blog script (im new to php and mysql). First off, heres my code for the update (place to post a new article) page (excluding the includes to connect to the database): Code:
Reading Data Posted With XMLHttprequest
To use the $_POST global without enabling the raw data in php.ini, try the following code: objXMLHttpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); objXMLHttpRequest.send('var=value&var2=value2');
CURL/PHP - Outputting Different Data
I would like multiple, different urls / proxy servers / proxy ports to be submitted, all on the same script (without having to create any other files). function file_get_contents_proxy($szURL, $szProxy, $iProxyPort) { $pCurl = curl_init($szURL); curl_setopt(CURLOPT_PROXY, $szProxy); curl_setopt(CURLOPT_PROXYPORT, $iProxyPort); curl_setopt(CURLOPT_FOLLOWLOCATION, true); curl_setopt(CURLOPT_RETURNTRANSFER, true); return curl_exec($pCurl); } ............
CURL - How To Get URL Of Returned Page?
Is there a way to get the URL of the page that is returned when using Curl? If I look at CURLINFO_EFFECTIVE_URL value from the return of curlget_info(), all I see is the URL I requested, not the one that is returned. I am trying to write an URL checking script against a site that may return a page other than the one you requested without it being seen as a 302...
Curl / Page Scrape
I'm having trouble using Curl. Here is the situation. My goal is to perform an Orbitz hotel search and retrieve the results. I don't need help with any of the regex stuff (well, i can't even get to that point as of yet). With this URL ... http://www.orbitz.com/App/Landing?placementID=1&pageID=41&startDate:useDateText=true&endDate:useDateText=true&city=New+York&startDate:date=07/26/2007&endDate:date=07/27/2007&numberOfRooms=1&adults=1 (as an example, I've put in a search for hotels in New York from 7/26 - 7/27). The problem is, it goes to orbitz's "now searching" page, and then I get redirected to the page that actually shows the results. When I try to use curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); it just autmoatically redirects the page that is performing the CURL to the Orbitz url that shows the results. Any ideas?
How To Attach POST Data To CURL
I'm trying to use CURL to submit XML requests to web service API's. I've got everything working except that I can't figure out how to actually attach my own custom XML string request to the POST. As such, I'm getting XML responses that simply say 'Invalid Request'. Here's what my CURL function currently looks like: Code:
CURL To Pull Data From A Site
I've been using php and cURL to pull data from a site, and things worked just fine. however, when i used the same script to access a different site, not data is being returned. however, i can go to the url of the site being used and there is clearly html there which should theoretically be scraped. any idea why it is not being gathered and how can i fix this?
CURl Get Yahoo! Search Page
I want to use curl get yahoo! search result page. but it returns null. I read the Yahoo! developer network,and follow the tutorial.But it also returns null. http://developer.yahoo.com/php/howto-reqRestPhp.html
Curl :: Send XML To A HTTPS Web Page
I'm using PHP to send XML to a HTTPS web page. Everything works fine but can someone help me to remove what I presume is the Curl transfer stats. In the middle of the web page I get the following: % Total % Received % Xferd Average Speed Time etc etc $ch=curl_init($url); curl_setopt($ch,CURLOPT_VERBOSE,0); curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false); curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,1); curl_setopt($ch,CURLOPT_POST,0); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_NOPROGRESS,0); curl_setopt($ch,CURLOPT_HTTPDHEADER,$request_post); curl_setopt($ch,CURLOPT_POSTFIELDS,"xmlstream=".$request_xml); $request_result=curl_exec($ch);
Get Form Elements From A Page Using Curl
I am trying to get all form elements on any page using curl. I can get the data no problem but I think the preg_match_all is all screwy because I don't get the results I want. Here is my code: ....
Curl Load Page That Has Variable In Url?
I'm trying to load a page that has a variable in the url. Such as: index.php?name=bob I tried acting like the page was just a normal page (such as index.php) but that didn't seem to work. How do I give the server the variable in the url?
CURL To Post Form Data To Another Site
Is there a way to use CURL to post form data to another site and make the URL change from the current php script to the url of the site that I curl to? Right now when i test this the URL remains as the name of mu script ... ie> www.mysite.com/curl.php instead of changing to the address I am doing the curl to. I tried setting this variable curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); but it only changes to the new sites URL when I click a link on that site.
Redirecting To Target Page Along With POST With CURL...
I want to send some POST data with cURL and then also redirect to the location where Im sending the POST data. Ive been running around like crazy and unable to find a way. This must be something very simple. Heres what I have thus far, except this doesnt redirect to my target page. Code:
Blank Response By Curl When Posting Form Data
Here is my code, and the problem: $st="...(string to post is formed from different variables read from file)..."; $lngth=strlen($st); $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_URL, $url2); $fp = fopen("example_homepage2.txt", "w"); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,20); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_REFERER, $url); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDSIZE, $lngth); curl_setopt($ch, CURLOPT_POSTFIELDS, $st); $page2=curl_exec($ch); curl_close($ch); fclose($fp);
Blank Response From Curl When Posting Form Data
Here is my code, and the problem: $st="...(string to post is formed from different variables read from file)..."; $lngth=strlen($st); $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_URL, $url2); $fp = fopen("example_homepage2.txt", "w"); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,20); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_REFERER, $url); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDSIZE, $lngth); curl_setopt($ch, CURLOPT_POSTFIELDS, $st); $page2=curl_exec($ch); curl_close($ch); fclose($fp); I tried both with and without POSTFIELDSIZE option, with same result. This code works fine for strings smaller than 800 characters (actually 795 or so), but my regular string is just under 13000 characters. I have uploaded the script to 5 webservers (including my development machine with Win XP , PHP 5 and Apache 2.2.) and it only works on one. The rest return a blank page to stare at on the curl post. Is this some configuration issue, or a curl issue?
Simulate Send Data With POST And Get Data From A Web Page (whith A Session)
I'd like to get text of a webpageB that I reach by putting a login and a password in a webpageA. I mean: I'd like to get text of a WebPageB with a php script. But before I can see WebPageB I have to autenticate myself in a WebPageA writing my login and my password in a form, the host recognise me and (by session) let me see the WebPageB. The question is: 1)how to simulate send data (login an password) in form with a PHP script? 2)how to navigate in a Web usin the same session?
PHP CLI Command Line On Win XP Pro Calling External Page With CURL
I wanted to avoid using VBSCRIPT to process a local script running on a win xp pro box. Being that I know php pretty well, I thought I might try it to solve the problem of not knowing vbscript. I have it running fine on this machine. even have it so I can just type in the php script name instead of c:/php5/php.exe before the script. Cool stuff. I need to call a php script on another server when this runs and receive a response. (preferrably using POST). I had a test working with vbscript using MS's XMLHTTP. Not knowing what else to use. I got a quick test working with cURL but it doesnt seem to like the curl_setopt settings. without them, it calls the page (As GET) and receives a response. So my question is. is there a better method than CURL to receive a response from a script running on the command line? and how can I get it to use POST if I cant use curl_setopt.
If Value =1 Direct To Page Otherwise Show Data On Page
In the member account area there is a button saying (list) when the member clicks this they are redirected to add.php here i am wanting to check if a members account is limited, if it is direct them to a page saying you must pay your bill. if its not display the info on the page. in the database there is a field called limited which is tiny in if its not limited the value of the field would be 0 if it is limited the value would be 1.
Notify Once Posted
While I'm writing a reply to a message, someone else writes one and posts it, now for my site I'll be making a message board. Is there anyway to tell the user that someone has posted a response while they're on the compose screen?
Name Of The Form That Was POSTed?
Is it possible to determine the name of the form that caused a page to be submitted? I have seen numerous examples of how to determine the method of the POST and how to retrieve data elements from the post, but I haven't seen any way to know the name of the form that caused the post. The page that is POSTing to my script has two forms and I'd like to know if I can determine which one of them was submitted without having to add a hidden element to the forms.
CURL Problem.. Comparing Output From IE/CURL Differs
I'm writing a tiny php app that will log into our bank of america account and retrieve a file containing a list of checks that cleared the previous day. The problem I'm running into is when I perform actions with php/CURL the output is different than when I use IE and I'm completely stumped as to why. The final output should list files available for retrieval but the CURL output displays an error/empty file message. Here is the curl portion of my code:
How To Check That Form Is Posted ?
i have a form on a php script - the php script is signup.php, i want to check that when it is submitted when user press the submit button, it will check whether the fields are empty or filled. how do i check that the user is clicking on the submit button and not going to the signup.php as a link ? because currently, when anyone click on signup.php, it immediately showed the errors (as if the user forgot to fill up the fields - when actually he is just going there from another link ). <? if(!$name&&!$email&&!$address&&!$phone) { // all not filled up echo "Error. You must fill up your name..... ";}?>
Escape All Posted Variables?
this works well enough when all the elements in $HTTP_POST_VARS are scalars, but it doesn't work so hot if one or more of them is an array: <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre> while(list($key,$val)=each($HTTP_POST_VARS)){$$key=htmlspecialchars($val);} [/code] So what I need is an easy way to tell if "$val" is an Array so that I can do something similar to each of its elements in turn.
Faking Posted Variables
I have played with this some unsuccessfully and can't find any references to it on-line. What I have is a forms-based application where I POST the form. This was decided on because of security and the length limits of a URL. Now I have a need where I would like to link to a form and "fake" some of the variables that are normally posted. For example, I have a form that normally comes up where the user selects information from a combobox and on reload, the fields are then automatically filled in. I would like to be able to go to that form from other locations and fake the POST variable of the combobox so that the form will fill in when they first access it.
Editing Posted Bulletins
I have a section on my church website that pulls announcements stored in mySQL and displays them with PHP. I recently started working on a control panel so that other people could login and edit/create the announcements so as to keep it up to date and lighten my load. I use a while statement to display all of the bits of news but my question is how can I make an edit button specific to each row in the table on mysql? All I need to really be able to do is have an edit button spit out for each post that will set a session variable to that particular posts index number. I created the mysql table with this in mind and have index numbers to reference the chunks of data.
Retaining Previous Posted Values
I have a form that if submitted correctly posts back to itself with a message that says the record was entered correctly. what I would like to do is retain the last values entered in some of the fields so that they don't have to retype everything if they want to add addtional records (it's a list of species and many times phylum, class, order do not change.) i thought I could do it with session variables but it doesn't work.
PHP/ List Authors That Have Posted More Than X Comments
I'm currently trying to implement sort of a "remember me"-addon to a newsposting script I'm using (cutenews, cutephp.com). What I need is to produce an array that contains comment-authors that have posted a set number of comments to my site. If I set this numer to 5, I want all commenter-names that have posted 5+ comments to be in the array this script is to produce. The format of the comments database is this: <unique id>¦<comment-authorname>¦<url>¦<ip>¦<comment-text>¦¦ (where ¦¦ means new comment follows - no seperate line for each comment.) Can anyone give me pointers to where I should start? This problem is really bugging me. 1, I need to search a huge text-file with hundreds of these unique comments, then I need to print a list of the authornames that have posted more than the set minimum number of comments to get listed. I'm going to use this list for a form field where people can select their name...
Best Way To Encrypt A Form Posted URL String?
Could someone post some examples with explanations of how to encode/encrypt a form posted URL and then decrypt it, so that it is very hard or currently impossible to break? so, something like http://localhost/page.php?product=12&price=4.50 would appear obfuscated in my browser display area like: http://localhost/page.php?Ur7@7892yRyw&wq84y@$y8@$ (or whatever)
Removing Oldest Table Row When New One Is Posted
im trying to figure out how to make it so that a user can pick how many rows they want to keep stored in a database table before an old one is automatically deleted im guessing the query would be made, then a while loop would determine how many......ahhh i dont know there has to be a simpler way of doing it..
Getting Data From Another Page
Is there any way I could get the information from this page (http://www.domain.com/rankcapture.php?name=dylandcor2&check=true) such as level and experience into a variable so I can use it to create an image. The page that is linked isn't mine, so I don't know how it is set up. I know how to create the image, I just can't seem to get all of the data out of the page.
Converting The Posted String To The Value Of Html Element
I've been very confused in dealing with posted strings. For example, if I fill in a text element with "(double quote), submit it and display it in a text and a textarea, I get "(backslash followed by double quote) in the textarea element but (backslash only) in the text element. Code: <input name="somename" value="<?php if(isset($HTTP_POST_VARS['submitName'])) echo $HTTP_POST_VARS['somename']; ?>" /> I made a function which correct the misbehavings:
Losing Posted Form Fields Over Https
This has been driving me nuts. I have an application running for several clients. Some run on http and two run on https. Two weeks ago, the https customers started occassionally getting kicked out to the home page. This is not every time, it's generally 1 in 10 form posts. Refreshing the page asks you to repost the info and it posts as it should have in the first place. Dumping the $_SERVER variable shows me that if things go well I get the $_POST and $_GET variables and the $_SERVER["CONTENT_LENGTH"] is a number. When the error shows up, CONTENT_LENGTH=0 and there are no $_POST or $_GET variables. I can only reproduce this over https on Linux/Apache/PHP using Internet Explorer. I cannot reproduce it using Mozilla or Opera as a browser. And I also can't reproduce it using IE over https with Windows/IIS/PHP. None of the PHP code changed and there were no new installations on the server I can point to as a possible cause. We were running PHP v4.1.1 and upgraded to v4.3.4. I have been able to trap the condition to offer our users a page to inform them to refresh so they won't lose their data. Any suggestions, ideas, places to look or ask more questions, is much appreciated. $_SERVER[SERVER_SOFTWARE] => Apache/1.3.20 Sun Cobalt (Unix) mod_ssl/2.8.4 OpenSSL/0.9.6b PHP/4.3.4 mod_auth_pam_external/0.1 FrontPage/4.0.4.3 mod_perl/1.25
Page Keeps Caching Old Data, How To Fix?
i have a php page that has a series of check boxes in it and you press the update button after unticking some boxes and ticking others. after the page updates the changes actually take place in the database but the page displays the old state where it was before you ticked and unticked the boxes. as soon as you press Ctrl + F5 it actually updates the page to what is in the database. how can i fix this so when i press the update button it refreshes and doesnt cache the old state? i have the following in the header but it dont seem to work, is there anything else i need to do? <meta http-equiv="pragma" content="no-cache"> <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
Change Data On The Same Page To Something Else
I'm trying to change data on this line of code using a drop down option box. map.centerAndZoom(new GPoint(-79.89505, 40.85708), 10); When the page opens I want the above data to be used. I want to use a drop down menu to select a different radius. Lets say 30 miles. I want to update the page so that the above line of code will update and look like this. map.centerAndZoom(new GPoint(-79.89505, 40.85708), 30); Here is some sections of code I am using. <form action='<?php echo $_SERVER['PHP_SELF'];?>' method='post'> <select name="radius" class="selectBoxes"> <option value="20">20 miles</option> <option value="30">30 miles</option> <option value="40">40 miles</option> </select> <input type='submit' name='submit' value='Click To Update Map'> </form> <script> map.centerAndZoom(new GPoint(-79.89505, 40.85708), 10); </script>
Display Data On Page
Ive got my page set up correctly as far as getting data into the database goes however I am not sure how to display it all on the page. Basically I have a news table: news_id, club_id, title, news I would like to display all the news items associated with the club that the user is logged into. Id like each news item to be separated so that its easy to identify they are different news items e.g. __________________________ $title $news __________________________ $title $news __________________________
Extract Data From A Web Page?
with PHP, can somebody direct me or give me some insight on how to go about extracting data from a web page. Say I want to pull sports statistics from a page.. how is this done?
Cant View Data On My PHP Page From MySql DB.
Im working on a character generator for a PHP game Im trying to get going but Im having trouble getting data from my mySql database. I created the table and added all the columns using this file:
IE+Page Refresh+Resubmitting Data
I am in the processing of developing a site making use of PHP and MySQL. The problem I am experiencing is that when I refresh Internet Explorer, the data that was processed by a form is resubmitted to the database - can anyone tell me what the correct process is to avoid having this happen. The only thing that comes to mind is to, after the processing is complete, redirect to another screen - ultimately I would like to avoid doing that.
Trying To Display 1 Row Of Data On Static Web Page
I have a database with about 600 rows of data, and about 40 fields. I want to display 1 row of data at a time and populate it into a static web page in misc areas on that web page. I am having trouble displaying the results! Do I still need a loop even though I want one record at a time? Code:
Page Reloads Keep Entering Data In Db
The problem is I have a small form that allows a user to input data into a database. Everything works fine, after a successful submission, the user get a message saying that their info was accepted. The problem is that if that page is reloaded, it enters the info again. There is only going to be one person doing the submitting so I could explicitly say...DO NOT RELOAD the page, but that seems kinda half as**d.
Echo RAW Data From Unicode Page?
How can I print raw data (string) from a UTF-8 .php file? Simple echo $var ouputs unicode string to browser (with unicode prefix bytes), but if I want to ouput BLOB data (jpeg file)?
Loading All The Data Of A Page Into A Variable.
I was wondering how you would go about emulating header('Content-Type: application/csv'); header('Content-Disposition: attachment; filename=' . 'test' . '.csv'); but instead of getting a file...I would like to load all the data into a variable. Is this possible?
|