style.css in PHP page

Discussion in 'CSS' started by Tal_el, Nov 11, 2007.

  1. #1
    how can i put image in the "Browse" button on system "UploadImage"
    example:
    [​IMG]
    and how i cant put image for the "text box" on the "UploadImage" system
    example:
    [​IMG]

    the php code:
    <?php
    
    define("MAX_FILE_SIZE", 100);
    define("UPLOAD_DIR", "**censored **\**censored **\**censored *\*censored **\img");
    $FileTypes = array("image/pjpeg",
              "image/gif",
              "image/jpg",
              "image/png");
    
    ?>
    
    
    <html>
    <center>
    <head>
     <title></title>
    </head>
    
    <body>
    <img src="images/logo.gif">
    <BODY background="images\main-bg.gif">
    </BODY>
    <br><br>
    
    <?php
    
    if(!@$_POST['image'])
    {
        ?>
        <form enctype="multipart/form-data" action=<?php echo '"'.$_SERVER['PHP_SELF'].'"'; ?> method="POST">
    
                        <input type="file" name="file" size=img="images\bro.gif">
    <br><br>
     
          
     
    
        <input type="image" name="image" src="***\***\***\***\images\up.gif" >
    
    
        </form>
        <?php
    echo date("j/n/Y H:i" , time() );
    }
    else
    {
        //echo $_FILES['file']['type'].'<BR>';
    
        $is_ValidType = false;
    
        foreach($FileTypes as $Type)
        {
            if($_FILES['file']['type'] == $Type)
            {
                $is_ValidType = true;
                break;
            }
        }
    
        if($is_ValidType)
            if(($_FILES['file']['size']/1024) > MAX_FILE_SIZE)
                echo "File is too big. Maximum size allowed is ".MAX_FILE_SIZE." kb.";
            else
                if(move_uploaded_file($_FILES['file']['tmp_name'], UPLOAD_DIR."\\".$_FILES['file']['name']))
                    echo "File was succefully uploaded!";
                else
                    echo "Uploading failed. Please try again.";
        else
            echo "Wrong file type.";
    
    
    
    }
    
    
    ?>
    
    </body>
    </center>
    </html>
    
    
    
    PHP:

     
    Tal_el, Nov 11, 2007 IP
  2. aaron d.

    aaron d. Peon

    Messages:
    37
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    aaron d., Nov 12, 2007 IP
  3. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #3
    Don't encourage it :p Besides cross browser compatibility problems, there is a (security) reason why this is not supposed to happen.
     
    krt, Nov 12, 2007 IP