Page 1 of 1

php parse error, using echo and a linked url

Posted: Sat Aug 23, 2003 2:33 am
by longhorn14
I am trying to get a link to print on a page. here is a snippet of what I have (some vars are not defined in the snippet)

Code: Select all

<?php
$url = "<a href=/"add_customer_taxproc.htm/">Click here to add another record for processors 
and taxidermists</a>";
echo "Thanks $submitted_by, a record has been added for $company<BR>";
echo stripslashes($url);?> 
?>
What am I doing wrong?

Posted: Sat Aug 23, 2003 4:31 am
by Drachlen
Switch your slashes to backslashes, backslashing takes the meaning away from the double quote, so its just a double quote, you can do it to other characters too, such as ' and $.

Code: Select all

<?php 
$url = "<a href="add_customer_taxproc.htm">Click here to add another record for processors 
and taxidermists</a>"; 
echo "Thanks $submitted_by, a record has been added for $company<BR>"; 
echo stripslashes($url);
?>

Posted: Sat Aug 23, 2003 9:36 am
by longhorn14
Thanks! Perfect! I knew I was close...
Nat

Posted: Sun Aug 24, 2003 8:48 am
by AVATAr
a tip longhorn14: check the color highlighting... compare both and you will notice a difference