Click to See Complete Forum and Search --> : Im new... Help..
wookie224
Jul 2nd, 2003, 08:11 PM
Im new at PHP... I am in a crunch. I need help with two things...
1) How do I get the value of some combo boxes and a text box and do some math in PHP???
2) What would be the easiest way to separate the month,day,year into three separate variables I can use later on in the webpage for being part of a link..
I appreciate all the help.
The Hobo
Jul 2nd, 2003, 09:06 PM
1) Like so:
echo $_POST['name_of_combobox_here'];
What do you mean do math in php? +, -, *, / all work fine for me...
2) Uh...
echo date('m', $date); //month
echo date('d', $date); //day
echo date ('Y', $date); //year
The most valuable resource as a PHP programmer is http://www.php.net/
Read it, know it, and refer to it. It has 90% of the answers in the documentation.
ferke
Jul 3rd, 2003, 10:03 AM
The values of input fields on a form in the variable named input field names:
<input type="text" name="trythis" value=<? print $trythis; ?>>
The value of this text is in the variable $trythis;)
The Hobo
Jul 3rd, 2003, 08:43 PM
Originally posted by ferke
The values of input fields on a form in the variable named input field names:
<input type="text" name="trythis" value=<? print $trythis; ?>>
The value of this text is in the variable $trythis;)
That is poor and deprecated coding and should not be used. $_POST['trythis']; should be used instead.
The option is even turned off by default in all recent versions of PHP.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.