SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member 12mbs's Avatar
    Join Date
    May 2003
    Location
    Holland
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy PHPDEV problem (passing forms/variables)

    Hello,

    I 'm trying to set up a complete PHPDEV environment locally on my PC. So testing of my (updated) website is easy, I use a small form to display the daynumber which simplly doesn't work on my local environment.

    When i use the same code on my regular server, with my hosting provider, i have no problem and everything works just fine as expected.

    I use a small form and want to pass some variables to a next page or with a hidden variable stay on the same page, on the next page the values of these variables just will not be displayed, remain empty! I tried a few things, including $_post['...'] but it didn't work.

    I guess i have a small problem in setting up my phpdev environment.
    I use phpdev version 5. Does this problem sound familiar? Please help me!


    here is the code i use:



    <form method="POST" action="datum.php">
    DD: <input type="text" name=dd size=20><br>
    mm: <input type="text" name=mm size=20><br>
    yyyy: <input type="text" name=yy size=20><br>
    <br>
    <input type=hidden name=dateisset value=1>
    <input type="submit">
    </form>

    <?
    if($dateisset == "1")
    {
    $dag=$_POST['dd'];
    $maand=$_POST['mm'];
    $jaar=$_POST['yy'];

    if ($dag > 0)
    {
    $my_time = mktime(0, 0, 0, $maand, $dag, $jaar);

    $my_formatted_time = date("j F Y", $my_time);
    $my_daynr = date("z", $my_time) +1;

    echo ("<b>Date/b>". $my_formatted_time)."<br><br>";
    echo ("<b>daynumber: </b>".$my_daynr);
    }
    else{

    echo "No daynumber";
    }
    }
    ?>

  2. #2
    ********* wombat firepages's Avatar
    Join Date
    Jul 2000
    Location
    Perth Australia
    Posts
    1,717
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you are on the right tracks ..

    if($dateisset == "1" )

    needs to be
    if($_POST['dateisset'] == "1" )

    as phpdev has register_globals off by default.
    this was probably better suited in the general php forum ?

  3. #3
    SitePoint Member 12mbs's Avatar
    Join Date
    May 2003
    Location
    Holland
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok now for me the next question is how to turn register_globals to "on" ?

  4. #4
    SitePoint Member 12mbs's Avatar
    Join Date
    May 2003
    Location
    Holland
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, i looked in the php.ini file and found this line:
    register_globals = On

    I also tried the
    if($_POST['dateisset'] == "1" )
    solution but still no result :-(

    So is there another thing that could be wrong or that i should be thinking of?


Bookmarks

Posting Permissions

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