kryptobs2000
02 Apr 2011, 06:37 PM
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?
<?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 [].
<?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 [].