joop
11-21-2004, 09:50 PM
Hello all (if there are any - well i expect it will grow :D )
I am having trouble with something really stupid....
The easiest way to explain is to show you my code unfortunately there is a lot - so in advance im sorry.
OK there are three pages the first : pre_contact.html
<html>
<head>
<title>Select your contact</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../CSS/preliminary.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0">
<table align="center" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width=14%"></td>
<td width="800" height="200" background="graphic/title_image.jpg" valign="top" >
<table width="803" cellpadding="10">
<tr>
<td width="96" ><font size="12" face="Comic Sans MS"> Contact</font></td>
</tr>
</table>
<table width="803" cellpadding="0">
<tr>
<td width="95"></td>
<td width="660" valign="top"><font size="8" face="Comic Sans MS">inciter.org.uk</font></td>
<tr>
</table>
</td>
<td width=14%"></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<th width="750" height="25"></th>
<th width="25"><a href="index.html"><img src="graphic/back.jpg" width="25" height="25" border="none"></a></th>
<th width="125"></th>
</tr>
</table>
<table width="100%" border="0" cellpadding="2" cellspacing="3" class="fontstyledefault">
<tr>
<td width="14%" scope="col" valign="top">
</td>
<td width="72%" scope="col" valign="top" align="left">
<FORM NAME="contact" action="contact.php" method="POST">
<TABLE align="center" border="0" cellpadding="3" cellspacing="3" width="676">
<TR>
<TD width="196" align="right" valign="top"> Select Contact: </TD>
<TD width="206" align="center" valign="top">
<SELECT NAME="cont_act">
<OPTION VALUE="support">Support
<OPTION SELECTED VALUE="feedback">Feedback
<OPTION VALUE="complaint">Complaints
<OPTION VALUE="brainstorm">Brainstorm
<OPTION VALUE="volunteer">Volunteer
</SELECT>
</TD>
<td width="244" valign="top">&nbsp;</td>
</TR>
</TABLE>
<table>
<tr>
<td width="67"></td>
<td width="667" align="center">
<INPUT TYPE="submit" value="Continue">
<INPUT TYPE="reset" value="Reset Selection">
</td>
</tr>
</table>
</FORM>
</td>
<th width="14%" scope="col" valign="top">&nbsp;</th>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<th width="725" height="25"></th>
<th width="25"><img src="graphic/back.jpg" width="25" height="25" border="none" usemap="#back"></th>
<th width="25" valign="middle" align="center"><img src="graphic/top.jpg" width="25" height="25" border="none" usemap="#top"></th>
<th width="125"></th>
</tr>
</table>
<map name="back">
<area shape="rect" coords="-2,-13,36,28" href="index.html">
</map>
<map name="top">
<area shape="rect" coords="-1,-2,38,29" href="#" target="_top">
</map>
</body>
</html>
The second, called : contact.php
It's here that everything seems ok.
<!-- PHP BEGINS -->
<?php
$cont_act=$HTTP_POST_VARS['cont_act'];
?>
<!-- PHP ENDS -->
<html>
<head>
<title>Contact inciter.org.uk</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../CSS/preliminary.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0">
<table align="center" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width=14%"></td>
<td width="800" height="200" background="graphic/title_image.jpg" valign="top">
<table width="803" cellpadding="10">
<tr>
<td width="96"><font size="10" face="Comic Sans MS"> Contact</font></td>
</tr>
</table>
<table width="803" cellpadding="0">
<tr>
<td width="95"></td>
<td width="660" valign="top"><font size="8" face="Comic Sans MS">inciter.org.uk</font></td>
<tr>
</table>
</td>
<td width=14%"></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<th width="750" height="25"></th>
<th width="25"><a href="pre_contact.html"><img src="graphic/back.jpg" width="25" height="25" border="none"></a></th>
<th width="125"></th>
</tr>
</table>
<table width="100%" border="0" cellpadding="2" cellspacing="3" class="fontstyledefault">
<tr>
<td width="14%" scope="col" valign="top">
</td>
<td width="72%" scope="col" valign="top" align="left">
<?php
echo '<FORM NAME="contact" action="process_contact.php?$cont_act=$cont_act" method="POST">
<TABLE align="center" border="0" cellpadding="3" cellspacing="3" width="676">
<TR>
<TD align="right" width="154">Contact:</TD>
<TD width="501">';
if(!$cont_act)
{
echo "Failed to process contact selection !";
}
else
{
echo $cont_act." "; // don't ask - i get a parse error unexpected ';' on line X (if i do not put the " " before ';')
}
echo '</TD></TR></TABLE>
<TABLE align="center" border="0" cellpadding="3" cellspacing="3" width="676">
<TR>
<TD> <font color="green">TODO: Add details in relation to contact
selected.</font>';
switch($cont_act)
{
case 'support' :
echo '<br>Support details <br />';
break;
case 'feedback' :
echo '<br>feedback details <br />';
break;
case 'complaint' :
echo '<br>complaint details <br />';
break;
case 'brainstorm' :
break;
case 'volunteer' :
echo '<br>volunteer details <br />';
break;
default :
echo '<br>failed to process information <br>regarding your contact selection <br />';
break;
}
echo '</TD></TR></TABLE>
<TABLE align="center" border="0" cellpadding="3" cellspacing="3" width="676">
<TR>
<TD align="right" width="156">*First Name:</TD>
<TD width="499">
<INPUT TYPE="text" size="30" name="f_name"></TD>
<TR>
<TD align="right" width="156">*Last Name:</TD>
<TD width="499">
<INPUT TYPE="text" size="30" name="l_name"></TD>
</TR>
<tr>
<TD align="right" width="156">*E-Mail Address:</TD>
<TD width="499">
<INPUT TYPE="text" size="40" name="email"></TD>
</tr>
</TABLE>
<table align="center" width="676">
<tr>
<td width="160" align="right">Subject:</td>
<td><INPUT TYPE="text" size="40" name="subject"></td>
</tr>
<tr>
<td width="160" align="right" valign="top">Comments: </td>
<td align="left" width="504">
<TEXTAREA NAME="comments" ROWS="10" COLS="55" WRAP></TEXTAREA>
</td>
</tr>
</table>
<table>
<tr>
<td>
<INPUT TYPE="submit" value="Submit Message">
<INPUT TYPE="reset" value="Reset Message">
</td>
</tr>
</table>
</FORM>';
?>
</td>
<th width="14%" scope="col" valign="top">&nbsp;</th>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<th width="725" height="25"></th>
<th width="25"><img src="graphic/back.jpg" width="25" height="25" border="none" usemap="#back"></th>
<th width="25" valign="middle" align="center"><img src="graphic/top.jpg" width="25" height="25" border="none" usemap="#top"></th>
<th width="125"></th>
</tr>
</table>
<map name="back">
<area shape="rect" coords="-2,-13,36,28" href="pre_contact.html">
</map>
<map name="top">
<area shape="rect" coords="-1,-2,38,29" href="#" target="_top">
</map>
</body>
</html>
The next page seems to fail to recieve the variable $cont_act i don't really understand whats supposed to happen, when or even where.
This final page is called : process_contact.php
<?php
//experiment
//create short variable names
$f_name=$HTTP_POST_VARS['f_name'];
$l_name=$HTTP_POST_VARS['l_name'];
$email=$HTTP_POST_VARS['email'];
$comments=$HTTP_POST_VARS['comments'];
$subject=$HTTP_POST_VARS['subject'];
$mail_content = 'Customer name: ' .$f_name." ".$l_name."\n"
.'Customer e-mail: ' .$email."\n"
."Customer comments: \n".$comments."\n";
switch($_GET['cont_act'])
{
case 'support' :
$toaddress='support@inciter.org.uk';
break;
case 'feedback' :
$toaddress='feedback@inciter.org.uk';
break;
case 'complaint' :
$toaddress='complaints@inciter.org.uk';
break;
case 'brainstorm' :
$toaddress='brainstorm@inciter.org.uk';
break;
case 'volunteer' :
$toaddress='volunteer@inciter.org.uk';
break;
default :
$toaddress='geoff@inciter.org.uk';
break;
}
$fromaddress = 'inciter.org.uk';
mail($toaddress, $subject, $mail_content, $fromaddress);
?>
<html>
<head>
<title>Contact processed</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../CSS/preliminary.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0">
<table align="center" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width=14%"></td>
<td width="800" height="200" background="graphic/title_image.jpg" valign="top" >
<table width="803" cellpadding="10">
<tr>
<td width="96" ><font size="12" face="Comic Sans MS"> Contact</font></td>
</tr>
</table>
<table width="803" cellpadding="0">
<tr>
<td width="147"></td>
<td width="648" valign="top"><font size="12" face="Comic Sans MS">status</font></td>
<tr>
</table>
</td>
<td width=14%"></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<th width="750" height="25"></th>
<th width="25"><a href="index.html"><img src="graphic/back.jpg" width="25" height="25" border="none"></a></th>
<th width="125"></th>
</tr>
</table>
<table width="100%" border="0" cellpadding="2" cellspacing="3" class="fontstyledefault">
<tr>
<td width="14%" scope="col" valign="top"></td>
<td width="72%" scope="col" valign="top" align="left"> Thankyou for contacting
inciter your mail has been sent to
<?php
echo $cont_act;
echo 'at the e-mail address : ' .$toaddress;
?> with success.</td>
<td width="14%" scope="col" valign="top"></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<th width="725" height="25"></th>
<th width="25"><img src="graphic/back.jpg" width="25" height="25" border="none" usemap="#back"></th>
<th width="25" valign="middle" align="center"><img src="graphic/top.jpg" width="25" height="25" border="none" usemap="#top"></th>
<th width="125"></th>
</tr>
</table>
<map name="back">
<area shape="rect" coords="-2,-13,36,28" href="index.html">
</map>
<map name="top">
<area shape="rect" coords="-1,-2,38,29" href="#" target="_top">
</map>
</body>
</html>
Again sorry for the length in message. Thanks for any input :-)
[/b]
I am having trouble with something really stupid....
The easiest way to explain is to show you my code unfortunately there is a lot - so in advance im sorry.
OK there are three pages the first : pre_contact.html
<html>
<head>
<title>Select your contact</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../CSS/preliminary.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0">
<table align="center" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width=14%"></td>
<td width="800" height="200" background="graphic/title_image.jpg" valign="top" >
<table width="803" cellpadding="10">
<tr>
<td width="96" ><font size="12" face="Comic Sans MS"> Contact</font></td>
</tr>
</table>
<table width="803" cellpadding="0">
<tr>
<td width="95"></td>
<td width="660" valign="top"><font size="8" face="Comic Sans MS">inciter.org.uk</font></td>
<tr>
</table>
</td>
<td width=14%"></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<th width="750" height="25"></th>
<th width="25"><a href="index.html"><img src="graphic/back.jpg" width="25" height="25" border="none"></a></th>
<th width="125"></th>
</tr>
</table>
<table width="100%" border="0" cellpadding="2" cellspacing="3" class="fontstyledefault">
<tr>
<td width="14%" scope="col" valign="top">
</td>
<td width="72%" scope="col" valign="top" align="left">
<FORM NAME="contact" action="contact.php" method="POST">
<TABLE align="center" border="0" cellpadding="3" cellspacing="3" width="676">
<TR>
<TD width="196" align="right" valign="top"> Select Contact: </TD>
<TD width="206" align="center" valign="top">
<SELECT NAME="cont_act">
<OPTION VALUE="support">Support
<OPTION SELECTED VALUE="feedback">Feedback
<OPTION VALUE="complaint">Complaints
<OPTION VALUE="brainstorm">Brainstorm
<OPTION VALUE="volunteer">Volunteer
</SELECT>
</TD>
<td width="244" valign="top">&nbsp;</td>
</TR>
</TABLE>
<table>
<tr>
<td width="67"></td>
<td width="667" align="center">
<INPUT TYPE="submit" value="Continue">
<INPUT TYPE="reset" value="Reset Selection">
</td>
</tr>
</table>
</FORM>
</td>
<th width="14%" scope="col" valign="top">&nbsp;</th>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<th width="725" height="25"></th>
<th width="25"><img src="graphic/back.jpg" width="25" height="25" border="none" usemap="#back"></th>
<th width="25" valign="middle" align="center"><img src="graphic/top.jpg" width="25" height="25" border="none" usemap="#top"></th>
<th width="125"></th>
</tr>
</table>
<map name="back">
<area shape="rect" coords="-2,-13,36,28" href="index.html">
</map>
<map name="top">
<area shape="rect" coords="-1,-2,38,29" href="#" target="_top">
</map>
</body>
</html>
The second, called : contact.php
It's here that everything seems ok.
<!-- PHP BEGINS -->
<?php
$cont_act=$HTTP_POST_VARS['cont_act'];
?>
<!-- PHP ENDS -->
<html>
<head>
<title>Contact inciter.org.uk</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../CSS/preliminary.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0">
<table align="center" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width=14%"></td>
<td width="800" height="200" background="graphic/title_image.jpg" valign="top">
<table width="803" cellpadding="10">
<tr>
<td width="96"><font size="10" face="Comic Sans MS"> Contact</font></td>
</tr>
</table>
<table width="803" cellpadding="0">
<tr>
<td width="95"></td>
<td width="660" valign="top"><font size="8" face="Comic Sans MS">inciter.org.uk</font></td>
<tr>
</table>
</td>
<td width=14%"></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<th width="750" height="25"></th>
<th width="25"><a href="pre_contact.html"><img src="graphic/back.jpg" width="25" height="25" border="none"></a></th>
<th width="125"></th>
</tr>
</table>
<table width="100%" border="0" cellpadding="2" cellspacing="3" class="fontstyledefault">
<tr>
<td width="14%" scope="col" valign="top">
</td>
<td width="72%" scope="col" valign="top" align="left">
<?php
echo '<FORM NAME="contact" action="process_contact.php?$cont_act=$cont_act" method="POST">
<TABLE align="center" border="0" cellpadding="3" cellspacing="3" width="676">
<TR>
<TD align="right" width="154">Contact:</TD>
<TD width="501">';
if(!$cont_act)
{
echo "Failed to process contact selection !";
}
else
{
echo $cont_act." "; // don't ask - i get a parse error unexpected ';' on line X (if i do not put the " " before ';')
}
echo '</TD></TR></TABLE>
<TABLE align="center" border="0" cellpadding="3" cellspacing="3" width="676">
<TR>
<TD> <font color="green">TODO: Add details in relation to contact
selected.</font>';
switch($cont_act)
{
case 'support' :
echo '<br>Support details <br />';
break;
case 'feedback' :
echo '<br>feedback details <br />';
break;
case 'complaint' :
echo '<br>complaint details <br />';
break;
case 'brainstorm' :
break;
case 'volunteer' :
echo '<br>volunteer details <br />';
break;
default :
echo '<br>failed to process information <br>regarding your contact selection <br />';
break;
}
echo '</TD></TR></TABLE>
<TABLE align="center" border="0" cellpadding="3" cellspacing="3" width="676">
<TR>
<TD align="right" width="156">*First Name:</TD>
<TD width="499">
<INPUT TYPE="text" size="30" name="f_name"></TD>
<TR>
<TD align="right" width="156">*Last Name:</TD>
<TD width="499">
<INPUT TYPE="text" size="30" name="l_name"></TD>
</TR>
<tr>
<TD align="right" width="156">*E-Mail Address:</TD>
<TD width="499">
<INPUT TYPE="text" size="40" name="email"></TD>
</tr>
</TABLE>
<table align="center" width="676">
<tr>
<td width="160" align="right">Subject:</td>
<td><INPUT TYPE="text" size="40" name="subject"></td>
</tr>
<tr>
<td width="160" align="right" valign="top">Comments: </td>
<td align="left" width="504">
<TEXTAREA NAME="comments" ROWS="10" COLS="55" WRAP></TEXTAREA>
</td>
</tr>
</table>
<table>
<tr>
<td>
<INPUT TYPE="submit" value="Submit Message">
<INPUT TYPE="reset" value="Reset Message">
</td>
</tr>
</table>
</FORM>';
?>
</td>
<th width="14%" scope="col" valign="top">&nbsp;</th>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<th width="725" height="25"></th>
<th width="25"><img src="graphic/back.jpg" width="25" height="25" border="none" usemap="#back"></th>
<th width="25" valign="middle" align="center"><img src="graphic/top.jpg" width="25" height="25" border="none" usemap="#top"></th>
<th width="125"></th>
</tr>
</table>
<map name="back">
<area shape="rect" coords="-2,-13,36,28" href="pre_contact.html">
</map>
<map name="top">
<area shape="rect" coords="-1,-2,38,29" href="#" target="_top">
</map>
</body>
</html>
The next page seems to fail to recieve the variable $cont_act i don't really understand whats supposed to happen, when or even where.
This final page is called : process_contact.php
<?php
//experiment
//create short variable names
$f_name=$HTTP_POST_VARS['f_name'];
$l_name=$HTTP_POST_VARS['l_name'];
$email=$HTTP_POST_VARS['email'];
$comments=$HTTP_POST_VARS['comments'];
$subject=$HTTP_POST_VARS['subject'];
$mail_content = 'Customer name: ' .$f_name." ".$l_name."\n"
.'Customer e-mail: ' .$email."\n"
."Customer comments: \n".$comments."\n";
switch($_GET['cont_act'])
{
case 'support' :
$toaddress='support@inciter.org.uk';
break;
case 'feedback' :
$toaddress='feedback@inciter.org.uk';
break;
case 'complaint' :
$toaddress='complaints@inciter.org.uk';
break;
case 'brainstorm' :
$toaddress='brainstorm@inciter.org.uk';
break;
case 'volunteer' :
$toaddress='volunteer@inciter.org.uk';
break;
default :
$toaddress='geoff@inciter.org.uk';
break;
}
$fromaddress = 'inciter.org.uk';
mail($toaddress, $subject, $mail_content, $fromaddress);
?>
<html>
<head>
<title>Contact processed</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../CSS/preliminary.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0">
<table align="center" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width=14%"></td>
<td width="800" height="200" background="graphic/title_image.jpg" valign="top" >
<table width="803" cellpadding="10">
<tr>
<td width="96" ><font size="12" face="Comic Sans MS"> Contact</font></td>
</tr>
</table>
<table width="803" cellpadding="0">
<tr>
<td width="147"></td>
<td width="648" valign="top"><font size="12" face="Comic Sans MS">status</font></td>
<tr>
</table>
</td>
<td width=14%"></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<th width="750" height="25"></th>
<th width="25"><a href="index.html"><img src="graphic/back.jpg" width="25" height="25" border="none"></a></th>
<th width="125"></th>
</tr>
</table>
<table width="100%" border="0" cellpadding="2" cellspacing="3" class="fontstyledefault">
<tr>
<td width="14%" scope="col" valign="top"></td>
<td width="72%" scope="col" valign="top" align="left"> Thankyou for contacting
inciter your mail has been sent to
<?php
echo $cont_act;
echo 'at the e-mail address : ' .$toaddress;
?> with success.</td>
<td width="14%" scope="col" valign="top"></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<th width="725" height="25"></th>
<th width="25"><img src="graphic/back.jpg" width="25" height="25" border="none" usemap="#back"></th>
<th width="25" valign="middle" align="center"><img src="graphic/top.jpg" width="25" height="25" border="none" usemap="#top"></th>
<th width="125"></th>
</tr>
</table>
<map name="back">
<area shape="rect" coords="-2,-13,36,28" href="index.html">
</map>
<map name="top">
<area shape="rect" coords="-1,-2,38,29" href="#" target="_top">
</map>
</body>
</html>
Again sorry for the length in message. Thanks for any input :-)
[/b]