Multiple image upload problem

images php coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Post by ruturajv » Mon Apr 04, 2005 8:09 pm

$picture1 = $_POST['$stFile'];
$picture2 = $_POST['$stFile'];
$picture3 = $_POST['$stFile'];
$picture4 = $_POST['$stFile'];

I don't understand this....
there is a problem with this part of code,

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Post by Alexej Kubarev » Tue Apr 05, 2005 4:11 am

you must have different field names or something for each of your pictures..

in this case all four varibles:
$picture1 = $_POST['$stFile'];
$picture2 = $_POST['$stFile'];
$picture3 = $_POST['$stFile'];
$picture4 = $_POST['$stFile'];

will get the same final value... i would use an array $puctures
and do it in a loop $pictures[$i] = $_POST[$stFile]; while $stFile changes and $i increases...
Last edited by Alexej Kubarev on Tue Apr 05, 2005 3:44 pm, edited 1 time in total.

User avatar
swirlee
Moderator
Moderator
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Post by swirlee » Tue Apr 05, 2005 9:24 am

ruturajv wrote:
$picture1 = $_POST['$stFile'];
$picture2 = $_POST['$stFile'];
$picture3 = $_POST['$stFile'];
$picture4 = $_POST['$stFile'];

I don't understand this....
there is a problem with this part of code,


The problem is that variables are not expanded inside single-quotes. The correct way to do this is thus:

Code: Select all

$picture1 = $_POST[$stFile];
$picture2 = $_POST[$stFile];
$picture3 = $_POST[$stFile];
$picture4 = $_POST[$stFile];

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest