PHP image code help pls

ramkhan

Well-known member
  • Jun 20, 2008
    1,971
    1,113
    113
    click.jpg

    machan click kiyana text eke uda click kalama new window eke image view wena oni. eka komahamada php cod liyane kiyala dana ekenek kiyannako :(
     

    kolavari

    Well-known member
  • Aug 11, 2012
    33,746
    1
    25,655
    113
    කැළෑ පොජ්ජේ
    PHP walin nam oka karanna puluwanda kiyala sure na..danna tharamin nam ba..

    Widi dekak thiyenawa :yes:

    1) Image map ekak use karanna

    HTML:
    <img src="click.jpg" border="0" width="460" height="243" orgWidth="460" orgHeight="243" usemap="#image-map" alt="" />
    <map name="image-map">
    <area  alt="" title="Click Here" href="#" shape="rect" coords="254,77,302,97" style="outline:none;" target="_self"     />
    <area shape="rect" coords="458,241,460,243" alt="Image Map" style="outline:none;" title="Image Map" href="#" />
    </map>


    2) Nattam oya image eke click here kiyana eka makala image eka div eke background image widihata set karanna..ita passe ethanata place widihata normal html <a> ekak danna

    :yes:
     
    Last edited:

    wdishan

    Active member
  • Mar 28, 2008
    431
    45
    28
    Here is the code mall but your all images are should be in one size

    <?php
    /*
    **Identify Image name with index and image src
    */
    // Following code mus run under loop while dispalying database codes

    $index = "label1"; // Index number or some uniqure number
    $imagesrc ="click.jpg"; // Image thumbnail and click here to be shown
    $tobeopen_imagelink = "click-openimage.jpg"; // On the database need to set the field here to be open n new window
    switch($index){
    case "label1" : echo "<div style='background:url(".$imagesrc.") no-repeat;position:relative;width:460px;height:323px;'><a style='display:block;position:absolute;width:174px;height:46px;right:90px;top:64px' href=".$tobeopen_imagelink."></a></div>";
    break;
    }
    ?>

    Tested and Run all ok
     

    ramkhan

    Well-known member
  • Jun 20, 2008
    1,971
    1,113
    113
    Here is the code mall but your all images are should be in one size

    <?php
    /*
    **Identify Image name with index and image src
    */
    // Following code mus run under loop while dispalying database codes

    $index = "label1"; // Index number or some uniqure number
    $imagesrc ="click.jpg"; // Image thumbnail and click here to be shown
    $tobeopen_imagelink = "click-openimage.jpg"; // On the database need to set the field here to be open n new window
    switch($index){
    case "label1" : echo "<div style='background:url(".$imagesrc.") no-repeat;position:relative;width:460px;height:323px;'><a style='display:block;position:absolute;width:174px;height:46px;right:90px;top:64px' href=".$tobeopen_imagelink."></a></div>";
    break;
    }
    ?>

    Tested and Run all ok

    Thankuuu machan :):):)
     

    kolavari

    Well-known member
  • Aug 11, 2012
    33,746
    1
    25,655
    113
    කැළෑ පොජ්ජේ
    thread Eka kiyewwama lankawe web developers la gana dukath hithenawa ban.

    Mokakda awula? Uba kiyahan balanna ehenam widihak..mage knowledge eken nam mu kiyala thyena de karanna ba :oo:

    kohomada image ekak clickable karanne PHP walin? GD walin generate karana image ekakata link ekak embed karanna puluwanda php walin?

    mu ahala thiyena deta thama answer deela thyenne..thread eke title eka balapan..PHP Image code..kiyala image ekak dala, eke Click here eka clickable wenna onelu..ithin widi dekai thiyenne...ekko map ekak use karanna one..nattam bg image ekata oka danna one..

    uba dannawa nam dapan..apitath danaganna :yes:
     

    kolavari

    Well-known member
  • Aug 11, 2012
    33,746
    1
    25,655
    113
    කැළෑ පොජ්ජේ
    thread Eka kiyewwama lankawe web developers la gana dukath hithenawa ban.

    Ube comment eka godak watinawa issella uba monahari answer ekak mekata post karala, ita passe meka dammanam :) If you don't add anything valuable, you shouldn't discourage others who are willing to help others :no: I know you are a good guy with great programming knowledge.
     
    • Like
    Reactions: Game of Thrones

    wdishan

    Active member
  • Mar 28, 2008
    431
    45
    28
    Ube comment eka godak watinawa issella uba monahari answer ekak mekata post karala, ita passe meka dammanam :) If you don't add anything valuable, you shouldn't discourage others who are willing to help others :no: I know you are a good guy with great programming knowledge.
    :yes: