473,573 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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('c onnect.php');

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

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

if ($row[0] == 1){
$query2 = "SELECT name, hp, gold, exp FROM characters WHERE
username='".$_S ESSION['username']."'";
$result2 = mysql_query ($query2) or die("<b>A fatal MySQL
error occured</b>.\n<br>\nErro r: (" . mysql_errno() . ") " .
mysql_error());
$character_tabl e .= "<TABLE CELLSPACING='2' CELLPADDING='2'
BORDER='0'><TR> <TD>Name</TD><TD>Hit
Points</TD><TD>Gold</TD><TD>Experien ce</TD><TD>Delete</TD></TR>";
$x=0;
while ($character = mysql_fetch_arr ay ($result2)) {
$x=$x+1;
$character_tabl e .=
"<TR><TD>".$cha racter[1]."</TD><TD>".$chara cter[2]."</TD><TD>".$chara cter[3]."</TD><TD>".$chara cter[4]."</TD>";
$character_tabl e .= "<TD><form action='charact er.php'
method='post'>< input type='hidden' name='character '
value='".$chara cter[1]."'><INPUT TYPE='submit'
NAME='delete_ch aracter_submit'
VALUE='delete_c haracter'></FORM></TD></TR>";}
$character_tabl e .= "</TABLE>";
if ($x >= 1){
$error_message .= "<P>You have too many characters. You must
delete ".$x."befor e you can create another.</P>";
}else{
$character_crea tion_form .= "<FORM
ACTION='charact er.php?op=creat e_character' METHOD='post'>" ;
$character_crea tion_form .= "<table cellspacing='2'
cellpadding='2' border='0'><tr> ";
$character_crea tion_form .= "<td>New Character
Name:</td><td><input type='text' name='new_chara cter_name' size='30'
maxlength='30' value=''/></td></tr>";
$character_crea tion_form .= "<tr><td></td><td><input
type='submit' name='New_Chara cter_Submit' value='Create
Character'></td></tr></table></FORM>";}

if ($row[0] == 2){
$query3 = "SELECT name, hp, gold, exp FROM characters WHERE
username='".$_S ESSION['username']."'";
$result3 = mysql_query ($query3) or die("<b>A fatal MySQL
error occured</b>.\n<br>\nErro r: (" . mysql_errno() . ") " .
mysql_error());
$character_tabl e .= "<TABLE CELLSPACING='2' CELLPADDING='2'
BORDER='0'><TR> <TD>Name</TD><TD>Hit
Points</TD><TD>Gold</TD><TD>Experien ce</TD><TD>Delete</TD></TR>";
$x=0;
while ($character = mysql_fetch_arr ay ($result2)) {
$x=$x+1;
$character_tabl e .=
"<TR><TD>".$cha racter[1]."</TD><TD>".$chara cter[2]."</TD><TD>".$chara cter[3]."</TD><TD>".$chara cter[4]."</TD>";
$character_tabl e .= "<TD><form action='charact er.php'
method='post'>< input type='hidden' name='character '
value='".$chara cter[1]."'><INPUT TYPE='submit'
NAME='delete_ch aracter_submit'
VALUE='delete_c haracter'></FORM></TD></TR>";}
$character_tabl e .= "</TABLE>";
if ($x >= 2){
$error_message .= "<P>You have too many characters. You must
delete ".$x."befor e you can create another.</P>";
}else {
$character_crea tion_form .= "<FORM
ACTION='charact er.php?op=creat e_character' METHOD='post'>" ;
$character_crea tion_form .= "<table cellspacing='2'
cellpadding='2' border='0'><tr> ";
$character_crea tion_form .= "<td>New Character
Name:</td><td><input type='text' name='new_chara cter_name' size='30'
maxlength='30' value=''/></td></tr>";
$character_crea tion_form .= "<tr><td></td><td><input
type='submit' name='New_Chara cter_Submit' value='Create
Character'></td></tr></table></FORM>";}

if ($row[0] == 3){
$query4 = "SELECT name, hp, gold, exp FROM characters WHERE
username='".$_S ESSION['username']."' ORDER BY name ASC";
$result4 = mysql_query ($query4) or die("<b>A fatal MySQL
error occured</b>.\n<br>\nErro r: (" . mysql_errno() . ") " .
mysql_error());
$character_tabl e .= "<TABLE CELLSPACING='2' CELLPADDING='2'
BORDER='0'><TR> <TD>Name</TD><TD>Hit
Points</TD><TD>Gold</TD><TD>Experien ce</TD><TD>Delete</TD></TR>";
$x=0;
while ($character = mysql_fetch_arr ay ($result2)) {
$x=$x+1;
$character_tabl e .=
"<TR><TD>".$cha racter[1]."</TD><TD>".$chara cter[2]."</TD><TD>".$chara cter[3]."</TD><TD>".$chara cter[4]."</TD>";
$character_tabl e .= "<TD><form action='charact er.php'
method='post'>< input type='hidden' name='character '
value='".$chara cter[1]."'><INPUT TYPE='submit'
NAME='delete_ch aracter_submit'
VALUE='delete_c haracter'></FORM></TD></TR>";}
$character_tabl e .= "</TABLE>";
if ($x >= 3){
$error_message .= "<P>You have too many characters. You must
delete ".$x."befor e you can create another.</P>";
}else {
$character_crea tion_form .= "<FORM
ACTION='charact er.php?op=creat e_character' METHOD='post'>" ;
$character_crea tion_form .= "<table cellspacing='2'
cellpadding='2' border='0'><tr> ";
$character_crea tion_form .= "<td>New Character
Name:</td><td><input type='text' name='new_chara cter_name' size='30'
maxlength='30' value=''/></td></tr>";
$character_crea tion_form .= "<tr><td></td><td><input
type='submit' name='New_Chara cter_Submit' value='Create
Character'></td></tr></table></FORM>";}

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

if ($_POST['delete_charact er_submit']){//test for delete character
button pressed
$query5 = "DELETE FROM characters, accounts WHERE
characters.acco unt_id = accounts.accoun t_id AND
accounts.userna me='".$_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>\nErro r: (" . mysql_errno() . ") " . mysql_error());
echo "<PRE>".$result 5."</PRE>";
$row5 = mysql_affected_ rows ($dbc);
echo "<PRE>".$row5." </PRE>";
if($row5 = 0){$error_messa ge .= "Something went wrong. Please try
again.";}
elseif($row5 >= 2){$error_messa ge .= "Somehow the entire character
database has been trashed. Thank You for playing Severed Realms.";}}

if ($HTTP_GET_VARS[op]=="create_chara cter"){//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>\nErro r: (" . mysql_errno() . ") " . mysql_error());
$row6 = mysql_affected_ rows ($dbc);
if($row6 = 0){$error_messa ge .= "Something went wrong. Please try
again.";}
elseif($row6 >= 2){$error_messa ge .= "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="ima ges/bkg.gif" bgcolor="#EEE2C C" 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"><i mg
src="images/header.jpg" width="550" height="100" alt=""
border="0"></td></tr>

<!-- Menu Column -->
<tr><td width="100" valign="top" background="ima ges/lt_bkg.gif"
style="border: medium solid #804000;">
<?php echo login_logout (); ?>
<A HREF="forgotpas sword.php"><sma ll>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="ima ges/lt_bkg.gif" style="border: medium
solid #804000;">
<?php if ($message){echo stripslashes($m essage);} ?>
<?php if ($error_message ){echo stripslashes($e rror_message);} ?>
<?php if ($character_tab le){echo stripslashes($c haracter_table) ;} ?>
<?php if ($character_cre ation_form){ech o
stripslashes($c haracter_creati on_form);} ?>
</td></tr>

<!-- Footer Row -->
<tr><td colspan="2" align="center"
valign="top"bac kground="images/lt_bkg.gif" style="border: medium solid
#804000;">copyr ight contacts policies other stuff to go here</td></tr>
</table></div>
</BODY></HTML>
Jul 17 '05 #1
3 2922
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 .xs4all.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.blue yonder.co.uk> wrote in message
news:7d******** ************@ne ws-text.cableinet. net...

"Jan Pieter Kunst" <de*****@cauce. org> wrote in message
news:de******** *************** ****@news1.news .xs4all.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
2284
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. <!DOCTYPE CustomerLoopService SYSTEM "AAA.dtd"> How could I switch off the the loading and validating of the DTD when using jstl tag <x:parse> ?
6
3684
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
3201
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 writing one object in C# which will take the entire table tag contents and renders. Ie., we need to pass "<table>………… <thead>……</thead>. <tr>.<td>...
3
2754
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 into a <xml> document but not sure which direction to take. Is there perhaps a starter document which uses sql server as the data source I can...
14
3616
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 readibility on browsers w/o css-support. For important notes, warnings etc I use the <pre> tag, which shows in a neat bordered box when viewed...
1
2234
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 $dom->childNodes->length; ?>
1
2238
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=" + poster + ">Choose Poster of a " + animal + "</a>";
3
3085
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 virtual hosting is the right way to deal with this issue. Is it possible to customise the 503 page, so that, for any resource not found issue, tomcat...
2
2051
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! Error: BC30456: 'Read_DOM' is not a member of
0
7784
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
1
7796
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8074
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5294
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3734
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3739
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2223
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1310
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1044
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.