Hi
I have a php page that allows the user to browse to a file (image) then sumbit, the confirmation page then has the following code which uploads the said file to the hosting server, but also appends a unique number (WOref) to the file name and saves some other information to a MYSQL database. It also confirms the upload by showing a preview of the image. What I want is to allow at the browse for file stage, for it to select more than one file, and then upload those files using the same principles below. Any ideas?
Extract from Initial page with file browse button and area:
<input type="file" name="photo">
Extract from Confirmation page of the code which uploads file etc:
<?php
//This gets all the other information from the form
$name=$_POST['WOref'];
$pic=($_FILES['photo']['name']);
//This is the directory where images will be saved
$target = "uploads/";
$target = $target .$name. basename( $_FILES['photo']['name']);
mysql_query("INSERT INTO `attachments` VALUES ('$name','$pic','$target',current_timestamp)") ;
//Writes the photo to the server
if(move_uploaded_file($_FILES['photo']['tmp_name'], $target))
{
//Tells you if its all ok
echo "The file " .$pic. basename($_FILES['uploadedfile']['name']). " has been uploaded, and your information has been added to the directory";
}
else {
//Gives and error if its not
echo "Sorry, there was a problem uploading your file.";
}
?>
<?php chmod( $target , 0644 );?>
<img src="<?php print $target; ?>">
Many many thanks.
Calculus Help (and by help I mean homework)
Hrmmm, I hate posting about math homework, partly because it's homework, and partly because I hate whenever I can't figure out math myself.Yes, I realize this is an extremely long post. Feel free to
Click counter to ignore traffic from search bots
I have a click counter on my site that...well, counts the number of clicks a link gets on the frontpage. It's a good system, but it's got a few flaws, an example being that it counts
mysql UNION | warning mysql_fetch_array !!
Code: <?php $i = 0; $query1="SELECT * FROM `products` WHERE `division`='$f_usr_div' ORDER BY `pname` UNION SELECT `stock_close` FROM `stockiest_entry` WHERE
Query failed issue with php script but works fine in mssql manager!
hi i have the script below which copies data from one table to another but will only insert new data update current data or delete old data from tempproducts to products then it will delete the
Rss feed question
HiMy blog and my website are different. Am i able to take my rss feed from my blog and place it on the index page of my site using php and how to I do it (do I need soap)?
Install page
How do I make it so when a user submits information on the Install page, it'll right it into the correct file. I can do the forms and $_POST, but I need it so that it actually works.Current stuff in
Display last record first.
I need some help how put the last record first and first record last.ThanksCode: <?phpinclude("connect.php");$query="SELECT * FROM MyNotes ";$result=mysql_query($query);$num
date("now") prints out wrong date ?
Hi GuysAnyone know why and how I can fix it ?
PHP and XML image gallery variable issue
I'm trying to display the large image on the same page as the thumbnails, to do that I'm passing a variable called $current. I know that the code to display large image works, because it works when no
sql error
I have been looking at this code for 20mins and can't work out what I am doing wrong. There is something wrong with my sql statement below is the error and the code. what I am trying to do is to edit