phpsql1 Posted May 23, 2007 Share Posted May 23, 2007 I have two html pages the first one has email, and name input s. the second page should have amoung other things these two info. I want to display this name and email into the apropriate inputs of the second page while it is being loaded I already assigned those values to variables in php file but my concern is mainly how to use them. any ideas. thanks Quote Link to comment https://forums.phpfreaks.com/topic/52693-solved-transfering-values-from-one-form-to-another/ Share on other sites More sharing options...
per1os Posted May 23, 2007 Share Posted May 23, 2007 <input type="text" name="fieldname" value="<?php echo $_POST['fieldname']; ?>" /> You may need to stripslashes on the post fields, you can do them all at once like so, but be cautious if you are entering this data into a DB <?php foreach ($_POST as $key => $val) { $_POST[$key] = stripslashes($val); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/52693-solved-transfering-values-from-one-form-to-another/#findComment-260180 Share on other sites More sharing options...
vynsane Posted May 23, 2007 Share Posted May 23, 2007 if you want to display the email address somewhere, you would just use the "$_POST" global variable to retrieve that info. you said you changed it into a variable, but i don't know what that variable was, so i'll make one up... $email = $_POST['s']; if you wanted to display it anywhere on the page, you could say <p>The email you supplied is <?php echo "".$email.""; ?></p> if you didn't need to display it, but just pass it along from the second page of the form to, say, a database insert, you would need to turn it into a hidden input field of the form, thusly: <input type="hidden" name="s" value="<?php echo "".$email.""; ?>" /> something like that. Quote Link to comment https://forums.phpfreaks.com/topic/52693-solved-transfering-values-from-one-form-to-another/#findComment-260185 Share on other sites More sharing options...
phpsql1 Posted May 23, 2007 Author Share Posted May 23, 2007 can you guys elaborate a little. to make sure we are in the same frequency this is where am blocked. in the first page: <input type "text" name "email"> let's the user inputs qqqqqq@qqqq.net and hit next The second page is loaded this page has (amoung other ethings) a field reserved for the e-mail. this field's value should be qqqqqq@qqqq.net. thanks Quote Link to comment https://forums.phpfreaks.com/topic/52693-solved-transfering-values-from-one-form-to-another/#findComment-260216 Share on other sites More sharing options...
chigley Posted May 23, 2007 Share Posted May 23, 2007 <input name="email" type="text" value="<?php echo $_POST[email]; ?>" /> Quote Link to comment https://forums.phpfreaks.com/topic/52693-solved-transfering-values-from-one-form-to-another/#findComment-260217 Share on other sites More sharing options...
phpsql1 Posted May 23, 2007 Author Share Posted May 23, 2007 thanks a lot guys Quote Link to comment https://forums.phpfreaks.com/topic/52693-solved-transfering-values-from-one-form-to-another/#findComment-260233 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.