Web Hosting Talk







View Full Version : Parse error problem


akashik
11-08-2000, 02:22 AM
Hi,

I'm getting an error with the following script at line 49. It says I'm having a parsing error. If anyone can check this out a little and see if it's an error in the script it would be greatly appreciated. Failing that any ideas about a script that may be causing the error that's connected to this one (there's quite a few in the whole thing *lol*)

Greg Moore




<?include "connect.php3"; ?>
<?include "authorize-access.php3" ; ?>
<?include "verify-parameters.php3" ; ?>
<?

/* To modifiy the flag of the notebook, you must own it */
if ($visitor_id != $user_id) {

$error_message = "You do not have permission to modify the access flag of the notebook owned by $user_name. <br>If you are $user_name, please go back to <a href=\"$system_url\">the initial page</a> and login again.\n" ;
include "error-page.php3" ;
exit ;
}

$sql = "update notebooks set is_public='$is_public' where notebook_id=$notebook_id" ;
if ( ($result=mysql_db_query($database,$sql)) == 0) {
include "db-error.php3" ;
exit ;
}
echo "
<html>
<head>
<title>Modify flag</title>
</head>
<body bgcolor=#ffffff text=#000000>

<font size=+2>Access Flag Modified</font>" ;

include "show-nav.php3" ;

echo "<HR>" ;

if ($is_public == 't') {
$notebook_URL = $system_url . "entries.php3?notebook_id=$notebook_id" ;
echo "The notebook is now accessible by all users. If you want to point people to this notebook, you can distribute the URL <blockquote><a href=\"$notebook_URL\">$notebook_URL</a></blockquote><p>" ;
} else {
echo "The notebook will not be public." ;
}

echo "

<br>Go to <a href=\"notebooks.php3?user_id=$user_id\">your notebooks page</a> to continue working.

" ;

include "bottom.php3" ;

/* Header("Location: notebooks.php3?user_id=$user_id") ; */
exit ;
}
?>

Travis
11-08-2000, 02:46 AM
At first glance, it looks like you need to remove the curly brace (}) right before the final PHP closing tag.

akashik
11-08-2000, 03:23 AM
Thanks,

Umm, do you mean the curly tag pointed out below?


} else {
echo "The notebook will not be public." ;
} <-----THIS ONE? -------

echo "

Greg Moore

kunal
11-08-2000, 03:46 AM
Use this

<?
include ('connect.php3');
include ('authorize-access.php3');
include ('verify-parameters.php3');


/* To modifiy the flag of the notebook, you must own it */
if ($visitor_id != $user_id) {

$error_message = "You do not have permission to modify the access flag of the notebook owned by $user_name. <br>If you are $user_name, please go back to <a href=\"$system_url\">the initial page</a> and login again.\n" ;
include "error-page.php3" ;
exit ;
}

$sql = "update notebooks set is_public='$is_public' where notebook_id=$notebook_id" ;
if ( ($result=mysql_db_query($database,$sql)) == 0) {
include "db-error.php3" ;
exit ;
}
echo "
<html>
<head>
<title>Modify flag</title>
</head>
<body bgcolor=#ffffff text=#000000>

<font size=+2>Access Flag Modified</font>" ;

include "show-nav.php3" ;

echo "<HR>" ;

if ($is_public == 't') {
$notebook_URL = $system_url . "entries.php3?notebook_id=".$notebook_id;
echo "The notebook is now accessible by all users. If you want to point people to this notebook, you can distribute the URL <blockquote><a href=\"$notebook_URL\">$notebook_URL</a></blockquote><p>" ;
} else {
echo "The notebook will not be public." ;
}

echo "

<br>Go to <a href=\"notebooks.php3?user_id=$user_id\">your notebooks page</a> to continue working.

" ;

include "bottom.php3" ;

/* Header("Location: notebooks.php3?user_id=".$user_id) ; */
exit ;
?>

Travis
11-08-2000, 03:49 AM
Yep, Kunal's got it.... the very last curly brace after the commented-out "Header" call.

kunal
11-08-2000, 03:55 AM
Yup. Also, he waa using the <? ?> tag too many times. Just made a lil change there to. :)

Travis
11-08-2000, 03:58 AM
Yeah, while that doesn't hurt anything, it makes it a little weird to read. :)

kunal
11-08-2000, 04:03 AM
It just calls the PHP engine many more times and shuts it down many more times. I dun like tiring the poor guy out ;)

akashik
11-08-2000, 06:20 AM
Kunal,

you're a scholar and a gentleman. I changed that script and it's running fine now.

Thanks.

Greg Moore

kunal
11-08-2000, 06:30 AM
lol.. thanx :)

If you need any more help, drop me email or icq message :)