cancel
Showing results for 
Search instead for 
Did you mean: 

php form processing not Working...............Need help

westhendon111
Member

Hi , I need some help

 

I have just created a php to process my contact form 

 

but  each time is press sumbit in my form, my php doesnt run , i just an error message

 

i get this message

 

Internal Server ErrorThe server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, or webmaster and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

 

Here the PHP code am tryin to run

 

<?php

  $to = "-f contact@whbchurch.org.uk";
  $subject = "Contact Form Message";
  $email = $_REQUEST['temail'] ;
  $femail = "contact@whbchurch.org.uk ;
  $ename = $_REQUEST['ename'] ;
  $phone = $_REQUEST['phone'] ;
  $comment = $_REQUEST['comment'];
  $suggestion = $_REQUEST['suggestion'] ;
  $headers = "From: $email";
  $sent = mail($to, $subject, $ename, "From: $femail") ; 

  if($sent)
  {print "Your mail was sent successfully";}
  else
  {print "We encountered an error sending your mail"; }
?>

HERE IS HTML Code calling the PHP

 

<body>
<form action="/cgi-bin/addcomm" method="post" name="enquiry" onSubmit="return checkEqry();">
<input type="hidden">


<tr align="left">

<p><h4>Contact Us</h4></p>
<p>Please complete the form below to get intourch. </p>


<pre>

<p>Name:       <input type="text" name="ename" size="45" />
<p>Email:      <input type="text" name="temail" size=45" />
<p>Telephone:  <input type="text" name="phone" size="45" />
<p>How did you hear of us? <select name="suggestion"/>

<p><option selected> Make a selection </option>
<p><option> Web Search </option>
<p><option> From a Church Member</option>
<p><option> Other  </option>
<p><option>Email</option>
</select>
<p>Enquiry/Comments/Request    
            <textarea name="comment" rows="6" cols="40" />
</textarea>
<input type="submit">

</pre>
</tr>



</form>

</body>

 

Any suggestions will be nice... Thanx

 

1 ACCEPTED SOLUTION

Accepted Solutions

westhendon111
Member

hi

 

I Finally solve the problem

 

I first had to include Formmail as part of my setup when creating my webpage and 

 

it worked perfectly 

 

many thanks everyone for all your help..

 

Regards

View solution in original post

6 REPLIES 6

orchie
Grand Master

Is looks like the following line is wrong as it's not pointing at your .php file:

 

<form action="/cgi-bin/addcomm"

 

 

westhendon111
Member

I have made changes to my PHP , now the PHP scripts runs, but only a blank screen appears ...i need help

 

seems the PHP excutes but nothin is showing

 

HELP HELP HELP 

 

Can anyone from BT HELP .........???????

Tracey
Guru

Hi westthendon111,

 

Can you post a screenshot of the error please.

 

Many thanks

 

Tracey

 

BT Forum Moderator





If you like a post please click on the star image on the left-hand side of the post.
If someone answers your question correctly please let other Forum members know by clicking on Accept as Solution on the right-hand side of the answer post. Please also consider replying to the post stating that your question has been answered successfully.

westhendon111
Member

hi

 

I Finally solve the problem

 

I first had to include Formmail as part of my setup when creating my webpage and 

 

it worked perfectly 

 

many thanks everyone for all your help..

 

Regards

johnvarenda
Member

hi...

I am new to php but i know sql.

Can anyone briefly explain about php or give me some links.

Thanks in advance...

...............

<URL Removed by Moderators>

pmillman
Power User

Hello,

 

Here is a site that I have found very resourceful:

 

http://www.w3schools.com/PHP/DEfaULT.asP

 

Peter