Jump to content

PHP Form syntax written correctly but it doesnt work!


Iroken22

Recommended Posts

I have a site at http://forms.peoriatroop333.org/postcalendar.php . There is a form at the bottom of the page. Wen you click the submit button, the action is it refers to the contCal.php file for what to do with the form. The Email gets sent correctly but it is like it doesnt not reognize the header code and instead it just goes to a blank page. I have no clue what is wrong. I also have another form at http://forms.peoriatroop333.org/Join.php. If you click the submit button on that form its header does work and it redirects back to Join.php.  all of these files are in a folder called Forms. The Code For all the files will be listed below.

 

-----Postcalendar.php Code-----

 

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

<html xmlns="http://www.w3.org/1999/xhtml">

 

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Post Calendar</title>

<style type="text/css">

.style1 {

text-align: center;

font-size: xx-large;

}

.style2 {

text-align: center;

font-size: x-large;

}

.style17 {

margin-right: 0px;

}

.style19 {

text-align: left;

}

.style18 {

text-align: left;

font-size: x-large;

}

.style20 {

font-size: xx-large;

}

.style10 {

text-align: center;

}

.style15 {

border-width: 0;

text-decoration: underline;

}

.style21 {

font-size: large;

text-align: left;

}

.style22 {

font-size: large;

text-align: center;

}

</style>

<script type="text/javascript">

<!--

function FP_preloadImgs() {//v1.0

var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();

for(var i=0; i<a.length; i++) { d.FP_imgs=new Image; d.FP_imgs.src=a; }

}

 

function FP_swapImg() {//v1.0

var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;

n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;

elm.$src=elm.src; elm.src=args[n+1]; } }

}

 

function FP_getObjectByID(id,o) {//v1.0

var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);

else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;

if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if©

for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }

f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;

for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }

return null;

}

// -->

</script>

</head>

 

<body style="margin-right: 150px; background-color: #FFFF99" onload="FP_preloadImgs(/*url*/'PostCalendar/button447.gif',/*url*/'PostCalendar/button448.gif',/*url*/'PostCalendar/button44A.gif',/*url*/'PostCalendar/button44B.gif',/*url*/'PostCalendar/button44D.gif',/*url*/'PostCalendar/button44E.gif',/*url*/'PostCalendar/button450.gif',/*url*/'PostCalendar/button451.gif',/*url*/'PostCalendar/button453.gif',/*url*/'PostCalendar/button454.gif',/*url*/'PostCalendar/button456.gif',/*url*/'PostCalendar/button457.gif',/*url*/'PostCalendar/button459.gif',/*url*/'PostCalendar/button45A.gif',/*url*/'PostCalendar/button45C.gif',/*url*/'PostCalendar/button45D.gif',/*url*/'PostCalendar/button45F.gif',/*url*/'PostCalendar/button460.gif',/*url*/'PostCalendar/button462.gif',/*url*/'PostCalendar/button463.gif',/*url*/'PostCalendar/button465.gif',/*url*/'PostCalendar/button466.gif')">

 

<table style="width: 100%; height: 706px">

<tr>

<td style="width: 232px" valign="top" rowspan="4"><strong>

<a href="http://www.peoriatroop333.org">

<img alt="On My Honor  *Timeless Values*" src="Admin/On%20My%20Honor.gif" width="214" height="199" style="float: left" align="top" class="style15" longdesc="Circle with Boy scout symbol in middle and On My Honor  *Timeless Values*" /></a></strong></td>

<td style="width: 658px; height: 70px" class="style1"> B.S.A. Troop 333 Peoria,

Illinois</td>

<td rowspan="4"> </td>

</tr>

<tr>

<td style="width: 658px" valign="top" class="style1">W.D. Boyce Council

- Heartland District</td>

</tr>

<tr>

<td style="width: 658px"> </td>

</tr>

<tr>

<td style="width: 658px; height: 75px" valign="top"><hr /></td>

</tr>

<tr>

<td style="width: 232px; height: 324px;" valign="top">

<a href="index.php">

<img style="border: 0" id="img12" src="PostCalendar/button446.gif" height="40" width="121" alt="Home" onmouseover="FP_swapImg(1,0,/*id*/'img12',/*url*/'PostCalendar/button447.gif')" onmouseout="FP_swapImg(0,0,/*id*/'img12',/*url*/'PostCalendar/button446.gif')" onmousedown="FP_swapImg(1,0,/*id*/'img12',/*url*/'PostCalendar/button448.gif')" onmouseup="FP_swapImg(0,0,/*id*/'img12',/*url*/'PostCalendar/button447.gif')" /><!-- MSComment="ibutton" fp-style="fp-btn: Embossed Tab 7; fp-font-style: Bold; fp-font-size: 12; fp-transparent: 1" fp-title="Home" --></a><br />

<a href="Calendar.php">

<img style="border: 0" id="img13" src="PostCalendar/button449.gif" height="40" width="121" alt="Calendar" onmouseover="FP_swapImg(1,0,/*id*/'img13',/*url*/'PostCalendar/button44A.gif')" onmouseout="FP_swapImg(0,0,/*id*/'img13',/*url*/'PostCalendar/button449.gif')" onmousedown="FP_swapImg(1,0,/*id*/'img13',/*url*/'PostCalendar/button44B.gif')" onmouseup="FP_swapImg(0,0,/*id*/'img13',/*url*/'PostCalendar/button44A.gif')" /><!-- MSComment="ibutton" fp-style="fp-btn: Embossed Tab 7; fp-font-style: Bold; fp-font-size: 12; fp-transparent: 1" fp-title="Calendar" --></a><br />

<a href="News.php">

<img style="border: 0" id="img14" src="PostCalendar/button44C.gif" height="40" width="121" alt="News" onmouseover="FP_swapImg(1,0,/*id*/'img14',/*url*/'PostCalendar/button44D.gif')" onmouseout="FP_swapImg(0,0,/*id*/'img14',/*url*/'PostCalendar/button44C.gif')" onmousedown="FP_swapImg(1,0,/*id*/'img14',/*url*/'PostCalendar/button44E.gif')" onmouseup="FP_swapImg(0,0,/*id*/'img14',/*url*/'PostCalendar/button44D.gif')" /><!-- MSComment="ibutton" fp-style="fp-btn: Embossed Tab 7; fp-font-style: Bold; fp-font-size: 12; fp-transparent: 1" fp-title="News" --></a><br />

<a href="Troop%20Info.php">

<img style="border: 0" id="img15" src="PostCalendar/button44F.gif" height="40" width="121" alt="Troop Only" onmouseover="FP_swapImg(1,0,/*id*/'img15',/*url*/'PostCalendar/button450.gif')" onmouseout="FP_swapImg(0,0,/*id*/'img15',/*url*/'PostCalendar/button44F.gif')" onmousedown="FP_swapImg(1,0,/*id*/'img15',/*url*/'PostCalendar/button451.gif')" onmouseup="FP_swapImg(0,0,/*id*/'img15',/*url*/'PostCalendar/button450.gif')" /><!-- MSComment="ibutton" fp-style="fp-btn: Embossed Tab 7; fp-font-style: Bold; fp-font-size: 12; fp-transparent: 1" fp-title="Troop Only" --></a><br />

<a href="Campout.php">

<img style="border: 0" id="img16" src="PostCalendar/button452.gif" height="40" width="121" alt="Activities" onmouseover="FP_swapImg(1,0,/*id*/'img16',/*url*/'PostCalendar/button453.gif')" onmouseout="FP_swapImg(0,0,/*id*/'img16',/*url*/'PostCalendar/button452.gif')" onmousedown="FP_swapImg(1,0,/*id*/'img16',/*url*/'PostCalendar/button454.gif')" onmouseup="FP_swapImg(0,0,/*id*/'img16',/*url*/'PostCalendar/button453.gif')" /><!-- MSComment="ibutton" fp-style="fp-btn: Embossed Tab 7; fp-font-style: Bold; fp-font-size: 12; fp-transparent: 1" fp-title="Activities" --></a><br />

<a href="Photos.php">

<img style="border: 0" id="img17" src="PostCalendar/button455.gif" height="40" width="121" alt="Photos" onmouseover="FP_swapImg(1,0,/*id*/'img17',/*url*/'PostCalendar/button456.gif')" onmouseout="FP_swapImg(0,0,/*id*/'img17',/*url*/'PostCalendar/button455.gif')" onmousedown="FP_swapImg(1,0,/*id*/'img17',/*url*/'PostCalendar/button457.gif')" onmouseup="FP_swapImg(0,0,/*id*/'img17',/*url*/'PostCalendar/button456.gif')" /><!-- MSComment="ibutton" fp-style="fp-btn: Embossed Tab 7; fp-font-style: Bold; fp-font-size: 12; fp-transparent: 1" fp-title="Photos" --></a><br />

<a href="Links.php">

<img style="border: 0" id="img18" src="PostCalendar/button458.gif" height="40" width="121" alt="Links" onmouseover="FP_swapImg(1,0,/*id*/'img18',/*url*/'PostCalendar/button459.gif')" onmouseout="FP_swapImg(0,0,/*id*/'img18',/*url*/'PostCalendar/button458.gif')" onmousedown="FP_swapImg(1,0,/*id*/'img18',/*url*/'PostCalendar/button45A.gif')" onmouseup="FP_swapImg(0,0,/*id*/'img18',/*url*/'PostCalendar/button459.gif')" /><!-- MSComment="ibutton" fp-style="fp-btn: Embossed Tab 7; fp-font-style: Bold; fp-font-size: 12; fp-transparent: 1" fp-title="Links" --></a><br />

<a href="About%20Us.php">

<img style="border: 0" id="img19" src="PostCalendar/button45B.gif" height="40" width="121" alt="About Us" onmouseover="FP_swapImg(1,0,/*id*/'img19',/*url*/'PostCalendar/button45C.gif')" onmouseout="FP_swapImg(0,0,/*id*/'img19',/*url*/'PostCalendar/button45B.gif')" onmousedown="FP_swapImg(1,0,/*id*/'img19',/*url*/'PostCalendar/button45D.gif')" onmouseup="FP_swapImg(0,0,/*id*/'img19',/*url*/'PostCalendar/button45C.gif')" /><!-- MSComment="ibutton" fp-style="fp-btn: Embossed Tab 7; fp-font-style: Bold; fp-font-size: 12; fp-transparent: 1" fp-title="About Us" --></a><br />

<a href="Games.php">

<img style="border: 0" id="img20" src="PostCalendar/button45E.gif" height="40" width="121" alt="Games" onmouseover="FP_swapImg(1,0,/*id*/'img20',/*url*/'PostCalendar/button45F.gif')" onmouseout="FP_swapImg(0,0,/*id*/'img20',/*url*/'PostCalendar/button45E.gif')" onmousedown="FP_swapImg(1,0,/*id*/'img20',/*url*/'PostCalendar/button460.gif')" onmouseup="FP_swapImg(0,0,/*id*/'img20',/*url*/'PostCalendar/button45F.gif')" /><!-- MSComment="ibutton" fp-style="fp-btn: Embossed Tab 7; fp-font-style: Bold; fp-font-size: 12; fp-transparent: 1" fp-title="Games" --></a><br />

<a href="admin.php">

<img style="border: 0" id="img21" src="PostCalendar/button461.gif" height="40" width="121" alt="Admin Only" onmouseover="FP_swapImg(1,0,/*id*/'img21',/*url*/'PostCalendar/button462.gif')" onmouseout="FP_swapImg(0,0,/*id*/'img21',/*url*/'PostCalendar/button461.gif')" onmousedown="FP_swapImg(1,0,/*id*/'img21',/*url*/'PostCalendar/button463.gif')" onmouseup="FP_swapImg(0,0,/*id*/'img21',/*url*/'PostCalendar/button462.gif')" /><!-- MSComment="ibutton" fp-style="fp-btn: Embossed Tab 7; fp-font-style: Bold; fp-font-size: 12; fp-transparent: 1" fp-title="Admin Only" --></a><br />

<a href="Support.php">

<img style="border: 0" id="img22" src="PostCalendar/button464.gif" height="40" width="121" alt="Support" onmouseover="FP_swapImg(1,0,/*id*/'img22',/*url*/'PostCalendar/button465.gif')" onmouseout="FP_swapImg(0,0,/*id*/'img22',/*url*/'PostCalendar/button464.gif')" onmousedown="FP_swapImg(1,0,/*id*/'img22',/*url*/'PostCalendar/button466.gif')" onmouseup="FP_swapImg(0,0,/*id*/'img22',/*url*/'PostCalendar/button465.gif')" /><!-- MSComment="ibutton" fp-style="fp-btn: Embossed Tab 7; fp-font-style: Bold; fp-font-size: 12; fp-transparent: 1" fp-title="Support" --></a></td>

<td style="width: 658px; height: 324px;" valign="top" class="style2">

<table style="width: 100%" class="style17">

<tr>

<td>Have something you want posted on the

calendar? Follow these easy steps to get it done.<br />

</td>

</tr>

<tr>

<td>

<ol>

<li class="style19">Gather dates!</li>

<li class="style18">Send dates to

<a href="mailto:Calendaradd@peoriatroop333.org">

Calendaradd@peoriatroop333.org</a>  </li>

<li class="style19">Dates will be reviewed and added if

deemed that they are relevant to scouting.</li>

</ol>

<p><strong><span class="style20">OR</span></strong></p>

<p>Fill out the form below and send it.</p>

<form action="contCal.php" method="post">

<table style="width: 100%" cellspacing="7">

<tr>

<td style="width: 164px" class="style21">

<label id="Label1">Your Name:</label></td>

<td class="style19">

<input name="Name" type="text" style="width: 221px" /></td>

</tr>

<tr>

<td style="width: 164px" class="style21">

<label id="Label2">E-mail Address:</label></td>

<td class="style19">

<input name="Email" type="text" style="width: 217px" /></td>

</tr>

<tr>

<td style="width: 164px" class="style21">

<label id="Label1">Name of Event:</label></td>

<td class="style19">

<input name="Event" type="text" style="width: 217px" /></td>

</tr>

<tr>

<td style="width: 164px" class="style21">

<label id="Label3">Date of Event:</label></td>

<td class="style19">

<input name="Date1" type="text" style="width: 216px" /></td>

</tr>

<tr>

<td style="width: 164px" class="style21">

<label id="Label4">Time of Event:</label></td>

<td class="style19">

<input name="Time1" type="text" style="width: 219px" /></td>

</tr>

<tr>

<td style="width: 164px" class="style21">

<label id="Label5">Event Comments:</label></td>

<td class="style19">

<input name="Comment" type="text" style="width: 218px" /></td>

</tr>

<tr>

<td style="width: 164px; height: 42px;" class="style21"></td>

<td class="style19" style="height: 42px"><input name="IPAddress" type="hidden" value="<?php echo $_SERVER['REMOTE_ADDR']; ?>" />

<input name="Referrer" type="hidden" value="<?php echo $_SERVER['HTTP_REFERER']; ?>" />

<input name="Date" type="hidden" value="<?php $today = date("F j, Y, g:i a"); ?>" />

<input name="Browser" type="hidden" value="<?php include('browser_detection.php'); ?>" />

<input name="Time" type="hidden" value="<?php print strftime ('%c'); ?>" /> </td>

</tr>

<tr>

<td class="style22" colspan="2">

<input name="Submit1" type="submit" value="Submit" style="width: 58px" />           

<input name="Reset1" type="reset" value="Clear" /></td>

</tr>

</table>

</form>

</td>

</tr>

</table>

</td>

<td style="height: 324px"></td>

</tr>

<tr>

<td style="width: 232px" valign="top"> </td>

<td style="width: 658px" class="style10"><img src="/tinc?key=KwOPkWuw"></td>

<td> </td>

</tr>

<tr>

<td style="width: 232px" valign="top"> </td>

<td style="width: 658px">

 

<p style="text-align:center"><a href="http://joomla.peoriatroop333.com/tinc?key=oxaYala1">Please provide feedback on our website</a></p>

 

</td>

<td> </td>

</tr>

<tr>

<td style="width: 232px" valign="top"> </td>

<td style="width: 658px" class="style10">Contact the Webmaster at <a href="mailto:compunerd451@yahoo.com">

webmaster@peoriatroop333.org</a></td>

<td> </td>

</tr>

</table>

<p style="text-align:center">

<!-- phpmyvisites -->

<a href="http://www.phpmyvisites.net/" title="Free web analytics, website statistics"

onclick="window.open(this.href);return(false);"><script type="text/javascript">

<!--

var a_vars = Array();

var pagename='';

 

var phpmyvisitesSite = 1;

var phpmyvisitesURL = "http://phpmyvisites.peoriatroop333.org/phpmyvisites.php";

//-->

</script>

<script language="javascript" src="http://phpmyvisites.peoriatroop333.org/phpmyvisites.js" type="text/javascript"></script>

<noscript><p>Free web analytics, website statistics

<img src="http://phpmyvisites.peoriatroop333.org/phpmyvisites.php" alt="Statistics" style="border:0" />

</p></noscript></a>

<!-- /phpmyvisites -->

<!-- phpmyvisites -->

<a href="http://www.phpmyvisites.us/" title="Free web analytics, website statistics"

onclick="window.open(this.href);return(false);"><script type="text/javascript">

<!--

var a_vars = Array();

var pagename='';

 

var phpmyvisitesSite = 1;

var phpmyvisitesURL = "http://www.peoriatroop333.org/phpmv2/phpmyvisites.php";

//-->

</script>

<script language="javascript" src="http://www.peoriatroop333.org/phpmv2/phpmyvisites.js" type="text/javascript"></script>

</a>

<!-- /phpmyvisites -->  </p>

 

</body>

 

</html>

 

-----end of PostCalendar.php-----

 

-----Start of contCal.php-----

 

<?php

$Name=$_POST['Name'];

$Email=$_POST['Email'];

$Event=$_POST['Event'];

$Date1=$_POST['Date1'];

$Time1=$_POST['Time1'];

$Comment=$_POST['Comment'];

$IPAddress=$_POST['IPAddress'];

$Referrer=$_POST['Referrer'];

$Date=$_POST['Date'];

$browser = $HTTP_USER_AGENT;

$Time=$_POST['Time'];

$to='compunerd451@insightbb.com';

$subject="Troop 333 Website Form";

$message="E-mail message from Boy Scout Website\n\nName: $Name\nEvent: $Event\nDate: $Date1\nTime: $Time1\nComment: $Comment\nE-mail: $Email\nIP Address: $IPAddress\nReferrer: $Referrer\nDate: $Date\nBrowser: $Browser\nTime: $Time\n";

mail ("webmaster@peoriatroop333.org", "E-mail From: $Name", "$message", "From: $Email");

header("location: http://www.forms.peoriatroop333.org/Postcalendar.php");

?>

 

 

I Really need help with figuring out why on earth this file works all up until the header tag. Please can someone help me???

 

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.