Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
| Search | Today's Posts | Mark Forums Read
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 29th, 2006, 05:18 PM
Authorized User
 
Join Date: Mar 2005
Location: arima, West Indies, Trinidad and Tobago.
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to arimakidd
Default Problem with move_uploaded_file

I am having a problem with using the move_uploaded_file. I prefer to use this as I can send the image to a folder. I am creating web page where you can submit text and and image in a form and then it will be displayed. Thus the reason for using move_uploaded_file, I can send the image to the images folder and easily retrieve it. The problem is, you must specify a destination and filename. So when you call the function or object, not sure which it is, for the second time, the first image gets overwritten cause the name of the file in the destination is the same. What do I do so that I can repeatedly use the page without overwriting images. The page that processes the form is:
Code:
$file = '\images\some.gif';
  print("<pre>\n");
  move_uploaded_file($_FILES['img_pic']['tmp_name'], $file);
  print("File uploaded: ".$file."\n");
  print("</pre>\n");
As you can see I am in the testing phase.

 
Old October 29th, 2006, 09:49 PM
Authorized User
 
Join Date: Mar 2005
Location: arima, West Indies, Trinidad and Tobago.
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to arimakidd
Default

This problem has been sweetly solved. WROX BOOKS ARE THE BEST. Chapter 7, Beginning PHP5, Apahce, MySQL Web Development. Excellent work.









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.