Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Closed Thread
Parse error: parse error, unexpected T_STRING, expecting ',' or ';'
Old 05-20-2005, 09:21 PM Parse error: parse error, unexpected T_STRING, expecting ',' or ';'
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Hi,

I Have been going crazy over this simple problem...I just can't figure it out!!

Somone wanna take a shot at it?

Code:
// PHP script
<?
// Connect to the database
mysql_connect ('localhost', 'username', 'password') ;
mysql_select_db ('db_name'); 

// Edit this number to however many links you want displaying
$num_displayed = 3 ;

// Select random rows from the database
$result = mysql_query ("SELECT * FROM products ORDER BY RAND() LIMIT $num_displayed"); 

// For all the rows that you selected
while ($row = mysql_fetch_array($result)) 

{
// Display them to the screen...

echo "<a href="http://www.brothersvarietystore.com/shop/index.php?p=product&id= . $row["pid"]">
<img src=\"" . $row["image_url"] . "\" border=1 alt=\"" . $row["title"] ."\"> 
</a>" ;
}
?>
As you have probably already noticed, the error is in the title of this thread, for you convenience, here it is again, the dreaded T_String...

Code:
Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/brother/public_html/rand.php on line 19
Your help is Greatly Appreciated!!

-Brian
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
View Public Profile
 
 
Register now for full access!
Old 05-20-2005, 09:27 PM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
Trades: 0
The error is in your echo statement, you forgot to escape the first double-quote
should be:
Code:
echo "<a href=\"http://www.brothersvarietystore.com .....
Anacrusis is offline
View Public Profile
 
Old 11-24-2007, 05:22 AM Re: Parse error: parse error, unexpected T_STRING, expecting ',' or ';'
Junior Talker

Posts: 4
Name: Marcel
Trades: 0
have also this problem

Code:
<?php
session_start();
$sid=session_id();
include"intern.php"?>
<html>
<head>
       <title><?php echo $titel?></title>
</head>
<?php echo $head?>
<table width="<?php echo $weite?>" align="center" valign="top" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td><?php echo $left2?></td>
    <td width="<?php echo $weitemitte?>">
      <table width="90%" cellpadding="0" cellspacing="0" align="center">
             <tr height="30">
               <td colspan="2" background="/Bilder/darkSilverHeader_01.gif" width="30"></td>
               <td background="/Bilder/darkSilverHeader_03.gif"></td>
               <td colspan="2" background="/Bilder/darkSilverHeader_05.gif" width="30"></td>
             </tr>
             <tr>
               <td background="/Bilder/darkSilverFooter_05.gif" width="16"></td>
               <td width="14"></td>
               <td align="center">
    <?php if(!isset($_POST['submit'])) {?>
    <form action="<?php $PHP_SELF ?>" method="post">
    <table width="80%" class="back1" style="border:medium solid ; border-color:#000000; padding:10px; border-spacing:10px" align="center" cellpadding="0" cellspacing="0">
        <tr>
        <td class="back1" align="center" colspan="2">
        <b>Wählen Sie ihre Rasse und Klasse aus!!</b>
        </td>
    </tr>
    <tr>
        <td class="back1">Rasse</td>
        <td class="back1"><select name="Rasse" size="1"><?php if ($data['Galaxie']=='1') { echo='<option>Mensch</option><option>Goauld</option><option>Tokra</option><option>Asgard</option><option>Replikator</option>'; } elseif ($data['Galaxie']=='2') { echo='<option>Mensch</option><option>Genii</option><option>Wraith</option><option>Replikator</option>'; } else { echo='<option>FEHLER</option>'; }?></select></td>
    </tr>
    <tr>
        <td class="back1">Beschreibung</td>
        <td class="back1"><textarea name="RBeschreibung" cols="25" rows="10"></textarea></td>
    </tr>
    <tr>
        <td class="back1">Klasse</td>
        <td class="back1"><select name="Klasse" size="1">
                                  <option>Raider</option>
                                  <option>Defer</option>
                                  <option>Händler</option>
                                  <option>Miener</option>
                                  </select></td>
    </tr>
        <tr>
                <td class="back1">Beschreibung</td>
                <td class="back1"><textarea name="KBeschreibung" cols="25" rows="10"></textarea></td>
        </tr>
    <tr>
        <td class="back1" align="center" colspan="2">
        <input type="submit" name="submit" value="Auswahl treffen" class="button">
        </td>
    </tr>
    </table>
    </form>
    <?php

    }else{
        $rasse = $_POST['Rasse'];
        $klasse = $_POST['Klasse'];
                $id = $_SESSION['user_id'];

        if($update =@mysql_query("UPDATE benutzer SET Rasse = '$rasse', Klasse = '$klasse' WHERE Id = '$id'")) {



   echo '<p align="center"><span class="green">Ihre Einstellungen wurden erfolgreich übernommen!<br><br>Rasse: '.$rasse.'<br>Klasse: '.$klasse.'<a href="/index2.php"><br><br>Weiter</a></p>';
        }else{
            echo '<p align="center"><span class="green">Beim ändern ihrer Einstellungen trat leider ein Fehler auf!<br><br><a href="/chose.php">Zurück</a></p>';}}?></td>
               <td width="14"></td>
               <td background="/Bilder/darkSilverFooter_06.gif" width="16"></td>
             </tr>
             <tr height="13">
               <td background="/Bilder/darkSilverFooter_01.gif" width="16"></td>
               <td colspan="3" background="/Bilder/darkSilverFooter_02.gif"></td>
               <td background="/Bilder/darkSilverFooter_04.gif" width="16"></td>
             </tr>
         </table>
       </td>
    <td><?php echo $right2; ?></td>
  </tr>
</table>
</body>
</html>
errorcode:
Code:
 Parse error:  parse error, unexpected '=', expecting ',' or ';' in /srv/www/htdocs/web156/html/sg/chose.php on line 34
that is this line:

Code:
        <td class="back1"><select name="Rasse" size="1"><?php if ($data['Galaxie']=='1') { echo='<option>Mensch</option><option>Goauld</option><option>Tokra</option><option>Asgard</option><option>Replikator</option>'; } elseif ($data['Galaxie']=='2') { echo='<option>Mensch</option><option>Genii</option><option>Wraith</option><option>Replikator</option>'; } else { echo='<option>FEHLER</option>'; }?></select></td>
Hanta is offline
View Public Profile
 
Old 11-24-2007, 08:36 AM Re: Parse error: parse error, unexpected T_STRING, expecting ',' or ';'
Super Talker

Posts: 134
Trades: 0
echo= should be echo (3 times)
__________________

Please login or register to view this content. Registration is FREE

Check out the Facebook Clone build with Jcow SNS at
Please login or register to view this content. Registration is FREE
, it is free and it always will be
Falcone is offline
View Public Profile
 
Old 11-24-2007, 05:00 PM Re: Parse error: parse error, unexpected T_STRING, expecting ',' or ';'
Junior Talker

Posts: 4
Name: Marcel
Trades: 0
oh yes... thanks very much... I forgot^^ is a long time ago that i coded the last time^^
Hanta is offline
View Public Profile
 
Old 08-01-2008, 01:11 PM Re: Parse error: parse error, unexpected T_STRING, expecting ',' or ';'
Junior Talker

Posts: 1
Trades: 0
I have that problem too here is my code

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- Meta Data -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="Short description of your site here." />
<meta name="keywords" content="keywords, go, here, seperated, by, commas" />
<?php include("content/var.php"); ?>
<!-- Site Title -->
<title> <?php echo $title ?> </title>
<!-- Link to Style External Sheet -->
<link href="style.css" type="text/css" rel="stylesheet" />
</head>
<body>
<?php include("content/toppart.php") ?>
<h3>Report A Sighting</h3>
<p>
<?php
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
  {
  //send email
  $email = $_REQUEST['email'] ; 
  $state = $_REQUEST['state'] ;
  $time = $_REQUEST['time'] ;
  $description = $_REQUEST['description'] ;
  mail( "Andy@easternbigfoot.com", "Subject: $subject",
  $message, "From: $email" );
  echo "Thank you for using our mail form";
  }
else
//if "email" is not filled out, display the form
  {
  echo "<form method='post' action='mailform-sightings.php'>
  Email: <input name='email' type='text' /><br />
  State:
  <select name="state">
    <option value="NewYork">New York</option>
    <option value="Connecticut">Connecticut</options>
  </select>
  Time Of Event:
  <select name="time", size="1">
    <option value="Morning">Morining</option>
    <option value="DayTime">Day Time</option>
    <option Value="Night">Night Time</option>
  </select>
  Description Of Event:<br />
  <textarea name='description' rows='15' cols='40'>
  </textarea><br />
  <input type='submit' />
  </form>";
  }
?>
</p>
</div>
<div id='right_side'>
<?php include("content/right.php") ?>
</div>
<div class='spacer'></div>
</div>
<div id='page_footer'>
<?php include("content/footer.php") ?>
</div>
</div>
</body>
</html>
andrewjm222 is offline
View Public Profile
 
Old 08-01-2008, 01:30 PM Re: Parse error: parse error, unexpected T_STRING, expecting ',' or ';'
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- Meta Data -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="Short description of your site here." />
<meta name="keywords" content="keywords, go, here, seperated, by, commas" />
<?php include("content/var.php"); ?>
<!-- Site Title -->
<title> <?php echo $title ?> </title>
<!-- Link to Style External Sheet -->
<link href="style.css" type="text/css" rel="stylesheet" />
</head>
<body>
<?php include("content/toppart.php"?>
<h3>Report A Sighting</h3>
<p>
<?php
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
  
{
  
//send email
  
$email $_REQUEST['email'] ; 
  
$state $_REQUEST['state'] ;
  
$time $_REQUEST['time'] ;
  
$description $_REQUEST['description'] ;
  
mail"Andy@easternbigfoot.com""Subject: $subject",
  
$message"From: $email);
  echo 
"Thank you for using our mail form";
  }
else
//if "email" is not filled out, display the form
  
{
  echo 
"<form method='post' action='mailform-sightings.php'>
  Email: <input name='email' type='text' /><br />
  State:
  <select name="
state">
    <option value="
NewYork">New York</option>
    <option value="
Connecticut">Connecticut</options>
  </select>
  Time Of Event:
  <select name="
time", size="1">
    <option value="
Morning">Morining</option>
    <option value="
DayTime">Day Time</option>
    <option Value="
Night">Night Time</option>
  </select>
  Description Of Event:<br />
  <textarea name='description' rows='15' cols='40'>
  </textarea><br />
  <input type='submit' />
  </form>"
;
  }
?>
</p>
</div>
<div id='right_side'>
<?php include("content/right.php"?>
</div>
<div class='spacer'></div>
</div>
<div id='page_footer'>
<?php include("content/footer.php"?>
</div>
</div>
</body>
</html>
argh! your includes are missing ; and one of your echo's has double quotes in it.

Try this:

PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- Meta Data -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="Short description of your site here." />
<meta name="keywords" content="keywords, go, here, seperated, by, commas" />
<?php include("content/var.php"); ?>
<!-- Site Title -->
<title> <?php echo $title?> </title>
<!-- Link to Style External Sheet -->
<link href="style.css" type="text/css" rel="stylesheet" />
</head>
<body>
<?php include("content/toppart.php"); ?>
<h3>Report A Sighting</h3>
<p>
<?php
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
  
{
  
//send email
  
$email $_REQUEST['email'] ; 
  
$state $_REQUEST['state'] ;
  
$time $_REQUEST['time'] ;
  
$description $_REQUEST['description'] ;
  
mail"Andy@easternbigfoot.com""Subject: $subject",
  
$message"From: $email);
  echo 
"Thank you for using our mail form";
  }
else
//if "email" is not filled out, display the form
  
{
  
  
?>
  <form method='post' action='mailform-sightings.php'>
  Email: <input name='email' type='text' /><br />
  State:
  <select name="state">
    <option value="NewYork">New York</option>
    <option value="Connecticut">Connecticut</options>
  </select>
  Time Of Event:
  <select name="time", size="1">
    <option value="Morning">Morining</option>
    <option value="DayTime">Day Time</option>
    <option Value="Night">Night Time</option>
  </select>
  Description Of Event:<br />
  <textarea name='description' rows='15' cols='40'>
  </textarea><br />
  <input type='submit' />
  </form>
  <?php 
  
}
?>
</p>
</div>
<div id='right_side'>
<?php include("content/right.php"); ?>
</div>
<div class='spacer'></div>
</div>
<div id='page_footer'>
<?php include("content/footer.php"); ?>
</div>
</div>
</body>
</html>
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE

Last edited by rogem002; 08-01-2008 at 01:31 PM..
rogem002 is offline
View Public Profile Visit rogem002's homepage!
 
Old 06-17-2010, 05:37 PM Re: Parse error: parse error, unexpected T_STRING, expecting ',' or ';'
Junior Talker

Posts: 1
Name: Steve
Trades: 0
Can anyone look at this for me? I'm a total PHP newb but this is not my code...PHP is spitting an error at me for T_STRING at this line...any help would be great - thanks!

global $submit,$sql_act,$sql_query,$sql_query_result,$sql _confirm,$sql_query_error,$tbl_struct;
if (($submit) and (!$sql_query_result) and ($sql_confirm)) {if (!$sql_query_error) {$sql_query_error = "Query was empty";} echo "<b>Error:</b> <br>".$sql_query_error."<br>";}
nemadrias is offline
View Public Profile
 
Old 06-17-2010, 06:59 PM Re: Parse error: parse error, unexpected T_STRING, expecting ',' or ';'
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
the error will probably be a missing semicolon in a line ABOVE that the interpreter indicated.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
View Public Profile Visit chrishirst's homepage!
 
Closed Thread     « Reply to Parse error: parse error, unexpected T_STRING, expecting ',' or ';'
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.30748 seconds with 12 queries