473,408 Members | 1,623 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

parse error on the last line of code </html>

/// here is the code i'm getting a parse error on the last line of the
code which
/// is </html> any help will be much appreciated.


<?php

session_start ();
require_once('connect.php');

if ($_SESSION['username']){ //test for logged-in
$query = "SELECT status FROM accounts WHERE
username='".$_SESSION['username']."'";
$result = mysql_query ($query) or die("<b>A fatal MySQL error
occured</b>.\n<br>\nError: (" . mysql_errno() . ") " . mysql_error());
$row = mysql_fetch_array ($result,MYSQL_NUM);

if ($row[0] == 0){
$error_message .= "<P>Your account has been frozen. Email the <A
HREF='mailto:ac************@severedrealm.net'>webm aster</A> for more
information.</P>";}

if ($row[0] == 1){
$query2 = "SELECT name, hp, gold, exp FROM characters WHERE
username='".$_SESSION['username']."'";
$result2 = mysql_query ($query2) or die("<b>A fatal MySQL
error occured</b>.\n<br>\nError: (" . mysql_errno() . ") " .
mysql_error());
$character_table .= "<TABLE CELLSPACING='2' CELLPADDING='2'
BORDER='0'><TR><TD>Name</TD><TD>Hit
Points</TD><TD>Gold</TD><TD>Experience</TD><TD>Delete</TD></TR>";
$x=0;
while ($character = mysql_fetch_array ($result2)) {
$x=$x+1;
$character_table .=
"<TR><TD>".$character[1]."</TD><TD>".$character[2]."</TD><TD>".$character[3]."</TD><TD>".$character[4]."</TD>";
$character_table .= "<TD><form action='character.php'
method='post'><input type='hidden' name='character'
value='".$character[1]."'><INPUT TYPE='submit'
NAME='delete_character_submit'
VALUE='delete_character'></FORM></TD></TR>";}
$character_table .= "</TABLE>";
if ($x >= 1){
$error_message .= "<P>You have too many characters. You must
delete ".$x."before you can create another.</P>";
}else{
$character_creation_form .= "<FORM
ACTION='character.php?op=create_character' METHOD='post'>";
$character_creation_form .= "<table cellspacing='2'
cellpadding='2' border='0'><tr>";
$character_creation_form .= "<td>New Character
Name:</td><td><input type='text' name='new_character_name' size='30'
maxlength='30' value=''/></td></tr>";
$character_creation_form .= "<tr><td></td><td><input
type='submit' name='New_Character_Submit' value='Create
Character'></td></tr></table></FORM>";}

if ($row[0] == 2){
$query3 = "SELECT name, hp, gold, exp FROM characters WHERE
username='".$_SESSION['username']."'";
$result3 = mysql_query ($query3) or die("<b>A fatal MySQL
error occured</b>.\n<br>\nError: (" . mysql_errno() . ") " .
mysql_error());
$character_table .= "<TABLE CELLSPACING='2' CELLPADDING='2'
BORDER='0'><TR><TD>Name</TD><TD>Hit
Points</TD><TD>Gold</TD><TD>Experience</TD><TD>Delete</TD></TR>";
$x=0;
while ($character = mysql_fetch_array ($result2)) {
$x=$x+1;
$character_table .=
"<TR><TD>".$character[1]."</TD><TD>".$character[2]."</TD><TD>".$character[3]."</TD><TD>".$character[4]."</TD>";
$character_table .= "<TD><form action='character.php'
method='post'><input type='hidden' name='character'
value='".$character[1]."'><INPUT TYPE='submit'
NAME='delete_character_submit'
VALUE='delete_character'></FORM></TD></TR>";}
$character_table .= "</TABLE>";
if ($x >= 2){
$error_message .= "<P>You have too many characters. You must
delete ".$x."before you can create another.</P>";
}else {
$character_creation_form .= "<FORM
ACTION='character.php?op=create_character' METHOD='post'>";
$character_creation_form .= "<table cellspacing='2'
cellpadding='2' border='0'><tr>";
$character_creation_form .= "<td>New Character
Name:</td><td><input type='text' name='new_character_name' size='30'
maxlength='30' value=''/></td></tr>";
$character_creation_form .= "<tr><td></td><td><input
type='submit' name='New_Character_Submit' value='Create
Character'></td></tr></table></FORM>";}

if ($row[0] == 3){
$query4 = "SELECT name, hp, gold, exp FROM characters WHERE
username='".$_SESSION['username']."' ORDER BY name ASC";
$result4 = mysql_query ($query4) or die("<b>A fatal MySQL
error occured</b>.\n<br>\nError: (" . mysql_errno() . ") " .
mysql_error());
$character_table .= "<TABLE CELLSPACING='2' CELLPADDING='2'
BORDER='0'><TR><TD>Name</TD><TD>Hit
Points</TD><TD>Gold</TD><TD>Experience</TD><TD>Delete</TD></TR>";
$x=0;
while ($character = mysql_fetch_array ($result2)) {
$x=$x+1;
$character_table .=
"<TR><TD>".$character[1]."</TD><TD>".$character[2]."</TD><TD>".$character[3]."</TD><TD>".$character[4]."</TD>";
$character_table .= "<TD><form action='character.php'
method='post'><input type='hidden' name='character'
value='".$character[1]."'><INPUT TYPE='submit'
NAME='delete_character_submit'
VALUE='delete_character'></FORM></TD></TR>";}
$character_table .= "</TABLE>";
if ($x >= 3){
$error_message .= "<P>You have too many characters. You must
delete ".$x."before you can create another.</P>";
}else {
$character_creation_form .= "<FORM
ACTION='character.php?op=create_character' METHOD='post'>";
$character_creation_form .= "<table cellspacing='2'
cellpadding='2' border='0'><tr>";
$character_creation_form .= "<td>New Character
Name:</td><td><input type='text' name='new_character_name' size='30'
maxlength='30' value=''/></td></tr>";
$character_creation_form .= "<tr><td></td><td><input
type='submit' name='New_Character_Submit' value='Create
Character'></td></tr></table></FORM>";}

}else{//display login form
$login .= '<!-- Login Form -->';
$login .= '<form action="index.php?' . SID . '" method="post">';
$login .= '<small>User Name</small><BR><input type="text"
name="username" size="10" maxlength="20" value="';
$login .= '" /><BR>';
$login .= '<small>Password</small><BR><input type="password"
name="password" size="10" maxlength="20" /><BR>';
$login .= '<input type="submit" name="login_submit" value="login"
/>';
$login .= '</form></p>';}

if ($_POST['delete_character_submit']){//test for delete character
button pressed
$query5 = "DELETE FROM characters, accounts WHERE
characters.account_id = accounts.account_id AND
accounts.username='".$_SESSION['username']."' and
characters.name='".$_POST['character']."'";
echo "<PRE>".$query5."</PRE>";
$result5 = mysql_query ($query5) or die("<b>A fatal MySQL error
occured</b>.\n<br>\nError: (" . mysql_errno() . ") " . mysql_error());
echo "<PRE>".$result5."</PRE>";
$row5 = mysql_affected_rows ($dbc);
echo "<PRE>".$row5."</PRE>";
if($row5 = 0){$error_message .= "Something went wrong. Please try
again.";}
elseif($row5 >= 2){$error_message .= "Somehow the entire character
database has been trashed. Thank You for playing Severed Realms.";}}

if ($HTTP_GET_VARS[op]=="create_character"){//test for create
character button pressed
$query6 = "INSERT INTO characters (name, hp, gold, exp) VALUES
('".$_POST['new_character_name']."', 10, 100, 0)";
$result6 = mysql_query ($query6) or die("<b>A fatal MySQL error
occured</b>.\n<br>\nError: (" . mysql_errno() . ") " . mysql_error());
$row6 = mysql_affected_rows ($dbc);
if($row6 = 0){$error_message .= "Something went wrong. Please try
again.";}
elseif($row6 >= 2){$error_message .= "Somehow the entire character
database has been trashed. Thank You for playing Severed Realms.";}}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>
<head>
<title>New Character</title>
</head>
<body background="images/bkg.gif" bgcolor="#EEE2CC" text="#804000"
link="#004000" vlink="#000040" alink="#808080">
<div align="center"><table width="85%" border="0" cellspacing="5"
cellpadding="5" align="center" style="font-family: sans-serif;">

<!-- Header Row -->
<tr><td colspan="2" align="left" valign="top"><img
src="images/header.jpg" width="550" height="100" alt=""
border="0"></td></tr>

<!-- Menu Column -->
<tr><td width="100" valign="top" background="images/lt_bkg.gif"
style="border: medium solid #804000;">
<?php echo login_logout (); ?>
<A HREF="forgotpassword.php"><small>Forgot Your
Password?<br></small></A><HR>
<a href="index.php">Home</a><BR>
Forum<br>
FAQ's<br>
Policies<br>
Artifacts<br>
Contact Us<br>
Downloads<br>

</td>

<!-- Content Column -->
<td valign="top" background="images/lt_bkg.gif" style="border: medium
solid #804000;">
<?php if ($message){echo stripslashes($message);} ?>
<?php if ($error_message){echo stripslashes($error_message);} ?>
<?php if ($character_table){echo stripslashes($character_table);} ?>
<?php if ($character_creation_form){echo
stripslashes($character_creation_form);} ?>
</td></tr>

<!-- Footer Row -->
<tr><td colspan="2" align="center"
valign="top"background="images/lt_bkg.gif" style="border: medium solid
#804000;">copyright contacts policies other stuff to go here</td></tr>
</table></div>
</BODY></HTML>
Jul 17 '05 #1
3 2906
In article <90**************************@posting.google.com >,
sk*******@yahoo.com (josh dismukes) wrote:
/// here is the code i'm getting a parse error on the last line of the
code which
/// is </html> any help will be much appreciated.


Check your {}'s. I would guess that a closing } is missing somewhere.

JP

--
Sorry, <de*****@cauce.org> is een "spam trap".
E-mail adres is <jpk"at"akamail.com>, waarbij "at" = @.
Jul 17 '05 #2

"Jan Pieter Kunst" <de*****@cauce.org> wrote in message
news:de***************************@news1.news.xs4a ll.nl...
In article <90**************************@posting.google.com >,
sk*******@yahoo.com (josh dismukes) wrote:
/// here is the code i'm getting a parse error on the last line of the
code which
/// is </html> any help will be much appreciated.


Check your {}'s. I would guess that a closing } is missing somewhere.

JP


According to my bracket matching editor, there are _three_ missing. Get one,
they're great for this sort of thing.

Garp
Jul 17 '05 #3
"Garp" <ga***@no7.blueyonder.co.uk> wrote in message
news:7d********************@news-text.cableinet.net...

"Jan Pieter Kunst" <de*****@cauce.org> wrote in message
news:de***************************@news1.news.xs4a ll.nl...
In article <90**************************@posting.google.com >,
sk*******@yahoo.com (josh dismukes) wrote:
/// here is the code i'm getting a parse error on the last line of the
code which
/// is </html> any help will be much appreciated.
Check your {}'s. I would guess that a closing } is missing somewhere.

JP


According to my bracket matching editor, there are _three_ missing. Get

one, they're great for this sort of thing.


People with poor curly hygiene depends to be tormented if you ask me.
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Michael Alers | last post by:
Hello, I am extracting XML from a dbase and using jstl xml tag library to parse and display the xml. The problem I have is that the XML contains a DOCTYPE with a relative DTD declaration eg. ...
6
by: Eric Enright | last post by:
Could someone please tell me why this code doesn't work? ----- begin "line.pl" ----- #!/usr/bin/perl # output i'm expecting: # #-----begin----- #foreach $outerline (<FIN>) #{
2
by: Eshrath | last post by:
Hi, What I am trying to do: ======================= I need to form a table in html using the xsl but the table that is formed is quite long and cannot be viewed in our application. So we are...
3
by: | last post by:
I have been researching articles on google on how to create a simple RSS feed that sucks <title><blurb><link><date> out of a sql server 2000 database via an aspx page. I know it has to be pushed...
14
by: Schraalhans Keukenmeester | last post by:
I am building a default sheet for my linux-related pages. Since many linux users still rely on/prefer viewing textmode and unstyled content I try to stick to the correct html tags to pertain good...
1
by: yawnmoth | last post by:
I'm trying to mess around with PHP5's DOM functions and have run into something that confuses me: <?php $dom = new DOMDocument(); $dom->loadHTML('<html></html>'); echo...
1
by: John | last post by:
Hi var poster="<html><head..... etc .... </html>"; var animal='dog'; The string contains images and text that changes. Originally I wanted to do something like print "<a href=" +...
3
by: Yash | last post by:
Hi all, I found that while we are updating our application, the application is not known to tomcat, untill it is completed. So tomcat sends 503 page as resource not found. I want to know is...
2
by: -Karl | last post by:
Couls someone please advise me on this error. What I am trying to do is be able to convert an XML document into arrays. I read that the subs & functions have to be in <scripttags. Thanks! ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.