Originally posted by halojoy
I suggest
the following changes in
news_check.php
<?php
error_reporting( E_ALL );
//START SESSION
session_start();
// get values from POST login form
$userid = $_POST[ "userid" ];
$password = $_POST[ "password" ];
include('../../ssi/mysqlCredentials.php');
$connection = mysql_connect('localhost', $db_user, $db_pass) or die(mysql_error());
mysql_select_db('$database', $connection) or die(mysql_error());
//set up the query
$sql = "SELECT * FROM login WHERE userid='$userid' AND password='$password'";
$result = mysql_query($sql) or die("Unable to get results.");
$num = mysql_numrows( $result );
// I guess your if($num) will work, but .....
if ( $num > 0 ) {
// SUCCESS store userid and password=TRUE, then GOTO news_upload.php
$_SESSION[ "userid" ] = $userid;
$_SESSION[ "password" ] = TRUE;
header('Location: news_upload.php');
exit;
}
else {
// GO BACK TO LOGIN PAGE, news_login.php
header('Location: news_login.php');
exit;
}
exit;
?>
<?php
error_reporting( E_ALL );
//START SESSION
session_start();
// get values from POST login form
$userid = $_POST[ "userid" ];
$password = $_POST[ "password" ];
Well, I tell you:
It is not from MY ADDITIONS you get error
Parse error, you say
What is that????????
A php error tells us more than that
What error, what it had expected, instead
what php page, line number .....
To get all notices we can from your bad script,
I now have suggested the cange above: E_ALL
And I tell you, if you get any parse errors from My Additions
I will resign from www.phpbuilder.com - right away
Why you get erros, I am almost sure,
is because you have not MADE all the changes I told you
in news_check.php
But if you do not want to fix this now,
go on and do not listen to any more advices from ME,
halojoy
good Luck
:evilgrin: