NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page [resolved] Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 12-05-2007, 05:37 AM THREAD STARTER               #1 (permalink)
NamePros Regular
Join Date: Apr 2005
Posts: 383
flishess will become famous soon enoughflishess will become famous soon enough
 



Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING


I am getting this error on line 24:

Code:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/getgscom/public_html/bf2matchplay/index.php on line 24
Code:
<?
include "config.php";

if (is_numeric($_GET['id']))
{
    $id = $_GET['id'];
    $result = mysql_query("SELECT platform,description,id,title,release_us,msrp,buylink,developer,publisher,esrb,genre,boxart FROM `gamepage` where id = $id") or die(mysql_error
        ());
    while ($row = mysql_fetch_array($result))
    {
        $title = $row["title"];
        $description = $row["description"];
        $cat = $row['platform'];
        $release_us = $row['release_us'];
        $boxart = $row['boxart'];
        $msrp = $row['msrp'];
        $buylink = $row['buylink'];
        $developer = $row['developer'];
        $publisher = $row['publisher'];
        $esrb = $row['esrb'];
        $genre = $row['genre'];
        echo nl2br($title . "\n\n" . $description . "\n\n" . $cat . "\n\n" . $release_us . "\n\n" . $boxart . "\n\n" . $msrp . "\n\n" . $buylink . "\n\n" . $developer . "\n\n" . $publisher . "\n\n" . $esrb . "\n\n" . $genre");
    }
    LINE 24: echo nl2br("\n\n<a href='" . $_SERVER['SCRIPT_NAME'] . "'>Back</a>");
} else
{

    $result = mysql_query("SELECT id,title FROM `gamepage`") or die(mysql_error());
    while ($row = mysql_fetch_array($result))
    {
        $title = $row["title"];
        $id = $row["id"];
        echo "<p><a href='index.php?id=$id'>$title</a></p>";
    }

}
?>
flishess is offline  
Old 12-05-2007, 05:45 AM   #2 (permalink)
i love automation
 
xrvel's Avatar
Join Date: Nov 2007
Location: xrvel.com
Posts: 1,615
xrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant futurexrvel has a brilliant future
 




I have run script below, and had no error... (??)
PHP Code:
<?php
????: NamePros.com http://www.namepros.com/programming/403434-resolved-parse-error-syntax-error-unexpected.html
echo nl2br("\n\n<a href='" $_SERVER['SCRIPT_NAME'] . "'>Back</a>");
?>
__________________
xrvel is offline  
Old 12-05-2007, 06:48 AM   #3 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,074
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
The error is not with line 24. As with most PHP errors you are best looking at the line before the 1 mentioned.

????: NamePros.com http://www.namepros.com/showthread.php?t=403434
You have the following:-

PHP Code:
echo nl2br($title "\n\n" $description "\n\n" $cat "\n\n" $release_us "\n\n" $boxart "\n\n" $msrp "\n\n" $buylink "\n\n" $developer "\n\n" $publisher "\n\n" $esrb "\n\n" $genre");
    } 
Notice near the end of the line you have a ". Remove this and the error will disappear.

I highly advise you to get an editor that checks your code as you write. For example I use Zend Studio. Spotting these types of errors are very easy. Without even running the script the IDE highlights that there is a problem with the line.

Take a look HERE as a demonstation.
__________________
Manage your portfolio using my new Domain Portfolio Management script.
Securing Your Domain Name From Theft
Last edited by Peter; 12-05-2007 at 06:52 AM.
Peter is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 02:25 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger