This code is the last lines in an upload script that uploads 4 images at the same time and writes the url to these and som other information to the database.
database structure: id img1 img2 img3 img4 imageobject imageinfo imagecategory
The problem is that im trying to write an array on $destination so i can insert the urls as below: IMG1= $destination[1] and so on. the example below writes the same url four times insted of every files url one time.
imagedestroy($src);
imagedestroy($tmp); // NOTE: PHP will clean up the temp file it created when the request
// has completed.
echo "Successfully Uploaded: ".$filename."
";
}
if(isset($_POST[submit])){
$imgNumb=1; //This the "pointer" to images
$DestinationDir="images/gallery/"; //Place the destination dir here
while ($_FILES["img".$imgNumb][tmp_name]){
$Unique=microtime(); // unique names
$destination=$DestinationDir.md5($Unique).".jpg";
imgReisize($_FILES["img".$imgNumb][tmp_name], $destination);
$imgNumb++;
}
$destination = array(1 => $destination, 2 => $destination, 3 => $destination, 4 => $destination);
include("includes/connect_database.php");
$sql = mysql_query("INSERT INTO test (img1, img2, img3, img4, imageobject, imageinfo, imagecategory) values ('$destination[1]', '$destination[2]', '$destination[3]', '$destination[4]', '$_POST[imageobject]','$_POST[imageinfo]','$_POST[imagecategory]')");
mysql_close()
urldecode question
How would I format this line of code properly?<?php echo urldecode($_GET['Title']); ?>
elseif help!
OK so I'm new to the site, as well as PHP altogether (Trying my hand at managing an online RPG) and so far it's been quite smooth. However whilst trying to change an aspect of the game from giving the
PHP hyperlinks generator
HiI need some help to get this done using php:1 - I have few hyperlinks say 500 in format like:<a href="http://domaina.com/1.html"
user validation always displaying invalid ? please help
Hello,I have 2 accounts and there is a field in mysql called validated it can be either "true" or "false"I tried writing a code so when the user logs in if the user is validated
value not going in data base
hello friends.... i am having a working javascript....when i am selecting any designation and refresh/validation problem the form is resetting the designation value and the
How would I do "Users not logged in since *** delete them"
I know how I would set this up, and delete the user roughly.I'll create a table called "Users Status" with ID, Username, date registered, and last logged in collumns. Last Logged in will be
help with image text
Hi ...see i need the text of the name and number to start in the center and always be in the center now with the code i have the text starts in the center and goes on to the rite it does not stay in
how to export excel file in same server
My first post - php newbie, so appreciate your support.I'm currently using headers to save web page as excel file.$filename="sms.xls";header("Pragma: public");header("Expires:
curl javascript problem
Hi Experts.I'm new curl and wanna to get some info from this http://www.amadeus.net/when user enter some city name,the page suggest a list and then user select one of them.then user click a button and
Pass sql into pl/sql and create RMAN duplicate script.
Hi,