Results 1 to 1 of 1

Thread: Why is this php script making my form dissapear?

  1. #1
    Join Date
    Nov 2006
    Posts
    53

    Why is this php script making my form dissapear?

    If I comment out the if else branch the form displays fine, if I leave it the page is totally blank. This is how pretty much every tutorial I've read seems to handle forms, what's the problem?

    Code:
        <?php
        // Check for authentication
        include('includes/variables.php');
         
        include('includes/header.php');
         
        if ($_POST("postSubmit") == 'Submit')
        {
          ;
        }
        else
        {
          ;
        }
         
        ?>
         
        <!-- This form may need work -->
        <form action="newpost.php" method="post">
        <h5>Title:</h5> <input type="text" name="title" /><br />
        <h5>Post:</h5>  <textarea name="body"></textarea>
        <input type="submit" name="postSubmit" value="Submit" />
        </form>
         
        <?php
        include('includes/footer.php');
        ?>

    edit: nevermind, newb mistake. Indexing the $_POST array with () instead of [].
    Last edited by kryptobs2000; 02 Apr 2011 at 06:00 PM. Reason: Solved!

Similar Threads

  1. Any errors in this PHP form submission script?
    By LetJimiTakeOver in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 0
    Last Post: 19 Oct 2010, 08:56 AM
  2. Form Mailer - PHP Script - Data issue
    By dcj in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 28 Sep 2009, 09:44 PM
  3. PHP contact form script
    By femyram in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 1
    Last Post: 30 Mar 2007, 01:58 PM
  4. Overlib images dissapear under Flash
    By Sundy in forum Graphic Design
    Replies: 1
    Last Post: 22 Mar 2007, 01:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •