|
-
Jul 2nd, 2003, 08:11 PM
#1
Thread Starter
Lively Member
Im new... Help..
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.
-
Jul 2nd, 2003, 09:06 PM
#2
Stuck in the 80s
1) Like so:
Code:
echo $_POST['name_of_combobox_here'];
What do you mean do math in php? +, -, *, / all work fine for me...
2) Uh...
Code:
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.
-
Jul 3rd, 2003, 10:03 AM
#3
Junior Member
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
-
Jul 3rd, 2003, 08:43 PM
#4
Stuck in the 80s
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|