Hi,
I'm looking for a script that will allow me to upload images to a
folder and shows pagination...
pls can any body help me?
i hav done with the uploading, but not able to do with the
pagination...he re is the upload code..
<?php
define ("MAX_SIZE","10 0");
function getExtension($s tr) {
$i = strrpos($str,". ");
if (!$i) { return ""; }
$l = strlen($str) - $i;
$ext = substr($str,$i+ 1,$l);
return $ext; }
$errors=0;
if(isset($_POST['Submit'])) {
$image=$_FILES['image']['name'];
if ($image) {
$filename = stripslashes($_ FILES['image']['name']);
$extension = getExtension($f ilename);
$extension = strtolower($ext ension);
if (($extension != "jpg") && ($extension != "jpeg") && ($extension !=
"png") && ($extension != "gif")) {
echo '<h1>Unknown extension!</h1>';
$errors=1; }
else {
$size=filesize( $_FILES['image']['tmp_name']);
if ($size MAX_SIZE*1024){ echo '<h1>You have exceeded the size
limit!</h1>'; $errors=1;}
$image_name=tim e().'.'.$extens ion;
$newname="image s/".$image_na me;
$copied = copy($_FILES['image']['tmp_name'], $newname);if (!$copied)
{ echo '<h1>Copy unsuccessfull!</h1>';
$errors=1;}}}}
if(isset($_POST['Submit']) && !$errors) { echo "<h1>Image Uploaded
Successfully! Try again!</h1>"; } ?>
<form name="newad" method="post" enctype="multip art/form-data"
action=""<table <tr><td><inpu t type="file" name="image"></td></tr>
<tr><td><inpu t name="Submit" type="submit" value="Upload image"></
td></tr</table> </form>
I'm looking for a script that will allow me to upload images to a
folder and shows pagination...
pls can any body help me?
i hav done with the uploading, but not able to do with the
pagination...he re is the upload code..
<?php
define ("MAX_SIZE","10 0");
function getExtension($s tr) {
$i = strrpos($str,". ");
if (!$i) { return ""; }
$l = strlen($str) - $i;
$ext = substr($str,$i+ 1,$l);
return $ext; }
$errors=0;
if(isset($_POST['Submit'])) {
$image=$_FILES['image']['name'];
if ($image) {
$filename = stripslashes($_ FILES['image']['name']);
$extension = getExtension($f ilename);
$extension = strtolower($ext ension);
if (($extension != "jpg") && ($extension != "jpeg") && ($extension !=
"png") && ($extension != "gif")) {
echo '<h1>Unknown extension!</h1>';
$errors=1; }
else {
$size=filesize( $_FILES['image']['tmp_name']);
if ($size MAX_SIZE*1024){ echo '<h1>You have exceeded the size
limit!</h1>'; $errors=1;}
$image_name=tim e().'.'.$extens ion;
$newname="image s/".$image_na me;
$copied = copy($_FILES['image']['tmp_name'], $newname);if (!$copied)
{ echo '<h1>Copy unsuccessfull!</h1>';
$errors=1;}}}}
if(isset($_POST['Submit']) && !$errors) { echo "<h1>Image Uploaded
Successfully! Try again!</h1>"; } ?>
<form name="newad" method="post" enctype="multip art/form-data"
action=""<table <tr><td><inpu t type="file" name="image"></td></tr>
<tr><td><inpu t name="Submit" type="submit" value="Upload image"></
td></tr</table> </form>
Comment