Please help - Open in new page

Discussion in 'PHP' started by fedoras, Oct 30, 2009.

  1. #1
    Please help me with this, i want to open the picture in a new page, i created download.php and i want this picture to be open in "download.php" page..

    This is the code:
    if ($Wallpaper1 != NULL) {
    $size='';
    $size=getimagesize("images/wallpapers/".$Wallpaper1);
    if ($Settings['Enable_Watermark'] == '1') {
    $dHTML .= '<a href="'.$image_path.'images/wmwallpapers/'.str_replace(" ","-",$Title).'-1.jpeg" title= "Games Wallpapers" style="text-decoration: underline;">'.$size[0].'x'.$size[1].'</a> ';

    Thanks
     
    fedoras, Oct 30, 2009 IP
  2. Dennis M.

    Dennis M. Active Member

    Messages:
    119
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #2
    Add this to the end of your link code (<a href="..." ... THIS>)

    target="_blank"

    So it should read as follows:

    $dHTML .= '<a href="'.$image_path.'images/wmwallpapers/'.str_replace(" ","-",$Title).'-1.jpeg" title= "Games Wallpapers" style="text-decoration: underline;" target="_blank">'.$size[0].'x'.$size[1].'</a> ';
    Code (markup):
    Regards,
    Dennis M.
     
    Dennis M., Oct 30, 2009 IP
  3. mike30

    mike30 Well-Known Member

    Messages:
    887
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    140
    #3
    mike30, Oct 30, 2009 IP
  4. fedoras

    fedoras Active Member

    Messages:
    197
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #4
    fedoras, Oct 30, 2009 IP
  5. szalinski

    szalinski Peon

    Messages:
    341
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #5
    depending on the image file's location you can $_GET the file path and display it that way e.g. download.php?img=picture.jpg if it's in the same folder as download.php. but it's better to do it via a db where you would use and id instead, such as download.php?id=0001 etc.
     
    szalinski, Oct 30, 2009 IP