bobs2007 Posted April 11, 2007 Share Posted April 11, 2007 Hi, I'm still new to PHP so this probably has an obvious answer, so could you bare with me. I have an HTML for that I'm using to post data to a PHP validation script. I was then wondering if there is a way to pass the data from the post to another script without have the user to click submit on a form? Thanks for you help. Quote Link to comment Share on other sites More sharing options...
boo_lolly Posted April 11, 2007 Share Posted April 11, 2007 how else are you planning on sending the data? Quote Link to comment Share on other sites More sharing options...
per1os Posted April 11, 2007 Share Posted April 11, 2007 You want to look into cURL www.php.net/curl You can add post data there and retrieve the results. Quote Link to comment Share on other sites More sharing options...
rpadilla Posted April 11, 2007 Share Posted April 11, 2007 1. You can try putting the data in the url like this redirect.php?value=1&value2=2 but this one is a bit insecure, 2. you can put it in a session, since it will be saved, when you go to the next page. session_start() $_SESSION['value'] = 33; 3. or you can store it in the db, its a bit complicated though. Quote Link to comment Share on other sites More sharing options...
clown[NOR] Posted April 11, 2007 Share Posted April 11, 2007 what he wants to do is to save all the data before the user hits submit... if i understood him right... but that cant be possible can it? fill your form out and the boom you're signed up without hitting enter clicking the submit button Quote Link to comment Share on other sites More sharing options...
per1os Posted April 11, 2007 Share Posted April 11, 2007 It is possible using ajax and an onleave or unfocus I do not remember. But yea, you are in the wrong forum if that is the desired results. Look into AJAX. Quote Link to comment Share on other sites More sharing options...
rpadilla Posted April 11, 2007 Share Posted April 11, 2007 well, I think from start the user submit the data, to some script 1, then script 1 pass the data to script 2. I guess Quote Link to comment Share on other sites More sharing options...
boo_lolly Posted April 11, 2007 Share Posted April 11, 2007 i'm not sure either one of those posts answers the question as how to send data from a form without requiring the user to press 'submit'. if curl can do this, i have no idea how, and i'd like an explaination =). but since i don't think i can, you'd have to use a client-side scripting language... the only question left is how do you want your script to know when to send data on its own? which was the point of my original post: how else are you planning on sending the data? Quote Link to comment Share on other sites More sharing options...
bobs2007 Posted April 11, 2007 Author Share Posted April 11, 2007 Thanks for the help. I think I've posted it incorrectly, What I meant was when my user clicks submit the data is posted to a validation script. I wanted so that the validation script passes the data from the form after being checked without having to write out a form to do this and have the user push submit again. This is because I wanted to auto-redirect if the validation is all correct. Quote Link to comment Share on other sites More sharing options...
rpadilla Posted April 11, 2007 Share Posted April 11, 2007 checkout my first post, it should do that, if you have just two or three variables just use the $_SESSION page1.php session_start() $_SESSION['value1'] = $_POST['value1']; $_SESSION['value2'] = $_POST['value2']; page2.php session_start(); echo $_SESSION['value1']; echo $_SESSION['value2']; Quote Link to comment Share on other sites More sharing options...
bobs2007 Posted April 11, 2007 Author Share Posted April 11, 2007 Ok thank you for the help. Quote Link to comment Share on other sites More sharing options...
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.