dc_jt Posted November 3, 2006 Share Posted November 3, 2006 HiI have a form which contains fields such as name, email, photo etc.If someone does not enter a required field such as a name or email then they are returned back to the form with the error messages displayed.When the form is refreshed, every input they entered is still there by using [quote]<H4><input name="email" type="text" value="<?=htmlentities(stripslashes($_POST['email']))?>" SIZE=50/>[/quote] for example.The only one that doesnt is the photo field. Any idea how to keep hold of the photo input field when the form is refreshed?Below is the code for my formThanks[quote]<form enctype="multipart/form-data" action="<?=$_SERVER['PHP_SELF']?>" method="post"></center><BLOCKQUOTE><center><P><TABLE BORDER=0 CELLSPACING=0><TR><TD WIDTH=116><H4>Name:</H4></TD><TD><H4><input name="name" type="text" value="<?=htmlentities(stripslashes($_POST['name']))?>" SIZE=50/> <br class="clear"/></H4></TD></TR><TR><TD WIDTH=116><H4>Address:</H4></TD><TD><H4><input name="address1" type="text" value="<?=htmlentities(stripslashes($_POST['address1']))?>" SIZE=50/> <br class="clear"/></TD></TR><TR><TD WIDTH=116><H4>Town:</H4></TD><TD><H4><input name="town" type="text" value="<?=htmlentities(stripslashes($_POST['town']))?>" SIZE=50/> <br class="clear"/></TD></TR><TR><TD WIDTH=116><H4>City:</H4></TD><TD><H4><input name="city" type="text" value="<?=htmlentities(stripslashes($_POST['city']))?>" SIZE=50/> <br class="clear"/></TD></TR><TR><TD WIDTH=116><H4>Post Code/Zip Code:</H4></TD><TD><H4><input name="postcode" type="text" value="<?=htmlentities(stripslashes($_POST['postcode']))?>"/></H4> <br class="clear"/></TD></TR><TR><TD WIDTH=116><H4>Country:</H4></TD><TD><H4><select name="country"> <option value="United Kingdom">United Kingdom</option> <option value="United States of America">United States of America</option> <option value="Spain">Spain</option> <option value="Italy">Italy</option> </select><TR><TD WIDTH=116><H4>Email Address:</H4></TD><TD><H4><input name="email" type="text" value="<?=htmlentities(stripslashes($_POST['email']))?>" SIZE=50/> <br class="clear"/></H4></TD></TR><TR><TD WIDTH=210><H4>I agree to grant a license for you to use my text/photograph</H4></TD><TD><H4><input name="license" type="checkbox" id="license" value="1" <?=($_POST['license'] == '1')?' checked="checked"':''?>/></H4><TR><TD WIDTH=116><H4>Photo:</H4></TD><TD><H4><input type="file" name="photo" ></H4><br class="clear"/></H4></TD></TR><TR><TD WIDTH=116><H4>Memory:</H4></TD><TD><H4><textarea name="memory" rows=6 cols=40 id="memory"><?=($_POST['memory'])?></textarea></textarea></H4></TD></TR><TR><TD WIDTH=210><H4>Data Protection:</H4></TD><TD><H4><input name="datap" type="checkbox" id="datap" value="1" <?=($_POST['datap'] == '1')?' checked="checked"':''?>/></H4> <br class="clear"/><input type="Submit" name="submit" value="Submit" class="button"/> <input type="hidden" name="mode" value="apply" /><?php }//end else?>[/quote] Link to comment https://forums.phpfreaks.com/topic/26037-holding-photo-input-in-form/ Share on other sites More sharing options...
dc_jt Posted November 3, 2006 Author Share Posted November 3, 2006 anyone? Link to comment https://forums.phpfreaks.com/topic/26037-holding-photo-input-in-form/#findComment-119031 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.