Right now how i have it set up is that the upload script works the same with all 3 sections, but it needs to work separetly, so can you help me out with this in trying to get this upload script to work seperately within this form?
thanks
the page i am working on that you can take a look at is:
http://www.mcnealeyprinting.com/test/order.php
This is the code that i am working with, it is an html page with php as the upload script.
<!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=ISO-8859-1" />
<title>McNealy and Associates</title>
<link rel="stylesheet" href="mcNealy.css" />
<script src="utility.txt"></script>
Code: Select all
<script type="text/javascript">
<!--
// function switchDiv()
// this function takes the id of a div
// and calls the other functions required
// to show that div
//
function switchDiv(div_id)
{
var style_sheet = getStyleObject(div_id);
if (style_sheet)
{
hideAll();
changeObjectVisibility(div_id,"visible");
}
else
{
alert("sorry, this only works in browsers that do Dynamic HTML");
}
}
// function hideAll()
// hides a bunch of divs
//
function hideAll()
{
changeObjectVisibility("ez","hidden");
changeObjectVisibility("full","hidden");
changeObjectVisibility("superduper","hidden");
}
// function getStyleObject(string) -> returns style object
// given a string containing the id of an object
// the function returns the stylesheet of that object
// or false if it can't find a stylesheet. Handles
// cross-browser compatibility issues.
//
function getStyleObject(objectId) {
// checkW3C DOM, then MSIE 4, then NN 4.
//
if(document.getElementById && document.getElementById(objectId)) {
return document.getElementById(objectId).style;
}
else if (document.all && document.all(objectId)) {
return document.all(objectId).style;
}
else if (document.layers && document.layers[objectId]) {
return document.layers[objectId];
} else {
return false;
}
}
function changeObjectVisibility(objectId, newVisibility) {
// first get a reference to the cross-browser style object
// and make sure the object exists
var styleObject = getStyleObject(objectId);
if(styleObject) {
styleObject.visibility = newVisibility;
return true;
} else {
// we couldn't find the object, so we can't change its visibility
return false;
}
}
// -->
</script>
Code: Select all
</head>
<body>
<div id="centerPage">
<div id="whopper">
<div id="header"></div>
<div id="nav" class="nav" align="right"> <img src="images/shim.gif" border="0" height="5" width="1" /><br />
<a href="index.html">HOME</a> | <a href="about.html">ABOUT</a> | <a href="order.php">ORDER</a>
| <a href="services.html">SERVICES</a> | <a href="contact.php">CONTACT</a>
</div>
<div id="shadow"></div>
<div id="content">
<div id="pictures"> <img src="images/rollers.jpg" border="0" /><br />
<img src="images/dieCut.jpg" border="0" /><br />
<img src="images/blackPrinter.jpg" border="0" />
<div id="text" class="bodyText"> <span class="mainHead"><br>Order </span> <br />
<br />
<span class="smallText"> We offer a simple and convenient way to submit
your orders to us directly online. This process ensures that we obtain
the most complete information about you and your order. To order online,
please follow these steps:<br />
1. Collect all of your important files and documents (pictures, fonts,
PDFs, etc.) into one folder.<br />
2. Compress the folder using ZIP compression for Windows or SIT (Stuffit)
compression for Macintosh.<br />
3. Make sure that total size of the compressed file is 80 MB or less.
If it is larger than 80 MB, please send us a CD, DVD or ZIP disk, or arrange
for another method to deliver the files to us. <br />
<br />
When you have completed the steps above you are ready to order online...please
complete the form below </span>
<form name="the_form">
<font style="color:#3399FF">Choose One:</font>
<input type="radio" name="form_type" value="ez"
onClick="switchDiv('ez');">
Business Cards
<input type="radio" name="form_type" value="full"
onClick="switchDiv('full');">
Postcards
<input type="radio" name="form_type" value="full"
onClick="switchDiv('superduper');">
Other
</form>
<div id="ez" style="position:absolute;visibility:hidden;top:200px;left:5px;">
<form name="ez_form" method="POST"
action="http://64.175.14.218/cgi-bin/thanks.cgi"><br /><br>
<table>
<tr>
<td>Final Size:</td>
<td> <select name="final_size">
<option value="final_size">3.5" x 2"</option>
</select> </td>
<tr>
<tr>
<td>Print Type:</td>
<td> <select name="print_type">
<option value="print_type">--Select Print Type--</option>
<option value="1/0">1/0</option>
<option value="1/1">1/1</option>
<option value="2/0">2/0</option>
<option value="2/2">2/2</option>
</select> </td>
</tr>
<tr>
<td>Material:</td>
<td> <select name="material">
<option value="material">80PT Cover </option>
<option value="material">100 PT Cover</option>
<option value="material">10PT</option>
<option value="material">12 Pt. Covers C1S</option>
<option value="material">Field for Gloss and Non Gloss </option>
</select> </td>
</tr>
<tr>
<td>Gloss:</td>
<td> <select name="gloss">
<option value="gloss">Gloss</option>
<option value="gloss">Non-Gloss</option>
</select> </td>
</tr>
<tr>
<td>Type of Service:</td>
<td> <select name="material">
<option value="material">24 Hours</option>
<option value="material">48 Hours</option>
<option value="material">5 days</option>
</select> </td>
<tr>
<tr>
<td>Format:</td>
<td> <select name="format">
<option value="format">--Select Format--</option>
<option value="PDF">PDF</option>
<option value="photoshop">Photoshop</option>
<option value="illustrator">Illustrator</option>
<option value=".TIFF">.TIFF</option>
<option value=".EPS">.EPS</option>
<option value="quark">QuarkXpress</option>
<option value="indesign">Indesign</option>
<option value="corel_draw">Corel Draw</option>
</select> </td>
</tr>
<tr>
<td>Quantity:</td>
<td> <select name="quantity">
<option value="quantity">--Select Quantity--</option>
<option value="500">500</option>
<option value="1000">1000</option>
<option value="1500">1500</option>
<option value="2000">2000</option>
<option value="2500">2500</option>
<option value="3000">3000</option>
<option value="5000">5000</option>
</select> </td>
</tr>
<tr>
<td align="center" colspan="2"> <strong>Sub-Total:</strong> </td>
</tr>
<tr>
<td align="center" colspan="2"> <strong>Total:</strong> </td>
</tr>
</table>
<input type="submit" value="continue">
</form>
Code: Select all
<?php
// specify the directory where the uploaded file should end up
$path = 'upload/' ;
// specify the filetypes allowed
$allowed = array('image/gif','image/pjpeg','image/jpeg','image/png');
// specify the max filesize in bytes
$max_size = 200000;
if(isset($HTTP_POST_FILES['userfile']))
{
if(is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name']))
{
if($HTTP_POST_FILES['userfile']['size'] < $max_size)
{
if(in_array($HTTP_POST_FILES['userfile']['type'],$allowed))
{
if(!file_exists($path . $HTTP_POST_FILES['userfile']['name']))
{
if(@rename($HTTP_POST_FILES['userfile']['tmp_name'],$path.$HTTP_POST_FILES['userfile']['name']))
{
$html_output = 'Upload sucessful!<br>';
$html_output .= 'File Name: '.$HTTP_POST_FILES['userfile']['name'].'<br>';
$html_output .= 'File Size: '.$HTTP_POST_FILES['userfile']['size'].' bytes<br>';
$html_output .= 'File Type: '.$HTTP_POST_FILES['userfile']['type'].'<br><br>';
$html_output .= '<a href="order.php">Back to upload form</a>';
$image = $HTTP_POST_FILES['userfile']['name'] ;
}else{
$html_output = 'Upload failed!<br>';
if(!is_writeable($path))
{
$html_output = 'The Directory "'.$path.'" must be writeable!<br>';
$html_output .= '<a href="order.php">Back to upload form</a>';
}else{
$html_output = 'an unknown error ocurred.<br>';
$html_output .= '<a href="order.php">Back to upload form</a>';
}
}
}else{
$html_output = 'The file already exists<br>';
$html_output .= 'File Name: '.$HTTP_POST_FILES['userfile']['name'].'<br>';
$html_output .= '<a href="order.php">Back to upload form</a>';
}
}else{
$html_output = 'Wrong file type<br>';
$html_output .= '<a href="order.php">Back to upload form</a>';
}
}else{
$html_output = 'The file is too big<br>';
$html_output .= '<a href="order.php">Back to upload form</a>';
}
}
}else{
$html_output = '<TABLE BGCOLOR="#dcdcdc" BORDER="1" bordercolor="#000066" CELLSPACING="2" CELLPADDING="2" WIDTH="30%">';
$html_output .= '<tr><td align="center">';
$html_output .= '<strong><div align="center">Upload File!</div></strong>';
$html_output .= '<form method="post" enctype="multipart/form-data" action="'.$_SERVER['PHP_SELF'].'">';
$html_output .= '<input type="file" name="userfile"><br>';
$html_output .= '<input type="submit" value="upload">';
$html_output .= '</form>';
$html_output .= '</td></tr></table>';
}
echo $html_output;
?>
Code: Select all
</div>
<div id="full" style="position:absolute;visibility:hidden;top:200px;left:5px;">
<form name="full_form" method="POST"
action="http://64.175.14.218/cgi-bin/thanks.cgi"><br /><br>
<table>
<tr>
<td>Final Size:</td>
<td> <select name="final_size_post">
<option value="4x6">4" x 6"</option>
<option value="4x9">4" x 9"</option>
<option value="5x7">5" x 7"</option>
<option value="5.5x8.5">5.5" x 8.5"</option>
<option value="6x9">6" x 9"</option>
</select> </td>
<tr>
<tr>
<td>Print Type:</td>
<td> <select name="print_type">
<option value="print_type">--Select Print Type--</option>
<option value="4/0">4/0</option>
<option value="4/1">4/1 (black)</option>
<option value="4/4">4/4</option>
</select> </td>
</tr>
<tr>
<td>Material:</td>
<td> <select name="material">
<option value="material">10 Pt. Covers C1S</option>
<option value="material">10 Pt. Covers C2S</option>
<option value="material">12 Pt. Covers C2S</option>
</select> </td>
<tr>
<tr>
<td>Type of Service:</td>
<td> <select name="material">
<option value="material">24 Hours</option>
<option value="material">48 Hours</option>
<option value="material">5 days</option>
</select> </td>
<tr>
<tr>
<td>Format:</td>
<td> <select name="format">
<option value="format">--Select Format--</option>
<option value="PDF">PDF</option>
<option value="photoshop">Photoshop</option>
<option value="illustrator">Illustrator</option>
<option value=".TIFF">.TIFF</option>
<option value=".EPS">.EPS</option>
<option value="quark">QuarkXpress</option>
<option value="indesign">Indesign</option>
<option value="corel_draw">Corel Draw</option>
</select> </td>
</tr>
<tr>
<td>Quantity:</td>
<td> <select name="quantity">
<option value="quantity">--Select Quantity--</option>
<option value="500">500</option>
<option value="1000">1000</option>
<option value="1500">1500</option>
<option value="2000">2000</option>
<option value="2500">2500</option>
<option value="3000">3000</option>
<option value="5000">5000</option>
</select> </td>
</tr>
<tr>
<td align="center" colspan="2"> <strong>Sub-Total:</strong> </td>
</tr>
<tr>
<td align="center" colspan="2"> <strong>Total:</strong> </td>
</tr>
</table>
<input type="submit" value="continue">
</form>
Code: Select all
<?php
// specify the directory where the uploaded file should end up
$path2 = 'upload/' ;
// specify the filetypes allowed
$allowed2 = array('image/gif','image/pjpeg','image/jpeg','image/png');
// specify the max filesize in bytes
$max_size2 = 200000;
if(isset($HTTP_POST_FILES['userfile']))
{
if(is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name']))
{
if($HTTP_POST_FILES['userfile']['size'] < $max_size2)
{
if(in_array($HTTP_POST_FILES['userfile']['type'],$allowed2))
{
if(!file_exists($path2 . $HTTP_POST_FILES['userfile']['name']))
{
if(@rename($HTTP_POST_FILES['userfile']['tmp_name'],$path2.$HTTP_POST_FILES['userfile']['name']))
{
$html_output2 = 'Upload sucessful!<br>';
$html_output2 .= 'File Name: '.$HTTP_POST_FILES['userfile']['name'].'<br>';
$html_output2 .= 'File Size: '.$HTTP_POST_FILES['userfile']['size'].' bytes<br>';
$html_output2 .= 'File Type: '.$HTTP_POST_FILES['userfile']['type'].'<br><br>';
$html_output2 .= '<a href="order.php">Back to upload form</a>';
$image2 = $HTTP_POST_FILES['userfile']['name'] ;
}else{
$html_output2 = 'Upload failed!<br>';
if(!is_writeable($path2))
{
$html_output2 = 'The Directory "'.$path2.'" must be writeable!<br>';
$html_output2 .= '<a href="order.php">Back to upload form</a>';
}else{
$html_output2 = 'an unknown error ocurred.<br>';
$html_output2 .= '<a href="order.php">Back to upload form</a>';
}
}
}else{
$html_output2 = 'The file already exists<br>';
$html_output2 .= 'File Name: '.$HTTP_POST_FILES['userfile']['name'].'<br>';
$html_output2 .= '<a href="order.php">Back to upload form</a>';
}
}else{
$html_output2 = 'Wrong file type<br>';
$html_output2 .= '<a href="order.php">Back to upload form</a>';
}
}else{
$html_output2 = 'The file is too big<br>';
$html_output2 .= '<a href="order.php">Back to upload form</a>';
}
}
}else{
$html_output2 = '<TABLE BGCOLOR="#dcdcdc" BORDER="1" bordercolor="#000066" CELLSPACING="2" CELLPADDING="2" WIDTH="30%">';
$html_output2 .= '<tr><td align="center">';
$html_output2 .= '<strong><div align="center">Upload File!</div></strong>';
$html_output2 .= '<form method="post" enctype="multipart/form-data" action="'.$_SERVER['PHP_SELF'].'">';
$html_output2 .= '<input type="file" name="userfile"><br>';
$html_output2 .= '<input type="submit" value="upload">';
$html_output2 .= '</form>';
$html_output2 .= '</td></tr></table>';
}
echo $html_output2;
?>
Code: Select all
</div>
<div id="superduper" style="position:absolute;visibility:hidden;top:200px;left:5px;">
<form name="full_form" method="POST"
action="http://64.175.14.218/cgi-bin/thanks.cgi"><br /><br>
<table>
<tr>
<td>Final Size:</td>
<td> <select name="final_size_post">
<option value="5.5x8.5">5.5" x 8.5"</option>
<option value="6x9">6" x 9"</option>
<option value="7x10">7" x 10"</option>
<option value="8.5x11">8.5" x 11"</option>
<option value="9x12">9" x 12"</option>
<option value="9x16">9" x 16"</option>
<option value="11x17">11" x 17"</option>
<option value="17x12">17" x 12"</option>
</select> </td>
<tr>
<tr>
<td>Print Type:</td>
<td> <select name="print_type">
<option value="print_type">--Select Print Type--</option>
<option value="1/0">1/0</option>
<option value="1/1">1/1</option>
<option value="2/0">2/0</option>
<option value="2/2">2/2</option>
</select> </td>
</tr>
<tr>
<td>Material:</td>
<td> <select name="material">
<option value="material">70 lbs. text</option>
<option value="material">100 lbs. Cover</option>
<option value="material">10 PT</option>
</select> </td>
<tr>
<tr>
<td>Gloss:</td>
<td> <select name="gloss">
<option value="gloss">Gloss</option>
<option value="gloss">Non-Gloss</option>
</select> </td>
</tr>
<tr>
<td>Type of Service:</td>
<td> <select name="material">
<option value="material">24 Hours</option>
<option value="material">48 Hours</option>
<option value="material">5 days</option>
</select> </td>
<tr>
<tr>
<td>Format:</td>
<td> <select name="format">
<option value="format">--Select Format--</option>
<option value="PDF">PDF</option>
<option value="photoshop">Photoshop</option>
<option value="illustrator">Illustrator</option>
<option value=".TIFF">.TIFF</option>
<option value=".EPS">.EPS</option>
<option value="quark">QuarkXpress</option>
<option value="indesign">Indesign</option>
<option value="corel_draw">Corel Draw</option>
</select> </td>
</tr>
<tr>
<td>Quantity:</td>
<td> <select name="quantity">
<option value="quantity">--Select Quantity--</option>
<option value="500">500</option>
<option value="1000">1000</option>
<option value="1500">1500</option>
<option value="2000">2000</option>
<option value="2500">2500</option>
<option value="3000">3000</option>
<option value="5000">5000</option>
</select> </td>
</tr>
<tr>
<td align="center" colspan="2"> <strong>Sub-Total:</strong> </td>
</tr>
<tr>
<td align="center" colspan="2"> <strong>Total:</strong> </td>
</tr>
</table>
<input type="submit" value="continue">
</form>
Code: Select all
<?php
// specify the directory where the uploaded file should end up
$path3 = 'upload/' ;
// specify the filetypes allowed
$allowed3 = array('image/gif','image/pjpeg','image/jpeg','image/png');
// specify the max filesize in bytes
$max_size3 = 200000;
if(isset($HTTP_POST_FILES['userfile']))
{
if(is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name']))
{
if($HTTP_POST_FILES['userfile']['size'] < $max_size3)
{
if(in_array($HTTP_POST_FILES['userfile']['type'],$allowed3))
{
if(!file_exists($path3 . $HTTP_POST_FILES['userfile']['name']))
{
if(@rename($HTTP_POST_FILES['userfile']['tmp_name'],$path2.$HTTP_POST_FILES['userfile']['name']))
{
$html_output3 = 'Upload sucessful!<br>';
$html_output3 .= 'File Name: '.$HTTP_POST_FILES['userfile']['name'].'<br>';
$html_output3 .= 'File Size: '.$HTTP_POST_FILES['userfile']['size'].' bytes<br>';
$html_output3 .= 'File Type: '.$HTTP_POST_FILES['userfile']['type'].'<br><br>';
$html_output3 .= '<a href="order.php">Back to upload form</a>';
$image3 = $HTTP_POST_FILES['userfile']['name'] ;
}else{
$html_output3 = 'Upload failed!<br>';
if(!is_writeable($path3))
{
$html_output3 = 'The Directory "'.$path3.'" must be writeable!<br>';
$html_output3 .= '<a href="order.php">Back to upload form</a>';
}else{
$html_output3 = 'an unknown error ocurred.<br>';
$html_output3 .= '<a href="order.php">Back to upload form</a>';
}
}
}else{
$html_output3 = 'The file already exists<br>';
$html_output3 .= 'File Name: '.$HTTP_POST_FILES['userfile']['name'].'<br>';
$html_output3 .= '<a href="order.php">Back to upload form</a>';
}
}else{
$html_output3 = 'Wrong file type<br>';
$html_output3 .= '<a href="order.php">Back to upload form</a>';
}
}else{
$html_output3 = 'The file is too big<br>';
$html_output3 .= '<a href="order.php">Back to upload form</a>';
}
}
}else{
$html_output3 = '<TABLE BGCOLOR="#dcdcdc" BORDER="1" bordercolor="#000066" CELLSPACING="2" CELLPADDING="2" WIDTH="30%">';
$html_output3 .= '<tr><td align="center">';
$html_output3 .= '<strong><div align="center">Upload File!</div></strong>';
$html_output3 .= '<form method="post" enctype="multipart/form-data" action="'.$_SERVER['PHP_SELF'].'">';
$html_output3 .= '<input type="file" name="userfile"><br>';
$html_output3 .= '<input type="submit" value="upload">';
$html_output3 .= '</form>';
$html_output3 .= '</td></tr></table>';
}
echo $html_output3;
?>
Code: Select all
</div>
</div>
<br>
<br><br><br> <br><br><br> <br><br><br> <br><br><br>
<table cellpadding="10" cellspacing="10" width="750">
<tr>
<td valign="top"><img src="images/3x2.jpg" /></td>
<td valign="top"> <span class="bodyText"> How to Create Bleeds<br>
To create bleeds, make your document larger than the final CUT SIZE.
We require that you make your document 0.125" larger on all four sides,
therefore, the size with bleeds will be 0.25" larger than the final
cut size in both dimensions. For example, if you are printing a postcard
with a final cut size of 4" x 6", then the size with bleeds (BLEED
SIZE) will be 4.25" x 6.25". <br>
<br>
The best way to design keeping bleeds in mind is to make use of visual
guides found in most graphics programs. Start by making your document
size equal to the BLEED SIZE (for a 4" x 6" postcard, make it 4.25"
x 6.25"). Now place guides 0.125" in from these edges, all the way
around. These guides are where the document/card will be cut (CUT
EDGE). Anything you want to bleed off the edge of the card must extend
past your guides out to the BLEED EDGE. If photos and backgrounds
do not extend past these guides, (if they do not bleed), white may
show around the edges when we cut the cards, due to slight movement
during the cutting process. <a href="http://www.impressionsinprint.ca/bleedpicture.html">http://www.impressionsinprint.ca/bleedpicture.html</a>
<br>
<br>
</span> </td>
</tr>
</table>
<!--end text-->
</div>
<!--end content--><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br> <br><br><br> <br>
<div id="footer" class="footerText" align="center"> <img src="images/shim.gif" border="0" height="3" width="1" /><br />
McNealey & Associates, Inc. Copyright 2006 | Developed by <a href="http://www.vextrum.com" target="_blank">Vextrum
Studios</a> </div>
</div>
<!--end whopper-->
</div>
<!--end centerpage-->
</body>
</html>