iStriide Posted July 29, 2010 Share Posted July 29, 2010 I need to know how to echo multiple things on the same page. If you do understand the last line then don't read this next part. So say if had just a textbox and a submit button. I already know how to make it where they type something and they hit submit and echo's to the page. But after it echos I want to know how to make it where if they entered in another body of text it would enter on the same page right under the last echo, or the last thing they typed. So if you could help me with this or just post a code for me that would be nice. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted July 30, 2010 Share Posted July 30, 2010 Where are you stuck? Post the code you're having problems with. Quote Link to comment Share on other sites More sharing options...
onlyican Posted July 30, 2010 Share Posted July 30, 2010 so you have page 1 <form method="post" action="page2.php"> <input type="text" name="frmUserField" value="" /> <input type="submit" name="btnSubmit" value="Submit me now!!" /> </form> So on Page 2 you want to create a variable //Proper method $strUserValue = ''; if(isset($_POST['frmUserField']){ $strUserValue = $_POST['frmUserField']; } echo $strUserValue; You can echo $strUserValue as many times as you want. You name a Variable, such as 'strUserValue' (I put str, int, bln, dt in front of a variable so I know at a glance what data type it is) You then add a value to the variable the Variable is available throughout the page your on, it doesn't lose its value by echoing it. if you change pages, then the variable is left behind and forgotten will be left behind 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.