Lassie Posted November 22, 2007 Share Posted November 22, 2007 I have constructed a link but have a parse error I cant solve. The error is unexpected T_Constant_Encapsed_String <?php $product_id=13; ?> <a href="<?php'show_book.php?product_id='.$product_id;?>">Order Now</a> I know this is basic but any help gratefully received. Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted November 22, 2007 Share Posted November 22, 2007 you forgot the echo <?php $product_id=13; ?> <a href="<?php echo 'show_book.php?product_id='.$product_id;?>">Order Now</a> better still do it in this way <?php $product_id=13; ?> <a href="show_book.php?product_id=<?php echo $product_id;?>">Order Now</a> Quote Link to comment Share on other sites More sharing options...
Lassie Posted November 22, 2007 Author Share Posted November 22, 2007 Thanks Rajiv, Couldn't see the woods for the trees! Quote Link to comment Share on other sites More sharing options...
kratsg Posted November 22, 2007 Share Posted November 22, 2007 If you really want it shorter.. <a href="show_book.php?product_id=<?=$product_id ?>">Order Now</a> Should work. 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.