Jump to content

Can't get a simple request form to work in a Joomla! 1.5 template


Wolverine68

Recommended Posts

I created a request form in an Article in a Joomla! 1.5 template.  When the form is submitted it calls the php form but the only thing that prints out is the actual php coding. It does not process the information that is entered in the form when it's submitted.

 

Request Form:

 



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>

<head>
<title>Request Form</title>
</head>

<body background="#EEEEEE">
<img src="pics\um-cross3.gif" height="100" width="100"><img src="pics\title.gif"><br>
<h3 align="center">Information Request Form</h3>
<div>
<form action="feedback.php" method="post">

<p><font color="blue">Thank you for visiting our website. If you would like more information, please fill out all the information in the form below. When finished, click on the "Submit" button. Be sure to include your address, e-mail, or phone so that someone can follow up with you.</font></p>
<hr width="100%">
<p>Name:&nbsp&nbsp&nbsp&nbsp&nbsp<INPUT TYPE="text" SIZE="35" name="name"></p>
<p>E-mail:&nbsp&nbsp&nbsp&nbsp<INPUT TYPE="text" SIZE="35" name="email"></p>
<p>Phone:&nbsp&nbsp&nbsp&nbsp<INPUT TYPE="text" SIZE="35" name="phone"></p>
<p>Address:   <INPUT TYPE="text" SIZE="35" name="address"></p><br>
I would like more information on the following (check all that apply):<br>
<INPUT TYPE="checkbox" NAME="Programs[]" VALUE="Adult Sunday School">Adult Sunday School<br>
<INPUT TYPE="checkbox" NAME="Programs[]" VALUE="Bible Studies"">Bible Studies<br>
<INPUT TYPE="checkbox" NAME="Programs[]" VALUE="Children's Programs">Children's programs<br>
<INPUT TYPE="checkbox" NAME="Programs[]" VALUE="Missions">Missions<br>
<INPUT TYPE="checkbox" NAME="Programs[]" VALUE="Music">Music/Choir<br>
<INPUT TYPE="checkbox" NAME="Programs[]" VALUE="Youth">Youth group<br><br>
Please add any additional comments or questions in the box below:<br>
<TEXTAREA NAME="comments" ROWS=10 COLS=60>
</TEXTAREA>
<br><br>
<input type="submit" name="submit" value="Submit"><br<br>
<hr width="100%">

</div>
</body>

</html>

 

feedback.php:

 



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>
<body>
<?php
$checkbox0 = $_POST['Programs'][0];
$checkbox1 = $_POST['Programs'][1];
$checkbox2 = $_POST['Programs'][2];
$checkbox3 = $_POST['Programs'][3];
$checkbox4 = $_POST['Programs'][4];
$checkbox5 = $_POST['Programs'][5];
?>
<?php
$formBody="Name:$name\nEmail:$email\nPhone:$phone\nAddress:$address\nI'd like more information on the following programs: $checkbox0, $checkbox1, $checkbox2, $checkbox3, $checkbox4, $checkbox5 \nComments:$comments";
$headers = "From:$email";

if ($submit) {
mail("wolverineken@yahoo.com", "Church Information Request",$formBody, $headers);
print "Thank you. Your request has been submitted <br /> <br />";
print "Current date and time :";
print date("F j, Y  g:i A T");
}


?>

</body>
</html>

 

Just to clarify, when the form is submitted, the actual code inside if($submit) is printed out.

 

 

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.