Jump to content

Why do I get this error?


MySQL_Narb

Recommended Posts

Error:

 

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/runevid/public_html/Quests/finished_tutorial.php on line 18

 

Code:

 

<?php session_start(); ?>
<html>
<head>
<title>CrazyQuest - The online website for quests!</title>
<link type="text/css" href="style.css" rel="stylesheet" media="screen" /> 
</head>
<body>
<center>
<div id="container" > 
<div id="banner" > 
		<img src="Images/logo.png" alt="" width="414" height="56" border="0" />
<h1>CrazyQuest</h1> 

</div>

<?php

$username = "$_SESSION['username']";

//connect
$connect = mysql_connect("localhost","","") or die("Connection failed!");
mysql_select_db("") or die("Database fail!");

//write
$update_complete = mysql_query("UPDATE users SET quest1 = quest1 + 1 WHERE username='$username'");
$points = mysql_query("UPDATE users SET points = points + 3 WHERE username='$username'");

echo "<b><span style='color:green'>You have completed quest and gained 3 points!</span></b>";
}
?>

<div id="footer"><h1>Copyright 2009 - CrazyQuest</h1></div>

Link to comment
https://forums.phpfreaks.com/topic/178293-why-do-i-get-this-error/
Share on other sites

i believe i see you with the same thread at least once a day .. you should really save yourself some time and learn why these errors are occurring so you can prevent or rectify them yourself.  i know this is a help forum, and i wouldn't want to take away from that, but you should really look into Parse Errors if you plan on continuing with PHP in the future.

 

just an observation.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.