PHP Cant Pass Variable include File? -
lets go point,
i hava form this
exhibition.php
<?php include("email_class.php"); if(isset($_post[save])){ $email = $_post[email]; $company = $_post[company]; $gender = $_post[gender]; $buyer = $_post[buyer]; $discussion = $_post[discussion]; $class = new email_class(); $class->notifikasi($discussion); }//end if ?>
and code include file this
email_class.php
<?php class email_class{ function notifikasi($discussion){ if($discussion == "discussion"){ $to = $email; $subjek = "thanks visiting @ gulfood exhibition, dubai"; $message = "<html> <head> <title>exibithion email</title> </head> <body> bla blaa"; $message.= "dear <b> ".$gender." ".$buyer."</b><br><br>"; $headers = "mime-version: 1.0" . "\r\n"; $headers .= "content-type:text/html;charset=utf-8" . "\r\n"; $headers .= 'from: **** group <export@***>' . "\r\n"; echo $message; }//end if }//end function }//end of class ?>
ok, echo html mail succees. running well, variabel exhibition.php cant pass email_class.php.
can fix problem?
pass values arguments notifikasi
.
<?php include("email_class.php"); if(isset($_post[save])){ $class = new email_class(); $class->notifikasi($_post[email], $_post[company], $_post[gender], $_post[buyer], $_post[discussion]) }//end if ?>
class
class email_class{ function notifikasi($email, $company, $gender, $buyer, $discussion){ if($discussion == "discussion"){ /** ... **/
Comments
Post a Comment