Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   A quick php question ????? (https://www.warriorforum.com/programming/2853-quick-php-question.html)

Tirmizi 13th August 2008 01:38 PM

A quick php question ?????
 
Dear Warriors,



Just wanted to ask a quick php question, I have a page on which we have static pictures but i want those pictures to be clickable as currently they don't link to anything the code is

<img src="<?php bloginfo('template_url'); ?>/images/ad1.gif" class="left" alt="" />

now how can i make this code to link to some other website ... i mean the graphic that should link to some other website ...

I hope you get the idea..



Best Regards,



Tirmizi

Mark Brian 13th August 2008 01:42 PM

It's just HTML you need. Just use the following HTML code:

<a href="http://google.com">
<img src="<?php bloginfo('template_url'); ?>/images/ad1.gif" class="left" alt="" />
</a>

Just replace google.com of course :)

Jared Alberghini 13th August 2008 01:42 PM

<a href="YOUR-URL-HERE">
<img src="<?php bloginfo('template_url'); ?>/images/ad1.gif" class="left" alt="" />
</a>

Does that answer your question? Or am I misunderstanding your question?

- Jared

Tirmizi 13th August 2008 10:52 PM

Thanks guys , will definatly give it a go ..


am sure it will work ..




Tirmizi

Tirmizi 14th August 2008 05:00 AM

This is exactly what I was looking for. However, something starnge happened. When I looked at the link after changing , it looked fine. the picture showed an external link to the website that i wanted.

But I checked it back again after an hour or so ... and it had some sort of malware thing going on it... like you see on virust websites .... when clicked on it , gave an option for " checking your computer for virus etc' i am pretty much sure that would be some sort of malware or virus .. but how did it get their ....

What i wanted to do basically was to put " click bank hop" link on the picture .... so that people would go to the product sales page through that link ....

is their an easier way of doing it .. or am i doing something wrong ...

for reference do check out the website

How to Lose Weight Fast - How to lose weight fast. This website will contain all the relevent information which will help you lose weight fast , I want to put the links on the 125X125 pixel pics on the right side bar ....

the code for this is the one that I mentioned in my earlier post ...


appreciate your help ...




Tirmizi

Dan Grossman 14th August 2008 06:00 AM

Perhaps it's time to do an AdAware/Spybot scan on your own PC to look for malware that would inject ads into your browsing experience... :)

Tirmizi 14th August 2008 06:11 AM

i'll definatly do that ... so there is basically nothing wrong with the code????

Tirmizi 14th August 2008 06:11 AM

i'll definatly do that ... so there is basically nothing wrong with the code???? I mean everything else is fine .....

Dan Grossman 14th August 2008 06:16 AM

Right... adding a link doesn't cause virus checking graphics to appear... that wasn't what caused it. Either your website was hijacked (but it doesn't look to be), or your computer... so more likely your computer.

edynas 14th August 2008 07:06 AM

Nothing wrong with the code. If you want to use an affiliate link make a simple cloak on it.

create a file called fi likes.php and in it have something like this

<?php
$url="http://www.youraffiliatelink";
header("Location: $url");
?>

Ross Dalangin 14th August 2008 11:11 AM

In your code:
Quote:

<div id="sponsors">

<img src="http://weightlossprogramtips.info/wp-content/themes/Wordpress_Magazine/images/ad1.gif" class="left" alt="">
<img src="http://weightlossprogramtips.info/wp-content/themes/Wordpress_Magazine/images/ad2.gif" class="right" alt="">
<img src="http://weightlossprogramtips.info/wp-content/themes/Wordpress_Magazine/images/ad3.gif" class="left" alt="">

<img src="http://weightlossprogramtips.info/wp-content/themes/Wordpress_Magazine/images/ad4.gif" class="right" alt="">
<div style="clear: both;"></div>
</div>
Change it as:
Quote:

<div id="sponsors">

<a href="TheLinkHere"><img src="http://weightlossprogramtips.info/wp-content/themes/Wordpress_Magazine/images/ad1.gif" class="left" alt="" border="0"></a>
<a href="TheLinkHere"><img src="http://weightlossprogramtips.info/wp-content/themes/Wordpress_Magazine/images/ad2.gif" class="right" alt="" border="0"></a>
<a href="TheLinkHere"><img src="http://weightlossprogramtips.info/wp-content/themes/Wordpress_Magazine/images/ad3.gif" class="left" alt="" border="0"></a>

<a href="TheLinkHere"><img src="http://weightlossprogramtips.info/wp-content/themes/Wordpress_Magazine/images/ad4.gif" class="right" alt="" border="0"></a>
<div style="clear: both;"></div>
</div>

JonathanKrantz 7th June 2010 03:29 PM

Re: A quick php question ?????
 
Instead of border="0" you can also add this to your CSS file:

Code:

a img {
  border:none;
}



All times are GMT -6. The time now is 06:13 AM.