Jump to content


Photo

Newbie question...having to do with links.


  • Please log in to reply
1 reply to this topic

#1 nomadofthewaves

nomadofthewaves
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 05 March 2006 - 09:59 PM

I'm usually good at being able to look at code and trying to figure out how to fix or change something and I usually don't ask for any help on forums, because well I hate to join a site and just try to ask for help. But i've been trying to figure this out and I can't seem to do it so here I am.

I run an image upload site, and I want to change my script so that it shows a php link to the image so that I can advertise on the image link.

Here is an example of a link from my site:

[a href=\"http://www.photoboothpics.com/uploads/3c49241de2.jpg\" target=\"_blank\"]My site..[/a]


This is an example from another site of how I want mine to look:

[a href=\"http://img111.imagevenue.com/img.php?loc=loc8&image=th_95895_pirate.JPG\" target=\"_blank\"]Example site.[/a]



I'm hoping I can just add to my script to get what I want. So if you could tell me what I even just need to read about or change that would be helpfull.

Thanks.

#2 nomadofthewaves

nomadofthewaves
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 05 March 2006 - 10:34 PM

Here is the code from the page that shows the links to the image. Not sure if this would help.

<?
    include("include/common.php");
    include("include/header.php");
    if($loggedin){
        include("include/accmenu.php");
    }
    $img = $_REQUEST['img'];
    $sql = "SELECT * FROM images WHERE id='$img'";
    $a = mysql_fetch_object( mysql_query($sql) );
    $filen = $siteurl."/".str_replace('./', '', $att_path)."/".$a->filename;
    $filen = str_replace('http://','%%',$filen);
    $filen = str_replace('//','/',$filen);
    $filen = str_replace('%%','http://',$filen);
?>
    <b>Here is your code below to display your image:</b><br>
    <table width="85%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td><div align="center"><img src="<?=$filen?>"></div></td>
    </tr>
    <tr>
        <td><div align="center"><br>
            To insert this image in a message board post copy and paste the following
            code:<br>
            <textarea name="textarea" cols="155" wrap="soft" rows="3">[url=<?=$siteurl?>][img]<?=$filen?>[/img][/url]</textarea>
        </div></td>
    </tr>
    <tr>
        <td><div align="center"><br>
            To send this image to friends and family, copy and paste this code: <br>
            <textarea name="textarea2" cols="155" rows="4"><?=$filen?></textarea>
        </div></td>
    </tr>
    <tr>
        <td><div align="center"><br>
            To insert this image using HTML, copy and paste the following
            code:<br>
            <textarea name="textarea3" cols="155" wrap="soft" rows="3"><a href="<?=$siteurl?>" target="_blank"><img alt="Image Hosted by <?=$sitename?>" src="<?=$filen?>" /></a></textarea>
        </div></td>
    </tr>
    <tr>
        <td>&nbsp;</td>
    </tr>
    </table>
<?
    include("include/footer.php");
?>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users