Kieran-R Posted January 23, 2011 Posted January 23, 2011 Hello. Im working on a voting site, and its going all good. However, ive came to adding incentive voting, and im stuck :( What I dont get is how do I send data to another file (scipt url) without actually taking the user to that page? The way I want to do it through a POST form. But is there a way to post data to another file, without taking the user to that file? Thanks! Quote
Danny696 Posted January 23, 2011 Posted January 23, 2011 Try using curl function... A quick google found these: http://www.askapache.com/htaccess/sending-post-form-data-with-php-curl.html http://www.php.net/curl Quote
doublet Posted January 23, 2011 Posted January 23, 2011 Hello. Im working on a voting site, and its going all good. However, ive came to adding incentive voting, and im stuck :( What I dont get is how do I send data to another file (scipt url) without actually taking the user to that page? The way I want to do it through a POST form. But is there a way to post data to another file, without taking the user to that file? Thanks! Magic word is AJAX Quote
Dave Posted January 23, 2011 Posted January 23, 2011 Do a curl request, you could also use file_get_contents they both do a similar thing and would both work for what you're after. Quote
Karlos94 Posted January 23, 2011 Posted January 23, 2011 I agree with Dave, little did I know he was posting what I was basically going to post.. http://php.net/curl @doublet; I have to disagree with you here, AJAX would just be an enhancement. Just image if a use disables JavaScript, well in a sense you're screwed. Why? because the script won't be doing what it was achieved for. Quote
Kieran-R Posted January 23, 2011 Author Posted January 23, 2011 Thanks for the help guys. Ill look into that curl. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.