Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
newvisionjeff  
#1 Posted : Friday, August 10, 2007 1:47:30 PM(UTC)
newvisionjeff

Rank: Advanced Member

Groups: Member
Joined: 4/19/2006(UTC)
Posts: 42

Can someone take a look at this script and possibly tell me why the "form1" is not processed. Basically when the user hits the Send button to upload the files I want the additional form results sent to me.

Here is my code...

index.php

Code:
<!--BEGIN-->
<!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>
	<title>Aurigma Image Uploader</title>

	<script src="../iuembed.js" type="text/javascript"></script>
	<script src="../../SpryAssets/SpryCollapsiblePanel.js" type="text/javascript"></script>
	<script src="../../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
	<script src="../../SpryAssets/SpryValidationSelect.js" type="text/javascript"></script>

	
    <link rel="stylesheet" type="text/css" href="../Watermark/style.css">

	<script type="text/javascript">
//<![CDATA[


function ImageUploader_BeforeUpload(){
	//Use author name as a watermark. To do it, initialize the watermark string of Thumbnail1.
	//
	//NOTE: The quote character (') in watermark text should be replaced by doubled quote character (''). 
	//Otherwise Image Uploader will not be able to parse the watermark string. 
	getImageUploader("ImageUploader1").setUploadThumbnail1Watermark("opacity=100;size=30;text='" + 
		document.getElementById("Author").value.split("'").join("''") + "'");
}

iu.addEventListener("Progress", "ImageUploader_Progress");



//]]>
	</script>

    <link href="../../SpryAssets/SpryCollapsiblePanel.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
<!--
.style1 {font-size: 1.2em}
-->
    </style>
    <link href="../../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
    <link href="../../SpryAssets/SpryValidationSelect.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
<!--
.style4 {
	color: #0000FF
}
.style5 {
	font-size: x-small
}
-->
    </style>
</head>
<body>
<fieldset>
</fieldset>


<?php
   if ($_SERVER['REQUEST_METHOD'] != 'POST'){
      $me = $_SERVER['PHP_SELF'];
?>
<h1 align="center">Proof Order Form BETA</h1>
<form id="form1" name="form1" action="<?=$me?>">
   <table width="471" border="0" align="left" cellpadding="5" cellspacing="0">
   <tr>
         <td width="161" align="right" valign="middle">Your Order Name:</td>
         <td width="290"><input name="Name" type="text" size="40">         </td>
      </tr>
      <tr>
         <td align="right" valign="middle">Print Size:</td>
         <td><select name="size">
           <option>--Select Size--</option>
           <option value="3.5x5">3.5x5</option>
           <option value="4x5">4x5</option>
           <option value="4x6">4x6</option>
           <option value="5x5">5x5</option>
         </select>         </td>
      </tr>
      <tr>
         <td align="right" valign="middle">Options:</td>
         <td><select name="options[]" size="4" multiple id="options[]">
               <option value="magnifier" selected="selected">Magnifier</option>
               <option value="reducer">Reducer</option>
               <option value="timer">Timer</option>
               <option value="oscillator">Oscillator</option>
            </select>         </td>
      </tr>
      <tr>
         <td align="right" valign="middle">Border Style:<br />
           Default=FULL BLEED</td>
         <td><input type="radio" name="color" checked value="Style A">
            Style A<br>
            <input type="radio" name="color" value="Style B">
            Style B<br>
            <input type="radio" name="color" value="Style C">
            Style C</td>
            
      </tr>
      <tr>
         <td align="right" valign="top"> Notes to Lab:</td>
         <td><textarea name="MsgBody" cols="40" rows="6"></textarea>         </td>
      </tr>
      <tr>
         <td> </td>
        <td>&nbsp;</td>
      </tr>
   </table>
</form>
<?php
   } else {
      error_reporting(0);
      // initialize a array to 
      //hold any errors we encounter
      $errors = array();

      // test to see if the form was actually 
      // posted from our form
      // In testing, if you get an Inavlid referer error
      // comment out or remove the next three lines
      $page = $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
      if (!ereg($page, $_SERVER['HTTP_REFERER']))
         $errors[] = "Invalid referer";

      // check to see if a name was entered
      if (!$_POST['Name'])
         $errors[] = "Name is required";
      // if there are any errors, display them
      if (count($errors)>0) {
         foreach($errors as $err)
            echo "$err<br>\n";
         echo "<br>Please use your browser's Back button to fix.";
      } else {
         // no errors, so we build our message
         switch($_POST['color']){
            case 'red':
               $recipient = 'jmacdoug@optonline.net';
               break;
            case 'green':
               $recipient = 'jmacdoug@optonline.net';
               break;
            case 'blue':
               $recipient = 'jmacdoug@optonline.net';
               break;
            default:
               $recipient = 'jmacdoug@optonline.net';
         }
         $subject = "Widget On Line Order";
         $from = stripslashes($_POST['Name']);
         $msg = "Message sent by $from\n";
         $msg.="\nSize: ".$_POST['size'];
         $options=$_POST['options'];
         $msg.="\nOptions:";
         if ($options)
            for ($i=0;$i<count($options);$i++)
               $msg.= "\n- $options[$i]";
         else
            $msg.="\n- None";
         $msg.="\nColor: ".$_POST['color'];
         $extension=($_POST['extension'])?"Extension: Yes":"Extension: No";
         $wallmount=($_POST['wallmount'])?"Wallmount: Yes":"Wallmount: No";
         $deskmount=($_POST['deskmount'])?"Deskmount: Yes":"Deskmount: No";
         $msg.="\n$extension\n$wallmount\n$deskmount";
         $msg.="\n".stripslashes($_POST['MsgBody'])."\n";
         if (mail($recipient,$subject,$msg)){
            echo "<p>Thanks for your order!</p>";
            echo nl2br($msg);
         } else
            echo "An unknown error occurred.";
      }
   }
?>



<br />
		<br />

    	<script type="text/javascript">
//<![CDATA[
//Create JavaScript object that will embed Image Uploader to the page.
var iu = new ImageUploaderWriter("ImageUploader1", 400, 500);



//For ActiveX control full path to CAB file (including file name) should be specified.
iu.activeXControlCodeBase = "../ImageUploader4.cab";
iu.activeXControlVersion = "4,5,4,0";

//For Java applet only path to directory with JAR files should be specified (without file name).
iu.javaAppletCodeBase = "../";
iu.javaAppletCached = true;
iu.javaAppletVersion = "2.5.4.0";

iu.showNonemptyResponse = "off";

//Configure appearance and behaviour.
iu.addParam("PaneLayout", "OnePane");
iu.addParam("FolderView", "Details");
iu.addParam("UploadView", "Details");
iu.addParam("FolderPaneHeight", "220");
iu.addParam("ShowDebugWindow", "true");
iu.addParam("EnableRotate", "true");
iu.addParam("ShowDescriptions", "false");
iu.addParam("ShowUploadListButtons", "true");
iu.addParam("BackgroundColor", "#ffffff");
iu.addParam("LicenseKey", "5982-6335-7358-6463;6384-6750-7704-8144");
iu.addParam("LoadingFilesText", "Loading your proof files...be patient! Have some Coffee.");
iu.addParam("ShowButtons", "true");


//Configure upload settings.
iu.addParam("TimeOut", "3600000"); // This equals 1 hour
iu.addParam("FilesPerOnePackageCount", "1");
iu.addParam("AutoRecoverMaxTriesCount", "5");
iu.addParam("AutoRecoverTimeOut", "10000");
iu.addParam("MaxConnectionCount", "5");
iu.addParam("MaxFileCount", "0");
iu.addParam("AllowFolderUpload", "true");


//Configure Image Uploader to rotate photos automatically 
//according to the orientation stored in EXIF metadata.
iu.addParam("AllowAutoRotate", "true");

//Append the form with total file size to the upload.
iu.addParam("AdditionalFormName", "form1");

//Configure file mask to upload JPEG images only.
iu.addParam("FileMask", "*.jpg;*.jpeg;*.jpe;*.tif;*.tiff");


//Set image size restrictions.
iu.addParam("MinImageWidth", "1000");
iu.addParam("MinImageHeight", "1000");

//Exclude the source file from upload because only 
//resized versions of the photo will be sent.
iu.addParam("UploadSourceFile", "false");

//Configure settings of the optimized image. Optimized image
//is resized to 1200x1200 with JPEG quality = 100 and EXIF 
//metadata is preserved.
iu.addParam("UploadThumbnail1FitMode", "Fit");
iu.addParam("UploadThumbnail1Width", "1100");
iu.addParam("UploadThumbnail1Height", "1100");
iu.addParam("UploadThumbnail1JpegQuality", "100");
iu.addParam("UploadThumbnail1CopyExif", "true");

//Configure thumbnail settings.
iu.addParam("UploadThumbnail2FitMode", "Fit");
iu.addParam("UploadThumbnail2Width", "120");
iu.addParam("UploadThumbnail2Height", "120");
iu.addParam("UploadThumbnail2JpegQuality", "60");

//Configure URL files are uploaded to.
iu.addParam("Action", "upload.php");


//Configure URL where to redirect after upload.
//iu.addParam("RedirectUrl", "gallery.php");
//iu.addParam("RedirectUrl","gallery.php?author");


//Add event handler.
iu.addEventListener("BeforeUpload", "ImageUploader_BeforeUpload");





//Tell Image Uploader writer object to generate all necessary HTML code to embed
//Image Uploader to the page.
iu.writeHtml();
//]]>
var CollapsiblePanel1 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel1", {contentIsOpen:false});
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {validateOn:["change"], hint:"Enter your order name"});
var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {validateOn:["blur", "change"], invalidValue:"-1"});
var spryselect2 = new Spry.Widget.ValidationSelect("spryselect2", {validateOn:["change", "blur"], invalidValue:"-1"});
</script>
</fieldset>
</body>
</html>
<!--END-->

Edited by user Monday, December 17, 2007 7:27:41 PM(UTC)  | Reason: Not specified

Jeff MacDougall
New Vision Color Lab
www.newvisioncolorlab.com
www.modebook.com
Eugene Kosmin  
#2 Posted : Sunday, August 12, 2007 1:41:18 PM(UTC)
Eugene Kosmin

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 9/19/2006(UTC)
Posts: 505

Was thanked: 41 time(s) in 41 post(s)
Hello Jeff,

Sorry for a long delay… Please, check upload content once again through our helper scripts. I have tested your code (and form) with the latest IU (4.5.35 AX / 2.5.35 Java) available. In both cases form1 content was uploaded.

If form data will still absent in upload content, give us more information about your environment: OS, IE, Java versions, Java console dump and so on (How to make successful bug report).

Edited by user Saturday, February 23, 2008 2:43:06 AM(UTC)  | Reason: Not specified

Best regards,
Eugene Kosmin
The Aurigma Development Team
newvisionjeff  
#3 Posted : Wednesday, August 15, 2007 2:24:44 AM(UTC)
newvisionjeff

Rank: Advanced Member

Groups: Member
Joined: 4/19/2006(UTC)
Posts: 42

Hmmm, I am very green to this coding. I am ultimately trying to achieve the following. When the upload comlpetes I want the details of the upload (print size, border style, etc) emailed to the client. After the upload actually completes I would like the redirect page to displat the details to the user.

What do you think? I am desperate for help and I'm not really sure what the helper scripts will do for me.

I really appreciate your time.

Edited by user Saturday, February 23, 2008 2:42:55 AM(UTC)  | Reason: Not specified

Jeff MacDougall
New Vision Color Lab
www.newvisioncolorlab.com
www.modebook.com
Eugene Kosmin  
#4 Posted : Wednesday, August 15, 2007 1:33:41 PM(UTC)
Eugene Kosmin

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 9/19/2006(UTC)
Posts: 505

Was thanked: 41 time(s) in 41 post(s)
At least, using helper scripts you can localize the problem. Try to set upload action to ExtractFiles.aspx:
Code:
…
iu.addParam(“Action”, “ExtractFiles.aspx”);
…


After upload all POST content will be saved into Dumps/ExtractDump.txt. Open this file with text editor and check if there a form data. If it will be there, the problem is in server side script, otherwise – in client side.

Edited by user Saturday, February 23, 2008 2:42:42 AM(UTC)  | Reason: Not specified

Best regards,
Eugene Kosmin
The Aurigma Development Team
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.