Jump to content

upload pictures to server echo them out with php


shaunno2007

Recommended Posts

This stuff is hard look at this code:

 

How can make php echo out all my images from my server onto my website?

 

Right, what i am trying to do is echo out the pictures that are in the server, and at the same time echo out the links, i don't know how to say it i hope you understand. What i am getting with this is it echos out the picture, but 2 times and its in all of the link (my information box thing). i hope you understand you prob will not but i will see

 

<?php
while($website_row_m_i = mysql_fetch_array($website_result_m_i))
{
?><a href="javascript:#" title="<?php echo "<center><b>Link Information Box</b></center>"; ?>
<br/>
<?php echo "<center><b>Link</b></center>" ; ?>
<center>
<?php echo substr ($website_row_m_i['url'], 0, 31); ?>
</center>
<br/>
<?php echo "<b>From</b>: <font color='red'>{$website_row_m_i['name']}</font>" ; ?>
<br/>
<br/>
<b>Category</b>
<br/>
<?php echo $website_row_m_i['category_id']; ?>
<br/>
<br/>
<b>Description</b>
<br/>
<?php echo "<font size='1'>{$website_row_m_i['description']}</font>" ; ?>
<br/>
<br/>
<b>Submitted on the:</b>
<br/>
<?php echo $website_row_m_i['created_at']; ?>
<br/>
<br/>
<?PHP

$folder = "uploads/";
$handle = opendir($folder);

# Making an array containing the files in the current directory:
while ($file = readdir($handle))
{
    $files[] = $file;
    echo "<img src='uploads/$file' /> <br />";
    
} 
closedir($handle);

#echo the files

    

?>" style="cursor:default">More Info</a><br />
<?php } ?> 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.