Hi Ken,
I thought I had this solved, but it turns out I'm still getting the same error. I believe that $fileguidlist is not getting set.
Here is the code I'm attempting to run:
- <?php require_once "phpuploader/include_phpuploader.php" ?>
- <?php session_start();
- set_error_handler("customError");
-
- function customError($errno, $errstr) {
- echo "<p><b>Error:</b> [$errno] $errstr</p>";
-
-
- }
-
- $fileguidlist=@$_POST['myuploader'];
-
- $firstname = $_POST['first-name'];
- $lastname = $_POST['last-name'];
- $companyname = $_POST['company-name'];
- $email = $_POST['email'];
- $phone = $_POST['phone'];
- $btn = $_POST['btn'];
- $message = $_POST['message'];
-
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>
- Form - Start uploading manually
- </title>
- <link href="demo.css" rel="stylesheet" type="text/css" />
-
- <script type="text/javascript">
- function doStart()
- {
- var uploadobj = document.getElementById('myuploader');
- if (uploadobj.getqueuecount() > 0)
- {
- uploadobj.startupload();
- }
-
- }
- </script>
-
- </head>
- <body>
-
- <?php if (!isset($firstname) || $firstname == false) { ?>
-
- <div class="demo">
- <h2>Start uploading manually</h2>
- <p>This sample demonstrates how to start uploading manually after file selection vs automatically.</p>
- <P>Allowed file types: <span style="color:red">jpg, gif, txt, png, zip</span></p>
-
-
- </form>
- <form id="ab-form" action="" class="awesome" method="post" >
- <p>* Required field</p>
- <fieldset>
- <div class="input">
- <label for="first-name" class="inlined">First Name*</label>
- <input class="input-text" id="first-name" name="first-name" type="text" required />
- </div>
- <div class="input">
- <label for="last-name" class="inlined">Last Name*</label>
- <input class="input-text" id="last-name" name="last-name" type="text" required />
- </div>
- <div class="input">
- <label for="company-name" class="inlined">Company Name*</label>
- <input class="input-text" id="company-name" name="company-name" type="text" required />
- </div>
- <div class="input">
- <label for="email" class="inlined">E-mail Address*</label>
- <input class="input-text" id="email" name="email" type="text" required />
- </div>
- <div class="input">
- <label for="btn" class="inlined">BTN*</label>
- <input class="input-text" id="btn" name="btn" type="text" required />
- </div>
- <div class="input">
- <label for="phone" class="inlined">Phone Number*</label>
- <input class="input-text" id="phone" name="phone" type="text" required />
- </div>
- </fieldset>
- <fieldset>
- <div class="file-upload">
- <?php
- $uploader=new PhpUploader();
- $uploader->MaxSizeKB=10240;
- $uploader->Name="myuploader";
- $uploader->InsertText="Select multiple files (Max 10M)";
- $uploader->AllowedFileExtensions="*.jpg,*.png,*.gif,*.txt,*.zip,*.rar";
- $uploader->MultipleFilesUpload=true;
- $uploader->ManualStartUpload=true;
- $uploader->Render();
- ?>
- <div class="instructions">
- <p>If you have multiple files, simply choose them one at a time using the Upload Documents button.</p>
- </div>
- </div>
- </fieldset>
- <fieldset>
- <div class="text-area">
- <label for="message" class="inlined">How can we help you?</label>
- <textarea class="input-textarea" id="message" name="message" >
-
-
- <div class="submit">
- <!-- <input type="image" src="/wp-content/themes/telegration/images/btn-submit.png" alt="Submit" value="submit" name="submit" onclick="doStart();return false;"> -->
- <button id="submitbutton" onclick="doStart();return false;">Start Uploading Files</button>
-
- </div>
-
-
-
- <!--?php } else {
- $uploader=new PhpUploader();
-
-
- echo "<p-->First Name: " . $firstname . "<p></p>";
- echo "<p>Last Name: " . $lastname . "</p>";
- echo "<p>Company Name: " . $companyname . "</p>";
- echo "<p>E-mail: " . $email . "</p>";
- echo "<p>Phone: " . $phone . "</p>";
- echo "<p>BTN: " . $btn . "</p>";
- echo "<p>Message: " . $message . "</p>";
-
-
- if($fileguidlist) {
- $guidlist=explode("/",$fileguidlist);
-
- echo("<div style="font-family:Fixedsys;">");
- echo("Uploaded ");
- echo(count($guidlist));
- echo(" files:");
- echo("</div>");
- echo("<hr>");
-
- foreach($guidlist as $fileguid)
- {
- $mvcfile=$uploader->GetUploadedFile($fileguid);
- if($mvcfile)
- {
- echo("<div>");
- echo("FileName: ");
- echo($mvcfile->FileName);
- echo("<br>FileSize: ");
- echo($mvcfile->FileSize." b");
- echo("<br>FilePath: ");
- echo($mvcfile->FilePath);
- echo("</div>");
-
-
-
-
- $mvcfile->CopyTo("D:/website_data/www.telegration.com/wp-content/uploads/files");
-
- $mvcfile->Delete();
- }
- }
- }
- }
-
- ?>
-
-
Can you see what I'm doing wrong?
Thanks!
Jack