Title Pic Not Showing

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
CoolAsCarlito
Forum Contributor
Posts: 192
Joined: Sat May 31, 2008 3:27 pm
Contact:

Title Pic Not Showing

Post by CoolAsCarlito »

Here's my code and why isn't it showing on my champions page located at http://www.kansasoutlawwrestling.com/champions.php

print '<tr><td valign=top width=200><a href=titlehistories.php?id=' . $row['id'] . ' title="View KOW '.$row['titlename'].' History"><img src=src="/images/' . $row['titleimage'] . '" width=200 height=200 border=0 alt="View KOW '.$row['titlename'].' History"></a></td>';
Dynamis
Forum Contributor
Posts: 122
Joined: Thu Jul 10, 2008 3:15 pm
Location: Indiana, US

Re: Title Pic Not Showing

Post by Dynamis »

Something I see real quick is your url. You currently have titlehistories.php?id=Xtitle=X, you are missing &. Should be:
titlehistories.php?id=X&title=X
CoolAsCarlito
Forum Contributor
Posts: 192
Joined: Sat May 31, 2008 3:27 pm
Contact:

Re: Title Pic Not Showing

Post by CoolAsCarlito »

Why do I need that?
Dynamis
Forum Contributor
Posts: 122
Joined: Thu Jul 10, 2008 3:15 pm
Location: Indiana, US

Re: Title Pic Not Showing

Post by Dynamis »

CoolAsCarlito wrote:Why do I need that?
In a url, you seperate the GET variables by & so:
example.php?var1=result1&var2=result2&var3=result3

Just how it is
pkbruker
Forum Commoner
Posts: 32
Joined: Sun Aug 03, 2008 9:36 am
Location: Oslo, Norway

Re: Title Pic Not Showing

Post by pkbruker »

Actually, to be absolutely correct, your code should:

1. Use & and not & as sepparator
2. Appropriate use of "

Like this:

Code: Select all

 
 print '<tr><td valign="top" width="200"><a href="titlehistories.php?id=' . $row['id'] . '&title='.urlencode('View KOW '.$row['titlename'].' History').'"><img src="/images/' . $row['titleimage'] . '" width="200" height="200" border="0" alt="View KOW '.$row['titlename'].' History"></a></td></tr>';
 
Dynamis
Forum Contributor
Posts: 122
Joined: Thu Jul 10, 2008 3:15 pm
Location: Indiana, US

Re: Title Pic Not Showing

Post by Dynamis »

I would still just use & by itself as in my previous statement, it works on every system and is shorter. No need for the other stuff.
User avatar
idevlin
Forum Commoner
Posts: 78
Joined: Tue Jun 26, 2007 1:10 pm
Location: Cambridge, UK

Re: Title Pic Not Showing

Post by idevlin »

Dynamis wrote:I would still just use & by itself as in my previous statement, it works on every system and is shorter. No need for the other stuff.
Using & rather than & is not XHTML compliant I believe.
User avatar
ghurtado
Forum Contributor
Posts: 334
Joined: Wed Jul 23, 2008 12:19 pm

Re: Title Pic Not Showing

Post by ghurtado »

Dynamis wrote:I would still just use & by itself as in my previous statement, it works on every system and is shorter. No need for the other stuff.
"Other stuff"? Pkbruker simply replaced the ampersand with an escaped ampersand, since it is being used inside of HTML. Although most browsers today work without escaping it, that is not the correct way of doing it as per the W3C recommendation, and you are running the risk that future browsers "break" your webpage (which was already broken to begin with) if you choose not to escape them.

The escaped ampersand is likely to work in as many browsers, if not more, and is future proof.
Dynamis
Forum Contributor
Posts: 122
Joined: Thu Jul 10, 2008 3:15 pm
Location: Indiana, US

Re: Title Pic Not Showing

Post by Dynamis »

Learn something new everyday. Thanks.
Post Reply