new to the site and w/lamp... right, here's the dilema.. when i run the script below i get parse error on line 138... that has the </html> on it, thats it... any help is appreciated...
PHP Code:
<?php
IF ($_POST['submit'] == 'Submit')
{
IF (!$_POST['content'])
{
$message = '<p>You have not entered any content.</p>';
}
IF (!$_POST['page'])
{
$message = '<p>Please choose a location for the content.</p>';
}
}
ELSE
{
//Open connection to DB
require_once "../$data_path" . "data/mysql_connect.php";
//Insert content to DB
$as_date = addslashes($_POST['date']);
$tr_date = trim($as_date);
$as_page = addslashes($_POST['page']);
$tr_page = trim($as_page);
$as_title = addslashes($_POST['title']);
$tr_title = trim($as_title);
$as_content = addslashes($_POST['content']);
$tr_content = trim($as_content);
$query = "INSERT INTO content (content_id, date, page, title, content)
VALUES(NULL, '$tr_date', '$tr_page', '$tr_title', '$tr_content')";
$result = mysql_query($query);
IF (mysql_affected_rows() == 1)
{
$message = '<p>The site has been updated!!</p>';
$noform_var = 1;
}
ELSE
{
error_log(mysql_error());
$message = '<p>Could not connect to the database.</p>';
}
//Show the form in every case except successful submission
IF (!$noform_var)
{
//$admin.php = $_SERVER['PHP_SELF'];
$message = <<< EOMSG
<p><b>Welcome to the Athletic Webware Website Administration portal.</b></p>
the last tag must be the first on the line with no leading spaces. Like this:
PHP Code:
$message = <<< EOMSG
Here is some text
The ending heredoc tag (EOMSG) MUST be the first thing on the line:
EOMSG;
All php commands must end with a semicolon. Even if for some reason it worked on other pages, you should code this way.
OK got the page to parse correctly, but now the only thing that shows is the message 'The site has been updated!!' and there is a row (albeit, empty) added to the db, can't get the form to display. More help?