flori
-
Posts
9 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by flori
-
-
I tried, but to no avail Thank you very much sirfor your replying and i wait your solution for this problemtry checking for errors in your PHP code.error_reporting(E_ALL); ini_set('display_errors', '1');
add some echo statements, anything. Try chipping away it piece by piece. I only wrote this code off the top of my head. It should only be something small to fix, but it is important to be able to know what the problem is first.
-
The same thing ,also not working and this video explains what happen Thank you very much for your replying and i wait you solution for this problemecho "<script>\n"; echo 'var str = \"download\"' . "\n"; echo "document.write(str.link(\"http://www.myshedplans.com/12BY8SHED.pdf\"));\n"; echo "</script>\n";
will be
echo "<script type='text/javascript>\n"; echo 'var str = \"download\"' . "\n"; echo "document.write(str.link(\"http://www.myshedplans.com/12BY8SHED.pdf\"));\n"; echo "</script>\n";
-
Do you know what is?you are missing type attribute in one of your script tag -
Thank you very much but how can we solve this problem with PHP - AJAX and MySQLi wait your solution for this problemi think you required php_ajax just look at this example: http://www.w3schools.com/php/php_ajax_database.asp -
There is an error in your solution because when you fill alldetails and after clicking download button Nothing happens ,a white window without a link of downloadthis is what happen Why does not appear a link of download ? thank you very much for replying and i wait your solution for this problemthis is not enoughif(isset($_POST['cf_name'],$_POST['cf_email'],$_POST['cf_message']))
by virtue of the form being submitted, even with empty values, they will all be isset. i.e. "" will pass the isset check. At the very minimum the OP would want to use !empty(XXX) for each POST param, since an empty("") will return true. Probably what would be even better is if the OP validated the clients information client side to prevent the user from submitting an empty form. In the event the JS is turned off, have a failsafe on the server side as well. i.e.
<?phpif(!empty($_POST['cf_name']) && !empty($_POST['cf_email']) && !empty($_POST['cf_message'])){ $field_name = $_POST['cf_name']; $field_email = $_POST['cf_email']; $field_message = $_POST['cf_message']; $mail_to = 'dedalusonline@yahoo.com'; $subject = 'Message from a site visitor '.$field_name; $body_message = 'From: '.$field_name."\n"; $body_message .= 'E-mail: '.$field_email."\n"; $body_message .= 'Message: '.$field_message; $headers = 'From: '.$field_email."\r\n"; $headers .= 'Reply-To: '.$field_email."\r\n"; $mail_status = mail($mail_to, $subject, $body_message, $headers); if ($mail_status) { echo "<script>\n"; echo 'var str = \"download\"' . "\n"; echo "document.write(str.link(\"http://www.myshedplans.com/12BY8SHED.pdf\"));\n"; echo "</script>\n"; }else { echo "<script language=\"javascript\" type=\"text/javascript\">"; echo "alert('Message failed. Please, send an email to gordon@template-help.com');"; echo "window.location = 'contact_page.html';"; echo "</script>"; }}else{ echo "<script language=\"javascript\" type=\"text/javascript\">"; echo "alert('Please fill out the entire form');"; echo "window.location = 'contact_page.html';"; echo "</script>";};?>
-
when visitor site filling detailes and hitdownload your free plan now i want shows link of download and when he hit link of download shows a link of installwhen visitor site dont fill all detailes i want shows alert Message failed. Please, send an email to gordon@template-help.com thats all thank you very much for your help and replying and i wait your solution for this problemwhat exactly u want after filling details and after clicking download buttonand what exactly u want without filling details and clicking on download button. -
doesn't work alsoyou can hit direct download your free plan now ,and show a white window without nothinglike thistry this=><?phpif(isset($_POST['cf_name'],$_POST['cf_email'],$_POST['cf_message'])){$field_name = $_POST['cf_name'];$field_email = $_POST['cf_email'];$field_message = $_POST['cf_message']; $mail_to = 'dedalusonline@yahoo.com';$subject = 'Message from a site visitor '.$field_name;$body_message = 'From: '.$field_name."\n";$body_message .= 'E-mail: '.$field_email."\n";$body_message .= 'Message: '.$field_message;$headers = 'From: '.$field_email."\r\n";$headers .= 'Reply-To: '.$field_email."\r\n";$mail_status = mail($mail_to, $subject, $body_message, $headers);if ($mail_status) { echo "<script>\n"; echo 'var str = \"download\"' . "\n"; echo "document.write(str.link(\"http://www.myshedplans.com/12BY8SHED.pdf\"));\n"; echo "</script>\n";}}else{ echo "<script language=\"javascript\" type=\"text/javascript\">"; echo "alert('Message failed. Please, send an email to gordon@template-help.com');"; echo "window.location = 'contact_page.html';"; echo "</script>";}?> -
I've created some if / else statements to get a download when a user hit click jf he fields name and email but doesn"t work for my site http://my-easy-woodw...ng-projects.com because it is do download without field name and email contact.php is
<?php$field_name = $_POST['cf_name'];$field_email = $_POST['cf_email'];$field_message = $_POST['cf_message'];$mail_to = 'dedalusonline@yahoo.com';$subject = 'Message from a site visitor '.$field_name;$body_message = 'From: '.$field_name."\n";$body_message .= 'E-mail: '.$field_email."\n";$body_message .= 'Message: '.$field_message;$headers = 'From: '.$field_email."\r\n";$headers .= 'Reply-To: '.$field_email."\r\n";$mail_status = mail($mail_to, $subject, $body_message, $headers);if ($mail_status) { echo "<script>\n"; echo 'var str = \"download\"' . "\n"; echo "document.write(str.link(\"http://www.myshedplans.com/12BY8SHED.pdf\"));\n"; echo "</script>\n";}else { echo "<script language=\"javascript\" type=\"text/javascript\">"; echo "alert('Message failed. Please, send an email to gordon@template-help.com');"; echo "window.location = 'contact_page.html';"; echo "</script>";}?>
If statement doesn't work?
in PHP
Posted · Edited by flori