| | |
Echo URL in PHP - having problems with a href in echo
![]() |
•
•
Join Date: Nov 2008
Posts: 153
Reputation:
Solved Threads: 0
This is the echo code from my site:
Yet it produces a T_STRING error, and I can't work out how to fix it.
The other variables work fine, $autoguide1 does not, and no matter how much I practice, this one is hard for me to figure out.
Any advice is appreciated, thanks.
PHP Syntax (Toggle Plain Text)
<?php $url1 = "http://www.canadiandriver.com"; $url2 = "http://www.chevrolet.com.br"; $autoguide = "Autoweekly"; $autoguide1 = /"<b>"<a href=\"$url1\buyers-guide/2010/volkswagen/passat.php"\>New car of the day</a>"/</b>"; ?>
Yet it produces a T_STRING error, and I can't work out how to fix it.
The other variables work fine, $autoguide1 does not, and no matter how much I practice, this one is hard for me to figure out.
Any advice is appreciated, thanks.
0
#2 Oct 31st, 2009
•
•
•
•
This is the echo code from my site:
PHP Syntax (Toggle Plain Text)
<?php $url1 = "http://www.canadiandriver.com"; $url2 = "http://www.chevrolet.com.br"; $autoguide = "Autoweekly"; $autoguide1 = /"<b>"<a href=\"$url1\buyers-guide/2010/volkswagen/passat.php"\>New car of the day</a>"/</b>"; ?>
Yet it produces a T_STRING error, and I can't work out how to fix it.
The other variables work fine, $autoguide1 does not, and no matter how much I practice, this one is hard for me to figure out.
Any advice is appreciated, thanks.
I am Not Understand that Actually What You want to Do with The above Code but if u want to print the autoguide1 variable then plz follow below code:
PHP Syntax (Toggle Plain Text)
<?php $url1 = "http://www.canadiandriver.com"; $url2 = "http://www.chevrolet.com.br"; $autoguide = "Autoweekly"; $autoguide1 = "<b><a href=$url1/buyers-guide/2010/volkswagen/passat.php>New car of the day</a></b>"; echo "$autoguide"; //if u dont want to print the auoguide variable then remove this line. echo "$autoguide1"; ?>
http://www.kuchamancity.com
Hem Web Solution..
Behind Every Successful Man, There is an Untold Pain in His Heart.
Hem Web Solution..
Behind Every Successful Man, There is an Untold Pain in His Heart.
•
•
Join Date: Nov 2008
Posts: 153
Reputation:
Solved Threads: 0
0
#3 Oct 31st, 2009
•
•
•
•
Dear Friend.
I am Not Understand that Actually What You want to Do with The above Code but if u want to print the autoguide1 variable then plz follow below code:
PHP Syntax (Toggle Plain Text)
<?php $url1 = "http://www.canadiandriver.com"; $url2 = "http://www.chevrolet.com.br"; $autoguide = "Autoweekly"; $autoguide1 = "<b><a href=$url1/buyers-guide/2010/volkswagen/passat.php>New car of the day</a></b>"; echo "$autoguide"; //if u dont want to print the auoguide variable then remove this line. echo "$autoguide1"; ?>
•
•
•
•
$autoguide1 = "<b><a href=$url1/buyers-guide/2010/volkswagen/passat.php>New car of the day</a></b>";
echo "$autoguide"; //if u dont want to print the auoguide variable then remove this line.
echo "$autoguide1";
•
•
•
•
Parse error: syntax error, unexpected T_STRING in C:\www\vhosts\mycarsite\testing.php on line 5
-1
#4 Oct 31st, 2009
•
•
•
•
PHP Syntax (Toggle Plain Text)
$autoguide1 = /"<b>"<a href=\"$url1\buyers-guide/2010/volkswagen/passat.php"\>New car of the day</a>"/</b>";
PHP Syntax (Toggle Plain Text)
$autoguide1 = "<strong><a href='$url1/buyers-guide/2010/volkswagen/passat.php'>New car of the day</a></strong>";
<b> is (or is being) deprecated - use <strong>.
Twpsyn cythraul. Cawr y dom tarw. Gwybod dim, gofyn dim.
•
•
Join Date: Nov 2008
Posts: 153
Reputation:
Solved Threads: 0
0
#5 Oct 31st, 2009
•
•
•
•
Your problem is the non-catenated strings. Try this:
PHP Syntax (Toggle Plain Text)
$autoguide1 = "<strong><a href='$url1/buyers-guide/2010/volkswagen/passat.php'>New car of the day</a></strong>";
<b> is (or is being) deprecated - use <strong>.
•
•
•
•
"New car of the day
•
•
Join Date: Nov 2008
Posts: 153
Reputation:
Solved Threads: 0
PHP Syntax (Toggle Plain Text)
$vwpassat = "<strong>\"<a href='$url1/buyers-guide/2010/volkswagen/passat.php'>VW PASSAT ARGENTINA</a>\"</strong>";
This seems to work - is this the correct syntax for bold quotation marks now?
•
•
Join Date: Apr 2009
Posts: 33
Reputation:
Solved Threads: 6
0
#7 Oct 31st, 2009
you can put it like this
hope that works shalom shalom
PHP Syntax (Toggle Plain Text)
$autoguide1 = "<a href='$url1/buyers-guide/2010/volkswagen/passat.php'><strong>New car of the day</strong></a>";
•
•
Join Date: Apr 2009
Posts: 33
Reputation:
Solved Threads: 6
0
#8 Oct 31st, 2009
you can put it like this
hope that works shalom shalom
PHP Syntax (Toggle Plain Text)
$autoguide1 = "<a href='$url1/buyers-guide/2010/volkswagen/passat.php'><strong>New car of the day</strong></a>";
-1
#9 Oct 31st, 2009
@whitestream:
Yes that's fine - I'm sorry, I didn't realise you needed the quote marks in the displayed text.
Hmm, I was once told that attribute values should be placed in double quote marks for XHTML - however I can't remember seeing that in my cursories. If you need this:
should work
Yes that's fine - I'm sorry, I didn't realise you needed the quote marks in the displayed text.
Hmm, I was once told that attribute values should be placed in double quote marks for XHTML - however I can't remember seeing that in my cursories. If you need this:
PHP Syntax (Toggle Plain Text)
vwpassat = "<strong>\"<a href=\"$url1/buyers-guide/2010/volkswagen/passat.php\">VW PASSAT ARGENTINA</a>\"</strong>";
Twpsyn cythraul. Cawr y dom tarw. Gwybod dim, gofyn dim.
0
#10 Nov 4th, 2009
If I understand your problem you would like to achieve the following :
"This is a new car" :
use this :
If you would achieve this :
"This is a new car"
then use this :
"This is a new car" :
use this :
PHP Syntax (Toggle Plain Text)
$car = "<a href='$url/somepage.php'><strong>"</strong>This is a new car<strong>"</strong></a>"; echo $car;
If you would achieve this :
"This is a new car"
then use this :
PHP Syntax (Toggle Plain Text)
$car = "<a href='$url/somepage.php'><strong>"This is a new car"</strong></a>"; echo $car;
![]() |
Other Threads in the PHP Forum
- Previous Thread: Messaging System
- Next Thread: Retrieve all $_POST values...
Views: 913 | Replies: 11
| Thread Tools | Search this Thread |
Tag cloud for PHP
ajax apache api archive array beginner binary box buttons cakephp cart check checkbox class classes cms code cron database date directory display download dropdown dropdownlist dynamic echo email error file files form forms function functions google header hosting htaccess html image images include insert ip java javascript joomla jquery limit link list login lookup loop mail methods mlm mod_rewrite multiple mysql order output parse password paypal php problem query radio redirect regex remote results rows script search select server session sessions sort source sql string structure table tutorial update upload url validate validation validator variable video web website wordpress xml






