View previous topic :: View next topic |
Author |
Message |
kev1952 -
Joined: 08 Sep 2005 Posts: 105 Location: Townsville Australia
|
Posted: Fri Feb 17, 2006 5:29 am Post subject: PHP Script Error |
|
|
Getting an error with this script and can't find the problem:
Code: | if ($p=2) {
echo '<td class="t9"><a href="tvl'; // This is Line 42 reported as error.
echo $c-1;
echo '.php">';
echo $name1;
echo '</a></td>';
echo '<td class="t9">';
echo $link; // Back to Gallery
echo '</td>';
echo '<td class="t9"><a href="tvl';
echo $c+1;
echo '.php">';
echo $name2;
echo '</a></td>';
echo '</tr>';
echo '</table>';
return;
} |
Gives ma a "parse error, unexpected T_STRING, expecting ',' or ';' in E:\Website\htdocs\NewSite\galnav.php on line 42". Usually when I get this it is a missed ";" or some other simple syntax error but I've gone over this code till my eyes were hanging out and still can't find an error. The value of $p and $c is passed by calling the script with "filename.php?p=3&c=2" and it is being set properly.
I realise there probably is a different way to set up this script but for now all I want to do is get this one working. _________________ Cheers.... Kev
Kev's Place - http://www.kevsplace.com
Powered by Abyss X1.
Last edited by kev1952 on Fri Feb 17, 2006 6:20 am; edited 1 time in total |
|
Back to top |
|
|
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Fri Feb 17, 2006 6:06 am Post subject: |
|
|
Use a code editor and look on line 42. |
|
Back to top |
|
|
kev1952 -
Joined: 08 Sep 2005 Posts: 105 Location: Townsville Australia
|
Posted: Fri Feb 17, 2006 6:19 am Post subject: |
|
|
Already did that (gave me the same error but no further info) - sorry, should have commented the script. As you probably already figured out the above code is only part of the whole document. Line 42 is this line:
Code: | echo '<td class="t9"><a href="tvl'; |
I've edited the code in the first post to reflect this. _________________ Cheers.... Kev
Kev's Place - http://www.kevsplace.com
Powered by Abyss X1. |
|
Back to top |
|
|
kev1952 -
Joined: 08 Sep 2005 Posts: 105 Location: Townsville Australia
|
Posted: Fri Feb 17, 2006 7:43 am Post subject: |
|
|
Thanks all for looking at it - I found the problem and it wasn't in the above module (even though the error was reported there). In an earlier piece of the code I'd neglected to use a single quote (') and that threw the whole script out. I just knew it was going to be something simple - aghhhh!!
At least, now it works!!!!! _________________ Cheers.... Kev
Kev's Place - http://www.kevsplace.com
Powered by Abyss X1. |
|
Back to top |
|
|
|