echo output formatting

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
User avatar
mhouldridge
Forum Contributor
Posts: 267
Joined: Wed Jan 26, 2005 5:13 am

echo output formatting

Post by mhouldridge »

Hi,

I have the following code;

Code: Select all

"<a href=\"myprofile.php\" class=\"blue2\">My Profile</a>""<a href=\"logout.php\" class=\"blue2\">logout</a>";

This displays two links on the same line, right next to each other. I would like to know how I could seperate these with an image (my spacer image).

thansks
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

This is pretty basic HTML stuff:

<a href=\"myprofile.php\" class=\"blue2\">My Profile</a>"<img src = "your_image.jpg">"<a href=\"logout.php\" class=\"blue2\">logout</a>
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
mhouldridge
Forum Contributor
Posts: 267
Joined: Wed Jan 26, 2005 5:13 am

Post by mhouldridge »

Hi,

That doesnt work;

echo <a href=\"myprofile.php\" class=\"blue2\">My Profile</a>"<img src = "your_image.jpg">"<a href=\"logout.php\" class=\"blue2\">logout</a>
User avatar
mhouldridge
Forum Contributor
Posts: 267
Joined: Wed Jan 26, 2005 5:13 am

Post by mhouldridge »

also tried....

Code: Select all

echo "<a href=\"myprofile.php\" class=\"blue2\">My Profile</a>"<img src= "1x1.gif" width="10">"<a href=\"logout.php\" class=\"blue2\">logout</a>";

that doesnt work either.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

uhm, yeah....

Code: Select all

echo '<a href="myprofile.php" class="blue2">My Profile</a><img src="1x1.gif" width="10"><a href="logout.php" class="blue2">logout</a>';
User avatar
mhouldridge
Forum Contributor
Posts: 267
Joined: Wed Jan 26, 2005 5:13 am

Post by mhouldridge »

that's done it!

Cheers!
Post Reply