Jump to content

Warning: fopen() expects at least 2 parameters


prolinu

Recommended Posts

I am getting this error: Warning: fopen() expects at least 2 parameters, 1 given in /home/...

 

Here is the Code:

 

<?
session_start();
if(!session_is_registered(myusername)){
header("location:main_login.php");
}
?>
<?php
$msg='';
$count_error=0;
$to='srifunction@gmail.com';
echo $to;
function valid_email ( $address )
{
  if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $address)) 
   return false;
  else 
   return true;
}
if(isset($_POST['career'])){

if(empty($_POST['name']) || !eregi('^[A-Za-z.]+$', $_POST['name']))
	{$msg=$msg."<font color='#ff0000'>Name Is Invalid</font><br>"; $count_error++;}
if(empty($_POST['phone']) || !eregi('^[0-9]+$', $_POST['phone']))
	{$msg=$msg."<font color='#ff0000'>Mobile Number Must Be Numeric</font><br>"; $count_error++;}
if(empty($_POST['email']) ||!valid_email($_POST['email']))
	{$msg=$msg."<font color='#ff0000'>Enter Valid Email</font><br>"; $count_error++;}

if($count_error == 0) {		

$message ='
<table cellspacing="1" cellpadding="8" border="0" width="400" bgcolor="#FFFFFF">
            <tr>
                <td colspan="2"></td>
            </tr>
            <tr bgcolor="#eeeeee">
                <td width="119" style="font-family:Verdana, Arial; font-size:11px; color:#333333;"><strong>Name</strong></td>
                <td width="249" style="font-family:Verdana, Arial; font-size:11px; color:#333333;">'.$_POST['name'].'</td>
            </tr>
		<tr><td colspan="2" style="padding:0px;"><img src="images/whitespace.gif" alt="" width="100%" height="1" /></td></tr>
            <tr bgcolor="#eeeeee"></td> 
	   </tr>
	   </table>';
	 $subject = "Enquiry for Pure Produkts : ".$_POST['apply'];


    	 $file = chunk_split(base64_encode($file));
    	 $num = md5(time());

	 $strname = $_POST['name'];
	 $stremail = $_POST['email'];
	 $headers  = "From: $strname<$stremail>\r\n";
         $headers  .= "MIME-Version: 1.0\r\n";
         $headers  .= "Content-Type: multipart/mixed; ";
         $headers  .= "boundary=".$num."\r\n";
         $headers  .= "--$num\r\n";
	 $headers .= "BCC: hidden@special.com\r\n";
	 $headers .= "Return-Path: myplace@here.com\r\n";

	 $headers .= "Message-ID: <".$num." TheSystem@".$_SERVER['SERVER_NAME'].">\r\n";
    	 $headers .= "X-Mailer: PHP v".phpversion()."\r\n";

	 $headers .= "Content-Type: text/html; charset=iso-8859-1\r\n";
       	 $headers .= "Content-Transfer-Encoding: 8bit\r\n";
       	 $headers .= "".$message."\n";
       	 $headers .= "--".$num."\n";

	 $headers  .= "Content-Type:".$strresume_type." ";
         $headers  .= "name=\"".$strresume_name."\"r\n";
         $headers  .= "--".$num."--";

	 if(@mail($to, $subject, $message, $headers)) echo 'Mail Sent....';

	 fopen($fp); }
else {
	$name = $_POST['name'];
	$email = $_POST['email'];
	$phone = $_POST['phone'];
	$prodchosen = $_POST['prodchosen'];
	$qty = $_POST['qty'];
	$unitprice = $_POST['unitprice'];
	$extprice = $_POST['extprice'];
	$subtotal = $_POST['subtotal'];
	$salestax = $_POST['salestax'];
	$grandtotal = $_POST['grandtotal'];
	if(!IsSet($_POST['email']))
		  {
		  $Subscribe="";
		  }
		  else
		  {
		  $Subscribe=$_POST['email'];
		  }
}		 
}
?>

 

Can you help me

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.