Maher_Nabeel Posted September 15, 2013 Share Posted September 15, 2013 I have html a page that takes the email details and pass it to semail.php but whenever I try it this error appears No input file specified. This is the html form: <form method="POST" sourceindex="44" action="semail.php" name="form1" onSubmit="return validate_form ( );"> <p> <label>Your name:<br> <input sourceindex="47" name="mail_name" class="text_field" type="text"> </label> </p> <p> <label>Your e-mail:<br> <input sourceindex="51" name="mail_email" class="text_field" type="text"> </label> </p> <p> <label>Message:<br> <textarea sourceindex="55" name="mail_msg" cols="45" rows="5" class="text_area"></textarea> </label> </p> <input name="B1" type="submit" class="form_button" value="" /> </form> and this is the php code: <?php $mail_to ="someEmail@hotmail.com"; $mail_subject = "Message From a Customer"; $mail_body ="Name of the Coustomer: ".$_POST['mail_name']."\n"; $mail_body .= "E-Mail Of the Coustomer: ".$_POST['mail_email']."\n"; $mail_body .= "The Message: ".$_POST['mail_msg']."\n"; if(mail($mail_to, $mail_subject, $mail_body)) echo "Thanks for your Message"; else echo "Failed to send the e-mail" ?> any suggestions what is causing this weird error ? Quote Link to comment https://forums.phpfreaks.com/topic/282155-error-no-input-file-specified-when-sending-email/ Share on other sites More sharing options...
Maher_Nabeel Posted September 15, 2013 Author Share Posted September 15, 2013 I just discovered that no php file is running. why ? and how to solve it ? Quote Link to comment https://forums.phpfreaks.com/topic/282155-error-no-input-file-specified-when-sending-email/#findComment-1449522 Share on other sites More sharing options...
DFulg Posted September 15, 2013 Share Posted September 15, 2013 This error indicates that semail.php either does not exist, or is not in the same directory as the file that contains the HTML form. Quote Link to comment https://forums.phpfreaks.com/topic/282155-error-no-input-file-specified-when-sending-email/#findComment-1449548 Share on other sites More sharing options...
priyankagound Posted September 16, 2013 Share Posted September 16, 2013 To first check and verify that PHP is running and available with the present Web hosting company, create a file called check_server.php and insert the following code: <?php// Show all information, defaults to INFO_ALLphpinfo();// Show just the module information.// phpinfo( yields identical results.phpinfo(INFO_MODULES);?> If successful, you will see your server information and configurations. It will also show the path to mail. Quote Link to comment https://forums.phpfreaks.com/topic/282155-error-no-input-file-specified-when-sending-email/#findComment-1449677 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.