Jump to content

Got a problem with my order page :(


promotaprint

Recommended Posts

If you cant see your errors we wont be able to..

put

error_reporting(E_ALL);
ini_set('display_errors',1);

at the top of your page and let us know if an error occurs..

 

If no errors show up a little code might help..

 

Sorry, shall i just upload a screen shot for you or u can put in a dummy order in if you like and that will bring the error up.

 

sorry

Link to comment
Share on other sites

We need to see the code on these lines

Warning: fopen() [function.fopen]: Filename cannot be empty in /home/a4013984/public_html/order/silverstreak-order.htm on line 211

 

Warning: fread(): supplied argument is not a valid stream resource in /home/a4013984/public_html/order/silverstreak-order.htm on line 213

 

Warning: fclose(): supplied argument is not a valid stream resource in /home/a4013984/public_html/order/silverstreak-order.htm on line 219

Link to comment
Share on other sites

We need to see the code on these lines

Warning: fopen() [function.fopen]: Filename cannot be empty in /home/a4013984/public_html/order/silverstreak-order.htm on line 211

 

Warning: fread(): supplied argument is not a valid stream resource in /home/a4013984/public_html/order/silverstreak-order.htm on line 213

 

Warning: fclose(): supplied argument is not a valid stream resource in /home/a4013984/public_html/order/silverstreak-order.htm on line 219

 

$file = fopen($FILE_UPLOADS_DIR.$new_filename,'rb');

while($dat = fread($file,1025657)){

$attachment_data .= $dat;

}

fclose($file);

Link to comment
Share on other sites

You need to look through all of your code to find where they are set..

It will look something like this..

$FILE_UPLOADS_DIR = '......';

 

I cant find it...

 

/*********************************************************

	This Free Script was downloaded at			

	Free-php-Scripts.net (HelpPHP.net)			

This script is produced under the LGPL license		

	Which is included with your download.			

Not like you are going to read it, but it mostly	

States that you are free to do whatever you want	

		With this script!						

	NOTE: Linkback is not required, 

but its more of a show of appreciation to us.					

*********************************************************/



//Include configuration file and function file

//(default location is in the same directory)

include_once('config.php');

include_once('functions.php');



//If contact is being sent:

if($_POST['submit_id'] == 1){

//Check name entered

if($_POST['name'] == NULL){ $message = 'Please enter your name.';}



//check if email is enetered

if($message == NULL && is_valid_email($_POST['email']) == false ){ $message = 'Please enter a valid email.';}



//check if message is entered

if($_POST['quantity'] == NULL && $message == NULL){ $message = 'Please enter a quantity.';}	



//File Upload checks

if($message == NULL && $FILE_UPLOAD == 1 && $_FILES['user_file']['name'] != NULL){

	if($_FILES['user_file']['size'] > (($FILE_UPLOAD_MAX*1024)*1024)){ $message = 'File is over '.$FILE_UPLOAD_MAX.' MB in size.';}

	if($message == NULL && allowed_ext($FILE_UPLOADS_EXT,$_FILES['user_file']['name']) == false){$message = 'Invalid extension.';}

	$new_filename = date("G_i_s_").$_FILES['user_file']['name'];

}



//Image verificaiton checks

if($message == NULL && $IMAGE_VERIFICATION == 1){

	$te_co = hex2bin($_POST['hid_code']);

	$word_is = RC4($te_co,$IMAGE_VER_CODE);

	if($word_is != $_POST['confirm_image']){$message = 'Your verfication code is incorrect.';}

}

//End verifications, start processing

if($message == NULL){

	//Check if file upload is needed

	if($FILE_UPLOAD == 2 && $_FILES['user_file']['name'] != NULL){

		//Store file for keep and email

		move_uploaded_file($_FILES['user_file']['tmp_name'],$FILE_UPLOADS_DIR.$new_filename);

	}

	//compose admin/user message templates replaces

	$do_search = array('$+name+$','$+email+$','number','inaddress','$disaddress','$+quantity+$','$+pen+$','$+sides+$','$+pencolour+$','$+printcolour+$','$+printcolour2+$','$+text1+$','$+text2+$');

	$do_replace = array($_POST['name'],$_POST['email'],$_POST['number'],$_POST['inaddress'],$_POST['disaddress'],$_POST['quantity'],$_POST['pen'],$_POST['sides'],$_POST['pencolour'],$_POST['printcolour'] ,$_POST['printcolour2'],$_POST['text1'],$_POST['text2']);





	//Send user email?

	if($SEND_THANKS == 1){

		$user_message = str_replace($do_search,$do_replace,$USER_TEMPLATE);

		//Set Headers

		$user_header = "Return-Path: ".$EMAIL_OPTIONS['TITLE']." <".$EMAIL_OPTIONS['FROM'].">\r\n"; 

		$user_header .= "From: ".$EMAIL_OPTIONS['TITLE']." <".$EMAIL_OPTIONS['FROM'].">\r\n";

		$user_header .= "Content-Type: ".$EMAIL_OPTIONS['TYPE']."; charset=".$EMAIL_OPTIONS['CHARSET'].";\n\n\r\n"; 

		//Send Thank you

		mail ($_POST['email'],$EMAIL_OPTIONS['USER_SUBJECT'],$user_message,$user_header);	

	}



	//Send admi email?

	if(count($ADMIN_EMAILS) > 0){

		$admin_message = str_replace($do_search,$do_replace,$ADMIN_TEMPLATE);

		//Do we need to send file as attachment?

		if($FILE_DO != 1){

			//Get file attriubtes

			$fileatt_type = $_FILES['user_file']['type'];



			$file = fopen($FILE_UPLOADS_DIR.$new_filename,'rb');

			while($dat = fread($file,1025657)){

				$attachment_data .= $dat;

			}

			fclose($file);



			// Encode file content

			$attachment_data = chunk_split(base64_encode($attachment_data));

			//File upload headers

			$semi_rand = md5(time());

			$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; 



			$headers = "From: ".$EMAIL_OPTIONS['TITLE']." <".$EMAIL_OPTIONS['FROM'].">";



			// Add the headers for a file attachment

			$headers .= "\nMIME-Version: 1.0\n" .

				"Content-Type: multipart/mixed;\n" .

				" boundary=\"{$mime_boundary}\"";						



			  // Add a multipart boundary above the plain message

			$new_message = "This is a multi-part message in MIME format.\n\n" .

				"--{$mime_boundary}\n" .

				"Content-Type: ".$EMAIL_OPTIONS['TYPE']."; charset=\"".$EMAIL_OPTIONS['CHARSET']."\"\n" .

				"Content-Transfer-Encoding: 7bit\n\n" .

				$admin_message . "\n\n";

		   			

			  // Add file attachment to the message

			 $new_message .= "--{$mime_boundary}\n" .

	             "Content-Type: {$fileatt_type};\n" .

	             " name=\"{$new_filename}\"\n" .

	             "Content-Disposition: attachment;\n" .

	             " filename=\"{$new_filename}\"\n" .

	             "Content-Transfer-Encoding: base64\n\n" .

	             $attachment_data . "\n\n" .

	             "--{$mime_boundary}--\n"; 



			unset($attachment_data);

		} else {

			//regular headers

			$headers = "Return-Path: ".$EMAIL_OPTIONS['TITLE']." <".$EMAIL_OPTIONS['FROM'].">\r\n"; 

			$headers .= "From: ".$EMAIL_OPTIONS['TITLE']." <".$EMAIL_OPTIONS['FROM'].">\r\n";

			$headers .= "Content-Type: ".$EMAIL_OPTIONS['TYPE']."; charset=".$EMAIL_OPTIONS['CHARSET'].";\n\n\r\n"; 

			$new_message = $admin_message;

		}

		//Send admin emails

		foreach($ADMIN_EMAILS as $this_email){

			mail ($this_email,$EMAIL_OPTIONS['USER_SUBJECT'],$new_message,$headers);	

		}

	}



	//Remove file if not needed

	if($FILE_DO == 2){

		unlink($FILE_UPLOADS_DIR.$new_filename);

	}

	$message = 'Your order has been sent, thank you.';

	$_POST = NULL;

}

}

if($message != NULL){

?>

<table width="90%"  border="0" cellpadding="5" cellspacing="0" bgcolor="#FF8080">

  <tr>

    <td bgcolor="#cd0505"><font color="#FFFFFF"><?=$message;?></font></td>

  </tr>

</table>

<br/>

<?php } ?>

<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data" name="contact" id="contact" style="display:inline;">

<table width="100%"  border="0" align="left" cellpadding="5" cellspacing="0">

<tr>

  <td>Name:</td>

	<td><input name="name" type="text" id="name" value="<?php echo $_POST['name'];?>"></td>

</tr>

<tr>	

  <td>Contact Number:</td>

	<td><textarea name="number" cols="13" rows="1" id="number"><?php echo $_POST['number'];?></textarea></td>

</tr>

<tr>	

  <td>Invoice Address:</td>

	<td><textarea name="inaddress" cols="40" rows="5" id="inaddress"><?php echo $_POST['inaddress'];?></textarea></td>

</tr>


<tr>	

  <td>Dispatch Address<br>
  <span class="style3">(If Different To<br>
   Invoice Address)</span>:</td>

	<td><textarea name="disaddress" cols="40" rows="5" id="disaddress"><?php echo $_POST['disaddress'];?></textarea></td>

</tr>

<tr>

  <td>Email:</td>

	<td><input name="email" type="text" id="email" value="<?php echo $_POST['email'];?>"></td>

</tr>

<tr>

  <td>Pen: </td>

	<td><select name="pen" id="pen" style="width:154px;">

	<?php if($_POST['pen'] == 'Silver Streak' || $_POST['pen'] == NULL){ $sel = ' selected';} else { $sel = NULL;} ?>

	<option value="Silver Streak"<?=$sel;?>>Silver Streak</option>


  </select></td>

</tr>

	<tr>

  <td>Pen Colour: </td>

	<td><select name="pencolour" id="pencolour" style="width:154px;">

	<?php if($_POST['pencolour'] == 'Black' || $_POST['pencolour'] == NULL){ $sel = ' selected';} else { $sel = NULL;} ?>

	<option value="Black"<?=$sel;?>>Black</option>

	<?php if($_POST['pencolour'] == 'Burgundy' || $_POST['pencolour'] == NULL){ $sel = ' selected';} else { $sel = NULL;} ?>

	<option value="Burgundy"<?=$sel;?>>Burgundy</option>

	<?php if($_POST['pencolour'] == 'Light Grey' || $_POST['pencolour'] == NULL){ $sel = ' selected';} else { $sel = NULL;} ?>

	<option value="Light Grey"<?=$sel;?>>Light Grey</option>

	<?php if($_POST['pencolour'] == 'Dark Grey' || $_POST['pencolour'] == NULL){ $sel = ' selected';} else { $sel = NULL;} ?>

	<option value="Dark Grey"<?=$sel;?>>Dark Grey</option>


  </select></td>

</tr>

		<tr>

  <td>No. Sides Printed: </td>

	<td><select name="sides" id="sides" style="width:154px;">

	<?php if($_POST['sides'] == '1' || $_POST['sides'] == NULL){ $sel = ' selected';} else { $sel = NULL;} ?>

	<option value="1"<?=$sel;?>>1</option>

	<?php if($_POST['sides'] == '2' || $_POST['sides'] == NULL){ $sel = ' selected';} else { $sel = NULL;} ?>

	<option value="2"<?=$sel;?>>2</option>

  </select></td>

</tr>


<tr>

  <td>Print Colour 1: </td>

	<td><select name="printcolour" id="printcolour" style="width:154px;">

	<?php if($_POST['printcolour'] == 'Black' || $_POST['printcolour'] == NULL){ $sel = ' selected';} else { $sel = NULL;} ?>

	<option value="Black"<?=$sel;?>>Black</option>

	<?php if($_POST['printcolour'] == 'Blue' || $_POST['printcolour'] == NULL){ $sel = ' selected';} else { $sel = NULL;} ?>

	<option value="Blue"<?=$sel;?>>Blue</option>

	<?php if($_POST['printcolour'] == 'Red' || $_POST['printcolour'] == NULL){ $sel = ' selected';} else { $sel = NULL;} ?>

	<option value="Red"<?=$sel;?>>Red</option>


  </select></td>

</tr>

<tr>

  <td>Print Colour 2: </td>

	<td><select name="printcolour2" id="printcolour2" style="width:154px;">

	<?php if($_POST['printcolour2'] == 'Black' || $_POST['printcolour2'] == NULL){ $sel = ' selected';} else { $sel = NULL;} ?>

	<option value="Black"<?=$sel;?>>Black</option>

	<?php if($_POST['printcolour2'] == 'Blue' || $_POST['printcolour2'] == NULL){ $sel = ' selected';} else { $sel = NULL;} ?>

	<option value="Blue"<?=$sel;?>>Blue</option>

	<?php if($_POST['printcolour2'] == 'Red' || $_POST['printcolour2'] == NULL){ $sel = ' selected';} else { $sel = NULL;} ?>

	<option value="Red"<?=$sel;?>>Red</option>


  </select></td>

</tr>

<tr>	

  <td>Text To Be Printed<br>
  On Side 1*:</td>

	<td><textarea name="text1" cols="35" rows="2" id="text1"><?php echo $_POST['text1'];?></textarea></td>

</tr>

<tr>	

  <td>Text To Be Printed<br>
  On Side 2*:</td>

	<td><textarea name="text2" cols="35" rows="2" id="text2"><?php echo $_POST['text2'];?></textarea></td>

</tr>


<tr>	

  <td>Quantity:</td>

	<td><textarea name="quantity" cols="10" rows="1" id="quantity"><?php echo $_POST['quantity'];?></textarea></td>

</tr>

<?php

if($IMAGE_VERIFICATION == 1){?>

<tr>

  <td>Verification code:</td>

	<td>		  <table  border="0" cellspacing="0" cellpadding="0">

		<tr>

			<td><?php

			$referenceid = md5(mktime()*rand());

			//Generate the random string

			$chars = array("a","A","b","B","c","C","d","D","e","E","f","F","g","G","h","H","i","I","j","J","k",

			"K","l","L","m","M","n","N","o","O","p","P","q","Q","r","R","s","S","t","T","u","U","v",

			"V","w","W","x","X","y","Y","z","Z","1","2","3","4","5","6","7","8","9");

			$length = 8;

			$textstr = "";

			for ($i=0; $i<$length; $i++) {

			   $textstr .= $chars[rand(0, count($chars)-1)];

			}

			$new_string = RC4($textstr,$IMAGE_VER_CODE);

			$image_link = bin2hex($new_string);

			?>

			<img src="sec_image.php?code=<?=$image_link;?>">

			<input name="hid_code" type="hidden" id="hid_code" value="<?=$image_link;?>"><br/>

			<input name="confirm_image" type="text" id="confirm_image" value="<?php echo $_POST['confirm_image'];?>"></td>

		</tr>

		</table>

	</td>

</tr>

<?php }

if($FILE_UPLOAD == 1){?>

<tr>

  <td>File Upload </td>

      <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">

        <tr>

          <td><input name="user_file" type="file" id="user_file"></td>

        </tr>

        <tr>

          <td><font color="#cd0505" size="2">Max. File Size: 

            <?=$FILE_UPLOAD_MAX;?> 

            MB, Allowed Extensions: 

            <?php 

		if($FILE_UPLOADS_EXT == 1){ echo 'All';}else{

		foreach($FILE_UPLOADS_EXT as $ext){ echo '-'.$ext;}}?>

          </font></td>

        </tr>

      </table>        </td>

</tr>

<tr>

	<td colspan="2"><div align="center">

	<input type="submit" name="Submit" value="Send Contact">

	<input name="submit_id" type="hidden" id="submit_id" value="1">

	</div></td>

</tr>

<?php } ?>

<tr>

  <td colspan="2"><div align="left"><a href="http://www.free-php-scripts.net" target="_blank"><font size="1">Powered by Simple Contact </font></a></div></td>

</tr>

</table>     

</form>

<?php

/*

Copyright notice (this notice won't show to users but 

will help other coders who are interested in the

script to find us */



echo "<!--

/*********************************************************

				Contact Form

		This Free Script was downloaded at			

   			  http://www.Free-php-Scripts.net 

*********************************************************/

-->";



/* +++++++++++++++++++++++++++++++++++++

	END Contact FILE

---------------------------------------*/



/*

Partner Sites:

====================



Free File Upload: 

		http://www.HotFile.us



Free Image Hosting: 

		http://www.MyImage.us



Free Games (all type of games): 

		http://www.FunTimes.us



Free Templates: 

		http://www.allfreetemplates.us



PHP Skills and Tricks: 

		http://www.phptricks.com

*/

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.