8 posts
  • Has been part of the Envato Community for over 2 years
mehrany says

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

8 posts
  • Has been part of the Envato Community for over 2 years
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

212 posts
  • Has sold $10,000+ on Envato Market
  • Has referred 10+ members
  • Has collected 1+ items on Envato Market
  • Had an item featured on Envato Market
+3 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).

8 posts
  • Has been part of the Envato Community for over 2 years
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");
5490 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Located in Australia
  • Has sold $1,000+ on Envato Market
+4 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

8 posts
  • Has been part of the Envato Community for over 2 years
mehrany says

What? path?!

8 posts
  • Has been part of the Envato Community for over 2 years
mehrany says

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

8 posts
  • Has been part of the Envato Community for over 2 years
mehrany says

Please Help me :(

8 posts
  • Has been part of the Envato Community for over 2 years
mehrany says

ajax loading?!

212 posts
  • Has sold $10,000+ on Envato Market
  • Has referred 10+ members
  • Has collected 1+ items on Envato Market
  • Had an item featured on Envato Market
+3 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