Click here to Skip to main content
13,140,613 members (52,278 online)
Rate this:
Please Sign up or sign in to 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
<pre lang="xml"><?php<br />
<br />
isset($_POST['op']) && $_POST['op'] != "add";<br />
<br />
if ($_POST['op'] != "add" )<br />
     {<br />
      //havent seen form, so see it<br />
     $display_block = "<h1>Add an Entry</h1><br />
       <form method = \"post\" action =\"$_SERVER[PHP_SELF]\"></pre><br />

the next part is my form and i end the form with
<pre lang="xml"><p><input type = \"submit\"  name=\"submit\" value=\"Add Entry\"></p><br />
<br />
       </form>";<br />
      }<br />
     else if ($_POST[op] == "add" ) //check required fields<br />
     {<br />
      if (($_POST[Venue_name] == "") || ($_POST[Venue_date] == ""))<br />
      {header("Location:addentry.php");<br />
       exit;<br />
     }</pre><br />

thank you
Posted 3-Jun-11 14:13pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

The third line is unnecessary. Replace it with these:
    // Insert your codes here
    // Additionally $_POST[op] is an invalid usage, it must be $_POST['op']
    // If there is no post variable whose name is 'op'
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170915.1 | Last Updated 12 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100