Click here to Skip to main content
11,925,101 members (54,549 online)
Rate this:
Please Sign up or sign in to vote.
See more: PHP MySQL
Good day to you all

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

Here is my code
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
<p><input type = \"submit\"  name=\"submit\" value=\"Add Entry\"></p>
     else if ($_POST[op] == "add" ) //check required fields
      if (($_POST[Venue_name] == "") || ($_POST[Venue_date] == ""))
thank you
Posted 3-Jun-11 15: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 | Mobile
Web02 | 2.8.151125.3 | Last Updated 12 Sep 2012
Copyright © CodeProject, 1999-2015
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