Click here to Skip to main content
15,881,882 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
GeneralRe: Simple trouble. Pin
Nikz216-Dec-09 9:48
Nikz216-Dec-09 9:48 
QuestionJoomFish problem with my component Pin
sharkbc13-Dec-09 16:48
sharkbc13-Dec-09 16:48 
AnswerRe: JoomFish problem with my component Pin
Marc Firth14-Dec-09 2:24
Marc Firth14-Dec-09 2:24 
GeneralRe: JoomFish problem with my component Pin
sharkbc15-Dec-09 0:04
sharkbc15-Dec-09 0:04 
GeneralRe: JoomFish problem with my component Pin
sharkbc25-Jan-10 15:08
sharkbc25-Jan-10 15:08 
QuestionREMOTE ACCESS OF MYSQL? Pin
hifiger200411-Dec-09 7:31
hifiger200411-Dec-09 7:31 
AnswerRe: REMOTE ACCESS OF MYSQL? Pin
EliottA11-Dec-09 7:41
EliottA11-Dec-09 7:41 
QuestionError while sending e-mail Pin
Gagan.2011-Dec-09 5:46
Gagan.2011-Dec-09 5:46 
Hi all.

I am new to PHP and trying to learn it.I have created a web page and defined items as below :

<form method="POST" action="send.php">
      <font color="green"> Full Name : </font>
      <input type="text" name="name" size="20">

      <font color="green"> Gotra(Clan) : </font>
      <input type="text" name="gotra" size="20">

      <font color="green"> Father's Name : </font>
      <input type="text" name="fname" size="20">

      <font color="green">Details of Prasad to be Offered : </font>
(eg.: name of temple, quantity of prasad, specific date & any other requirements)
      <textarea rows="5" name="prasad" cols="40" ></textarea>

      <font color="green"> Any Wish to God  : </font>
      <textarea rows="5" name="wish" cols="40" ></textarea>

      <font color="green"> Postal Address : </font>
      <textarea rows="5" name="address" cols="40" ></textarea>

      <font color="green"> Phone no.  : </font>
      <input type="text" name="phone" size="20">

      <font color="green"> Preferred Time of Contact : </font>
      <input type="text" name="time" size="20">

      <font color="green"> Email address : </font> 
      <input type="text" name="email" size="20">

	<br>      
	 <input name="Submit" type="submit" class="input" value="Send">
         <input name="Submit2" type="reset" class="input" value="Reset">
        </br>         
     </form>


and the send.php has following block of code :

<?php 
if(isset($_POST['submit'])) { 
$to = "gagan.u20@gmail.com"; 
$subject = "E-Prasad Details"; 
$name_field = $_POST['name']; 
$gotra_field=$_POST['gotra'];
$fname_field = $_POST['fname']; 
$prasad=$_POST['prasad'];
$wish=$_POST['wish'];
$address=$_POST['address'];
$phone_field=$_POST['phone'];
$time_field=$_POST['time'];
$email_field=$_POST['email'];
  
$body = "From: $name_field\n Gotra: $gotra_field\n Father's name: $fname_field\n Details of prasad to be offered : $prasad\n Any wish to God: $wish\n Postal address : $address\n Phone no. : $phone_field\n Preferred time of contact : $time_field\n E-mail address : $email_field"; 
  
echo "Data has been submitted!"; 
mail($to, $subject, $body); 
} else { 
echo "An error occurred! Please try again."; 
} 
?> 


Now the problem is, when I fill the form and click og sublit button, it gives an error that "An error occurred! Please try again."

Tell me where am I wrong in writing the code. Tell me the correct code.

Thanks.

Gagan
AnswerRe: Error while sending e-mail Pin
Dr.Walt Fair, PE11-Dec-09 6:55
professionalDr.Walt Fair, PE11-Dec-09 6:55 
GeneralRe: Error while sending e-mail Pin
Gagan.2011-Dec-09 16:21
Gagan.2011-Dec-09 16:21 
GeneralRe: Error while sending e-mail Pin
Dr.Walt Fair, PE11-Dec-09 16:52
professionalDr.Walt Fair, PE11-Dec-09 16:52 
GeneralRe: Error while sending e-mail Pin
Gagan.2011-Dec-09 21:47
Gagan.2011-Dec-09 21:47 
GeneralRe: Error while sending e-mail Pin
Dr.Walt Fair, PE12-Dec-09 5:23
professionalDr.Walt Fair, PE12-Dec-09 5:23 
AnswerRe: Error while sending e-mail Pin
adslccn19-Dec-09 17:05
adslccn19-Dec-09 17:05 
Questionregarding reading elements to array from dialog Pin
sriharichowdary10-Dec-09 22:23
sriharichowdary10-Dec-09 22:23 
AnswerRe: regarding reading elements to array from dialog Pin
cjoki22-Dec-09 4:29
cjoki22-Dec-09 4:29 
Questiona block problem Pin
mark_zxy10-Dec-09 16:35
mark_zxy10-Dec-09 16:35 
AnswerRe: a block problem Pin
shawndeprey10-Dec-09 17:12
shawndeprey10-Dec-09 17:12 
GeneralRe: a block problem Pin
mark_zxy10-Dec-09 18:36
mark_zxy10-Dec-09 18:36 
GeneralRe: a block problem Pin
shawndeprey11-Dec-09 1:57
shawndeprey11-Dec-09 1:57 
Questionhow to implement live video streaming for website in ubuntu ? Pin
Mahanthesh8-Dec-09 15:29
Mahanthesh8-Dec-09 15:29 
AnswerRe: how to implement live video streaming for website in ubuntu ? Pin
Mahanthesh8-Dec-09 16:37
Mahanthesh8-Dec-09 16:37 
GeneralRe: how to implement live video streaming for website in ubuntu ? Pin
cjoki9-Dec-09 7:55
cjoki9-Dec-09 7:55 
Questionredirecting to a web page using a loop [modified] Pin
ankitjain11104-Dec-09 22:15
ankitjain11104-Dec-09 22:15 
AnswerRe: redirecting to a web page using a loop Pin
ankitjain11104-Dec-09 22:53
ankitjain11104-Dec-09 22:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.