Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Picture

  1. #1
    Regular Coder
    Join Date
    Aug 2002
    Posts
    264
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Picture

    Hello, I need this script to only allow gif and jpg files instead of html and php:

    Code:
    <div style="width: 410px;">
    <?php
    if(empty($_GET['page']))
    {
            include("images/screenshots/nopicture.html");
    }
    elseif(file_exists("includes/".$_GET['page'].".html"))
    {
            include("includes/".$_GET['page'].".html");
    }
    elseif(file_exists("includes/".$_GET['page'].".php"))
    {
            include("includes/".$_GET['page'].".php");
    }
    else
    {
    ?>
    <div style="background-color:#7E7E7E; border: 1px solid black; padding: 1px;">
    <div style="border: 1px solid black; height: 17; background-image: url(images/menubg.gif); text-align: left;">
    <img src="images/headers/error.gif" width="140" height="15" alt=""></div></div>
    <img src="images/spacer.gif" width="3" height="3" alt=""><br>
    <div style="background-color:#7E7E7E; border: 1px solid black; padding: 1px;">
    <div style="border: 1px solid black; height: 17; background-color: #151515; text-align: center; padding: 10px;">
    The page cannot be found<br><br> 
    The page you are looking for might have been removed, had its name changed, or is
    temporarily unavailable.</div></div>
    <?
    }
    ?>
    </div>
    Thanks!!
    Please visit http://www.thickandthinpizza.com and tell me what you think.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts
    PHP Code:
    <div style="width: 410px;">
    <?php

    if( empty ( $_GET['page'] ) ) {
        print 
    '<img src="images/screenshots/nopicture.html" border="0">';
    } else if ( 
    file_exists 'includes/'.$_GET['page'].'.gif' ) ) {
        print 
    '<img src="includes/'.$_GET['page'].'.gif" border="0">');
    }else if ( 
    file_exists'includes/'.$_GET['page'].'.jpg' ) ) {
        print 
    '<img src="includes/'.$_GET['page'].'.jpg" border="0">');
    } else {

    ?>
    <div style="background-color:#7E7E7E; border: 1px solid black; padding: 1px;">
    <div style="border: 1px solid black; height: 17; background-image: url(images/menubg.gif); text-align: left;">
    <img src="images/headers/error.gif" width="140" height="15" alt=""></div></div>
    <img src="images/spacer.gif" width="3" height="3" alt=""><br>
    <div style="background-color:#7E7E7E; border: 1px solid black; padding: 1px;">
    <div style="border: 1px solid black; height: 17; background-color: #151515; text-align: center; padding: 10px;">
    The page cannot be found<br><br> 
    The page you are looking for might have been removed, had its name changed, or is
    temporarily unavailable.</div></div>
    <?
    }
    ?>
    </div>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •