somo Posted July 9, 2006 Share Posted July 9, 2006 Hi,does anybody know how i can get the contents of an input field? I need a date entered by a user that i then need to use in a script on the same page.im don't know how i can go around doin itthanks. :) Quote Link to comment https://forums.phpfreaks.com/topic/14090-need-to-get-input-field-contents/ Share on other sites More sharing options...
redarrow Posted July 9, 2006 Share Posted July 9, 2006 when you sat date you mean the date the user post the form if so i got this ok.$date=date("y/m/d"); year month day.for debuging purpose the date will be shown in the input box you can easly put hidden ok.<input type="text" name="date" value=<?echo $date; ?>"> Quote Link to comment https://forums.phpfreaks.com/topic/14090-need-to-get-input-field-contents/#findComment-55094 Share on other sites More sharing options...
somo Posted July 9, 2006 Author Share Posted July 9, 2006 No i have a mini calendar that gets the user to select a date which is autoimatically put into a field.All i need to do is get the field contents e.g. 09 July 2006 and store this as a variable in php sp i can use that variabile in an amount of days calculation script.[quote author=redarrow link=topic=99953.msg393922#msg393922 date=1152448832]when you sat date you mean the date the user post the form if so i got this ok.$date=date("y/m/d"); year month day.for debuging purpose the date will be shown in the input box you can easly put hidden ok.<input type="text" name="date" value=<?echo $date; ?>">[/quote] Quote Link to comment https://forums.phpfreaks.com/topic/14090-need-to-get-input-field-contents/#findComment-55106 Share on other sites More sharing options...
.josh Posted July 9, 2006 Share Posted July 9, 2006 example form:[code]<form action = 'blah.php' method='post'> <input type = 'text' name = 'somefield'> <input type = 'submit' value='blah'></form>[/code]and then in blah.php you would get the info like so:[code]//exampleecho $_POST['somefield']; //echos out what you put in the 'somefield' input field[/code] Quote Link to comment https://forums.phpfreaks.com/topic/14090-need-to-get-input-field-contents/#findComment-55110 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.