Jump to content

nublet

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

nublet's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, I found this piece of code on the internet to save images from urls. if ($_GET[xfer]) { if ($_POST[from] == "") { print "You forgot to enter a url."; } else { copy("$_POST[from]", "$_POST[to]"); $size = round((filesize($_POST[to])/1000000), 3); print "transfer complete.<br> <a><a href=\"$_POST[from]\">$_POST[from]</a><br> <a><a href=\"$_POST[to]\">$_POST[to]</a> : $size MB"; } } else { print "<form action=\"$PHP_SELF?xfer=true\" method=post> from(http://): <input name=from><br> to(filename): <input name=to><br> <input type=submit value=\"transload\">"; } and I was wondering how you would make it save to a specific directory and save the name in sql?
  2. Thanks for the quick replies. How would i got about spacing the images evenly and centering them in the page? Is it fine to do that with php or is it better doing things like that with css? xangelo I tried your code but it made the pictures go in a strange order like rows of 1 then 4 then 1 then 3 I coudnt work out why that was happening though.
  3. Hi im trying to arrange images into neat rows but im not sure how to go about it. This is the code im using to display pictures at the moment but it just gives me a long column of pictures. <?php include("config.inc.php"); $result = mysql_query("SELECT * FROM gallery_photos"); While($row = mysql_fetch_array($result)){ echo "<a href='photos/" . $row['photo_filename'] . "'><img src='photos/tb_" . $row['photo_filename'] . "' border='1' /></a><br />"; } ?>
  4. Hi i've been trying to make a simple image host with php. I've been having problems with linking the thumbnails to the fullsize images though. Im displaying the thumbnail images with this code <?php include("config.inc.php"); $result = mysql_query("SELECT * FROM gallery_photos"); While($row = mysql_fetch_array($result)){ echo "<img src='photos/tb_" . $row['photo_filename'] . "' />\n"; } ?> When an image is uploaded it is saved to a photos folder as well as a thumbnail version of the image with tb_ at the begining of the file name. File id, date and time are saved into an sql database. Could anyone please help me with this?
×
×
  • 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.