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

Reply
Syntax error - please help
Old 08-15-2008, 04:01 PM Syntax error - please help
Novice Talker

Posts: 8
Name: Mieke Janssens
Trades: 0
This is the error message I receive:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in...


This is the code:

Code:
<table align="center" class="specialtable">
  <tr>
    <td><?

include "nwc_admin/db.php";

$x1 = mysql_query("select * from linkscript_words order by rand()");
$row = mysql_fetch_array($x1);

echo "<span style=\"line-height: 200%; font-size: 14px; letter-spacing: 0.5px; word-spacing: 5px; margin-top: 5; margin-bottom: 5;\">";

while($row) {
    
    $wid = $row['wid'];
    $text = $row['text'];
    $taken = $row['taken'];
    
    if($taken==0) {
        $ahref = str_replace(" ","-",$text);
        $ahref= $wid . "-claim-" . $ahref . ".html";
        echo "<a href=\"$ahref\">$text</a> ";
    }
    
    else {
        $var1 = mysql_query("select * from linkscript_addons where wid='$wid'");
        $res = mysql_fetch_array($var1);
        
        $link = $res['link'];
        $mouseover = $res['mouseovertext'];
        $customcolor = $res['customcolor'];
        $fontcolor = $res['fontcolor'];
        $fontsize = $res['fontsize'];
        $name = $res['name'];
        
        $ahref = "<a href=\"$link\" title=\"$mouseover\" target=_blank>";
        if($customcolor)
            $ahref .= "<font color=\"#" . $customcolor "\"";
        else if($fontcolor==1)
            $ahref#000000\#008080\#00FF00\#800000\#FF0000\#000080\#A8B7F2\#FF9900\#800080\"";
            
        if($fontsize==2);
            
        $fontdecoration = $res['fontdecoration'];
        
        if(strstr($fontdecoration,"1"))
            $f1 = 1;"2"))
            $f2 = 1;"3"))
            $f3 = 1;"4"))
            $f4 = 1;
        
        if(strstr($ahref,"><font"))
            $ahref .= " style=\"";
        else
            $ahref .= "<font style=\"";
        
        if($f1==1)
            $ahref .= "font-weight: bold;";
        if($f2==1)
        if($f3==1)
        if($f4==1)>$text</font></font></a><font color=\"#" . $customcolor "\"";
        else if($fontcolor==1)
            $ahref#000000\#008080\#00FF00\#800000\#FF0000\#000080\#A8B7F2\#FF9900\#800080\"";
            
        if($fontsize==2);
            
        $fontdecoration = $res['fontdecoration'];
        
        if(strstr($fontdecoration,"1"))
            $f1 = 1;"2"))
            $f2 = 1;"3"))
            $f3 = 1;"4"))
            $f4 = 1;
        
        if(strstr($ahref,"> ";
        
        echo $ahref;
    }
    
    $row = mysql_fetch_array($x1);
}
echo "<p align=\"center\"><a href=\"suggest.php\"><font size=\"2\" color=\"#000000\">Suggest a word</font></a><p></p>";
echo "</font></span><font color=\"#" . $customcolor "\"";
        else if($fontcolor==1)
            $ahref#000000\#008080\#00FF00\#800000\#FF0000\#000080\#A8B7F2\#FF9900\#800080\"";
            
        if($fontsize==2);
            
        $fontdecoration = $res['fontdecoration'];
        
        if(strstr($fontdecoration,"1"))
            $f1 = 1;"2"))
            $f2 = 1;"3"))
            $f3 = 1;"4"))
            $f4 = 1;
        
        if(strstr($ahref,">";


?>
<br />
  
    <p align="center" class="specialtabletext">Powered by <a href="http://www.nichewordcloud.com/index.php?id=1" class="specialtablelink">Niche Word Cloud</a><p><p></p></td>
  </tr>
</table></font>
I can't seem to find what's wrong. Can anyone help me out?
__________________

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



Please login or register to view this content. Registration is FREE
lookielookies is offline
Reply With Quote
View Public Profile Visit lookielookies's homepage!
 
 
Register now for full access!
Old 08-15-2008, 06:11 PM Re: Syntax error - please help
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
*firstly, puts it in [php][/php] tags*

PHP Code:
<table align="center" class="specialtable">
  <tr>
    <td><?

include "nwc_admin/db.php";

$x1 mysql_query("select * from linkscript_words order by rand()");
$row mysql_fetch_array($x1);

echo 
"<span style=\"line-height: 200%; font-size: 14px; letter-spacing: 0.5px; word-spacing: 5px; margin-top: 5; margin-bottom: 5;\">";

while(
$row) {
    
    
$wid $row['wid'];
    
$text $row['text'];
    
$taken $row['taken'];
    
    if(
$taken==0) {
        
$ahref str_replace(" ","-",$text);
        
$ahref$wid "-claim-" $ahref ".html";
        echo 
"<a href=\"$ahref\">$text</a> ";
    }
    
    else {
        
$var1 mysql_query("select * from linkscript_addons where wid='$wid'");
        
$res mysql_fetch_array($var1);
        
        
$link $res['link'];
        
$mouseover $res['mouseovertext'];
        
$customcolor $res['customcolor'];
        
$fontcolor $res['fontcolor'];
        
$fontsize $res['fontsize'];
        
$name $res['name'];
        
        
$ahref "<a href=\"$link\" title=\"$mouseover\" target=_blank>";
        if(
$customcolor)
            
$ahref .= "<font color=\"#" $customcolor "\"";
        else if(
$fontcolor==1)
            
$ahref#000000\#008080\#00FF00\#800000\#FF0000\#000080\#A8B7F2\#FF9900\#800080\"";
            
        
if($fontsize==2);
            
        
$fontdecoration $res['fontdecoration'];
        
        if(
strstr($fontdecoration,"1"))
            
$f1 1;"2"))
            
$f2 1;"3"))
            
$f3 1;"4"))
            
$f4 1;
        
        if(
strstr($ahref,"><font"))
            
$ahref .= " style=\"";
        else
            
$ahref .= "<font style=\"";
        
        if(
$f1==1)
            
$ahref .= "font-weight: bold;";
        if(
$f2==1)
        if(
$f3==1)
        if(
$f4==1)>$text</font></font></a><font color=\"#" $customcolor "\"";
        else if(
$fontcolor==1)
            
$ahref#000000\#008080\#00FF00\#800000\#FF0000\#000080\#A8B7F2\#FF9900\#800080\"";
            
        
if($fontsize==2);
            
        
$fontdecoration $res['fontdecoration'];
        
        if(
strstr($fontdecoration,"1"))
            
$f1 1;"2"))
            
$f2 1;"3"))
            
$f3 1;"4"))
            
$f4 1;
        
        if(
strstr($ahref,"> ";
        
        echo 
$ahref;
    }
    
    
$row mysql_fetch_array($x1);
}
echo 
"<p align=\"center\"><a href=\"suggest.php\"><font size=\"2\" color=\"#000000\">Suggest a word</font></a><p></p>";
echo 
"</font></span><font color=\"#" $customcolor "\"";
        else if(
$fontcolor==1)
            
$ahref#000000\#008080\#00FF00\#800000\#FF0000\#000080\#A8B7F2\#FF9900\#800080\"";
            
        
if($fontsize==2);
            
        
$fontdecoration $res['fontdecoration'];
        
        if(
strstr($fontdecoration,"1"))
            
$f1 1;"2"))
            
$f2 1;"3"))
            
$f3 1;"4"))
            
$f4 1;
        
        if(
strstr($ahref,">";


?>
<br />
  
    <p align="center" class="specialtabletext">Powered by <a href="http://www.nichewordcloud.com/index.php?id=1" class="specialtablelink">Niche Word Cloud</a><p><p></p></td>
  </tr>
</table></font>
What line does the error occur? You seemed to have put ... where the rest of the error thingy is.
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE

Last edited by rogem002; 08-15-2008 at 06:13 PM..
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 08-15-2008, 07:16 PM Re: Syntax error - please help
Junior Talker

Posts: 2
Trades: 0
My guess would be these 2 lines
Code:
 $ahref#000000\#008080\#00FF00\#800000\#FF0000\#000080\#A8B7F2\#FF9900\#800080\"";
you are commenting out the ; at the end of the line.
travoll is offline
Reply With Quote
View Public Profile
 
Old 08-16-2008, 07:39 PM Re: Syntax error - please help
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
if($fontsize==2);

should be...

if($fontsize==2)

The ; escapes the if
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Syntax error - please help
 

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.13676 seconds with 12 queries