| | |
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: 54
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 33 Days Ago
•
•
•
•
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: 54
Reputation:
Solved Threads: 0
0
#3 33 Days Ago
•
•
•
•
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 33 Days Ago
•
•
•
•
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>.
"...the woods would be a very silent place if no birds sang except for the best"
All opinions count - unless you're a serial downvoter.
F'enw i yw Mr. Blaidd. Byddwch yn ofalus - dwi'n cnoi.
All opinions count - unless you're a serial downvoter.
F'enw i yw Mr. Blaidd. Byddwch yn ofalus - dwi'n cnoi.
•
•
Join Date: Nov 2008
Posts: 54
Reputation:
Solved Threads: 0
0
#5 33 Days Ago
•
•
•
•
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: 54
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: 32
Reputation:
Solved Threads: 5
0
#7 33 Days Ago
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: 32
Reputation:
Solved Threads: 5
0
#8 33 Days Ago
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 33 Days Ago
@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>";
"...the woods would be a very silent place if no birds sang except for the best"
All opinions count - unless you're a serial downvoter.
F'enw i yw Mr. Blaidd. Byddwch yn ofalus - dwi'n cnoi.
All opinions count - unless you're a serial downvoter.
F'enw i yw Mr. Blaidd. Byddwch yn ofalus - dwi'n cnoi.
0
#10 30 Days Ago
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 |
ajax apache api array basics beginner binary bounce broken cakephp checkbox class cms code codingproblem combobox cron curl database date display dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration interactive ip java javascript joomla js limit link login mail menu mlm mobile multiple mysql nodes oop outofmemmory paging parse paypal pdf php problem procedure query radio ram random recursion regex remote return script search server sessions smash sms soap source space sql syntax system table tutorial up-to-date update upload url validation validator variable video web webapplications websitecontactform xml youtube





