Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Displaying Image From Folder


I want to list all the image file in an array from a directory and then display them such that they appear say, 6 images per page. Can some1 please give me the code to do this.




View Complete Forum Thread with Replies

Related Forum Messages:
Displaying All Pics In A Folder
I would like to write a script that displays all photos (jpg) from a folder.  I want to be able to load photos into a folder without renaming them and have a script sort them and display them alphabetically.

View Replies !
Displaying Folder Contents
I am trying to display the contents of a folder for users to view/download, what is best way to do this? Also, is there a way to "hide" specific files in that folder that I do not want displayed?

View Replies !
Displaying Files In A Folder Using A Calender
I have excel sheets generated daily and weekly in this format for filenames..for daily sheets the filename is Jan-10-2002 (mmm-dd-yyyy) and weekly Week-39-2002. I have a script that uploads to a constant folder all the excel sheets.

Is there a script that can display the daily scripts in form of a calender. I.E a user can choose to view or download the sheet by choosing the date? Also another for displaying weekly excel sheets in a weekly format.

View Replies !
Problem With Displaying Folders From Folder
I want to display all the folders present from 1 folder, it works fine and gives me . and .. as directory listing which is not good. The code is as follows:

$path = "../cuz";
$img = opendir($path);
while($file = readdir($img))
{
if(is_dir($file))
{
echo "Folder name is ". $file;
}
}
closedir($img);

View Replies !
Image Upload Problem - New Image Not Displaying
I have a consistent problem that needs knocking on the head. I have an image upload script that uploads an image and replaces the old image. The image that is displayed is sometimes that old image and the page must be manually refreshed to get the new one. I need the new image to be displayed with out have to manually refresh the page.

So far I have identified the following:

•   Ive been testing in ie and firefox – the problem only happens in firefox.

•   If the upload script is activated more than once it works as desired – but not the first time. I need it to work the first time.

•   I have set the page to automatically refresh. – this works in ie, but firefox still needs a manual refresh.

•   I’ve included the following which makes no difference:

•   header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
•   header("Cache-Control: no-cache");
•   header("Pragma: no-cache");

View Replies !
First Image In Folder
function getFirstImage($dirname)
{
global $imageName;
$ext = array("jpg", "png", "jpeg", "gif", "JPG", "PNG", "GIF", "JPEG");
if($handle = opendir($dirname))
{
while(false!== ($file = readdir($handle)))
{
if(strstr($file, "." . $ext[$i]))
{
$imageName = $file;
break;
}
}
closedir($handle);
}
return($imageName);
}


just trying to get the name if the first image in the spacified folder...

thanks for any help!

View Replies !
Delete Image From Folder
I have some php scripts to upload images and delete it. But if I delete the image I only delete the image's data in the database, and the image still remains in the folder. My question is, how can I remove the image from the image folder?

View Replies !
Image Upload To DB Or Folder
Is it better to upload an image to a database or to a folder on my server. There will potentially be hundreds (close to a thousand) pictures uploaded.

And I don't know if this makes a difference but I'll be creating thumbnails from the images as well as keeping a full sized version.

View Replies !
Displaying Image From Image Path
Trying to display this simple query. Everything works but i can't get the image path correct. Its just displaying the image name.

   while ($row = mysql_fetch_array ($r)) { print "<p>{$row['title']} <br />
   {$row['address']} <br />
   {$row['description']} <br />
   {$row['price']} <br />
   <img src= "./uploads/images".{$row[['images']}"/>  <br />
   {$row['contact']} <br />
   {$row['phone']} </p>";

View Replies !
Simple Image And Folder Script
I want to have a simple script to show if a folder exist a random picture
and the number of images in that folder like this

uploads/admin.php will be the file which shows this info

the below would be folders that have images in them so the admin.php would
need to detect folder names under uploads/ and then show an image from each
one and give me the count of images in each one
uploads/candie/
uploads/sara/
uploads/amy/

View Replies !
How To Read From A Folder And Display It As An Image?
How is it you can read from a folder, loop through what is there and display it as an image? My knowledge of this is limited to databases so far, so it'd be interesting just to find out how you do the same with folders.

View Replies !
Uploaded Image Is Not Going To The Proper Folder
This is the first time I have worked with uploading files through and html form with php.  I can not see why this is not working.  I used this form once and it worked and then I started adding some other things to the file and of course it does not want to move the file properly anymore. I just can not see why it is not working anymore. Code:

View Replies !
Writing Image To Folder On Server
i've succesfuly created a thumbnail from an image that has be verified and copied to a folder on the server for later calling from a database. I'm having trouble saving the new thumbnail file that has been created. using move_uploaded_file($thumb, $thumbupload); does not work. 

is there a GD function for writing an image to a directory?  the thumbnail as be created and just needs to be written now.

View Replies !
Quick Image Show From Folder
I have a folder which contains 300+ images (captured from a Webcam). I want to create a scritp which will show these images in quick succession (preferably without reloading the whole page). Like an old age animation (filcker book).

How Can I do this ??

View Replies !
Created Two Versions Of Image In Folder
I was wonder if I could get some help on putting together a script that would loop through all the images in a folder and created two other images (a thumbnail and a largesize) for each image? Code:

View Replies !
How To Link An Image In A Protected Folder
I have a folder containing images and I protected it so that no one can directly access/download those images. So, Now if anyone directly type "www.myaddress/protected/image1.jpg", the browser asks for username and password (which I have set).

But i want to link those images in another php page "www.myaddress/link.php". But the problem is this page also asked for password. Is there any way to enter username and password through php coding in that page "link.php" ? Btw, I protect the folder through a built in feature in www.pro-hosts.org and I think they use .htaccess format.

View Replies !
How To Randomly Get An Image File From A Folder And Display It?
I have a folder loaded with images and I want to make it possible to generate at random an image from that folder onto my homepage. How would I go about doing this?

View Replies !
Retrieve An Image In Folder From Info Out Of Database
i am having problems displaying an image once i have uploaded
it. i upload it to a folder and store its name in a database. below is
the code to display the image. I have figured out the the code is not
grabbing the name from the database but i can not figure out why. can
anyone help?

//Retrieves data from MySQL
$data = mysql_query("SELECT IMAGE_NAME FROM item") or
die(mysql_error());

//Puts it into an array
while($info = mysql_fetch_array( $data ))
{
//Outputs the image and other data
Echo "<img src=http://www.abcxyz.com/pics/".$info['photo'] ."<br>";
}

View Replies !
Viewing Image From A CHMOD Blocked Folder
How can I show an Image that is inside a folder which I've blocked using CHMOD?
The reason I've blocked the containing folder of the Image is so no one could enter the folder's URL and see ALL of the images in it.

For Example: I have a file that is viewing the "Dog" photo from the Blocked Folder "Private_Images". In that case I cannot view the dog's file because the "Private_Images" folder is blocked, but if I will remove the blocking from the folder, then anyone could view all of my other photos.

View Replies !
How To Point The Path To IMAGE Folder For MYSQL PHP Database
in my website there are ftp-uploaded images (about 3000) in a folder called IMAGE. What I want to do is somehow get the image file names inserted in to my database so, I can see image file names in a pull down menu selection when I insert records through FORM on a php file. i use MYSQL PHP LINUX configuration.

View Replies !
Resize The Image And Save A Smaller Version In A Diffrent Folder.
What iv got is an upload form for a image, the image is there stored in a folder.
What im trying to do is also resize the image and save a smaller version in a diffrent folder. Code:

View Replies !
Image Displaying
It looks as if you are creating the second image, but not saving it anywhere.

This generates an image: imagejpeg($image_p, null, 100)."
";

But what about $image? You do a copyresampled then destroy it. If you want
to save the image, pass the second argument to imagejpeg.

View Replies !
Image Not Displaying?
My code doesn't seem to want to display the images in the location provided.  I get renderings but floorplans are not working, any suggestions in what i am doing wrong?

I checked permissions, i made sure the file exists, and thats what my code is suppose to be doing is if it exists than print the file, which i t does









<?php
  print "<h1><img src='http://homes.pacificscene.com/images/browse/logos/" . $row[0] . ".jpg' alt='" . $row[1] . "' /></h1>";
  print "<p>" . $row[6]; 
$linkresult = mysql_query("SELECT * from psh_commlinks where commID = '" . $row[0] . "'");
while ($linkrow = mysql_fetch_row($linkresult)) {
print "<br />For more information about " . $linkrow[1];
print ", please visit:<br /><a href='" . $linkrow[2] . "'>" . $linkrow[2] . "</a>.";
}
print "</p>";
if (file_exists("http://homes.pacificscene.com/browse/features/" . $row[10])) {
print "<p><a href='features/" . $row[10] . "' target='_blank'>View Features List</a></p>";
}
if (file_exists("http://homes.pacificscene.com/browse/brochures/" . $row[8])) {
print "<p><a href='brochures/" . $row[8] . "' target='_blank'>Download PDF brochure</a></p>";
}
$query = "SELECT * from psh_siteplans WHERE communityID = '$ID' ORDER BY orderID";
   $result = mysql_query($query);
 while ($row = mysql_fetch_row($result)) {
print "<form action=" . $_SERVER['PHP_SELF'] . "?ID=" . $ID . "&siteID=" . $row[0] . " method='POST'>";
print "<table border='0' cellspacing='0' cellpadding='5'><tr>";
                    $window = "'http://homes.pacificscene.com/popup.php?type=renderings&ID=" . $row[0] . "','popUp','width=775,height=550'";

print "<td width='206' rowspan='8' valign='top'>";
print '<a href="javascript:;"><img border="0" src="http://homes.pacificscene.com/images/browse/renderings/' . $row[0] . '-TH.jpg" onclick="MM_openBrWindow(' . $window . ')" /></a>';
print "</td>";
print "<td width='135'><strong>Model</strong></td>";
                  print "<td>" . $row[1] . "</td></tr>";
  print "<tr><td><strong>Appx Sq. Ft</strong>.</td>";
                  print "<td>" . $row[2] . "</td></tr>";
print "<tr><td><strong>Stories</strong>.</td>";
                  print "<td>" . $row[3] . "</td></tr>";
print "<tr><td><strong>Bedrooms</strong>.</td>";
                  print "<td>" . $row[4] . "</td></tr>";
print "<tr><td><strong>Baths</strong>.</td>";
                  print "<td>" . $row[5] . "</td></tr>";
  print "<tr><td><strong>Garage</strong>.</td>";
                  print "<td>" . $row[6] . "</td></tr>";

$window = "'http://homes.pacificscene.com/popup.php?type=floorplans&ID=" . $row[0] . "','popUp','width=825,height=625,scrollbars=yes'";
if (file_exists("http://homes.pacificscene.com/images/browse/floorplans/" . $row[0] . ".jpg")) {
print '<tr><td><a href="javascript:;" onclick="MM_openBrWindow(' . $window . ')">Floorplan</td></a>';
print "<td>&nbsp;</td></tr>";
}
$window = "'http://homes.pacificscene.com/popup.php?type=renderings&ID=" . $row[0] . "','popUp','width=775,height=550'";
if (file_exists("http://homes.pacificscene.com/images/browse/renderings/" . $row[0] . "-TH.jpg")) {
print '<tr><td><a href="javascript:;" onclick="MM_openBrWindow(' . $window . ')">Enlarged Rendering                         </td></a>';
print "<td>&nbsp;</td></tr>";
}                  
    print "</table><br />";
}
  ?>

View Replies !
Displaying Image
I have the following code: PHP Code:

<img src=http://www.trackingsite.com/cnt/a/12946/ height=1 width=1>
<?php
$ipaddress=$_SERVER['REMOTE_ADDR'];

if(!empty($product)) {echo '<script type="text/javascript">'."window.location.replace('".$product."');</script>";}
?>

1. Is it ok to display the single pixel gif or will that stop the $_SERVER['REMOTE_ADDR']; from picking out the ipaddress?

2. Will it redirect before the single pixel has time to display?

View Replies !
Image Not Displaying
echo " <td width="259" rowspan="4">&nbsp;</td>
";
echo " <td width="414" rowspan="4"><img src="file:///C¦/XamppServer/xampp/htdocs/car.jpg" width="75" height="76"</td>
"
echo " <td width="13">&nbsp;</td>
";

thats the error I get. Parse error: syntax error, unexpected T_STRING, expecting ',' or '' in C:XamppServerxampphtdocscarsgarage.php on line 80.

View Replies !
Displaying An Image From A MYSQL DB
Can someone point me in the right direction as to display an image in PHP that is being stored in MySQL? Basically I know how to store the image in MySQL, but getting it to display on a web page is what I am having trouble with.

View Replies !
Displaying An Image From Directory
I am new to php and having some troubles with something that should be relatively simple. I am trying to read an image file from a directory and display it in an html table. The catch is, the directory is not a set variable because it depends on the user who is logged in . this directory is called "$imagedirectory" below and is passed through a SESSION.
for example $imagedirectory = "/htdocs/page/members/johnny_tracks/images/imagefile.jpg"

the area of concern is highlighted below <img src="$imagedirectory"/>

I have checked that the directory is correct AND that the file exists. I have no clue how to show the image, every I run it the output is either nothing or "/htdocs/page/members/username_tracks/images/imagefile.jpg". Code:

View Replies !
Displaying A Binary Image
I would like to know if anyone knows how I could go about sending an image to the browser that is binary. Here is what I am doing right now...but it's not working:

header("Content-Type: image/jpeg");
header('Content-Disposition: inline; filename="image.jpg"');
$theImage = $thePage->GetAs("image.jpg", 350, 270, 60);
imagejpeg($theImage);

I have an ASP script that I am going off of to pull this together, and it uses "Response.BinaryWrite", is there an equivalent in PHP?

View Replies !
Image Displaying (through Pagination)
I'm trying to get a code like this (from DB):

<a href="#" onclick="window.open('image_1.html', 'Image', 'toolbar=no, status=no, scrollbars=no, menubar=no, width=100, height=100')"><img src="images-small/image_1_small.jpg" border="0"></a>

etc ... another 50 images

I'll show the way I paginated the records from DB when I had 1 record=1 row, maybe you could give me ideas, how to change the code, to show images the same: Code:

View Replies !
Displaying A Uploaded Image ?
If i just uploaded an image with a form and I'd like to display it wouldnt the right way to do this be Code:

$img = $_FILE['file'];
echo "<img src='$img'>";

View Replies !
How To Process Image Before Displaying?
I have a java servlet class that is needed to be coded&#12288;in PHP.

I need to process the image coming from the REQUEST of an IMG tag.

IMG="http://a.abc-efg.co.jp/demo/Sample.jpg"

What I want to do is call a php script everytime a request with .jpg|.gif|.png is written in the URL. Get the filename of the image and proces it.

I have done this in java by using a Filter and filter mapping in the web.xml file.

View Replies !
Displaying Temp Image
I am trying is built a image editing and upload system for my server. What I want to do is for the image editor I want to display the image everytime the user crops, changes color, ect. but I want the temp image to be shown from memory not from the harddrive. I don't want temp files saved to the harddrive.

View Replies !
Displaying Broken Image
I'm trying to check whether an image location (pulled from a text file) exists, and if so display it. Not too difficult, but I have the problem that if the image doesn't exist, it displays a broken image.

if (!empty($data[$r][2])) {
echo "<span style="display: block;width:100%;"><a href="loader.php?cid={$data[$r][0]}"><img src=
"/images/{$data[$r][2]}"></a></span>
";
} else {
echo "";
}

View Replies !
Problem Displaying Image From Database
I used the code below to pull out an image from a mysql database
but nothing shows on the page and there was no error message to
indicate any problem.What could be wrong.The image is actually in the
database with all the details:

<?php
if(isset($_GET[loginid]))
{
$con=mysql_connect("localhost","name","pass");
if(!$con)
{
die('Could not connect to database:'.mysql_error());
}
mysql_select_db("datab",$con);
$id = $_GET[loginid];
$query = "SELECT name, type, size, content " .
"FROM image WHERE id= '$id'";
$result = mysql_query($query) or die('Error, query failed');
$file=mysql_fetch_array($result);
$name=$file['name'];
$type=$file['type'];
$content=$file['content'];
header('Content-length: '.strlen($content));
header("Content-type: $type");
header("Content-Disposition: inline; filename=$name");
echo $content;
}
mysql_close($con)
?>

View Replies !
Displaying Image Stored In Database
The user can browse and upload an image and the image is stored successfully in a seperate binary table (with userid and bin_data, filesize, filename, filetype). The photo is displayed properly when I point my broswer to a script called fileshow.php:
PHP Code:

View Replies !
Displaying Image Stop The Script?
im using the gd function for displying an image, but after:

imagepng($image);
imagedestroy($image);

seems the script stop without execute all the rest. why that?

View Replies !
Image Display With 1 Displaying Every 10 Seconds...
I'm using:

<?php
$images = array("1.jpg","2.jpg","3.jpg");
srand(time());
for ($i=0;$i<3;++$i)
echo "<img src='$images[$i]'>";
?>

but it displays all the images. I need it to display one every 10 seconds.

View Replies !
Displaying Only A Portion Of A Graphic Image ?
I have a routine which reads in the names of all the GIF graphic files from a particular directory and displays the actual images but what I want to be able to do is just display a PART of each image. 

For example, all of the images are 500 pixels wide by 55 pixels high and I want only to display the first hundred pixels width of the image so that I would in effect have just a portion of each image starting from the left and 100 pixels wide.

View Replies !
Displaying Image On Web Page Question
My .php app displays an image on the web page, I notice that different
..jpg images display "funny" - apparently they all have slightly
different image widths and heights yet in the image tag I have to set
those properties to something - is there a way in php to get an image
width and height so I can set it correctly for each image?

<IMG SRC="<?php echo $php_image ?>" WIDTH="268" HEIGHT="176"
BORDER="0" ALT="">

View Replies !
Displaying A URL Stored In A Table As An Image On The Page?
In a table in my database I have a column for storing the URL of an image of a product. What PHP code would I use to display the image? PHP Code:

View Replies !
Displaying An Image Based On URL Origination-URL Redirect
I have several domains that use splash pages that point to my main
site:
i.e. http://www.mysite.com/index.php.

How do I replace an image, named "Logo.gif" on the main page
"http://www.mysite.com/index.php" with the image named "logo.gif"
from the URL splashpage, " http://www.mysite.com/SanDiego/"

Both images are named logo.gif because the PHP script references
logo.gif through the script in too many places...It is just easier to
keep the name logo.gif

Problem:
If a user is on the San Diego page and clicks to the main page I want
the user to feel that the site is all about SanDiego.
If a user is on the Los Angeles page and clicks to the main page I want
the user to feel that the site is all about Los Angeles.

Hence the site and database will still be the same..I just want them to
feel the experience is personalized for their city and this will be
determined by changing the logo.gif.

I am using an image named logo.gif that will display SanDiego for the
San Diego page
I am using an image named logo.gif that will display Los Angeles for
the Los Angeles page

I have seen some PHP code that uses php echo $picture I am not sure if
this will work....

View Replies !
Best Practice For Displaying A Thumbnail Of The Detailed Image?
Would appreciate some insight regarding the following: I am currently developing a mulitple image uploader (ie. the user selects how many images they wish to upload and the appropriate fields are displayed}.

What i do want to know is that if i upload only the detail of an image (not the thumbnail) what is the best practice for displaying a thumbnail of the detailed image? Also, if you do display a thumbnail of the detail are you still downloading the detail image when viewing the thumbnail of it?

View Replies !
Image Upload - Script Is Displaying A Blank Page
I am submitting a form with one image upload option. Now problem is that if a user submit form without choosing any image my script is displaying a blank page and not insert data in db. But when i select image with submition of formit is working fine. I think problem is i have to check whether file is selected or not. I am using like this

if(isset($_POST['submit']))
{
if(isset($_POST['userfile']))
{
echo "image selected";

if (isset($_FILES['userfile']))
{
//code to uplaod image
}
}
else
..................

View Replies !
Security Code Image In PHPNuke Login Isnt Displaying
i installed the PHP Nuke in a remote web space bought from prackhost.Problem is that iam not able to get the security code to login to the site as admin or normal user. All the remaining images like links and logo are comming except that security code. Iam not able to do any furthur action.

View Replies !
Drag Files From One Folder To Another Folder (copy) .. Possible?
Is it possible to write codings PHP or Javascript.. GUI representation
of File handling (ie. Drag files from one folder to another folder (copy)
like our windows).. pls give me some reference codings like this..

View Replies !
Creates A Temporary Folder And A File Within The Folder.
I have a PHP script which creates a temporary folder and a file within the folder.

I have a problem when trying to remove the file and folder using my FTP program. The ownership and group are set to NOBODY. I cannot change the permissions on either the file or the folder.

I have tried chmod and chgrp and chown but for some reason I cannot change permissions.

View Replies !
Remove From $name (folder)/(folder)/[x]/ <-- If Exists To Just Get [x].
I'll be quite honest. I don't have the faintest idea
how to do this, while I can do other php without a problem. Once I
know how to go about it I'll be okay.
It's two things I think?
1. see if there's a trailing slash and delete it.
2. Remove the preceding path to /x, the folders and slashes, and
delete them.
and then I have x.

X by the way is the final folder in a website and this grabs it for
me.

<?
$name = $REQUEST_URI;
?>

View Replies !
Get /folder/ To Redirect To /folder/index.php ?
I have a link www.example.com/folder/ but when people visit this i want it to go to www.example.com/folder/index.php because then it will log the page visit. Any ideas using mod rewrite i can get /folder/ to redirect to /folder/index.php ?

View Replies !
File In Folder Above Root Folder
I have a .php script in a folder one level above my website root, and I'd like to include it in pages in various website subfolders, some below the root. Can I use ($_SERVER['DOCUMENT_ROOT'] in the path in some way.

View Replies !
Help With Displaying Selecting A Date Range And Displaying Results
I wish to create a simple form that allows the selection of a start date and a stop date with the ability to select what columns to be displayed in the result page.

View Replies !
How Do I Get The Image Height Width When Generating Image From PHP (getimagesize Does Seem To Work)
Is it possible to obtain the width/ height of an image when that image
is dyanically created using a PHP script and passing GET attributes.
For example:

<img src="images/showImage.php?image_id=5" />

My images are created from images stored on the server, their paths
stored on in database table and retrieved using the GET image_id and
PHP script (showImage.php). Because the images are different sizes I
would like to be able to use a PHP function / class that can take an
image path and generate the IMG width and height attributes. This
would just tidy up the page when loading.

So when I try to use PHP 'getimagesize' like so:

$wh = getimagesize ($_SERVER['DOCUMENT_ROOT'] . "/images/showImage.php?
image_id=5");

.... I get an error saying that the file or directory does not exist:

Warning: getimagesize(/customersites/0/home/httpd/vhosts/
mydomain.co.uk/httpdocs/images/showImage.php?image_id=5): failed to
open stream: No such file or directory in /customersites/0/home/httpd/
vhosts/mydomain.co.uk/httpdocs/classes/html.class.php on line 11

I thin it may be the GET atttribute that is throwing it. How would I
go about doing this?

View Replies !
Determine Image Information On Image Stored In MySQL BLOB
I store images in my DB as BLOB. When I want to place them in an html
table, I want to determine the width of the image in order to asign the
correct width to the column inside table.
For JPEGs this is working fine, this is my code:

$image = @imagecreatefromstring($r["foto"]);
return @imagesx($image);

where $r["foto"] is the field selected from the db which contains the image.

For GIFs however, its getting really on my nerves !!
I know imagecreatefromstring is not supported in gd2 and I tried several
thinks. None of them worked ! :
-
$temp = tmpfile();
list($width, $height, $type, $attr) = getimagesize($temp);
echo $attr;

gives me :Warning: getimagesize: Unable to open 'Resource id #6' for reading
-
$handle = fopen("/tmp/tmp.dat", "w+");
fwrite($handle, $r["foto"]);
list($width, $height, $type, $attr) = getimagesize($handle);
echo $attr;

gives me : Warning: getimagesize: Unable to open 'Resource id #6' for
reading
-
Doing this with imagecreatefromgif($temp); wont work either !

Can somebody help me out please? by telling me what I'm doing wrong or what
I should do.

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved