Jump to content


Photo

Need to get input field contents...


  • Please log in to reply
3 replies to this topic

#1 somo

somo
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 09 July 2006 - 12:36 PM

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 it

thanks.  :)

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 09 July 2006 - 12:40 PM

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; ?>">
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 somo

somo
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 09 July 2006 - 12:55 PM

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.

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; ?>">



#4 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 09 July 2006 - 12:59 PM

example form:
<form action = 'blah.php' method='post'>
  <input type = 'text' name = 'somefield'>
  <input type = 'submit' value='blah'>
</form>
and then in blah.php you would get the info like so:
//example
echo $_POST['somefield']; //echos out what you put in the 'somefield' input field

Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users