9 posts
  • 3 Years of Membership
  • Collector Level 2
  • United Arab Emirates
mehrany
says

i want, form contact inlightbox and if u have send form email, page of thanks for email load on lightbox. how?!

9 posts
  • 3 Years of Membership
  • Collector Level 2
  • United Arab Emirates
mehrany
says

form contact: php ::


<?php

$EmailFrom = "no-reply@______";
$EmailTo = "__________";
$Subject = "Contact";
$name = Trim(stripslashes($_POST['name']));
$mail = Trim(stripslashes($_POST['mail'])); 
$comment = Trim(stripslashes($_POST['comment'])); 

// validation
$validationOK=true;
if (!$validationOK) {
  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
  exit;
}

// prepare email body text
$Body = "";
$Body .= "name: ";
$Body .= $name;
$Body .= "\n";
$Body .= "mail: ";
$Body .= $mail;
$Body .= "\n";
$Body .= "comment: ";
$Body .= $comment;
$Body .= "\n";

// send email 
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

// redirect to success page 
if ($success){
  print "<meta http-equiv=\"refresh\" content=\"0;URL=checks.html\">";
}
else{
  print "<meta http-equiv=\"refresh\" content=\"0;URL=contact.html\">";
}
?>

i want if u have click send, show checks.html in to the lightbox

262 posts
  • Trendsetter
  • Exclusive Author
  • Author Level 6
  • Affiliate Level 3
+4 more
KBRmedia
says

If you want to show just the content of checks.html, you can use the file_get_contents() function.

Example You can replace this:

// redirect to success page 
if ($success){
  print "<meta http-equiv=\"refresh\" content=\"0;URL=checks.html\">";
}

By this:
// redirect to success page 
if ($success){
   echo file_get_contents("checks.html");
}

This is one of many ways to show an external file if you are not redirecting user to another page, using PHP. You can also use jQuery to do the exact same thing (Hint: Search $.load() on google).

9 posts
  • 3 Years of Membership
  • Collector Level 2
  • United Arab Emirates
mehrany
says

not work it error is : Warning: file_get_contents(checks.html) [function.file-get-contents]: failed to open stream: No such file or directory in wwwroot\emails.php on line 35

lin 35 is :
   echo file_get_contents("checks.html");
5492 posts
  • 5 Years of Membership
  • Affiliate Level 1
  • Australia
  • Author Level 3
+5 more
Australia
says

not work it error is : Warning: file_get_contents(checks.html) [function.file-get-contents]: failed to open stream: No such file or directory in wwwroot\emails.php on line 35 lin 35 is :
   echo file_get_contents("checks.html");

..path

9 posts
  • 3 Years of Membership
  • Collector Level 2
  • United Arab Emirates
mehrany
says

What? path?!

9 posts
  • 3 Years of Membership
  • Collector Level 2
  • United Arab Emirates
mehrany
says

ok, i patch this error, but not not load page checks.html in lightbox

9 posts
  • 3 Years of Membership
  • Collector Level 2
  • United Arab Emirates
mehrany
says

Please Help me :(

9 posts
  • 3 Years of Membership
  • Collector Level 2
  • United Arab Emirates
mehrany
says

ajax loading?!

262 posts
  • Trendsetter
  • Exclusive Author
  • Author Level 6
  • Affiliate Level 3
+4 more
KBRmedia
says

not work it error is : Warning: file_get_contents(checks.html) [function.file-get-contents]: failed to open stream: No such file or directory in wwwroot\emails.php on line 35
You are getting that error because you need the path to checks.html. So if your contact.php and checks.html are not in the same directory you need to add the directory to file_get_contents("PATH/TO/checks.html")

If you want to use jQuery, simply use $(“HOLDER”).load(“http://YOURSITE/checks.html”)

by
by
by
by
by
by