Click here to Skip to main content
15,902,854 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I Have created a form having two input(text), one for name and another city
Here is coding of it

XML
<html>
<head>
<title>Confirm Page</title>

</head>
<body >
<form method="post" action="submit.php">
<label for="name">Name</label><input type="" size="20" name="name"><br>
<label for="city">City&nbsp;&nbsp;&nbsp;</label><input type="" size="20" name="city"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="Submit" value="Submit">
</form>
</body>
</html>


and coding of submit.php is

XML
<html>
<head>
</head>
<body>
<h2>Details Successfully Send....</h2>
<?php
    $name_=$_POST['name'];
    $city_=$_POST['city'];
    echo 'Name='.$name_.'<br>';
    echo 'City='.$city_.'<br>';
    $msg=$name_.' living in '.$city_;
    $subject='Information transfer using PHP';
    $to='abcd@xyz.com';
    $from='27ds@gmail.com';
    mail($to,$subject,$msg,'From:'.$from);
?>
</body>
</html>


I just want to know why this form data(input by user) not reach to the email(to). I have uploaded these files on web-server having php etc.
I have started learning PHP just few a days ago.
Please Help me in finding my mistake(if any).
Thanx in advance
Posted
Comments
Sergey Alexandrovich Kryukov 25-Jun-13 16:15pm    
What do you mean "if any"? Why couldn't you test it?
—SA
Anoop Kr Sharma 26-Jun-13 12:17pm    
I have tested it but form not reach to my mail.'If any' means if you find/caught any problem or mistake in my code then please help me in correcting it.
Sergey Alexandrovich Kryukov 26-Jun-13 13:21pm    
Start with using the same server and some available mail program. This will check if addresses and authentication (does it require authentication? it could be one of the problems) are correct.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900