carlg Posted December 14, 2007 Share Posted December 14, 2007 Is anyone aware of any IE issues that could be causing my problems. Everything works fine in FireFox. With IE (6 or 7) it seems like either the form is not getting submitted or there is a problem with the file upload. Here is some of my HTML <div class="piccontrol"> <div class="pctitle">Photo<?php print " " . $step; ?></div> <div class="photo"><img width="400" height="300" src="images/<?php print $filearray[$step]; ?>"></img></div> <div class="icontrol">Image File: <input type="file" name="img<?php print $step; ?>"></input></div> <div class="icontrol"> <span><input type="image" src="nj_savephoto.gif" name="save" value="Save Photo<?php print $step;?>"</span> <span><a href="<?php print $_SERVER['PHP_SELF'] . "?action=del" . $step . "&id=" . $id;?>"><img src="deletephoto.gif" border="0"></img></a></span> </div> </div> Here is the code that includes the above code $step = 1; include ("picuploadcontrol.php"); $step = 2; include ("picuploadcontrol.php"); $step = 3; include ("picuploadcontrol.php"); $step = 4; include ("picuploadcontrol.php"); $step = 5; include ("picuploadcontrol.php"); $step = 6; include ("picuploadcontrol.php"); Here is my code that processes the form input if ($_POST['save']=="Save Photo 1") { $newname = "images/" . $id . "_1.jpg"; move_uploaded_file($_FILES['img1']['tmp_name'], $newname); reSizePhoto ($newname); } if ($_POST['save'] == "Save Photo 2") { $newname = "images/" . $id . "_2.jpg"; move_uploaded_file($_FILES['img2']['tmp_name'], $newname); reSizePhoto ($newname); } if ($_POST['save'] == "Save Photo 3") { $newname = "images/" . $id . "_3.jpg"; move_uploaded_file($_FILES['img3']['tmp_name'], $newname); reSizePhoto ($newname); } if ($_POST['save'] == "Save Photo 4") { $newname = "images/" . $id . "_4.jpg"; move_uploaded_file($_FILES['img4']['tmp_name'], $newname); reSizePhoto ($newname); } if ($_POST['save'] == "Save Photo 5") { $newname = "images/" . $id . "_5.jpg"; move_uploaded_file($_FILES['img5']['tmp_name'], $newname); reSizePhoto ($newname); } if ($_POST['save'] == "Save Photo 6") { $newname = "images/" . $id . "_6.jpg"; move_uploaded_file($_FILES['img6']['tmp_name'], $newname); reSizePhoto ($newname); } It seems as if the $_POST is not coming thru on ie browsers. Your help is appreciated Thanks Carl Quote Link to comment Share on other sites More sharing options...
corbin Posted December 14, 2007 Share Posted December 14, 2007 You need a <form> tag, and you might also need a enctype="multipart/form-data" in that form tag. Quote Link to comment Share on other sites More sharing options...
carlg Posted December 14, 2007 Author Share Posted December 14, 2007 Sorry, I do have the form tag, i just did not include it in the post. I just put snippets in to make it less complex for posting purposes. Thanks Quote Link to comment Share on other sites More sharing options...
Xyphon Posted December 14, 2007 Share Posted December 14, 2007 Well, for submit, make it completely html. No php things like, making the value change to please wait, or something just a simple <input type='submit' value='Hi'> Quote Link to comment Share on other sites More sharing options...
carlg Posted December 14, 2007 Author Share Posted December 14, 2007 OK here's a more simple program that demonstrates the problem <link rel="stylesheet" type="text/css" href="area.css"> <?php print "the value is " . $_POST['save']; if (($_POST['save'] == "Save Photo 1")) { $newname = "images/newfile_1.jpg"; move_uploaded_file($_FILES['img1']['tmp_name'], $newname); } ?> <form action="<?php print $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data" method="POST"> <div class="piccontrol"> <div class="pctitle">Photo</div> <div class="photo"><img width="400" height="300" src="images/10_1>"></img></div> <div class="icontrol">Image File: <input type="file" name="img1"></input></div> <div class="icontrol"> <span><input type="image" src="savephoto.gif" name="save" value="Save Photo 1"</span> <span><a href="<?php print $_SERVER['PHP_SELF'] . "?action=del" . $step . "&id=1";?>"><img src="deletephoto.gif" border="0"></img></a></span> </div> </div> </form> This works fine in non MS browsers. In the IE browsers the $_POST['save'] variable does not get populated. I'm wondering if IE has a problem with the input type = image? Carl Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted December 14, 2007 Share Posted December 14, 2007 Read the following on how to properly use an image as a submit button - http://www.php.net/manual/en/faq.html.php#faq.html.form-image Quote Link to comment Share on other sites More sharing options...
corbin Posted December 14, 2007 Share Posted December 14, 2007 <span><input type="image" src="savephoto.gif" name="save" value="Save Photo 1"</span> Should be <span><input type="image" src="savephoto.gif" name="save" value="Save Photo 1" /></span> Quote Link to comment Share on other sites More sharing options...
carlg Posted December 15, 2007 Author Share Posted December 15, 2007 Thanks for everyone's help. The solution was in the link above. I needed to reference the variable as $_POST['save_x'] instead of $_POST['save'] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.