Lee-Bartlett Posted November 20, 2008 Share Posted November 20, 2008 At the moment there is a varible called $to with an email in, i need a text box, which will change that data in that varible to what ever i put in the text box, if you know what i mean. Say this is the varible $to = bob ......... puts jim in text box then submits it ........... new varible ............ $to = jim anyone got a tut on how to do that? Quote Link to comment https://forums.phpfreaks.com/topic/133535-making-a-text-box-change-a-varible/ Share on other sites More sharing options...
premiso Posted November 20, 2008 Share Posted November 20, 2008 Depending if you post or get $_POST $_GET After you enter the info the text box you have to submit that page in order to do what you want. During the <form> tag declaration define method as get or post depending on which use the above to access what you chose. Quote Link to comment https://forums.phpfreaks.com/topic/133535-making-a-text-box-change-a-varible/#findComment-694559 Share on other sites More sharing options...
.josh Posted November 20, 2008 Share Posted November 20, 2008 <?php $to = ($_POST['to'])? $_POST['to'] : 'bob'; ?> <form action = '' method = 'post'> Enter something here: <input type = 'text' name = 'to'> <input type = 'submit' value = 'submit'> </form> Quote Link to comment https://forums.phpfreaks.com/topic/133535-making-a-text-box-change-a-varible/#findComment-694564 Share on other sites More sharing options...
Lee-Bartlett Posted November 20, 2008 Author Share Posted November 20, 2008 that only works if its in the same file right? if so i cant use that. My situation i need it in an admin folder page and the email bit is in the users section. Quote Link to comment https://forums.phpfreaks.com/topic/133535-making-a-text-box-change-a-varible/#findComment-694574 Share on other sites More sharing options...
Lee-Bartlett Posted November 20, 2008 Author Share Posted November 20, 2008 i was thinking about using a database table and just storing it in there reckon that will work? Quote Link to comment https://forums.phpfreaks.com/topic/133535-making-a-text-box-change-a-varible/#findComment-694579 Share on other sites More sharing options...
.josh Posted November 20, 2008 Share Posted November 20, 2008 If you can't figure out how to break that up into several files, what makes you think you are ready to jump into databases? No offense, but I think you probably need to start out with square one: a "hello world" tutorial. Actually, you probably need to start with learning HTML first. Quote Link to comment https://forums.phpfreaks.com/topic/133535-making-a-text-box-change-a-varible/#findComment-694583 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.