1 line of code the href amidst '' and "" ...

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
emelianenko
Forum Commoner
Posts: 35
Joined: Thu Sep 09, 2010 11:49 am

1 line of code the href amidst '' and "" ...

Post by emelianenko »

Hello


it is one line about whose exact syntax I get confused .. it is just that it shows a row with a picture and this picture is a link that (onclick) passes a value to another page. i have the provider name which is actually the value that should be passed on the link that is on the pic



echo '<td>

<img id="'.addslahes ($row['provider_name']).'" <a href src="'.htmlspecialchars($row['pic1']).'" width="50" height="50" alt="'.$row['provider_name'].'</a>" />

</td>';

thank you a million if anybody knows the syntax of that line
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Re: 1 line of code the href amidst '' and "" ...

Post by klevis miho »

The syntax for the <img> tag is wrong. It should be:
<img src="link of the image" />
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Re: 1 line of code the href amidst '' and "" ...

Post by klevis miho »

You should also put the <a> tags out of the <img> tag, so:

<a href="link with get data"><img id="id of the image" src="link of the image" width="50" height="50" /></a>
emelianenko
Forum Commoner
Posts: 35
Joined: Thu Sep 09, 2010 11:49 am

Re: PHP 1 line of code the href amidst '' and "" ...

Post by emelianenko »

I am talking about PHP not about HTML


where are the dots in between ?, the source of the image is the database itself that is how it is indicated in the line I wrote


with this line I get the display alright, what I am not getting is the linking and passing of values to the other page or to the popup page

I have to replace the "onclick" which would be to send values to a function with the a href stuff

Code: Select all


echo '<td width="148"><img id="'.$row['provider_name'].'" onclick="template_closeup.php(this.provider_name);" src="'.htmlspecialchars($row['pic1']).'" width="148" height="100" alt="'.$row['provider_name'].'" />





Post Reply