Click here to Skip to main content
15,891,375 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Good day to you all

i'm new to php programing and i'm stuck could someone help please.

Here is my code
XML
<?php

isset($_POST['op']) && $_POST['op'] != "add";

if ($_POST['op'] != "add" )
     {
      //havent seen form, so see it
     $display_block = "<h1>Add an Entry</h1>
       <form method = \"post\" action =\"$_SERVER[PHP_SELF]\">


the next part is my form and i end the form with
XML
<p><input type = \"submit\"  name=\"submit\" value=\"Add Entry\"></p>

       </form>";
      }
     else if ($_POST[op] == "add" ) //check required fields
     {
      if (($_POST[Venue_name] == "") || ($_POST[Venue_date] == ""))
      {header("Location:addentry.php");
       exit;
     }

thank you
Posted

There is not much information, but did you check for type errors?

Like shouldn't it be $_POST['op'] in the second part?
And same for Venue_name and Venue_date.
 
Share this answer
 
The third line is unnecessary. Replace it with these:
PHP
if(isset($_POST['op']))
{
    // Insert your codes here
    // Additionally $_POST[op] is an invalid usage, it must be $_POST['op']
}
else
{
    // If there is no post variable whose name is 'op'
}
 
Share this answer
 
v2
Comments
Chi Ller 12-Sep-12 8:37am    
That´s how I wanted to write it when I read the code

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900