dan_t Posted March 9, 2009 Share Posted March 9, 2009 Hello, My question for today is: Say I have a form and it takes a user input from a text box named 'name'. How do I take the input from 'name' and make it a variable named $name? So that I can use it in an if else statement or whatever. Link to comment https://forums.phpfreaks.com/topic/148680-form-to-variable/ Share on other sites More sharing options...
Stephen68 Posted March 9, 2009 Share Posted March 9, 2009 depends on if your form uses GET or POST //Get method $name = $_GET['name']; //Post method $name = $_POST['name']; Hope that helps Link to comment https://forums.phpfreaks.com/topic/148680-form-to-variable/#findComment-780743 Share on other sites More sharing options...
dan_t Posted March 9, 2009 Author Share Posted March 9, 2009 Hey Thanks stephan! I tried it earlier and it did not work. You posted it, I tried it again and it worked. I guess I was doing something wrong. Anyway, Thanks a lot!! Dan Link to comment https://forums.phpfreaks.com/topic/148680-form-to-variable/#findComment-780750 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.