Results 1 to 4 of 4

Thread: Im new... Help..

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Location
    Allen, Texas
    Posts
    125

    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.

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    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.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3
    Junior Member
    Join Date
    Jul 2003
    Location
    Hungary
    Posts
    20
    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

  4. #4
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    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.
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width