MsKazza Posted November 11, 2011 Share Posted November 11, 2011 I created a form where people will upload their photos and then the form gets submitted to a process.php page. Before i added the photo upload script, it inserted the record and the whole process.php page worked great. Now i have added the photo upload script (Pure PHP Upload 2 by DMXZone.com) and the form action has changed and the values are not posting correctly to the process.php page. I have used this script lots of times before but always with the dreamweaver insert record, never using code i wrote myself. The Photos are uploading and a record is being created in the database however the record is emtpy. <?php require_once('ScriptLibrary/incPureUpload.php'); ?> <?php // Pure PHP Upload 2.1.3 if (isset($HTTP_GET_VARS['GP_upload'])) { $ppu = new pureFileUpload(); $ppu->path = "images/photos"; $ppu->extensions = ""; $ppu->formName = "books"; $ppu->storeType = "file"; $ppu->sizeLimit = ""; $ppu->nameConflict = "uniq"; $ppu->requireUpload = "true"; $ppu->minWidth = ""; $ppu->minHeight = ""; $ppu->maxWidth = ""; $ppu->maxHeight = ""; $ppu->saveWidth = ""; $ppu->saveHeight = ""; $ppu->timeout = "600"; $ppu->progressBar = "blueFlashProgress.htm"; $ppu->progressWidth = "500"; $ppu->progressHeight = "300"; $ppu->checkVersion("2.1.3"); $ppu->doUpload(); $uploadGoTo = "process.php"; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $uploadGoTo .= (strpos($uploadGoTo, '?')) ? "&" : "?"; $uploadGoTo .= $HTTP_SERVER_VARS['QUERY_STRING']; } header(sprintf("Location: %s", $uploadGoTo)); } $GP_uploadAction = $HTTP_SERVER_VARS['PHP_SELF']; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { if (!eregi("GP_upload=true", $HTTP_SERVER_VARS['QUERY_STRING'])) { $GP_uploadAction .= "?".$HTTP_SERVER_VARS['QUERY_STRING']."&GP_upload=true"; } else { $GP_uploadAction .= "?".$HTTP_SERVER_VARS['QUERY_STRING']; } } else { $GP_uploadAction .= "?"."GP_upload=true"; } if (isset($editFormAction)) { if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { if (!eregi("GP_upload=true", $HTTP_SERVER_VARS['QUERY_STRING'])) { $editFormAction .= "&GP_upload=true"; } } else { $editFormAction .= "?GP_upload=true"; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Digital Scribe Books</title> <link href="style.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } </script> <script language='javascript' src='ScriptLibrary/incPureUpload.js'></script> </head> <body onload="MM_preloadImages('images/buttons/home_over.png','images/buttons/books_over.png','images/buttons/cards_over.png','images/buttons/letters_over.png')"> <div id="snow"> <div id="wrapper"> <div id="header"> <div id="logo"><img src="images/digital_scripe.png" width="218" height="91" /></div> <div id="menu"><a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Home','','images/buttons/home_over.png',1)"><img src="images/buttons/home_act.png" name="Home" width="131" height="132" border="0" id="Home" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Books','','images/buttons/books_over.png',1)"><img src="images/buttons/books_act.png" name="Books" width="131" height="132" border="0" id="Books" /></a><a href="cards.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Cards','','images/buttons/cards_over.png',1)"><img src="images/buttons/cards_act.png" name="Cards" width="131" height="132" border="0" id="Cards" /></a><a href="letters.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Letters','','images/buttons/letters_over.png',1)"><img src="images/buttons/letters_act.png" name="Letters" width="131" height="132" border="0" id="Letters" /></a></div> </div> <div id="content"> <div id="info_bar"> <p>Send a personalised Christmas Card this year<br /> <img src="images/cards/SampleCard.png" width="120" height="104" /><br /> Available in packs of 10 or 20 from € including envelopes, p&p.</p> <p>Simply choose the style you would like on the inside of the card.</p> <p>Choose which pack you would like.<br /> </p> <p>Send us your drawing </p> <p>Your cards will be in the post with in 2-3 working days.</p> </div> <form action="<?php echo $GP_uploadAction; ?>" method="post" enctype="multipart/form-data" name="books" title="Santa_Book" onsubmit="checkFileUpload(this,'',true,'','','','','','','');showProgressWindow('blueFlashProgress.htm',500,300);return document.MM_returnValue"> <img src="images/book/Enter_your_details.png" width="400" height="60" /><br /> <ul id="inline_list"> <input type="text" name="first_name" id="first_name" value="Text to be displayed here" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"/> <label for="sur_name" class="inside">Name</label> <input name="sur_name" type="text" id="sur_name" class="inside" /> <label for="sname">Surname</label> <br /> Sex <select name="sex" id="sex"> <option selected="selected">Please Select....</option> <option value="girl">Girl</option> <option value="boy">Boy</option> </select> <label for="age">Age</label> <input type="text" name="age" id="age" /> <br /> <label for="house_no">House No.</label> <input type="text" name="house_no" id="house_no" /> <br /> <label for="street">Street Name</label> <input type="text" name="street" id="street" /> <br /> <label for="town">Town</label> <input type="text" name="town" id="town" /> <br /> <br /> <select name="bro_sis_cous_friend1" id="bro_sis_cous_friend1"> <option selected="selected">Please Select...</option> <option value="Brother1">Brother</option> <option value="Sister1">Sister</option> <option value="Cousin1">Cousin</option> <option value="Friend1">Friend</option> </select> <label for="bscf_name1">Friend / Sibling</label> <input type="text" name="bscf_name1" id="bscf_name1" /> <br /> <select name="Friend / Sibling"> <option>Please Select...</option> <option value="Brother2">Brother</option> <option value="Sister2">Sister</option> <option value="Cousin2">Cousin</option> <option value="Friend2">Friend</option> </select> <label for="bscf_name2">Friend / Sibling</label> <input type="text" name="bscf_name2" id="bscf_name2" /> <br /> <label for="from_name">This book is from...</label> <input type="text" name="from_name" id="from_name" /> <br /> <input name="photo" type="file" id="photo" onchange="checkOneFileUpload(this,'',true,'','','','','','','')" value="Upload Image" /> <br /> </ul> <br /> <button type="submit" name="card_submit" id="submit_button">Continue</button> </form> </div> <div id="footer" class="clear"><div id="sign"><div id="sign_text">Personalised<br /> Books</div> </div></div> </div></div> </body> </html> The dmxzone people said to change the method to get so i did and used : $first_name = mysql_real_escape_string(trim($_GET['first_name'])); to retrieve the records, still no joy, in fact it doesn't even go to the process.php page when i change it to get Any help much appreciated. Thanks, MsKazza Link to comment https://forums.phpfreaks.com/topic/250936-pure-php-upload-2-dmx-zone/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.