+ Reply to Thread
Results 1 to 4 of 4

Thread: problem with $_SERVER['POST']

  1. #1
    anilson1 is offline x10Hosting Member anilson1 is an unknown quantity at this point
    Join Date
    Apr 2008
    Posts
    45

    problem with $_SERVER['POST']

    Can anyone tell me what's wrong with it?
    my code doesn't work, before I even press any button it activates the value of button 3. check it.

    ------------------------------------

    <html>
    <head>
    <title>VOG - test</title>
    <style>
    .buttonchenger {background-color:red;color:white}
    a {text-decoration:none;color:blue}
    a:hover {color:red}
    body {font-family:Tahoma;color:red;font-size:9}
    </style
    </head>
    <body >
    <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
    <table border="0" width="100%">
    <tr><td><input class="buttonchenger" type="button" value="Checkup Winners" name="check"/></td></tr>
    <tr><td><input class="buttonchenger" type="button" value="Create DB print" name="create"/></td></tr>
    <tr><td><input class="buttonchenger" type="button" value="Update DB" name="update"/></td></tr>
    </table>
    <?php
    if(isset($_POST['check']))
    {echo "test1";}
    else
    { if(isset($_POST['create']))
    {echo "test2";}
    else
    {checkValuesIntoDB1();}
    }

    function checkValuesIntoDB1()
    {
    echo " this is another test";
    }
    ?>

    </form>
    </body>
    </html>


    ---------------------------------

    that was the full code.
    how can I get values from pressing the buttons?

  2. #2
    tnl2k7 is offline Banned tnl2k7 is an unknown quantity at this point
    Join Date
    Nov 2007
    Location
    #offtopic ;)
    Posts
    3,131

    Re: problem with $_SERVER['POST']

    We don't provide script support in Free Hosting, this forum is for ACCOUNT and HOSTING issues.

    * Moved to Programming Help *

  3. #3
    natsuki's Avatar
    natsuki is offline x10 Sophmore natsuki is an unknown quantity at this point
    Join Date
    Sep 2008
    Posts
    112

    Re: problem with $_SERVER['POST']

    Code:
    <tr><td><input class="buttonchenger" type="button" value="Checkup Winners" name="check"/></td></tr>
    <tr><td><input class="buttonchenger" type="button" value="Create DB print" name="create"/></td></tr>
    <tr><td><input class="buttonchenger" type="button" value="Update DB" name="update"/></td></tr>
    you should have used type="submit" instead

    and it's really a hard time reading through code with mangled braces >_<
    PHP Code:
    <?php
    if (isset($_POST['check']))
    {
        echo 
    'test1';
    }
    else
    {
        if (isset(
    $_POST['create']))
        {
            echo 
    'test2';
        }
        elseif (isset(
    $_POST['update']))
        {
            
    checkValuesIntoDB1();
        }
    }

    function 
    checkValuesIntoDB1()
    {
        echo 
    ' this is another test';
    }
    ?>
    looks better
    Last edited by natsuki; 10-22-2008 at 12:41 PM.

  4. #4
    anilson1 is offline x10Hosting Member anilson1 is an unknown quantity at this point
    Join Date
    Apr 2008
    Posts
    45

    Re: problem with $_SERVER['POST']

    thanks, you solved my problem.

+ Reply to Thread

Similar Threads

  1. Another Problem
    By beast474 in forum Free Hosting
    Replies: 1
    Last Post: 08-27-2008, 07:22 PM
  2. Slight Problem
    By rmb1993 in forum Free Hosting
    Replies: 2
    Last Post: 08-14-2008, 06:04 AM
  3. A problem with certificate
    By eon01 in forum Free Hosting
    Replies: 1
    Last Post: 07-31-2008, 01:27 PM
  4. DB number problem
    By lionheart8 in forum Free Hosting
    Replies: 5
    Last Post: 04-08-2008, 08:26 AM
  5. Ad code problem!
    By Akkarin in forum Free Hosting
    Replies: 8
    Last Post: 08-29-2005, 10:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers