PHP Script Error

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
kev1952
-


Joined: 08 Sep 2005
Posts: 105
Location: Townsville Australia

PostPosted: Fri Feb 17, 2006 5:29 am    Post subject: PHP Script Error Reply with quote

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 View user's profile Send private message Send e-mail Visit poster's website
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Fri Feb 17, 2006 6:06 am    Post subject: Reply with quote

Use a code editor and look on line 42.
Back to top View user's profile Send private message Visit poster's website
kev1952
-


Joined: 08 Sep 2005
Posts: 105
Location: Townsville Australia

PostPosted: Fri Feb 17, 2006 6:19 am    Post subject: Reply with quote

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 View user's profile Send private message Send e-mail Visit poster's website
kev1952
-


Joined: 08 Sep 2005
Posts: 105
Location: Townsville Australia

PostPosted: Fri Feb 17, 2006 7:43 am    Post subject: Reply with quote

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 View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group