PHP problem with executing... if (isset ($_POST['submit']))

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I'm having a problem with my PHP script.  

When the user arrives on my page there is an item for sale for them to
The user already has 200 points stored in their database row. I want
it work so that when the user clicks on the "buy" button(only then)
an mysql query is executed to update there points.

I thought of using an "if (isset ($_POST['submit'])) {...."
script, but I don't know what to make the else part of the statement +
I can't get it to work.

If anybody knows what I'm talking about then please help me. Can I
user the If statement or is there something better/easier to use?

Thanks php newsgroups

Re: PHP problem with executing... if (isset ($_POST['submit']))

csj wrote:

Quoted text here. Click to load it

I use a "hidden" variable that only gets set at submit time


         if (isset($_POST['flag'])) {
       echo $_POST['in_name'] ."<br>";
            echo '<form method=post><br><center>";
       echo '<input TYPE=submit value=Back></center>';
            echo '</form>';
    // do a bunch of other stuff

}else  {
    <form  method="post">
         Enter a NAME:
         <input type="text" name="in_name" size="90" />
         <input type=hidden name=flag value=1>
         <input TYPE=submit value=Submit>
         <input TYPE=reset value=Reset>

Michael Austin.
DBA Consultant
Donations welcomed. Http://

Site Timeline