Topic: another php question

i have <?php echo "$file_size"; ?> to get the size and <?php echo "$file_name"; ?> to get the name but i need one that says when its was uploaded like 6/6/04

Re: another php question

Its better to go through the Manual first..
For your request, I suggest you to try this

<?php echo "Last modified: ".date( "F d Y H:i:s.", getlastmod() ); ?>

God wisely designed the human body so that we can neither pat our own backs nor kick ourselves too easily

Re: another php question

It seems to me that he wants to use filemtime() or filectime()?

Re: another php question

not sure what i need can i post the code for the two pages and someone fix it for me?

Re: another php question

Hope so... you can post ur code...

God wisely designed the human body so that we can neither pat our own backs nor kick ourselves too easily

6 (edited by newera70 2004-06-10 16:11)

Re: another php question

heres the admin.php

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Admin Uploader</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
a.linkcolor:hover {font-family: Geneva, Arial, Helvetica, sans-serif; }
</style>
</head>
<body bgcolor="#000000">
<div align="center">
  <table width="699" border="1" bordercolor="#6699FF" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#6699FF">
<table width='389' border='1' align='center' bordercolor='#6699FF' bordercolorlight='#000000' bordercolordark='#000000' bgcolor='#6699FF'>
  <tr align='center' valign='top'> 
    <td width='379' bgcolor='#6699FF'><div align='center'><strong>[File Uploader]</strong></div></td>
  </tr>
  <tr align='center' valign='top'> 
<td height='71' bgcolor='#6699FF'>
<form action="scripts.php" method="post"
                                    enctype="multipart/form-data">

<input type="file" name="file" size="30">
<br/>
<input type="submit" value="Upload File">
</form>
</td>
  </tr></table>
</div>
</body>
</html>

heres were it uploads to scripts.php

<?php
if($file_name !="")
{
copy ("$file", "/home/user/public_html/uploads/$file_name")
         or die("Could not copy file");
}
else { die("No file specified"); }
?>

<html>
<body bgcolor="#FFFFFF">
<div align="center">
  <table width="699" border="1" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" bgcolor="#777777">
    <tr> 
      <td align="center" valign="top" bgcolor="#777777"><div align="center"><strong>Scripts</strong></div></td>
    </tr>
    <tr> 
      <td height="54" align="center" valign="top" bgcolor="#777777"><br> <table width="628" border="1" bordercolor="#FFFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" bgcolor="#777777">
          <tr align="center" valign="top"> 
            <td width="48" bgcolor="#777777"><div align="center"><strong>[No]</strong></div></td>
            <td width="273" bgcolor="#777777"><strong>[File Name]</strong></td>
            <td width="119" bgcolor="#777777"><strong>[Size]</strong></td>
            <td width="160" bgcolor="#777777"><strong>[Uploaded On]</strong></td>
          </tr>
        </table>
    <table width="628" border="1" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" bgcolor="#777777">
          <td width='48' bgcolor='#777777'></td>
          <td width='273' bgcolor='#777777'><a href="<?php echo "$file_name" ?>"><font color='#000000'></font></a><?php echo "$file_name"; ?></td>
          <td width='119' bgcolor='#777777'><?php echo "$file_size"; ?> bytes</td>
          <td width='160' bgcolor='#777777'><?php echo "Last modified: ".date( "F d Y H:i:s.", getlastmod() ); ?>
</td>

          </tr></td>
    </tr>
      </table><br>
      <table width='400'>
    <tr>
</td>
    </tr>
  </table>
</div>
</body>
</html>

Re: another php question

Hi

I had few minutes today, so I thought I would write you something!

Real quick rundown...

Admin Upload Manager

1. Secure login (supporting cookie session or url based)
2. allows 'MULTI' file uploads (unlimited only by server)
3. allows you simple managing options (view or delete)

Setup...

Create a md5() password using this simple script below,
then pate the ouput into the define() ADMIN_PASS !
Note the example password in the script is '2242'

<?

//

echo md5 ( 'some_plain_text_password' );

?>

Then configure the options at the top of the script!
Only change the HTML parts if you want to change
the colors that the 'results and manage page' output!
But only do that after you are sure you configured all
the define() options correctly!


//admin.php or whatever you want to call it!


<?

    // do not touch, if you don't know what it does....

    !isset($_COOKIE['sid']) && isset($_GET['sid']) && !empty($_GET['sid']) ? session_id($_GET['sid']) : (!isset($_COOKIE['sid']) ? session_id(md5(uniqid(microtime()))) : null);
    session_name ( 'sid' );
    session_start ();
    define('UP_A', (!isset($_COOKIE['sid']) ? '?sid=' . session_id() : ''), true);
    define('UP_B', (!isset($_COOKIE['sid']) ? '?sid=' . session_id() . '&' : '?'), true);

    /*
    *
    * define the admin user
    *
    */

    define ( 'ADMIN_USER', 'admin' );

    /*
    *
    * create a md5() password and place it in the define below!
    * Use the script that is below this one to do this...
    *
    */

    define ( 'ADMIN_PASS', '1a3f91fead97497b1a96d6104ad339f6' );

    /*
    *
    * The upload folder path to the upload directory!
    * On windows use full path (c:/www/docs/uploads/)
    *          !! INCLUDE TRAILING '/'
    *
    */

    define ( 'UPLOAD_PATH', 'e:/www/docs/www/docs/uploads/' );

    // max number of files allowed to upload

    define ( 'MAX_FILES', '5' );

    // define the max single file size (bytes)

    define ( 'MAX_SIZE', '1048576' );



    // do not touch below....

    $erro = array ();

    if ( !empty ( $_REQUEST['logout'] ) && !empty ( $_SESSION['local']['in'] ) )
    {
        do_out ( '1' );
    }

    elseif ( !empty ( $_REQUEST['manage'] ) && !empty ( $_SESSION['local']['in'] ) )
    {
        run_manage ();
    }

    elseif ( !empty ( $_REQUEST['upload'] ) && !empty ( $_SESSION['local']['in'] ) )
    {
        upload_form ();
    }

    elseif ( !empty ( $_POST['login'] ) && test_login () )
    {
        upload_form ();
    }

    elseif ( empty ( $_SESSION['local']['in'] ) )
    {

        do_out ( '0' );
        login_form ();
    }

    elseif ( !empty ( $_POST['send'] ) )
    {
          $return = array();
        $x = 0;

        for ( $i = 0; $i < sizeof ( $_FILES['up'] ); $i++ )
        {
            if ( is_uploaded_file ( $_FILES['up']['tmp_name'][$i] ) )
            {
                if ( $_FILES['up']['tmp_name'][$i] != 'none' )
                      {

                    $ss = filesize ( $_FILES['up']['tmp_name'][$i] );

                            if ( $ss > 10 && $ss <= MAX_SIZE )
                            {

                        $sn = $_FILES['up']['name'][$i];

                                  if ( move_uploaded_file ( $_FILES['up']['tmp_name'][$i], UPLOAD_PATH . $sn ) )
                                  {
                                        $return[$x]['name'] = substr ( $sn, 0, strrpos ( $sn, '.' ) );
                                        $return[$x]['type'] = substr ( $sn, ( strrpos ( $sn, '.' ) + 1 ) );
                                        $return[$x]['size'] = $ss;
                            $x++;
                                  }

                            }

                      }

            }

        }

        process_return ( $return );

    }
    else
    {
        do_out ( '0' );
        upload_form ();
    }

   
    function test_login ()
    {

        if ( ADMIN_USER == $_POST['admin'] && ADMIN_PASS == md5 ( $_POST['pass'] ) )
        {

            $_SESSION['local']['in'] = 1;

            return ( 1 );

        }

        return ( 0 );

    }

    function do_out ( $type )
    {

        $_SESSION = array ();
        session_destroy ();

        if ( !empty ( $type ) )
        {

            header ( 'Location: ' . $_SERVER['PHP_SELF'] );
            exit ();

        }

    }

    function login_form ()
    {
?>
<html>
<head>
  <title>ADMIN UPLOAD LOGIN</title>
</head>
<body>
  <center>
   <form action='<?=$_SERVER['PHP_SELF'];?>' method='post'>
   <input type='hidden' name='login' value='1'>
   <p></p>
   <p></p>
   USERNAME
   <br />
   <br />
   <input type='text' name='admin' size='20' maxlength='20'>
   <br />
   <br />
   PASSWORD
   <br />
   <br />
   <input type='password' name='pass' size='20' maxlength='20'>
   <br />
   <br />
   <input type='submit' name='submit' value='Login!'>
   </form>
  </center>
</body>
</html>
<?
    exit ();
}
    function upload_form ()
    {
?>
<html>
<head>
  <title>ADMIN UPLOAD FORM</title>
</head>
<body>
  <center>
   <br />
   <br />
   <a href='<?=$_SERVER['PHP_SELF'];?><?=UP_B;?>manage=1'>Manage Files</a>  or  <a href='<?=$_SERVER['PHP_SELF'];?><?=UP_B;?>logout=1'>Log Out</a></td>
   <br />
   <br />
   <form enctype='multipart/form-data' action='<?=$_SERVER['PHP_SELF'];?><?=UP_A;?>' method='post'>
   <input type='hidden' name='send' value='1'>
   <p></p>
   <p></p>
   UPLOAD FILES
   <br />
   <br />
<?
        for ( $i = 1; $i <= MAX_FILES; $i++ )
        {
            echo "<input type='file' name='up[]' size='40'>\r\n<br />\r\n";
        }
?>
   <br />
   <br />
   <input type='submit' name='submit' value='UPLOAD!'>
   </form>
  <center>
</body>
</html>
<?
    exit ();
}

    function process_return ( $in )
    {
        if ( !empty ( $in ) )
        {
?>
<html>
<head>
  <title>ADMIN UPLOAD RESULTS</title>
  <style>
  table {margin: 0px;padding: 0px;border: 0px;border-spacing: 0px;border-collapse: collapse;text-align: center;}
  td {margin: 0px;padding: 0px;border: 0px;border-spacing: 0px;border-collapse: collapse;text-align: center;}
  .zt, .mt {background-color: #ffffff;}
  .st, .ft, .mh, .mi, .bttn {background-color: #777777;}
  .st, .zt, .mh {border: 2px solid;}
  .zt {border-color: #777777;}
  .st {border-color: #000000;}
  .mh, .bttn {border-color: #ffffff;}
  .st, .mh, .mi, .bttn {color: #ffffff;}
  .zt {padding: 6px;}
  .st {padding: 4px;}
  .mh, .mi {padding: 2px;}
  .st, .zt, .mt, .ft, .mh, .mi, .bttn {font-size: 12px;}
  .bttn {height: 21px;}
  </style>
</head>
<body>
  <center>
   <table width='688'>
    <tr>
     <td class='zt' width='100%'>
      <table width='672'>
       <tr>
        <td class='st'>FILES UPLOADED</td>
       </tr>
       <tr>
        <td class='mt' width='100%' height='4'></td>
       </tr>
       <tr>
        <td class='mt' width='100%' height='20'><a href='<?=$_SERVER['PHP_SELF'];?><?=UP_B;?>logout=1'>Log Out</a></td>
       </tr>
       <tr>
        <td class='mt' width='100%' height='4'></td>
       </tr>
       <tr>
        <td class='st'>
         <table width='100%'>
          <tr>
           <td class='mh' width='4%' height='21'>#</td>
           <td class='ft' width='2%'></td>
           <td class='mh' width='52%' height='21'>FILE NAME</td>
           <td class='ft' width='2%'></td>
           <td class='mh' width='24%' height='21'>FILE SIZE</td>
           <td class='ft' width='2%'></td>
           <td class='mh' width='16%' height='21'>FILE TYPE</td>
          </tr>
<?
            for ( $i = 0; $i < sizeof ( $in ); $i++ )
            {

                $j = ( $i + 1 );

echo "          <tr>
           <td class='mi' width='4%' height='21'>" . ( $j < 10 ? '0' . $j : $j ) . "</td>
           <td class='ft' width='2%'></td>
           <td class='mi' width='52%' height='21'>" . $in[$i]['name'] . "</td>
           <td class='ft' width='2%'></td>
           <td class='mi' width='24%' height='21'>" . $in[$i]['size'] . " bytes</td>
           <td class='ft' width='2%'></td>
           <td class='mi' width='16%' height='21'>" . $in[$i]['type'] . "</td>
          </tr>
";
            }
?>
         </table>
        </td>
       </tr>
       <tr>
        <td class='mt' width='100%' height='8'></td>
       </tr>
       <tr>
        <td class='st'><input class='bttn' type='button' onclick="location.href='<?=$_SERVER['PHP_SELF'];?><?=UP_B;?>upload=1';" value='UPLOAD FILES'>  <input class='bttn' type='button' onclick="location.href='<?=$_SERVER['PHP_SELF'];?><?=UP_B;?>manage=1';" value='MANAGE FILES'></td>
       </tr>
      </table>
     </td>
    </tr>
   </table>
  </center>
</body>
</html>
<?
        }
        else
        {
?>
<html>
<head>
  <title>ADMIN UPLOAD ERROR</title>
  <META HTTP-EQUIV="Refresh" Content="4;URL=<?=$_SERVER['PHP_SELF'];?><?=UP_B;?>upload=1">
</head>
<body>
  <center>
   <p></p>
   <p></p>
   !! NO FILES BEING UPLOADED WERE VALID !!
   <br />
   <br />
   redirecting you to the upload form...
   <br />
   <br />
  <center>
</body>
</html>
<?
        }
    }

    function run_manage ()
    {

        if ( !empty ( $_POST['delete'] ) )
        {

            do_delete ();

        }

        $files = get_files ();

        if ( is_array ( $files ) && !empty ( $files ) )
        {
?>
<html>
<head>
  <title>ADMIN FILE MANAGE</title>
  <style>
  table {margin: 0px;padding: 0px;border: 0px;border-spacing: 0px;border-collapse: collapse;text-align: center;}
  td {margin: 0px;padding: 0px;border: 0px;border-spacing: 0px;border-collapse: collapse;text-align: center;}
  .zt, .mt {background-color: #ffffff;}
  .st, .ft, .mh, .mi, .bttn {background-color: #777777;}
  .st, .zt, .mh {border: 2px solid;}
  .zt {border-color: #777777;}
  .st {border-color: #000000;}
  .mh, .bttn {border-color: #ffffff;}
  .st, .mh, .mi, .bttn {color: #ffffff;}
  .zt {padding: 6px;}
  .st {padding: 4px;}
  .mh, .mi {padding: 2px;}
  .st, .zt, .mt, .ft, .mh, .mi, .bttn {font-size: 12px;}
  .bttn {height: 21px;}
  </style>
</head>
<body>
  <center>
   <table width='688'>
   <form action='<?=$_SERVER['PHP_SELF'];?><?=UP_A;?>' method='post'>
   <input type='hidden' name='manage' value='1'>
    <tr>
     <td class='zt' width='100%'>
      <table width='672'>
       <tr>
        <td class='st'>CURRENT FILES LIST</td>
       </tr>
       <tr>
        <td class='mt' width='100%' height='4'></td>
       </tr>
       <tr>
        <td class='mt' width='100%' height='20'><a href='<?=$_SERVER['PHP_SELF'];?><?=UP_B;?>logout=1'>Log Out</a></td>
       </tr>
       <tr>
        <td class='mt' width='100%' height='4'></td>
       </tr>
       <tr>
        <td class='st'>
         <table width='100%'>
          <tr>
           <td class='mh' width='4%' height='21'>#</td>
           <td class='ft' width='2%'></td>
           <td class='mh' width='44%' height='21'>FILE NAME</td>
           <td class='ft' width='2%'></td>
           <td class='mh' width='20%' height='21'>FILE SIZE</td>
           <td class='ft' width='2%'></td>
           <td class='mh' width='20%' height='21'>FILE DATE</td>
           <td class='ft' width='2%'></td>
           <td class='mh' width='4%' height='21'>DELETE</td>
          </tr>
<?
            for ( $i = 0; $i < sizeof ( $files ); $i++ )
            {

                $j = ( $i + 1 );

echo "          <tr>
           <td class='mi' width='4%' height='21'>" . ( $j < 10 ? '0' . $j : $j ) . "</td>
           <td class='ft' width='2%'></td>
           <td class='mi' width='44%' height='21'>" . $files[$i]['name'] . "</td>
           <td class='ft' width='2%'></td>
           <td class='mi' width='20%' height='21'>" . $files[$i]['size'] . " bytes</td>
           <td class='ft' width='2%'></td>
           <td class='mi' width='20%' height='21'>" . $files[$i]['date'] . "</td>
           <td class='ft' width='2%'></td>
           <td class='mh' width='4%' height='21'><input type='checkbox' name='delete[]' value='" . $files[$i]['file'] . "'></td>
          </tr>
";
            }
?>
         </table>
        </td>
       </tr>
       <tr>
        <td class='mt' width='100%' height='8'></td>
       </tr>
       <tr>
        <td class='st'><input type='submit' class='bttn' value='DELETE FILES'>  <input class='bttn' type='button' onclick="location.href='<?=$_SERVER['PHP_SELF'];?><?=UP_B;?>upload=1';" value='UPLOAD FILES'></td>
       </tr>
      </table>
     </td>
    </tr>
   </table>
  </center>
</body>
</html>

<?
        }
        else
        {
?>
<html>
<head>
  <title>ADMIN FILE MANAGER</title>
  <META HTTP-EQUIV="Refresh" Content="4;URL=<?=$_SERVER['PHP_SELF'];?><?=UP_B;?>upload=1">
</head>
<body>
  <center>
   <p></p>
   <p></p>
   !! THERE ARE NO FILES TO MANAGE !!
   <br />
   <br />
   redirecting you to the upload form...
   <br />
   <br />
  <center>
</body>
</html>
<?
        }
    }

    function do_delete ()
    {
        foreach ( $_POST['delete'] as $file )
        {
            $now = UPLOAD_PATH . pack ( "H*", $file );

            if ( file_exists ( $now ) )
            {
                unlink ( $now );
            }
        }
    }

    function get_files ()
    {

        $out = array ();
        $x = 0;

        if ( is_dir ( UPLOAD_PATH ) )
        {
            $td = opendir ( UPLOAD_PATH );

            while ( false !==  ( $file = readdir ( $td ) ) )
            {
                if ( $file != '.' && $file != '..' && !is_dir ( UPLOAD_PATH . $file ) )
                {
                    $out[$x]['name'] = $file;
                    $out[$x]['size'] = filesize ( UPLOAD_PATH . $file );
                    $out[$x]['date'] = date ( 'F d Y H:i:s', filemtime ( UPLOAD_PATH . $file ) );
                    $out[$x]['file'] = bin2hex ( $file );
                    $x++;
                }
            }
            closedir ( $td );
            clearstatcache ();
        }

        return ( $out );
    }
?>


Sonia

Re: another php question

Thanks but what do i called the files can you put spcaes between each page?

Re: another php question

and it will work so the visitors will be able to view it without using the admin functions?

Re: another php question

??????

Re: another php question

Hi newera,
Have you got the solution for your request?

Well i would like to suggest you something here,

Which operating system you are using.. I tried with linux+apache+php

I tried something for you.. I will post the code later tomorrow

Do you know that , First you are using file-upload, it will copy to a temp dir, with all the parameters(name,type,tempname,size). you can copy the file to server, if the file size is zero, you just read the temp file from the temp path and write it to new file...

If it is too confusing... then pls wait for the code..

God wisely designed the human body so that we can neither pat our own backs nor kick ourselves too easily

Re: another php question

its confusing yes because i dont know if that code is for 1 page or a few and i and using windows basiclly what i need is a page that you can upload the file thats password protected named admin.php and when i upload it itll be on a paged named scripts.php and on that page only the admin can delete it and the visitors cant upload files i need the file to have the name the size and date uploaded if its confusing please IM nsb823 if you have AIM

Re: another php question

are you gonna post it?

Re: another php question

ameenullah wrote:

Hi newera,
Have you got the solution for your request?

Well i would like to suggest you something here,

Which operating system you are using.. I tried with linux+apache+php

I tried something for you.. I will post the code later tomorrow

Do you know that , First you are using file-upload, it will copy to a temp dir, with all the parameters(name,type,tempname,size). you can copy the file to server, if the file size is zero, you just read the temp file from the temp path and write it to new file...

If it is too confusing... then pls wait for the code..


That was 2 days ago and you never posted it

Re: another php question

its been like 5 days come on i need it

Re: another php question

First .. Apology for the delay..
we have shifted our workplace and faced some problem in the new place to use internet.. thats why..

It seems you are desperately need this upload script..

God wisely designed the human body so that we can neither pat our own backs nor kick ourselves too easily

Re: another php question

here is the script which is working...
just edited your own script..

admin.php

<?
$upload_time=date("F d Y H:i:s");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Admin Uploader</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
a.linkcolor:hover {font-family: Geneva, Arial, Helvetica, sans-serif; }
</style>
</head>
<body bgcolor="#dedede">
<div align="center">
  <table width="699" border="1" bordercolor="#6699FF" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#6699FF">
<table width='389' border='1' align='center' bordercolor='#6699FF' bordercolorlight='#000000' bordercolordark='#000000' bgcolor='#6699FF'>
  <tr align='center' valign='top'> 
    <td width='379' bgcolor='#6699FF'><div align='center'><strong>[File Uploader]</strong></div></td>
  </tr>
  <tr align='center' valign='top'> 
<td height='71' bgcolor='#6699FF'>
<form name="uploader" action="scripts.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="102400">
<input type="file" name="user_selected_file" size="30">
<input type="hidden" name="uptime" value="<?=$upload_time?>" size="30">
<br>
<input type="submit" value="Upload File">
</form>
</td>
  </tr></table>
</div>
</body>
</html>

scripts.php

<?php
$time_uploaded=$HTTP_POST_VARS['uptime'];
$file_name=$HTTP_POST_FILES ['user_selected_file']['name'];
$file_type=$HTTP_POST_FILES ['user_selected_file']['type'];
$file_size=$HTTP_POST_FILES ['user_selected_file']['size'];
//$file_temp=$HTTP_POST_FILES ['user_selected_file']['tmp_name'];

// Just to check the uploading file format is valid format or not.
//        like (gif, txt, png, jpg, jpeg, etc;)
$ext=explode('.',$file_name);
$ext=strtolower($ext[count($ext)-1]);
if (preg_match('/^(gif|txt|png|jpe?g)$/',$ext)){
    $correct_format=1;
}

// If the file format is valid then proceed
if($correct_format==1){
    $path_to_upload="/home/www/xyz/sites/htdocs/users/ameen/upload";    //Destination Folder
    if(is_uploaded_file($user_selected_file)){
        move_uploaded_file($user_selected_file, "$path_to_upload/$file_name"); 
        if (!file_exists("$path_to_upload/$file_name")) {
            echo "<b>Uploaded File doesn't exist...</b><br><br>";
        }
        else{
            echo "<br>Uploaded file is in : $path_to_upload/<b>$file_name</b><br><br>";
        }
    }
    else{
        echo "No files copied";
    }
}
else{
    echo "Invalid file format";    
}
?>

<html>
<head>
<title>Uploader</title>
<style>
BODY{font-family:verdana,arial; font-size:11px;}
TD{font-family:verdana,arial; font-size:11px;}
</style>
</head>
<body bgcolor="#cecece">
<div align="center">
  <table width="699" border="1" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" bgcolor="#777777">
    <tr>
      <td align="center" valign="top" bgcolor="#777777"><div align="center"><strong>Scripts</strong></div></td>
    </tr>
    <tr>
      <td height="54" align="center" valign="top" bgcolor="#777777"><br> <table width="628" border="1" bordercolor="#FFFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" bgcolor="#777777">
          <tr align="center" valign="top">
            <td width="48" bgcolor="#777777"><div align="center"><strong>[No]</strong></div></td>
            <td width="273" bgcolor="#777777"><strong>[File Name]</strong></td>
            <td width="119" bgcolor="#777777"><strong>[Size]</strong></td>
            <td width="160" bgcolor="#777777"><strong>[Uploaded On]</strong></td>
          </tr>
        </table>
    <table width="628" border="1" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" bgcolor="#777777">
          <td width='48' bgcolor='#777777'><?=$i?></td>
          <td width='273' bgcolor='#777777'><a href="<?php echo "$file_name" ?>"><font color='#000000'></font></a><?php echo "$file_name"; ?></td>
          <td width='119' bgcolor='#777777'><?php echo "$file_size"; ?> bytes</td>
          <td width='160' bgcolor='#777777'><?php echo "
        <b>File Uploaded</b> :<br> $time_uploaded <br>
        <b>File Last modified</b> :<br> ".date( "F d Y H:i:s.", getlastmod() ); ?>
</td>

          </tr></td>
    </tr>
      </table><br>
      <table width='400'>
    <tr>
</td>
    </tr>
  </table>
</div>
</body>
</html>
God wisely designed the human body so that we can neither pat our own backs nor kick ourselves too easily

18 (edited by newera70 2004-07-13 16:19)

Re: another php question

Warning: move_uploaded_file(/home/newera/www/xyz/sites/htdocs/users/ameen/upload/Script.txt): failed to open stream: Permission denied in /home/newera/public_html/scripts.php on line 20

Warning: move_uploaded_file(): Unable to move '/tmp/php0N6WAp' to '/home/newera/www/xyz/sites/htdocs/users/ameen/upload/Script.txt' in /home/newera/public_html/scripts.php on line 20
Uploaded File doesn't exist...

Re: another php question

Dear... Instead the ("/home/newera/www/xyz/sites/htdocs/users/ameen/upload/ ")
You have to specify your server path name...files where you want to store..

I have given my address there... you have to specify yours...

God wisely designed the human body so that we can neither pat our own backs nor kick ourselves too easily

Re: another php question

i did i fixed it so thats were the files would go they would go to
/home/newera/www/xyz/sites/htdocs/users/ameen/upload/