A quick php question ?????

11 replies
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
#php #php scripts
  • Profile picture of the author imb
    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
    Signature

    {{ DiscussionBoard.errors[21361].message }}
  • Profile picture of the author Jared Alberghini
    <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
    Signature

    P.S.

    Join The Future: Telekinetic Marketing

    {{ DiscussionBoard.errors[21362].message }}
    • Profile picture of the author Tirmizi
      Thanks guys , will definatly give it a go ..


      am sure it will work ..




      Tirmizi
      {{ DiscussionBoard.errors[22544].message }}
      • Profile picture of the author Tirmizi
        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
        {{ DiscussionBoard.errors[23004].message }}
        • Profile picture of the author Dan Grossman
          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...
          Signature
          Improvely: Built to track, test and optimize your marketing.

          {{ DiscussionBoard.errors[23094].message }}
          • Profile picture of the author Tirmizi
            i'll definatly do that ... so there is basically nothing wrong with the code????
            {{ DiscussionBoard.errors[23120].message }}
          • Profile picture of the author Tirmizi
            i'll definatly do that ... so there is basically nothing wrong with the code???? I mean everything else is fine .....
            {{ DiscussionBoard.errors[23124].message }}
            • Profile picture of the author Dan Grossman
              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.
              Signature
              Improvely: Built to track, test and optimize your marketing.

              {{ DiscussionBoard.errors[23137].message }}
              • Profile picture of the author edynas
                Banned
                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");
                ?>
                {{ DiscussionBoard.errors[23219].message }}
                • Profile picture of the author Ross Dalangin
                  In your code:
                  <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:
                  <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>
                  {{ DiscussionBoard.errors[23879].message }}
  • Profile picture of the author JonathanKrantz
    Instead of border="0" you can also add this to your CSS file:

    Code:
    a img {
      border:none;
    }
    {{ DiscussionBoard.errors[2190847].message }}

Trending Topics