Jump to content

Emailed form with uploaded image


BlowYourMind
 Share

Recommended Posts

Hi everyone! I'm building my own website (imandraphotography.com) and I want a working form that sends me an email with the form details (containing an image that the user can upload).I've been searching some code on the internet but none of it was what I wanted. So I asked a friend if he could help me, and he came this far (see attachements). And thus far it sends me an email containing the form details, but without the uploaded photo. (The photo does appear on my server in the folder 'uploads') Also, in my hotmail inbox, I get this warning when I open a email from my website:"Dit bericht wordt niet vertrouwd door onze SmartScreen-filters." (This message isn't trusted by our smartscreen-filters) Can anybody help me with this issue? (The titles etc. are in Dutch, but since there merely titles, I guess it's not a problem?) Edit: Oh, and regarding the validation: Everytime, also when there's something wrong, it also gives the message "Bedankt voor de aanvraag van een fotoreportage. Er wordt zo spoedig mogelijk contact met u opgenomen.<br />Als u binnen twee weken nog niks terughebt, mail dan even naar imandraphotography@hotmail.com. <br /><br />Klik <a href="index.html">hier</a> om terug te keren naar IMANDRAphotography.com." (The thanks for the email, you'll soon be contacted etc part)It's no big deal, but just annoying :)!

contact.html

contactformulier.php

nicophp.php

Edited by BlowYourMind
Link to comment
Share on other sites

Oh okay: It was very long, that's why I didn't put it in the startpost itself :) HTML

<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><link rel="stylesheet" type="text/css" href="style1.css" media="screen"/><title>CONTACT</title></head> <body> <div id="wrapperc">         <div id="achtergrond">                    <div id="menu">                         <ul>                 <li><a href="index.html">HOME</a></li>                    <li><a href="bio.html">BIOGRAFIE</a></li>                    <li><a href="port.html">PORTFOLIO</a>                     <ul>                         <li id="dropdownp"><a href="paard.html">Paarden</a></li>                         <li id="dropdownp"><a href="ruiter.html">Paard en Ruiter</a></li>                            <li id="dropdownp"><a href="hond.html">Honden</a></li>                            <li id="dropdownp"><a href="mens.html">Mensen</a></li>                            <li id="dropdownp"><a href="eigen.html">Eigen Werk</a></li>                        </ul>                    </li>                    <li><a href="rep.html">FOTOREPORTAGES</a>                     <ul>                            <li id="dropdownf"><a href="voorwaarden.html">Voorwaarden</a></li>                            <li id="dropdownf"><a href="tarieven.html">Tarieven</a></li>                            <li id="dropdownf"><a href="bestel.html">Nabestellen</a></li>                        </ul>                    </li>                    <li><a href="contact.html">CONTACT</a></li>                </ul>                        </div>                        <div id="content">                                                <div id="contenttekstc">                 <p class="tekst">»» CONTACT ««</p>                </div>                 <div id="formeen">                <table>                <td><form action="contactformulier.php" METHOD="post" autocomplete="on" id="contenttekst" enctype="multipart/form-data">                        <fieldset>                            <legend>Gegevens:</legend>                                <b>Voornaam:</b><br>                                <input type="text" name="fname" /><br />                                <b>Achternaam:</b><br>                                <input type="text" name="lname" /><br />                                <b>E-mail:</b> <br>                                <input type="email" name="email" autocomplete="on" /><br />                                                                <b>Mobiel nummer:</b> <br>                                <input type="tel" name="usrtel" />                                <br>                                <b>Woonplaats:</b> <br>                                <input type="text" name="plaats" />                        </fieldset>                        <br>                        <br>                        <br>                        <fieldset>                        <b>Commentaar:</b>                        <br>                        <textarea name="descr" style="width: 300px; height: 144px;"></textarea>                        </fieldset></td>                <td id="contenttekst"><fieldset>                        <legend>Model:</legend>                            <br>                        <select name="soortshoot">                        <optgroup label="Portfolio of betaald?">                            <option value="portfolio">Portfolioreportage</option>                            <option value="betaald">Betaalde reportage</option>                        </optgroup>                        </select>                        <select name="soortmodel">                            <option value="paard">Paard</option>                            <option value="hond">Hond</option>                            <option value="mens">Mens</option>                        </select>                        <select name="pakket">                            <option value="Pakket A">Pakket A</option>                            <option value="Pakket B">Pakket B</option>                        </select>                        <br>                        <br>                        <b>Naam model:</b> <br>                        <input type="text" name="naam" />                        <br>                        <br>                        <b>Ras:</b> <br>                        <input type="text" name="ras" />                        <br>                        <br>                        <b>Foto upload:</b> <br>                        <input type="file" name="uploaded_file" id="fototekst" />                        <br>                        <br>                        <i>of</i>                        <br>                        <br>                        <b>Foto link:</b>                        <br>                        <i>Upload uw foto bij Imageshack.us, photobucket.com of tinypic.com en plaats de verkregen link hier.</i>                        <br>                        <input type="text" name="foto" />                        </fieldset>                        <br>                        <br>                        <br>                        <fieldset>                        <br>                        <i>Door op de versturen te drukken gaat u automatisch akkoord met de voorwaarden zoals deze op IMANDRAphotography.com beschreven staan.</i>                        <br>                            <input type="submit" value="Versturen">                        <input type="reset"  name="reset" value="Wissen"/>                    </fieldset>                    </form></td>                </table>                                                         </div>            </div>                </div>        </div> </body></html> 

PHP file 1

 <?phpif(isset($_POST['email'])) {         // EDIT THE 2 LINES BELOW AS REQUIRED    $email_to = "imandraphotography@hotmail.com";    $email_subject = "Aanvraag fotoreportage";              function died($error) {        // your error code can go here        echo "Het spijt me, maar er zijn er is iets niet goed ingevuld.";        echo "De fouten staan hieronder.<br /><br />";        echo $error."<br /><br />";        echo "Ga terug en verbeter de fouten.<br /><br />";        die();    }         $first_name = $_POST['fname']; // required    $last_name = $_POST['lname']; // required    $email_from = $_POST['email']; // required    $telephone = $_POST['usrtel']; // not required    $city = $_POST['plaats']; // required$descr = $_POST['descr'];     //Get the uploaded file information$name_of_uploaded_file =    basename($_FILES['uploaded_file']['name']);//get the file extension of the file$type_of_uploaded_file =    substr($name_of_uploaded_file,    strrpos($name_of_uploaded_file, '.') + 1);$size_of_uploaded_file =    $_FILES["uploaded_file"]["size"]/1024;//size in KBs //Settings$max_allowed_file_size = 5100; // size in KB$allowed_extensions = array("jpg", "jpeg", "gif", "bmp", "png");//Validationsif($size_of_uploaded_file > $max_allowed_file_size ){ $errors .= "\n De groote van het bestand moet minder zijn dan 5mb";}//------ Validate the file extension -----$allowed_ext = false;for($i=0; $i<sizeof($allowed_extensions); $i++){ if(strcasecmp($allowed_extensions[$i],$type_of_uploaded_file) == 0){    $allowed_ext = true;  }}if(!$allowed_ext){ $errors .= "\n Het geuploade bestand is niet het juiste type.. ". " Alleen de volgende extensies zijn te uploaden: ".implode(',',$allowed_extensions);} $upload_folder = "uploads/";     //copy the temp. uploaded file to uploads folder$path_of_uploaded_file = $upload_folder . $name_of_uploaded_file;$tmp_path = $_FILES["uploaded_file"]["tmp_name"];if(is_uploaded_file($tmp_path)){ if(!copy($tmp_path,$path_of_uploaded_file)) {$errors .= '\n Er ging wat fout met het uploaden van het bestand'; }}              $error_message = "";    $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';  if(!preg_match($email_exp,$email_from)) {    $error_message .= 'Het email adres wat u ingegeven hebt lijkt niet te kloppen.<br />';  }    $string_exp = "/^[A-Za-z .'-]+$/";  if(!preg_match($string_exp,$first_name)) {    $error_message .= 'De voornaam die u heeft ingegeven lijkt niet te kloppen.<br />';  }  if(!preg_match($string_exp,$last_name)) {    $error_message .= 'De achternaam die u heeft ingegeven lijkt niet te kloppen.<br />';  }  if(!preg_match($string_exp,$city)) {    $error_message .= 'De plaats die u heeft ingegeven lijkt niet te kloppen.<br />';  }    $email_message = "Formulierdetails hieronder.\n\n";           $email_message .= "Voornaam: ".$first_name."\n";    $email_message .= "Achternaam: ".$last_name."\n";    $email_message .= "Email: ".$email_from."\n";    $email_message .= "Mobiel nummer: ".$telephone."\n";    $email_message .= "Plaats: ".$city."\n \n";$email_message .= "Soort shoot: ".$_POST['soortshoot']."\n";$email_message .= "Soort model: ".$_POST['soortmodel']."\n";$email_message .= "Welk pakket: ".$_POST['pakket']."\n \n";$email_message .= "Naam model: ".$_POST['naam']."\n";$email_message .= "Ras model: ".$_POST['ras']."\n";$email_message .= "Beschrijving: ".$_POST['descr']."\n";$email_message .= "Afbeelding: ".$_POST['foto']."\n";     if($error_message == ""){$headers = 'From: '.$email_from."\r\n".'Reply-To: '.$email_from."\r\n" .'X-Mailer: PHP/' . phpversion();include("nicophp.php");$fFile = addFile($path_of_uploaded_file);//addBody($email_message);sendMail($first_name.' '.$last_name, $email_from, "Aanvraag fotoreportage", "IMANDRAphotography", $email_to, $email_message, $fFile);//@mail($email_to, $email_subject, $email_message, $headers);  }else{echo $error_message;}?> Bedankt voor de aanvraag van een fotoreportage. Er wordt zo spoedig mogelijk contact met u opgenomen.<br />Als u binnen twee weken nog niks terughebt, mail dan even naar imandraphotography@hotmail.com. <br /><br />Klik <a href="index.html">hier</a> om terug te keren naar IMANDRAphotography.com. <?php}?>

PHP file 2

<?php   $sHeader = '';      // Message headers  $sBody_html = '';   // HTML body message  $sBody_txt = '';    // Plain text body message    $aFile = '';        // files  $sBoundaryId =  md5(time());  // Unique boundary  $sAttachment = '';  // Filedata      ////////////////////////////////////////////////////////////////  // @Func:  AddFile  // @Input: sSource  // @Ouput:  true or False, $this->sAttachment  // @Desc:   This function adds files to a email  ////////////////////////////////////////////////////////////////  function addFile($sSource) {    if(file_exists($sSource)) {      $fp = fopen($sSource, "rb");      $sFiledata = fread($fp, filesize($sSource));       $sFiledata = chunk_split(base64_encode($sFiledata));       fclose($fp);      $sFileName = substr(strrchr($sSource, "/"), 1);      $aFile[$sFileName] = $sFiledata;      foreach($aFile AS $sFileName => $sFileData){         $sAttachment  = "\r\n--".$sBoundaryId."\r\n"                            . "Content-Type: application/octet-stream; name=\"".$sFileName."\"\r\n"                            . "Content-Transfer-Encoding: base64\r\n"                            . "Content-Disposition: attachment; filename=\"".$sFileName."\"\r\n\r\n"                            . $sFileData."\r\n\r\n"                            . "--".$sBoundaryId."--";      }            return $sAttachment;    }    return false;  }    ////////////////////////////////////////////////////////////////  // @Func:  setHeaders  // @Input: sFrom_name, sFrom_email, iPriority, bHtml  // @Ouput:  none  // @Desc:   This function is to set the headers of the email  //              Also this function is auto started from the sendMail function  ////////////////////////////////////////////////////////////////  function setHeaders($sFrom_name, $sFrom_email, $iPriority, $bHtml) {    $header = "From: ".$sFrom_email."\r\n"            . "Reply-To: ".$sFrom_email."\r\n"            . "X-Mailer: PHP/" . phpversion()            . "MIME-Version: 1.0\r\n"            . "Content-type:text/".($bHtml ? 'html' : 'plain')."; charset=iso-8859-1\r\n"            . "Content-Type: multipart/mixed; boundary=\"".$sBoundaryId."\"\r\n\r\n";    if(is_array($aFile)) {      $header .= "This is a multi-part message in MIME format.\r\n"                . "--".$sBoundaryId."\r\n"                . "Content-Transfer-Encoding: 7bit\r\n\r\n";    }    return $header;  }    ////////////////////////////////////////////////////////////////  // @Func:  addBody  // @Input: sMessage  // @Ouput:  none  // @Desc:   This function is to add the body to the email  //              also the attachment is included here  ////////////////////////////////////////////////////////////////  function addBody($sMessage) {    $sMessage .= $sAttachment;    $sBody_html = $sMessage;        $sBody_txt = strip_tags($sMessage);  }    ////////////////////////////////////////////////////////////////  // @Func:  sendMail  // @Input: sFrom_name, sFrom_mail, sSubject, sTo_name, sTo_mail, iPriority, bHtml  // @Ouput:  none  // @Desc:   In this function the email is actualy send with all the  //              information collected in the previous functions  ////////////////////////////////////////////////////////////////  function sendMail($sFrom_name, $sFrom_mail, $sSubject, $sTo_name, $sTo_mail, $ssMessage, $fFile, $iPriority = 1, $bHtml = false) {    $header = setHeaders($sFrom_name, $sFrom_mail, 1, false);    try {$fFile.= $ssMessage;      $sSendMail = mail($sTo_name.'<'.$sTo_mail.'>', $sSubject, $ssMessage, $header);      if(!$sSendMail) {        throw new error(4, 'Mail could not be send');        return false;      }      return true;    }    catch(error $e) {}  }   ?>

Link to comment
Share on other sites

It doesn't look like that code is finished, or was tested. First, you need to add this line to the top of the addFile and setHeaders functions: global $aFile; Neither function is using the global variable, they are both using local variables so they aren't working together. In the setFile function, before this line: $aFile[$sFileName] = $sFiledata; You need to add this code to change $aFile from a string to an array:

if (!is_array($aFile))  $aFile = array();

In this loop where it's trying to build a string to contain the file data:

foreach($aFile AS $sFileName => $sFileData){ $sAttachment = "\r\n--".$sBoundaryId."\r\n"

Before the loop you need to add this line to initialize the variable: $sAttachment = ''; And then change this line: $sAttachment = "\r\n--".$sBoundaryId."\r\n" to this: $sAttachment .= "\r\n--".$sBoundaryId."\r\n" And then inside the sendMail function it never actually does anything with the file data, it doesn't use it in the email. So I think you need to change this line: $sSendMail = mail($sTo_name.'<'.$sTo_mail.'>', $sSubject, $ssMessage, $header); to this: $sSendMail = mail($sTo_name.'<'.$sTo_mail.'>', $sSubject, $fFile, $header); At that point since $fFile contains the email text also then that should be the entire email plus the attachment.

Link to comment
Share on other sites

Thanks! The mail gets a whole lot faster in my inbox, but the attachement isn't attached to the mail, instead I get this in front of the form details: "This is a multi-part message in MIME format.--Content-Transfer-Encoding: 7bit--Content-Type: application/octet-stream; name="MSN_NadienFemLies.jpg"Content-Transfer-Encoding: base64Content-Disposition: attachment; filename="MSN_NadienFemLies.jpg" "And beneath that a whole lot of seemingly random letters and numbers. So unfortunately, all the issues remain...I probably did something wrong, here the codes I have now:(only the altered file)

<?php   $sHeader = '';	  // Message headers  $sBody_html = '';   // HTML body message  $sBody_txt = '';	// Plain text body message    $aFile = '';		// files  $sBoundaryId =  md5(time());  // Unique boundary  $sAttachment = '';  // Filedata      ////////////////////////////////////////////////////////////////  // @Func:  AddFile  // @Input: sSource  // @Ouput:  true or False, $this->sAttachment  // @Desc:   This function adds files to a email  ////////////////////////////////////////////////////////////////  function addFile($sSource) {global $aFile;	if(file_exists($sSource)) {	  $fp = fopen($sSource, "rb");	  $sFiledata = fread($fp, filesize($sSource));	  $sFiledata = chunk_split(base64_encode($sFiledata));	  fclose($fp);	  $sFileName = substr(strrchr($sSource, "/"), 1);if (!is_array($aFile))$aFile = array();	  $aFile[$sFileName] = $sFiledata;$sAttachment = '';	  foreach($aFile AS $sFileName => $sFileData){$sAttachment .= "\r\n--".$sBoundaryId."\r\n"							. "Content-Type: application/octet-stream; name=\"".$sFileName."\"\r\n"							. "Content-Transfer-Encoding: base64\r\n"							. "Content-Disposition: attachment; filename=\"".$sFileName."\"\r\n\r\n"							. $sFileData."\r\n\r\n"							. "--".$sBoundaryId."--";	  }	  	  return $sAttachment;	}	return false;  }    ////////////////////////////////////////////////////////////////  // @Func:  setHeaders  // @Input: sFrom_name, sFrom_email, iPriority, bHtml  // @Ouput:  none  // @Desc:   This function is to set the headers of the email  //			  Also this function is auto started from the sendMail function  ////////////////////////////////////////////////////////////////  function setHeaders($sFrom_name, $sFrom_email, $iPriority, $bHtml) {global $aFile;	$header = "From: ".$sFrom_email."\r\n"			. "Reply-To: ".$sFrom_email."\r\n"			. "X-Mailer: PHP/" . phpversion()			. "MIME-Version: 1.0\r\n"			. "Content-type:text/".($bHtml ? 'html' : 'plain')."; charset=iso-8859-1\r\n"			. "Content-Type: multipart/mixed; boundary=\"".$sBoundaryId."\"\r\n\r\n";	if(is_array($aFile)) {	  $header .= "This is a multi-part message in MIME format.\r\n"				. "--".$sBoundaryId."\r\n"				. "Content-Transfer-Encoding: 7bit\r\n\r\n";	}	return $header;  }    ////////////////////////////////////////////////////////////////  // @Func:  addBody  // @Input: sMessage  // @Ouput:  none  // @Desc:   This function is to add the body to the email  //			  also the attachment is included here  ////////////////////////////////////////////////////////////////  function addBody($sMessage) {	$sMessage .= $sAttachment;	$sBody_html = $sMessage;		$sBody_txt = strip_tags($sMessage);  }    ////////////////////////////////////////////////////////////////  // @Func:  sendMail  // @Input: sFrom_name, sFrom_mail, sSubject, sTo_name, sTo_mail, iPriority, bHtml  // @Ouput:  none  // @Desc:   In this function the email is actualy send with all the  //			  information collected in the previous functions  ////////////////////////////////////////////////////////////////  function sendMail($sFrom_name, $sFrom_mail, $sSubject, $sTo_name, $sTo_mail, $ssMessage, $fFile, $iPriority = 1, $bHtml = false) {	$header = setHeaders($sFrom_name, $sFrom_mail, 1, false);	try {$fFile.= $ssMessage;$sSendMail = mail($sTo_name.'<'.$sTo_mail.'>', $sSubject, $fFile, $header);	  if(!$sSendMail) {		throw new error(4, 'Mail could not be send');		return false;	  }	  return true;	}	catch(error $e) {}  }   ?>

Edited by BlowYourMind
Link to comment
Share on other sites

You also need to make the $sBoundaryId and $sAttachment variables global in the same 2 functions where you added the other global variable. Then inside the setHeaders function, add $sAttachment here:

if(is_array($aFile)) {   $header .= "This is a multi-part message in MIME format.\r\n"     . "--".$sBoundaryId."\r\n"     . "Content-Transfer-Encoding: 7bit\r\n\r\n"     . $sAttachment; }

And inside the sendMail function, switch that $fFile back to $ssMessage. If that doesn't work you'll probably need to print the $header and $ssMessage variables to see what's going on further, there might be too many double line breaks.

Link to comment
Share on other sites

Exactly how do I make the boundaryID and Attachement variables global? And I changed the setHeaders function the way you said, and switched $sSendMail = mail($sTo_name.'<'.$sTo_mail.'>', $sSubject, $fFile, $header); to $sSendMail = mail($sTo_name.'<'.$sTo_mail.'>', $sSubject, $ssMessage, $header);Within the sendmail function (because the ssMessage was already in the other lines) Am I doing this right? Sorry 'bout asking so much, I really don't know PHP, haha :P Edit: Just tested the code so far, I still get this part: This is a multi-part message in MIME format.--Content-Transfer-Encoding: 7bitBut no random letters and numbers. But also no attachement (and still the screenfilterwarning)

Edited by BlowYourMind
Link to comment
Share on other sites

You make the variables global like I showed you before, with the global keyword at the start of the function. I expect it to add more to what you see in the email, so print out the $ssMessage and $header variables when you send the email so that we can see what those are set to.

Link to comment
Share on other sites

Print out? Like printing as in ink on a piece of paper? Sorry, haha, feel really dumb right now :P. Really don't know about php: my lessons about php don't start untill next year. But, boundary and attachement don't have functions, right?

<?php   $sHeader = '';	  // Message headers  $sBody_html = '';   // HTML body message  $sBody_txt = '';	// Plain text body message    $aFile = '';		// files  $sBoundaryId =  md5(time());  // Unique boundary  $sAttachment = '';  // Filedata      ////////////////////////////////////////////////////////////////  // @Func:  AddFile  // @Input: sSource  // @Ouput:  true or False, $this->sAttachment  // @Desc:   This function adds files to a email  ////////////////////////////////////////////////////////////////  function addFile($sSource) {global $aFile;	if(file_exists($sSource)) {	  $fp = fopen($sSource, "rb");	  $sFiledata = fread($fp, filesize($sSource));	  $sFiledata = chunk_split(base64_encode($sFiledata));	  fclose($fp);	  $sFileName = substr(strrchr($sSource, "/"), 1);if (!is_array($aFile))$aFile = array();	  $aFile[$sFileName] = $sFiledata;$sAttachment = '';	  foreach($aFile AS $sFileName => $sFileData){$sAttachment .= "\r\n--".$sBoundaryId."\r\n"							. "Content-Type: application/octet-stream; name=\"".$sFileName."\"\r\n"							. "Content-Transfer-Encoding: base64\r\n"							. "Content-Disposition: attachment; filename=\"".$sFileName."\"\r\n\r\n"							. $sFileData."\r\n\r\n"							. "--".$sBoundaryId."--";	  }	  	  return $sAttachment;	}	return false;  }    ////////////////////////////////////////////////////////////////  // @Func:  setHeaders  // @Input: sFrom_name, sFrom_email, iPriority, bHtml  // @Ouput:  none  // @Desc:   This function is to set the headers of the email  //			  Also this function is auto started from the sendMail function  ////////////////////////////////////////////////////////////////  function setHeaders($sFrom_name, $sFrom_email, $iPriority, $bHtml) {global $aFile;	$header = "From: ".$sFrom_email."\r\n"			. "Reply-To: ".$sFrom_email."\r\n"			. "X-Mailer: PHP/" . phpversion()			. "MIME-Version: 1.0\r\n"			. "Content-type:text/".($bHtml ? 'html' : 'plain')."; charset=iso-8859-1\r\n"			. "Content-Type: multipart/mixed; boundary=\"".$sBoundaryId."\"\r\n\r\n";	if(is_array($aFile)) {  $header .= "This is a multi-part message in MIME format.\r\n". "--".$sBoundaryId."\r\n". "Content-Transfer-Encoding: 7bit\r\n\r\n". $sAttachment;}	return $header;  }    ////////////////////////////////////////////////////////////////  // @Func:  addBody  // @Input: sMessage  // @Ouput:  none  // @Desc:   This function is to add the body to the email  //			  also the attachment is included here  ////////////////////////////////////////////////////////////////  function addBody($sMessage) {	$sMessage .= $sAttachment;	$sBody_html = $sMessage;		$sBody_txt = strip_tags($sMessage);  }    ////////////////////////////////////////////////////////////////  // @Func:  sendMail  // @Input: sFrom_name, sFrom_mail, sSubject, sTo_name, sTo_mail, iPriority, bHtml  // @Ouput:  none  // @Desc:   In this function the email is actualy send with all the  //			  information collected in the previous functions  ////////////////////////////////////////////////////////////////  function sendMail($sFrom_name, $sFrom_mail, $sSubject, $sTo_name, $sTo_mail, $ssMessage, $fFile, $iPriority = 1, $bHtml = false) {	$header = setHeaders($sFrom_name, $sFrom_mail, 1, false);	try {$fFile.= $ssMessage;$sSendMail = mail($sTo_name.'<'.$sTo_mail.'>', $sSubject, $ssMessage, $header);	  if(!$sSendMail) {		throw new error(4, 'Mail could not be send');		return false;	  }	  return true;	}	catch(error $e) {}  }   ?>

Edited by BlowYourMind
Link to comment
Share on other sites

Print means display it on the screen so you can verify what the data is. This is how you made the $aFile variable global inside the function:

function addFile($sSource) {  global $aFile;  ...

You need to do the same with the other 2 variables in the same functions where $aFile is global.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...