Jump to content

[SOLVED] Parse error help...


fabioisonfire

Recommended Posts

Here is the error I'm getting:

 

Parse error: syntax error, unexpected T_STRING in /home/fabio/public_html/vote.php on line 21

 

 

Here's the code:

<?php
session_start();
require "global_func.php";
if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }
$userid=$_SESSION['userid'];
require "header.php";
$h = new headers;
$h->startheaders();
include "mysql.php";
global $c;
$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error());
$ir=mysql_fetch_array($is);
check_level();
$fm=money_formatter($ir['money']);
$lv=date('F j, Y, g:i a',$ir['laston']);
$h->userdata($ir,$lv,$fm);
$h->menuarea();
print "
<b>Vote here on each of these sites to help Ruins of Sera. Each one of your votes gives you 50 Credits.</b><br><br>
<a href="http://www.toprpgames.com/vote.php?idno=1832"><img src="http://www.toprpgames.com/images/banners/toprpg_88x31-2.gif" border="0"></a>
<br><br>
<a href="http://best-rpg.com/games/vote/382/" title="Vote on Best Rpg 200" ><img src="http://www.ruinsofsera.x10hosting.com/index.php/bestrpg.jpg"></a>
<br><br>
<div style="width: 88px; height: 55;">
	<a href="http://www.xtremetop100.com/in.php?site=1132239810">
	<img src="http://www.xtremeTop100.com/votenew.jpg" border="0" alt="MMORPG & MPOG Free server" style="float: left;\ margin-top: -1px;"></a><br><a href="http://www.xtremetop100.com/">
	<img src="http://www.xtremeTop100.com/tracker.jpg" border="0" alt="MMORPG & MPOG Free server" style="float: left;\ margin-top: -1px;"></a></td> </div><br><br><a href="http://www.gtop100.com/in.php?site=21959" title="MMORPG / MPOG" target="_blank">
<img src="http://www.gtop100.com/images/votebutton.jpg" border="0" alt="MMORPG / MPOG"></a>";
$h->endpage();
?>

Link to comment
https://forums.phpfreaks.com/topic/103098-solved-parse-error-help/
Share on other sites

Here try:

 

<?php
session_start();
require "global_func.php";
if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }
$userid=$_SESSION['userid'];
require "header.php";
$h = new headers;
$h->startheaders();
include "mysql.php";
global $c;
$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error());
$ir=mysql_fetch_array($is);
check_level();
$fm=money_formatter($ir['money']);
$lv=date('F j, Y, g:i a',$ir['laston']);
$h->userdata($ir,$lv,$fm);
$h->menuarea();
print '
<b>Vote here on each of these sites to help Ruins of Sera. Each one of your votes gives you 50 Credits.</b><br><br>
<a href="http://www.toprpgames.com/vote.php?idno=1832"><img src="http://www.toprpgames.com/images/banners/toprpg_88x31-2.gif" border="0"></a>
<br><br>
<a href="http://best-rpg.com/games/vote/382/" title="Vote on Best Rpg 200" ><img src="http://www.ruinsofsera.x10hosting.com/index.php/bestrpg.jpg"></a>
<br><br>
<div style="width: 88px; height: 55;">
	<a href="http://www.xtremetop100.com/in.php?site=1132239810">
	<img src="http://www.xtremeTop100.com/votenew.jpg" border="0" alt="MMORPG & MPOG Free server" style="float: left;\ margin-top: -1px;"></a><br><a href="http://www.xtremetop100.com/">
	<img src="http://www.xtremeTop100.com/tracker.jpg" border="0" alt="MMORPG & MPOG Free server" style="float: left;\ margin-top: -1px;"></a></td> </div><br><br><a href="http://www.gtop100.com/in.php?site=21959" title="MMORPG / MPOG" target="_blank">
<img src="http://www.gtop100.com/images/votebutton.jpg" border="0" alt="MMORPG / MPOG"></a>';
$h->endpage();
?>

The error is coming from this large print:

 

<?php

print "
<b>Vote here on each of these sites to help Ruins of Sera. Each one of your votes gives you 50 Credits.</b><br><br>
<a href="http://www.toprpgames.com/vote.php?idno=1832"><img src="http://www.toprpgames.com/images/banners/toprpg_88x31-2.gif" border="0"></a>
<br><br>
<a href="http://best-rpg.com/games/vote/382/" title="Vote on Best Rpg 200" ><img src="http://www.ruinsofsera.x10hosting.com/index.php/bestrpg.jpg"></a>
<br><br>
<div style="width: 88px; height: 55;">
	<a href="http://www.xtremetop100.com/in.php?site=1132239810">
	<img src="http://www.xtremeTop100.com/votenew.jpg" border="0" alt="MMORPG & MPOG Free server" style="float: left;\ margin-top: -1px;"></a><br><a href="http://www.xtremetop100.com/">
	<img src="http://www.xtremeTop100.com/tracker.jpg" border="0" alt="MMORPG & MPOG Free server" style="float: left;\ margin-top: -1px;"></a></td> </div><br><br><a href="http://www.gtop100.com/in.php?site=21959" title="MMORPG / MPOG" target="_blank">
<img src="http://www.gtop100.com/images/votebutton.jpg" border="0" alt="MMORPG / MPOG"></a>";

 

Instead, do this:

<?php

print<<<HERE
   <b>Vote here on each of these sites to help Ruins of Sera. Each one of your votes gives you 50 Credits.</b><br><br>
   <a href="http://www.toprpgames.com/vote.php?idno=1832"><img src="http://www.toprpgames.com/images/banners/toprpg_88x31-2.gif" border="0"></a>
   <br><br>
   <a href="http://best-rpg.com/games/vote/382/" title="Vote on Best Rpg 200" ><img src="http://www.ruinsofsera.x10hosting.com/index.php/bestrpg.jpg"></a>
   <br><br>
   	<div style="width: 88px; height: 55;">
   		<a href="http://www.xtremetop100.com/in.php?site=1132239810">
   		<img src="http://www.xtremeTop100.com/votenew.jpg" border="0" alt="MMORPG & MPOG Free server" style="float: left;\ margin-top: -1px;"></a><br><a href="http://www.xtremetop100.com/">
   		<img src="http://www.xtremeTop100.com/tracker.jpg" border="0" alt="MMORPG & MPOG Free server" style="float: left;\ margin-top: -1px;"></a></td> </div><br><br><a href="http://www.gtop100.com/in.php?site=21959" title="MMORPG / MPOG" target="_blank">
   <img src="http://www.gtop100.com/images/votebutton.jpg" border="0" alt="MMORPG / MPOG"></a>
HERE;

 

The reason your getting the error is because you can't use double quotes within double quotes. If you don't want to do it the way I showed you, you can go through and either escape all the double quotes with backslashes, or replace them with single quotes.

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.