php parse error, using echo and a linked url

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
longhorn14
Forum Newbie
Posts: 8
Joined: Mon Aug 18, 2003 10:49 pm
Location: austin

php parse error, using echo and a linked url

Post 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?
Drachlen
Forum Contributor
Posts: 153
Joined: Fri Apr 25, 2003 1:16 am

Post 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);
?>
longhorn14
Forum Newbie
Posts: 8
Joined: Mon Aug 18, 2003 10:49 pm
Location: austin

Post by longhorn14 »

Thanks! Perfect! I knew I was close...
Nat
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

Post by AVATAr »

a tip longhorn14: check the color highlighting... compare both and you will notice a difference
Post Reply