justAnoob Posted April 28, 2009 Share Posted April 28, 2009 <?php echo '".substr($row['description'],0,50),"<span class="style666"><a href="http://xxxxxxxx.com/viewitem.php"> ...View</a></span>'; ?> Can't figure out the problem. Keep getting error saying there should be a "," or ";" Quote Link to comment Share on other sites More sharing options...
justAnoob Posted April 28, 2009 Author Share Posted April 28, 2009 <?php echo "".substr($row['description'],0,50),"<a href='http://xxxxxxxx.com/viewitem.php'> ...View</a>"; ?> This works without the span class, having problems inserting the class though. Quote Link to comment Share on other sites More sharing options...
justAnoob Posted April 28, 2009 Author Share Posted April 28, 2009 <?php echo "".substr($row['description'],0,50),"<span class='style666'><a href='http://xxxxxxxxx.com/viewitem.php'> ...View</a></span>"; ?> Got this to work with no errors, but the style is not applied. .style666 { color: #0099FF; text-decoration: none; } Quote Link to comment Share on other sites More sharing options...
Helmet Posted April 29, 2009 Share Posted April 29, 2009 There's something weird going on with your two quotes (single or double) at the beginning of the string. This should work: echo substr($row['description'],0,50).'<span class="style666"><a href="http://xxxxxxxxx.com/viewitem.php"> ...View</a></span>'; Quote Link to comment Share on other sites More sharing options...
mikesta707 Posted April 29, 2009 Share Posted April 29, 2009 I assume you want the double quotes in there? Well they are messing the code up. When you want to output double quotes, you need to use the double quote escape character, which is \". Kinda like the newline character but with quotes instead of n. <?php echo "\".substr($row['description'],0,50),\"<a href='http://xxxxxxxx.com/viewitem.php'> ...View</a>"; ?> that should fix it Quote Link to comment 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.