Page 1 of 1

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

Posted: Fri Oct 29, 2010 5:27 am
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

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

Posted: Fri Oct 29, 2010 5:35 am
by klevis miho
The syntax for the <img> tag is wrong. It should be:
<img src="link of the image" />

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

Posted: Fri Oct 29, 2010 5:40 am
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>

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

Posted: Fri Oct 29, 2010 7:59 am
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'].'" />