Porkie Posted July 1, 2009 Share Posted July 1, 2009 echo "<a href='www.aa.co.uk/Newdirectory/video.php?category={$videos['category']}'>($videos['category']}</a>"; Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/myuklive/public_html/Newdirectory/video.php on line 64 cheers for any help Quote Link to comment https://forums.phpfreaks.com/topic/164442-parse-error/ Share on other sites More sharing options...
Brian W Posted July 1, 2009 Share Posted July 1, 2009 whats line 63-65, line 64 checks out as far as I can tell. You could try this just to be sure it gets parsed as expected (not that it should have any issues as is): echo "<a href='www.aa.co.uk/Newdirectory/video.php?category=".$videos['category']."'>".$videos['category']."</a>"; Quote Link to comment https://forums.phpfreaks.com/topic/164442-parse-error/#findComment-867417 Share on other sites More sharing options...
Porkie Posted July 1, 2009 Author Share Posted July 1, 2009 print ("<td>"); echo "<a href='www.aaa.co.uk/Newdirectory/video.php?category={$videos['category']}'>($videos['category']}</a>"; print ("</td>"); cheers Quote Link to comment https://forums.phpfreaks.com/topic/164442-parse-error/#findComment-867420 Share on other sites More sharing options...
Brian W Posted July 1, 2009 Share Posted July 1, 2009 hmm, line 64 was the issue... use the code I posted before: echo "<a href='www.aaa.co.uk/Newdirectory/video.php?category=".$videos['category']."'>".$videos['category']."</a>"; Quote Link to comment https://forums.phpfreaks.com/topic/164442-parse-error/#findComment-867422 Share on other sites More sharing options...
Porkie Posted July 1, 2009 Author Share Posted July 1, 2009 Notice: Undefined offset: 8 in /home/aaa/public_html/Newdirectory/video.php on line 64 Quote Link to comment https://forums.phpfreaks.com/topic/164442-parse-error/#findComment-867429 Share on other sites More sharing options...
Psycho Posted July 1, 2009 Share Posted July 1, 2009 Here's your problem: echo "<a href='www.aa.co.uk/Newdirectory/video.php?category={$videos['category']}'>($videos['category']}</a>"; The first red character should be a left curly brace - not a paren Quote Link to comment https://forums.phpfreaks.com/topic/164442-parse-error/#findComment-867432 Share on other sites More sharing options...
Brian W Posted July 1, 2009 Share Posted July 1, 2009 I believe that that is saying that $videos['category'] is not set. Not just empty, but hasn't been defined at all. Try: $cat = (is_set($videos['category'])) ? $videos['category'] : "NULL"; echo "<a href='www.aaa.co.uk/Newdirectory/video.php?category=".$cat ."'>".$cat ."</a>"; mjdamato, whats the problem, do explain... Quote Link to comment https://forums.phpfreaks.com/topic/164442-parse-error/#findComment-867433 Share on other sites More sharing options...
Psycho Posted July 1, 2009 Share Posted July 1, 2009 Maybe you were writing your post before I added my last comment. Look at the two characters I highlighted in red. They are being used to encapsulate a variable that the PHP code should evaluate in the string. but the first character is a paren and the second is a curly brace. The BOTH need to be curly braces () - parens {} - curly braces Quote Link to comment https://forums.phpfreaks.com/topic/164442-parse-error/#findComment-867436 Share on other sites More sharing options...
Porkie Posted July 1, 2009 Author Share Posted July 1, 2009 echo "<a href='www.aa.co.uk/Newdirectory/video.php?category={$video[$c]['category']}'>{$video[$c]['category']}</a>"; Notice: Undefined offset: 8 in /home/myuklive/public_html/Newdirectory/video.php on line 64 Notice: Undefined offset: 8 in /home/myuklive/public_html/Newdirectory/video.php on line 64 still errors m8 cheers for all help tho Quote Link to comment https://forums.phpfreaks.com/topic/164442-parse-error/#findComment-867439 Share on other sites More sharing options...
Psycho Posted July 1, 2009 Share Posted July 1, 2009 echo "<a href='www.aa.co.uk/Newdirectory/video.php?category={$video[$c]['category']}'>{$video[$c]['category']}</a>"; Notice: Undefined offset: 8 in /home/myuklive/public_html/Newdirectory/video.php on line 64 Notice: Undefined offset: 8 in /home/myuklive/public_html/Newdirectory/video.php on line 64 still errors mate cheers for all help tho What the hell! You're changing the code. In the code you first posted the array didn't have two indexes with the first index being [$c] Original: $videos['category'] Modified: $video[$c]['category'] Hmm... you aded a new index and you get an error about an undefined offset. I'll go out on a limb here and guess you haven't defined $c or it is a value that doesn't exist as an index in that array. Either way you should fix the original problem before trying to add new code/functionality. Quote Link to comment https://forums.phpfreaks.com/topic/164442-parse-error/#findComment-867445 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.