| | |
Echo URL in PHP - having problems with a href in echo
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Nov 2008
Posts: 66
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: 66
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>.
Happy Humbugging Christmas
•
•
Join Date: Nov 2008
Posts: 66
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: 66
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>";
Happy Humbugging Christmas
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...
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access address ajax apache api array autoincrement beginner binary broken cakephp checkbox class cms code cron curl database date dehasher directory display download dynamic echo email error external file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail menu method methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query question radio random recursion regex remote script search select server sessions shopping sms soap source space speed sql structure syntax system table tutorial update upload url validation validator variable video web xml youtube






