FirstBorn
asked on
Input Form to Display Original webpage After Clicking Submit
Hi Everyone!
I have a webpage that has a few input text boxes that will call a php file to submit info to my e-mail address. This procedure works well. However, I Need a way to Show the current form with text displayed where the input boxes were at originally that reads:
"Your Request Has Been Submitted".
My webpage and script are below.
Thanks in Advance!
:)
FirstBorn
PS. I'm Still kinda newbie-ish to php, so please explain thoroughly, if possible.
Thanks... :)
------------------
Testphp.html:
------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Test Page
</TITLE>
</HEAD>
<table width="100%" border="0" cellpadding="0">
<tr>
<td width="20%" valign="top"><table cellpadding="0"
cellspacing="0" border="0" height="100%">
<tr>
<td><div align="center"><font face="Verdana, Arial,
Helvetica, sans-serif" color="#000000" size="5"> Title
</font></div></td>
</tr>
<tr>
<td><img src="/_blnk.gif" width="150" height="5"></td>
</tr>
<tr>
<td width="169" height="100%" valign="top"
style="padding-top:10px;pa dding-bott om:10px;pa dding-left :10px;">
<table width="95%" border="0" cellpadding="10">
<tr>
<td><div align="center"></div></td>
</tr>
<tr>
<td><div align="center"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">My Page
</div></td>
</tr>
<tr>
<td><div align="center"><a href="link1.html"><font
size="2" face="Verdana, Arial, Helvetica,
sans-serif">link1</font></ a></div><B R>
<BR>
<div align="center"><a href="link2"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">Link 2</font></a></div></td>
</td>
<TR>
<TD>
<BR>
<BR>
<BR>
<div align="center"><B>This is what I need to Work, Thanks! ... :)
</B>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<form action="email.php" method="post">
<div align=left><B>Name</B></di v>
<input type="text" name="name" size="20" maxlength="100"
value="">
<div align=left><B>E-mail</B></ div>
<input type="text" name="email" size="20" maxlength="100"
value="">
<div align=left><B>Subject</B>< /div>
<input type="text" name="altsubject" size="20" maxlength="100"
value="">
<div align=left><B>Comments</B> </div>
<textarea wrap=phyiscal rows="12" name="comments" cols="15"
></textarea>
<BR>
<input type="Submit" name="submit" value="Submit">
<input type="Reset">
<BR>
</form>
</TD>
</TR>
</font>
</div></td>
</tr>
</font></a></div></td>
</tr>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td width="80%" valign="top"><p><a name="top"></a></p>
<table width="95%" border="0" align="center" cellpadding="10">
<tr>
<td valign="top"><table width="100%" border="1"
align="center" cellpadding="10">
<TABLE>
<TR>
<TR>
<TD>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>Title</B><BR>< /FONT>
<hr width="100%" align=center>
</TD>
</TR>
</TABLE>
<CENTER><FONT FACE="Times" SIZE="8" COLOR="#FF0000"><B>
</B></FONT></CENTER>
<FONT FACE="Times New Roman" SIZE="3">
<P>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<table width="90%" border="1" cellspacing="0" cellpadding="5">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<div align='Left'>Please, kick off your
shoes, relax, and</div>
<div>Enjoy the articles included in the links below</div>
<P>This Archive was made JUST FOR YOU!</P>
<P>_</P>
<Div><A HREF="link3.html">Link3</A ></Div>
<P>_</P>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<br>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>More Links</B><BR></FONT>
<hr width="100%" align=center>
<P><A HREF="Link4.html">Link4</A ></P>
<P><A HREF="Link5.html">Link5</A ></P>
<P><A HREF="Link6.html">Link6</A ></P>
</BODY>
</HTML>
-------------------------- ------
Testemail.php
-------------------------- ------
<HTML><Title>Testemail.php </Title><B ody><Cente r></Center >
<?
// Load up from POST
$name=$_POST['name'];
$email=$_POST['email'];
$altsubject=$_POST['altsub ject'];
$allinfo=$_POST['comments' ];
$allinfo=nl2br($allinfo);
// Build message parts
//$recipient = "me@me.com";
$recipient = "me@email.com";
$subject = "Here's My Subject";
$message = "Name: $name\nEmail: $email\nAltSubject:
$altsubject\ncomments: $allinfo\n";
$from = "$email";
// Send mail
mail($recipient,$subject,$ message,$f rom,$altsu bject);
//I Believe that Here is Where I would like to display the current page <-------
//(Testphp.html) with "Your Request Has Been Submitted" <-------
//Displayed Where the Input Boxes were Displayed. <-------
?>
</Body>
</HTML>
-------------------------- ----
I have a webpage that has a few input text boxes that will call a php file to submit info to my e-mail address. This procedure works well. However, I Need a way to Show the current form with text displayed where the input boxes were at originally that reads:
"Your Request Has Been Submitted".
My webpage and script are below.
Thanks in Advance!
:)
FirstBorn
PS. I'm Still kinda newbie-ish to php, so please explain thoroughly, if possible.
Thanks... :)
------------------
Testphp.html:
------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Test Page
</TITLE>
</HEAD>
<table width="100%" border="0" cellpadding="0">
<tr>
<td width="20%" valign="top"><table cellpadding="0"
cellspacing="0" border="0" height="100%">
<tr>
<td><div align="center"><font face="Verdana, Arial,
Helvetica, sans-serif" color="#000000" size="5"> Title
</font></div></td>
</tr>
<tr>
<td><img src="/_blnk.gif" width="150" height="5"></td>
</tr>
<tr>
<td width="169" height="100%" valign="top"
style="padding-top:10px;pa
<table width="95%" border="0" cellpadding="10">
<tr>
<td><div align="center"></div></td>
</tr>
<tr>
<td><div align="center"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">My Page
</div></td>
</tr>
<tr>
<td><div align="center"><a href="link1.html"><font
size="2" face="Verdana, Arial, Helvetica,
sans-serif">link1</font></
<BR>
<div align="center"><a href="link2"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">Link 2</font></a></div></td>
</td>
<TR>
<TD>
<BR>
<BR>
<BR>
<div align="center"><B>This is what I need to Work, Thanks! ... :)
</B>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<form action="email.php" method="post">
<div align=left><B>Name</B></di
<input type="text" name="name" size="20" maxlength="100"
value="">
<div align=left><B>E-mail</B></
<input type="text" name="email" size="20" maxlength="100"
value="">
<div align=left><B>Subject</B><
<input type="text" name="altsubject" size="20" maxlength="100"
value="">
<div align=left><B>Comments</B>
<textarea wrap=phyiscal rows="12" name="comments" cols="15"
></textarea>
<BR>
<input type="Submit" name="submit" value="Submit">
<input type="Reset">
<BR>
</form>
</TD>
</TR>
</font>
</div></td>
</tr>
</font></a></div></td>
</tr>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td width="80%" valign="top"><p><a name="top"></a></p>
<table width="95%" border="0" align="center" cellpadding="10">
<tr>
<td valign="top"><table width="100%" border="1"
align="center" cellpadding="10">
<TABLE>
<TR>
<TR>
<TD>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>Title</B><BR><
<hr width="100%" align=center>
</TD>
</TR>
</TABLE>
<CENTER><FONT FACE="Times" SIZE="8" COLOR="#FF0000"><B>
</B></FONT></CENTER>
<FONT FACE="Times New Roman" SIZE="3">
<P>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<table width="90%" border="1" cellspacing="0" cellpadding="5">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<div align='Left'>Please, kick off your
shoes, relax, and</div>
<div>Enjoy the articles included in the links below</div>
<P>This Archive was made JUST FOR YOU!</P>
<P>_</P>
<Div><A HREF="link3.html">Link3</A
<P>_</P>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<br>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>More Links</B><BR></FONT>
<hr width="100%" align=center>
<P><A HREF="Link4.html">Link4</A
<P><A HREF="Link5.html">Link5</A
<P><A HREF="Link6.html">Link6</A
</BODY>
</HTML>
--------------------------
Testemail.php
--------------------------
<HTML><Title>Testemail.php
<?
// Load up from POST
$name=$_POST['name'];
$email=$_POST['email'];
$altsubject=$_POST['altsub
$allinfo=$_POST['comments'
$allinfo=nl2br($allinfo);
// Build message parts
//$recipient = "me@me.com";
$recipient = "me@email.com";
$subject = "Here's My Subject";
$message = "Name: $name\nEmail: $email\nAltSubject:
$altsubject\ncomments: $allinfo\n";
$from = "$email";
// Send mail
mail($recipient,$subject,$
//I Believe that Here is Where I would like to display the current page <-------
//(Testphp.html) with "Your Request Has Been Submitted" <-------
//Displayed Where the Input Boxes were Displayed. <-------
?>
</Body>
</HTML>
--------------------------
incidentally it appears you're missing a <body> tag just below </HEAD>
loz
loz
ASKER
Hi loz,
I put the page onto my web server, loaded it, and there is the following displaying:
1. Right above the Main Text Input Boxes:
This is what I need to Work, Thanks! ... :)
" method="post">
2. Inside the Text Box for Name, Email, and Subject it shows:
"<? print $_POST["
3. Inside the Text Box for Comments, it shows:
<? print $_POST["comments"]; ?>
These text boxes need to be empty upon loading the page.
Thanks...
:)
FirstBorn
I put the page onto my web server, loaded it, and there is the following displaying:
1. Right above the Main Text Input Boxes:
This is what I need to Work, Thanks! ... :)
" method="post">
2. Inside the Text Box for Name, Email, and Subject it shows:
"<? print $_POST["
3. Inside the Text Box for Comments, it shows:
<? print $_POST["comments"]; ?>
These text boxes need to be empty upon loading the page.
Thanks...
:)
FirstBorn
ASKER
Hi loz,
Also, I click on 'Submit' and I get an "HTTP 404 - File not found" error.
Thanks...
:)
FirstBorn
Also, I click on 'Submit' and I get an "HTTP 404 - File not found" error.
Thanks...
:)
FirstBorn
ASKER
Hi loz,
k... I got it to submit, I had to rename the file to index.php.
After Submitting, though, it doesn't tell the user that the information has been submitted, and keeps the text input boxes on the page with the text that has been submitted in the text input boxes... The User may not know that they had submitted the information and will probably keep resending the information... that is what I'm trying to avoid... :)
Also, I need the page to be named index.html. Should I use an 'include' for the index.php to display the entire contents on the index.html file, and if so, how would I go about doing that? Also, would it affect the functionality?
Thanks...
:)
FirstBorn
k... I got it to submit, I had to rename the file to index.php.
After Submitting, though, it doesn't tell the user that the information has been submitted, and keeps the text input boxes on the page with the text that has been submitted in the text input boxes... The User may not know that they had submitted the information and will probably keep resending the information... that is what I'm trying to avoid... :)
Also, I need the page to be named index.html. Should I use an 'include' for the index.php to display the entire contents on the index.html file, and if so, how would I go about doing that? Also, would it affect the functionality?
Thanks...
:)
FirstBorn
You could add a hidden value in the form, eg
<input type="hidden" name="process" value="yes">
then add this to where you want it to say it has been processed..
<?php
if ($_POST['process']=="yes") {
echo "Form submitted";
}
?>
Of course, you could simply check an exisiting value, for example "name", but if they leave out the name field, it won't process. (i know you probably won't want it to process if they DO leave out the name, but validation is not what you asked for, although my way will make it easier to add validation script later..)
Good luck
<input type="hidden" name="process" value="yes">
then add this to where you want it to say it has been processed..
<?php
if ($_POST['process']=="yes")
echo "Form submitted";
}
?>
Of course, you could simply check an exisiting value, for example "name", but if they leave out the name field, it won't process. (i know you probably won't want it to process if they DO leave out the name, but validation is not what you asked for, although my way will make it easier to add validation script later..)
Good luck
hi,
those problems seem quite strange, maybe to do with the short tags. i've modified the script to be in two parts - i didn't realise you didn't want the information in text boxes after the mail is sent. filename.html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Test Page
</TITLE>
</HEAD>
<BODY>
<table width="100%" border="0" cellpadding="0">
<tr>
<td width="20%" valign="top"><table cellpadding="0"
cellspacing="0" border="0" height="100%">
<tr>
<td><div align="center"><font face="Verdana, Arial,
Helvetica, sans-serif" color="#000000" size="5"> Title
</font></div></td>
</tr>
<tr>
<td><img src="/_blnk.gif" width="150" height="5"></td>
</tr>
<tr>
<td width="169" height="100%" valign="top"
style="padding-top:10px;pa dding-bott om:10px;pa dding-left :10px;">
<table width="95%" border="0" cellpadding="10">
<tr>
<td><div align="center"></div></td>
</tr>
<tr>
<td><div align="center"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">My Page
</div></td>
</tr>
<tr>
<td><div align="center"><a href="link1.html"><font
size="2" face="Verdana, Arial, Helvetica,
sans-serif">link1</font></ a></div><B R>
<BR>
<div align="center"><a href="link2"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">Link 2</font></a></div></td>
</td>
<TR>
<TD>
<BR>
<BR>
<BR>
<div align="center"><B>This is what I need to Work, Thanks! ... :)
</B>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<form action="filename.php" method="post">
<div align=left><B>Name</B></di v>
<input type="text" name="name" size="20" maxlength="100">
<div align=left><B>E-mail</B></ div>
<input type="text" name="email" size="20" maxlength="100">
<div align=left><B>Subject</B>< /div>
<input type="text" name="altsubject" size="20" maxlength="100">
<div align=left><B>Comments</B> </div>
<textarea wrap=phyiscal rows="12" name="comments" cols="15" ></textarea>
<BR>
<input type="hidden" name="submit" value="Submit">
<input type="Submit" name="submit" value="Submit">
<input type="Reset">
<BR>
</form>
</TD>
</TR>
</font>
</div></td>
</tr>
</font></a></div></td>
</tr>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td width="80%" valign="top"><p><a name="top"></a></p>
<table width="95%" border="0" align="center" cellpadding="10">
<tr>
<td valign="top"><table width="100%" border="1"
align="center" cellpadding="10">
<TABLE>
<TR>
<TR>
<TD>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>Title</B><BR>< /FONT>
<hr width="100%" align=center>
</TD>
</TR>
</TABLE>
<CENTER><FONT FACE="Times" SIZE="8" COLOR="#FF0000"><B>
</B></FONT></CENTER>
<FONT FACE="Times New Roman" SIZE="3">
<P>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<table width="90%" border="1" cellspacing="0" cellpadding="5">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<div align='Left'>Please, kick off your
shoes, relax, and</div>
<div>Enjoy the articles included in the links below</div>
<P>This Archive was made JUST FOR YOU!</P>
<P>_</P>
<Div><A HREF="link3.html">Link3</A ></Div>
<P>_</P>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<br>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>More Links</B><BR></FONT>
<hr width="100%" align=center>
<P><A HREF="Link4.html">Link4</A ></P>
<P><A HREF="Link5.html">Link5</A ></P>
<P><A HREF="Link6.html">Link6</A ></P>
</BODY>
</HTML>
filename.php
<HTML>
<HEAD>
<TITLE>Test Page
</TITLE>
</HEAD>
<?php
if($_POST["submit"]) {
// Load up from POST
$name=$_POST['name'];
$email=$_POST['email'];
$altsubject=$_POST['altsub ject'];
$allinfo=$_POST['comments' ];
$allinfo=nl2br($allinfo);
// Build message parts
//$recipient = "me@me.com";
$recipient = "me@email.com";
$subject = "Here's My Subject";
$message = "Name: $name\nEmail: $email\nAltSubject:
$altsubject\ncomments:" . $_POST["comments"] . "\n";
$from = "$email";
// Send mail
mail($recipient,$subject,$ message,$f rom,$altsu bject);
} else {
print "No information sent to script";
}
?>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<div align=left><B>Name</B></di v>
<?php print $name; ?>
<div align=left><B>E-mail</B></ div>
<?php print $email; ?>
<div align=left><B>Subject</B>< /div>
<?php print $altsubject; ?>
<div align=left><B>Comments</B> </div>
<?php print $allinfo; ?>
</BODY>
</HTML>
i changed part of your mail script because you don't want to use nl2br on the comments field in it - line breaks are \n in emails. you need to change the action of the form to suit your filename. if it doesn't work, can you take a view source and paste the result in here, or any relevant errors
cheers,
loz
those problems seem quite strange, maybe to do with the short tags. i've modified the script to be in two parts - i didn't realise you didn't want the information in text boxes after the mail is sent. filename.html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Test Page
</TITLE>
</HEAD>
<BODY>
<table width="100%" border="0" cellpadding="0">
<tr>
<td width="20%" valign="top"><table cellpadding="0"
cellspacing="0" border="0" height="100%">
<tr>
<td><div align="center"><font face="Verdana, Arial,
Helvetica, sans-serif" color="#000000" size="5"> Title
</font></div></td>
</tr>
<tr>
<td><img src="/_blnk.gif" width="150" height="5"></td>
</tr>
<tr>
<td width="169" height="100%" valign="top"
style="padding-top:10px;pa
<table width="95%" border="0" cellpadding="10">
<tr>
<td><div align="center"></div></td>
</tr>
<tr>
<td><div align="center"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">My Page
</div></td>
</tr>
<tr>
<td><div align="center"><a href="link1.html"><font
size="2" face="Verdana, Arial, Helvetica,
sans-serif">link1</font></
<BR>
<div align="center"><a href="link2"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">Link 2</font></a></div></td>
</td>
<TR>
<TD>
<BR>
<BR>
<BR>
<div align="center"><B>This is what I need to Work, Thanks! ... :)
</B>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<form action="filename.php" method="post">
<div align=left><B>Name</B></di
<input type="text" name="name" size="20" maxlength="100">
<div align=left><B>E-mail</B></
<input type="text" name="email" size="20" maxlength="100">
<div align=left><B>Subject</B><
<input type="text" name="altsubject" size="20" maxlength="100">
<div align=left><B>Comments</B>
<textarea wrap=phyiscal rows="12" name="comments" cols="15" ></textarea>
<BR>
<input type="hidden" name="submit" value="Submit">
<input type="Submit" name="submit" value="Submit">
<input type="Reset">
<BR>
</form>
</TD>
</TR>
</font>
</div></td>
</tr>
</font></a></div></td>
</tr>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td width="80%" valign="top"><p><a name="top"></a></p>
<table width="95%" border="0" align="center" cellpadding="10">
<tr>
<td valign="top"><table width="100%" border="1"
align="center" cellpadding="10">
<TABLE>
<TR>
<TR>
<TD>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>Title</B><BR><
<hr width="100%" align=center>
</TD>
</TR>
</TABLE>
<CENTER><FONT FACE="Times" SIZE="8" COLOR="#FF0000"><B>
</B></FONT></CENTER>
<FONT FACE="Times New Roman" SIZE="3">
<P>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<table width="90%" border="1" cellspacing="0" cellpadding="5">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<div align='Left'>Please, kick off your
shoes, relax, and</div>
<div>Enjoy the articles included in the links below</div>
<P>This Archive was made JUST FOR YOU!</P>
<P>_</P>
<Div><A HREF="link3.html">Link3</A
<P>_</P>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<br>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>More Links</B><BR></FONT>
<hr width="100%" align=center>
<P><A HREF="Link4.html">Link4</A
<P><A HREF="Link5.html">Link5</A
<P><A HREF="Link6.html">Link6</A
</BODY>
</HTML>
filename.php
<HTML>
<HEAD>
<TITLE>Test Page
</TITLE>
</HEAD>
<?php
if($_POST["submit"]) {
// Load up from POST
$name=$_POST['name'];
$email=$_POST['email'];
$altsubject=$_POST['altsub
$allinfo=$_POST['comments'
$allinfo=nl2br($allinfo);
// Build message parts
//$recipient = "me@me.com";
$recipient = "me@email.com";
$subject = "Here's My Subject";
$message = "Name: $name\nEmail: $email\nAltSubject:
$altsubject\ncomments:" . $_POST["comments"] . "\n";
$from = "$email";
// Send mail
mail($recipient,$subject,$
} else {
print "No information sent to script";
}
?>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<div align=left><B>Name</B></di
<?php print $name; ?>
<div align=left><B>E-mail</B></
<?php print $email; ?>
<div align=left><B>Subject</B><
<?php print $altsubject; ?>
<div align=left><B>Comments</B>
<?php print $allinfo; ?>
</BODY>
</HTML>
i changed part of your mail script because you don't want to use nl2br on the comments field in it - line breaks are \n in emails. you need to change the action of the form to suit your filename. if it doesn't work, can you take a view source and paste the result in here, or any relevant errors
cheers,
loz
ASKER
Hi loz,
k, We seem to be back at Square One.
The Main Page name is index.html.
On index.html, the user enters their information and clicks submit.
When they submit the information, the information goes to my e-mail address.
I don't want another page to load, I would like the SAME Page to be viewed,
with the Exception of the input boxes. Where the Input Boxes Were, I would like
to have displayed, "Your Information Has Been Sent. Thank You."
Thanks...
:)
FirstBorn
-----------------
Hi rjdown,
Where in the file would I place this code?
As mentioned in the original thread:
"PS. I'm Still kinda newbie-ish to php, so please explain thoroughly, if possible.
Thanks... :)"
Thanks...
:)
FirstBorn
k, We seem to be back at Square One.
The Main Page name is index.html.
On index.html, the user enters their information and clicks submit.
When they submit the information, the information goes to my e-mail address.
I don't want another page to load, I would like the SAME Page to be viewed,
with the Exception of the input boxes. Where the Input Boxes Were, I would like
to have displayed, "Your Information Has Been Sent. Thank You."
Thanks...
:)
FirstBorn
-----------------
Hi rjdown,
Where in the file would I place this code?
As mentioned in the original thread:
"PS. I'm Still kinda newbie-ish to php, so please explain thoroughly, if possible.
Thanks... :)"
Thanks...
:)
FirstBorn
you can't have an html parsed as php unless you add a file called .htaccess with the following line
AddType application/x-httpd-php .html
only works if you have apache though. then you have index.html:
<HTML>
<HEAD>
<TITLE>Test Page
</TITLE>
</HEAD>
<BODY>
<?php
if($_POST["submit"]) {
// Load up from POST
$name=$_POST['name'];
$email=$_POST['email'];
$altsubject=$_POST['altsub ject'];
$allinfo=$_POST['comments' ];
$allinfo=nl2br($allinfo);
// Build message parts
//$recipient = "me@me.com";
$recipient = "me@email.com";
$subject = "Here's My Subject";
$message = "Name: $name\nEmail: $email\nAltSubject:
$altsubject\ncomments:" . $_POST["comments"] . "\n";
$from = "$email";
// Send mail
mail($recipient,$subject,$ message,$f rom,$altsu bject);
} else {
print "No information sent to script";
}
?>
<table width="100%" border="0" cellpadding="0">
<tr>
<td width="20%" valign="top"><table cellpadding="0"
cellspacing="0" border="0" height="100%">
<tr>
<td><div align="center"><font face="Verdana, Arial,
Helvetica, sans-serif" color="#000000" size="5"> Title
</font></div></td>
</tr>
<tr>
<td><img src="/_blnk.gif" width="150" height="5"></td>
</tr>
<tr>
<td width="169" height="100%" valign="top"
style="padding-top:10px;pa dding-bott om:10px;pa dding-left :10px;">
<table width="95%" border="0" cellpadding="10">
<tr>
<td><div align="center"></div></td>
</tr>
<tr>
<td><div align="center"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">My Page
</div></td>
</tr>
<tr>
<td><div align="center"><a href="link1.html"><font
size="2" face="Verdana, Arial, Helvetica,
sans-serif">link1</font></ a></div><B R>
<BR>
<div align="center"><a href="link2"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">Link 2</font></a></div></td>
</td>
<TR>
<TD>
<BR>
<BR>
<BR>
<div align="center"><B>This is what I need to Work, Thanks! ... :)
</B>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<?php
if($_POST["submit"]) {
?>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<div align=left><B>Name</B></di v>
<?php print $name; ?>
<div align=left><B>E-mail</B></ div>
<?php print $email; ?>
<div align=left><B>Subject</B>< /div>
<?php print $altsubject; ?>
<div align=left><B>Comments</B> </div>
<?php print $allinfo; ?>
} else {
?>
<form action="<?php print $_SERVER["PHP_SELF"]; ?>" method="post">
<div align=left><B>Name</B></di v>
<input type="text" name="name" size="20" maxlength="100">
<div align=left><B>E-mail</B></ div>
<input type="text" name="email" size="20" maxlength="100">
<div align=left><B>Subject</B>< /div>
<input type="text" name="altsubject" size="20" maxlength="100">
<div align=left><B>Comments</B> </div>
<textarea wrap=phyiscal rows="12" name="comments" cols="15" ></textarea>
<BR>
<input type="hidden" name="submit" value="Submit">
<input type="submit" name="submit" value="Submit">
<input type="reset">
<BR>
</form>
<?php } ?>
</TD>
</TR>
</font>
</div></td>
</tr>
</font></a></div></td>
</tr>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td width="80%" valign="top"><p><a name="top"></a></p>
<table width="95%" border="0" align="center" cellpadding="10">
<tr>
<td valign="top"><table width="100%" border="1"
align="center" cellpadding="10">
<TABLE>
<TR>
<TR>
<TD>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>Title</B><BR>< /FONT>
<hr width="100%" align=center>
</TD>
</TR>
</TABLE>
<CENTER><FONT FACE="Times" SIZE="8" COLOR="#FF0000"><B>
</B></FONT></CENTER>
<FONT FACE="Times New Roman" SIZE="3">
<P>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<table width="90%" border="1" cellspacing="0" cellpadding="5">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<div align='Left'>Please, kick off your
shoes, relax, and</div>
<div>Enjoy the articles included in the links below</div>
<P>This Archive was made JUST FOR YOU!</P>
<P>_</P>
<Div><A HREF="link3.html">Link3</A ></Div>
<P>_</P>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<br>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>More Links</B><BR></FONT>
<hr width="100%" align=center>
<P><A HREF="Link4.html">Link4</A ></P>
<P><A HREF="Link5.html">Link5</A ></P>
<P><A HREF="Link6.html">Link6</A ></P>
</BODY>
</HTML>
cheers,
loz
AddType application/x-httpd-php .html
only works if you have apache though. then you have index.html:
<HTML>
<HEAD>
<TITLE>Test Page
</TITLE>
</HEAD>
<BODY>
<?php
if($_POST["submit"]) {
// Load up from POST
$name=$_POST['name'];
$email=$_POST['email'];
$altsubject=$_POST['altsub
$allinfo=$_POST['comments'
$allinfo=nl2br($allinfo);
// Build message parts
//$recipient = "me@me.com";
$recipient = "me@email.com";
$subject = "Here's My Subject";
$message = "Name: $name\nEmail: $email\nAltSubject:
$altsubject\ncomments:" . $_POST["comments"] . "\n";
$from = "$email";
// Send mail
mail($recipient,$subject,$
} else {
print "No information sent to script";
}
?>
<table width="100%" border="0" cellpadding="0">
<tr>
<td width="20%" valign="top"><table cellpadding="0"
cellspacing="0" border="0" height="100%">
<tr>
<td><div align="center"><font face="Verdana, Arial,
Helvetica, sans-serif" color="#000000" size="5"> Title
</font></div></td>
</tr>
<tr>
<td><img src="/_blnk.gif" width="150" height="5"></td>
</tr>
<tr>
<td width="169" height="100%" valign="top"
style="padding-top:10px;pa
<table width="95%" border="0" cellpadding="10">
<tr>
<td><div align="center"></div></td>
</tr>
<tr>
<td><div align="center"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">My Page
</div></td>
</tr>
<tr>
<td><div align="center"><a href="link1.html"><font
size="2" face="Verdana, Arial, Helvetica,
sans-serif">link1</font></
<BR>
<div align="center"><a href="link2"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">Link 2</font></a></div></td>
</td>
<TR>
<TD>
<BR>
<BR>
<BR>
<div align="center"><B>This is what I need to Work, Thanks! ... :)
</B>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<?php
if($_POST["submit"]) {
?>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<div align=left><B>Name</B></di
<?php print $name; ?>
<div align=left><B>E-mail</B></
<?php print $email; ?>
<div align=left><B>Subject</B><
<?php print $altsubject; ?>
<div align=left><B>Comments</B>
<?php print $allinfo; ?>
} else {
?>
<form action="<?php print $_SERVER["PHP_SELF"]; ?>" method="post">
<div align=left><B>Name</B></di
<input type="text" name="name" size="20" maxlength="100">
<div align=left><B>E-mail</B></
<input type="text" name="email" size="20" maxlength="100">
<div align=left><B>Subject</B><
<input type="text" name="altsubject" size="20" maxlength="100">
<div align=left><B>Comments</B>
<textarea wrap=phyiscal rows="12" name="comments" cols="15" ></textarea>
<BR>
<input type="hidden" name="submit" value="Submit">
<input type="submit" name="submit" value="Submit">
<input type="reset">
<BR>
</form>
<?php } ?>
</TD>
</TR>
</font>
</div></td>
</tr>
</font></a></div></td>
</tr>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td width="80%" valign="top"><p><a name="top"></a></p>
<table width="95%" border="0" align="center" cellpadding="10">
<tr>
<td valign="top"><table width="100%" border="1"
align="center" cellpadding="10">
<TABLE>
<TR>
<TR>
<TD>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>Title</B><BR><
<hr width="100%" align=center>
</TD>
</TR>
</TABLE>
<CENTER><FONT FACE="Times" SIZE="8" COLOR="#FF0000"><B>
</B></FONT></CENTER>
<FONT FACE="Times New Roman" SIZE="3">
<P>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<table width="90%" border="1" cellspacing="0" cellpadding="5">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<div align='Left'>Please, kick off your
shoes, relax, and</div>
<div>Enjoy the articles included in the links below</div>
<P>This Archive was made JUST FOR YOU!</P>
<P>_</P>
<Div><A HREF="link3.html">Link3</A
<P>_</P>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<br>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>More Links</B><BR></FONT>
<hr width="100%" align=center>
<P><A HREF="Link4.html">Link4</A
<P><A HREF="Link5.html">Link5</A
<P><A HREF="Link6.html">Link6</A
</BODY>
</HTML>
cheers,
loz
ASKER
Hi loz,
k, This didn't work...
My Webhost uses Apache 1.3.27 and php 4
How about a 'redirect' to the index.html / index.php from the
'Results page' a few seconds After Submitting?
If so, where in the script / file would I put the redirect?
Thanks...
:)
FirstBorn
PS. Thanks for your patience with me... :)
k, This didn't work...
My Webhost uses Apache 1.3.27 and php 4
How about a 'redirect' to the index.html / index.php from the
'Results page' a few seconds After Submitting?
If so, where in the script / file would I put the redirect?
Thanks...
:)
FirstBorn
PS. Thanks for your patience with me... :)
try adding
AddHandler application/x-httpd-php .php .html
to your .htaccess
if you want to display dynamic content (the submitted fields from the form) onto an html (static content) page, you will need to have php parse html files as well
cheers,
loz
AddHandler application/x-httpd-php .php .html
to your .htaccess
if you want to display dynamic content (the submitted fields from the form) onto an html (static content) page, you will need to have php parse html files as well
cheers,
loz
ASKER
Hi loz,
I've added an .htaccess file in the specific directory needed for this to work.
The file consists of the line of code you mentioned above.
CHMODed to 664.
Attempted to load the index.html file, and it loaded, but with extra code displayed on the actual page.
I entered information, clicked submit and get "HTTP 404 - File not found"
Renamed the file to index.php, This Time, It Stays the Same... NOTHING Works with this file, now.
I moved the .htaccess file, then retried the index.php, refreshed the page, and I get:
"No information sent to script" on the top of the page (just like the 'else' statment in the script).
So, the .htaccess thing doesn't work.
Is there a way to just Redirect BACK to the index.html file after getting the results page?
This seems to be the ONLY Solution if I can't just eliminate the text input boxes after
user has submitted the information replaced with a message letting the user know
that they've had their information submitted and a Thank You.
Thanks.
:)
FirstBorn
I've added an .htaccess file in the specific directory needed for this to work.
The file consists of the line of code you mentioned above.
CHMODed to 664.
Attempted to load the index.html file, and it loaded, but with extra code displayed on the actual page.
I entered information, clicked submit and get "HTTP 404 - File not found"
Renamed the file to index.php, This Time, It Stays the Same... NOTHING Works with this file, now.
I moved the .htaccess file, then retried the index.php, refreshed the page, and I get:
"No information sent to script" on the top of the page (just like the 'else' statment in the script).
So, the .htaccess thing doesn't work.
Is there a way to just Redirect BACK to the index.html file after getting the results page?
This seems to be the ONLY Solution if I can't just eliminate the text input boxes after
user has submitted the information replaced with a message letting the user know
that they've had their information submitted and a Thank You.
Thanks.
:)
FirstBorn
probably there is a way using javascript, but that's avoiding the problem not solving it. to help me, can you do view source on the form and paste the result in here?
cheers,
loz
cheers,
loz
ASKER
Hi loz,
Here are the results from using index.php
Thanks...
:)
FirstBorn
-------------------------- ---------- ---------- ---------- -
<HTML>
<HEAD>
<TITLE>Test Page
</TITLE>
</HEAD>
<BODY>
No information sent to script
<table width="100%" border="0" cellpadding="0">
<tr>
<td width="20%" valign="top"><table cellpadding="0"
cellspacing="0" border="0" height="100%">
<tr>
<td><div align="center"><font face="Verdana, Arial,
Helvetica, sans-serif" color="#000000" size="5"> Title
</font></div></td>
</tr>
<tr>
<td><img src="/_blnk.gif" width="150" height="5"></td>
</tr>
<tr>
<td width="169" height="100%" valign="top"
style="padding-top:10px;pa dding-bott om:10px;pa dding-left :10px;">
<table width="95%" border="0" cellpadding="10">
<tr>
<td><div align="center"></div></td>
</tr>
<tr>
<td><div align="center"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">My Page
</div></td>
</tr>
<tr>
<td><div align="center"><a href="link1.html"><font
size="2" face="Verdana, Arial, Helvetica,
sans-serif">link1</font></ a></div><B R>
<BR>
<div align="center"><a href="link2"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">Link 2</font></a></div></td>
</td>
<TR>
<TD>
<BR>
<BR>
<BR>
<div align="center"><B>This is what I need to Work, Thanks! ... :)
</B>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
</TD>
</TR>
</font>
</div></td>
</tr>
</font></a></div></td>
</tr>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td width="80%" valign="top"><p><a name="top"></a></p>
<table width="95%" border="0" align="center" cellpadding="10">
<tr>
<td valign="top"><table width="100%" border="1"
align="center" cellpadding="10">
<TABLE>
<TR>
<TR>
<TD>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>Title</B><BR>< /FONT>
<hr width="100%" align=center>
</TD>
</TR>
</TABLE>
<CENTER><FONT FACE="Times" SIZE="8" COLOR="#FF0000"><B>
</B></FONT></CENTER>
<FONT FACE="Times New Roman" SIZE="3">
<P>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<table width="90%" border="1" cellspacing="0" cellpadding="5">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<div align='Left'>Please, kick off your
shoes, relax, and</div>
<div>Enjoy the articles included in the links below</div>
<P>This Archive was made JUST FOR YOU!</P>
<P>_</P>
<Div><A HREF="link3.html">Link3</A ></Div>
<P>_</P>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<br>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>More Links</B><BR></FONT>
<hr width="100%" align=center>
<P><A HREF="Link4.html">Link4</A ></P>
<P><A HREF="Link5.html">Link5</A ></P>
<P><A HREF="Link6.html">Link6</A ></P>
</BODY>
</HTML>
-------------------------- --
Here are the Results (below) using index.html (same file, different extension)
-------------------------- ---------- ---------- ---------- ---------- -----
Before Submit:
------------------------
<HTML>
<HEAD>
<TITLE>Test Page
</TITLE>
</HEAD>
<BODY>
<?php
if($_POST["submit"]) {
// Load up from POST
$name=$_POST['name'];
$email=$_POST['email'];
$altsubject=$_POST['altsub ject'];
$allinfo=$_POST['comments' ];
$allinfo=nl2br($allinfo);
// Build message parts
//$recipient = "me@me.com";
$recipient = "me@email.com";
$subject = "Here's My Subject";
$message = "Name: $name\nEmail: $email\nAltSubject:
$altsubject\ncomments:" . $_POST["comments"] . "\n";
$from = "$email";
// Send mail
mail($recipient,$subject,$ message,$f rom,$altsu bject);
} else {
print "No information sent to script";
}
?>
<table width="100%" border="0" cellpadding="0">
<tr>
<td width="20%" valign="top"><table cellpadding="0"
cellspacing="0" border="0" height="100%">
<tr>
<td><div align="center"><font face="Verdana, Arial,
Helvetica, sans-serif" color="#000000" size="5"> Title
</font></div></td>
</tr>
<tr>
<td><img src="/_blnk.gif" width="150" height="5"></td>
</tr>
<tr>
<td width="169" height="100%" valign="top"
style="padding-top:10px;pa dding-bott om:10px;pa dding-left :10px;">
<table width="95%" border="0" cellpadding="10">
<tr>
<td><div align="center"></div></td>
</tr>
<tr>
<td><div align="center"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">My Page
</div></td>
</tr>
<tr>
<td><div align="center"><a href="link1.html"><font
size="2" face="Verdana, Arial, Helvetica,
sans-serif">link1</font></ a></div><B R>
<BR>
<div align="center"><a href="link2"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">Link 2</font></a></div></td>
</td>
<TR>
<TD>
<BR>
<BR>
<BR>
<div align="center"><B>This is what I need to Work, Thanks! ... :)
</B>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<?php
if($_POST["submit"]) {
?>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<div align=left><B>Name</B></di v>
<?php print $name; ?>
<div align=left><B>E-mail</B></ div>
<?php print $email; ?>
<div align=left><B>Subject</B>< /div>
<?php print $altsubject; ?>
<div align=left><B>Comments</B> </div>
<?php print $allinfo; ?>
} else {
?>
<form action="<?php print $_SERVER["PHP_SELF"]; ?>" method="post">
<div align=left><B>Name</B></di v>
<input type="text" name="name" size="20" maxlength="100">
<div align=left><B>E-mail</B></ div>
<input type="text" name="email" size="20" maxlength="100">
<div align=left><B>Subject</B>< /div>
<input type="text" name="altsubject" size="20" maxlength="100">
<div align=left><B>Comments</B> </div>
<textarea wrap=phyiscal rows="12" name="comments" cols="15" ></textarea>
<BR>
<input type="hidden" name="submit" value="Submit">
<input type="submit" name="submit" value="Submit">
<input type="reset">
<BR>
</form>
<?php } ?>
</TD>
</TR>
</font>
</div></td>
</tr>
</font></a></div></td>
</tr>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td width="80%" valign="top"><p><a name="top"></a></p>
<table width="95%" border="0" align="center" cellpadding="10">
<tr>
<td valign="top"><table width="100%" border="1"
align="center" cellpadding="10">
<TABLE>
<TR>
<TR>
<TD>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>Title</B><BR>< /FONT>
<hr width="100%" align=center>
</TD>
</TR>
</TABLE>
<CENTER><FONT FACE="Times" SIZE="8" COLOR="#FF0000"><B>
</B></FONT></CENTER>
<FONT FACE="Times New Roman" SIZE="3">
<P>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<table width="90%" border="1" cellspacing="0" cellpadding="5">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<div align='Left'>Please, kick off your
shoes, relax, and</div>
<div>Enjoy the articles included in the links below</div>
<P>This Archive was made JUST FOR YOU!</P>
<P>_</P>
<Div><A HREF="link3.html">Link3</A ></Div>
<P>_</P>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<br>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>More Links</B><BR></FONT>
<hr width="100%" align=center>
<P><A HREF="Link4.html">Link4</A ></P>
<P><A HREF="Link5.html">Link5</A ></P>
<P><A HREF="Link6.html">Link6</A ></P>
</BODY>
</HTML>
----------------------
After Submit:
---------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<style>
a:link {font:8pt/11pt verdana; color:red}
a:visited {font:8pt/11pt verdana; color:#4e4e4e}
</style>
<meta HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
<title>HTTP 404 Not Found</title>
</head>
<script>
function Homepage(){
// in real bits, urls get returned to our script like this:
// res://shdocvw.dll/http_404 .htm#http://www.DocURL.com/bar.htm
//For testing use DocURL = "res://shdocvw.dll/http_40 4.htm#https://www.microsoft.com/bar.htm"
DocURL = document.location.href;
//this is where the http or https will be, as found by searching for :// but skipping the res://
protocolIndex=DocURL.index Of("://",4 );
//this finds the ending slash for the domain server
serverIndex=DocURL.indexOf ("/",proto colIndex + 3);
//for the href, we need a valid URL to the domain. We search for the # symbol to find the begining
//of the true URL, and add 1 to skip it - this is the BeginURL value. We use serverIndex as the end marker.
//urlresult=DocURL.substri ng(protoco lIndex - 4,serverIndex);
BeginURL=DocURL.indexOf("# ",1) + 1;
if (protocolIndex - BeginURL > 7)
urlresult=""
urlresult=DocURL.substring (BeginURL, serverInde x);
//for display, we need to skip after http://, and go to the next slash
displayresult=DocURL.subst ring(proto colIndex + 3 ,serverIndex);
// Security precaution: must filter out "urlResult" and "displayresult"
forbiddenChars = new RegExp("[<>\'\"]", "g"); // Global search/replace
urlresult = urlresult.replace(forbidde nChars, "");
displayresult = displayresult.replace(forb iddenChars , "");
document.write('<A target=_top HREF="' + urlresult + '">' + displayresult + "</a>");
}
function doSearch()
{
saOC.NavigateToDefaultSear ch();
}
function initPage()
{
document.body.insertAdjace ntHTML("af terBegin", "<object id=saOC CLASSID='clsid:B45FF030-44 47-11D2-85 DE-00C04FA 35C89' HEIGHT=0 width=0></object>");
}
</script>
<body bgcolor="white" onload="initPage()">
<table width="400" cellpadding="3" cellspacing="5">
<tr>
<td id="tableProps" valign="top" align="left"><img id="pagerrorImg" SRC="pagerror.gif"
width="25" height="33"></td>
<td id="tableProps2" align="left" valign="middle" width="360"><h1 id="errortype"
style="COLOR: black; FONT: 13pt/15pt verdana"><span id="errorText">The page cannot be found</span></h1>
</td>
</tr>
<tr>
<td id="tablePropsWidth" width="400" colspan="2"><font
style="COLOR: black; FONT: 8pt/11pt verdana">The page you are looking for might have been
removed, had its name changed, or is temporarily unavailable.</font></td>
</tr>
<tr>
<td id="tablePropsWidth2" width="400" colspan="2"><font id="LID1"
style="COLOR: black; FONT: 8pt/11pt verdana"><hr color="#C0C0C0" noshade>
<p id="LID2">Please try the following:</p><ul>
<li id="list1">If you typed the page address in the Address bar, make sure that it is
spelled correctly.<br>
</li>
<li id="list2">Open the <script> Homepage(); </script> home page, and then look for links to the information
you want. </li>
<li id="list3">Click the <a href="javascript:history.b ack(1)"><i mg valign=bottom border=0 src="back.gif"> Back</a> button to try another link. </li>
<li ID="list4">Click <a href="javascript:doSearch( )"><img border=0 src="search.gif" width="16" height="16" alt="search.gif (114 bytes)" align="center"> Search</a> to look for information on the Internet. </li>
</ul>
<p><br>
</p>
<h2 id="ietext" style="font:8pt/11pt verdana; color:black">HTTP 404 - File not found<br>
Internet Explorer <BR>
</h2>
</font></td>
</tr>
</table>
</body>
</html>
-------------------------- ---------- ---------- ---
Here are the results from using index.php
Thanks...
:)
FirstBorn
--------------------------
<HTML>
<HEAD>
<TITLE>Test Page
</TITLE>
</HEAD>
<BODY>
No information sent to script
<table width="100%" border="0" cellpadding="0">
<tr>
<td width="20%" valign="top"><table cellpadding="0"
cellspacing="0" border="0" height="100%">
<tr>
<td><div align="center"><font face="Verdana, Arial,
Helvetica, sans-serif" color="#000000" size="5"> Title
</font></div></td>
</tr>
<tr>
<td><img src="/_blnk.gif" width="150" height="5"></td>
</tr>
<tr>
<td width="169" height="100%" valign="top"
style="padding-top:10px;pa
<table width="95%" border="0" cellpadding="10">
<tr>
<td><div align="center"></div></td>
</tr>
<tr>
<td><div align="center"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">My Page
</div></td>
</tr>
<tr>
<td><div align="center"><a href="link1.html"><font
size="2" face="Verdana, Arial, Helvetica,
sans-serif">link1</font></
<BR>
<div align="center"><a href="link2"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">Link 2</font></a></div></td>
</td>
<TR>
<TD>
<BR>
<BR>
<BR>
<div align="center"><B>This is what I need to Work, Thanks! ... :)
</B>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
</TD>
</TR>
</font>
</div></td>
</tr>
</font></a></div></td>
</tr>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td width="80%" valign="top"><p><a name="top"></a></p>
<table width="95%" border="0" align="center" cellpadding="10">
<tr>
<td valign="top"><table width="100%" border="1"
align="center" cellpadding="10">
<TABLE>
<TR>
<TR>
<TD>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>Title</B><BR><
<hr width="100%" align=center>
</TD>
</TR>
</TABLE>
<CENTER><FONT FACE="Times" SIZE="8" COLOR="#FF0000"><B>
</B></FONT></CENTER>
<FONT FACE="Times New Roman" SIZE="3">
<P>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<table width="90%" border="1" cellspacing="0" cellpadding="5">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<div align='Left'>Please, kick off your
shoes, relax, and</div>
<div>Enjoy the articles included in the links below</div>
<P>This Archive was made JUST FOR YOU!</P>
<P>_</P>
<Div><A HREF="link3.html">Link3</A
<P>_</P>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<br>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>More Links</B><BR></FONT>
<hr width="100%" align=center>
<P><A HREF="Link4.html">Link4</A
<P><A HREF="Link5.html">Link5</A
<P><A HREF="Link6.html">Link6</A
</BODY>
</HTML>
--------------------------
Here are the Results (below) using index.html (same file, different extension)
--------------------------
Before Submit:
------------------------
<HTML>
<HEAD>
<TITLE>Test Page
</TITLE>
</HEAD>
<BODY>
<?php
if($_POST["submit"]) {
// Load up from POST
$name=$_POST['name'];
$email=$_POST['email'];
$altsubject=$_POST['altsub
$allinfo=$_POST['comments'
$allinfo=nl2br($allinfo);
// Build message parts
//$recipient = "me@me.com";
$recipient = "me@email.com";
$subject = "Here's My Subject";
$message = "Name: $name\nEmail: $email\nAltSubject:
$altsubject\ncomments:" . $_POST["comments"] . "\n";
$from = "$email";
// Send mail
mail($recipient,$subject,$
} else {
print "No information sent to script";
}
?>
<table width="100%" border="0" cellpadding="0">
<tr>
<td width="20%" valign="top"><table cellpadding="0"
cellspacing="0" border="0" height="100%">
<tr>
<td><div align="center"><font face="Verdana, Arial,
Helvetica, sans-serif" color="#000000" size="5"> Title
</font></div></td>
</tr>
<tr>
<td><img src="/_blnk.gif" width="150" height="5"></td>
</tr>
<tr>
<td width="169" height="100%" valign="top"
style="padding-top:10px;pa
<table width="95%" border="0" cellpadding="10">
<tr>
<td><div align="center"></div></td>
</tr>
<tr>
<td><div align="center"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">My Page
</div></td>
</tr>
<tr>
<td><div align="center"><a href="link1.html"><font
size="2" face="Verdana, Arial, Helvetica,
sans-serif">link1</font></
<BR>
<div align="center"><a href="link2"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">Link 2</font></a></div></td>
</td>
<TR>
<TD>
<BR>
<BR>
<BR>
<div align="center"><B>This is what I need to Work, Thanks! ... :)
</B>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<?php
if($_POST["submit"]) {
?>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<div align=left><B>Name</B></di
<?php print $name; ?>
<div align=left><B>E-mail</B></
<?php print $email; ?>
<div align=left><B>Subject</B><
<?php print $altsubject; ?>
<div align=left><B>Comments</B>
<?php print $allinfo; ?>
} else {
?>
<form action="<?php print $_SERVER["PHP_SELF"]; ?>" method="post">
<div align=left><B>Name</B></di
<input type="text" name="name" size="20" maxlength="100">
<div align=left><B>E-mail</B></
<input type="text" name="email" size="20" maxlength="100">
<div align=left><B>Subject</B><
<input type="text" name="altsubject" size="20" maxlength="100">
<div align=left><B>Comments</B>
<textarea wrap=phyiscal rows="12" name="comments" cols="15" ></textarea>
<BR>
<input type="hidden" name="submit" value="Submit">
<input type="submit" name="submit" value="Submit">
<input type="reset">
<BR>
</form>
<?php } ?>
</TD>
</TR>
</font>
</div></td>
</tr>
</font></a></div></td>
</tr>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td width="80%" valign="top"><p><a name="top"></a></p>
<table width="95%" border="0" align="center" cellpadding="10">
<tr>
<td valign="top"><table width="100%" border="1"
align="center" cellpadding="10">
<TABLE>
<TR>
<TR>
<TD>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>Title</B><BR><
<hr width="100%" align=center>
</TD>
</TR>
</TABLE>
<CENTER><FONT FACE="Times" SIZE="8" COLOR="#FF0000"><B>
</B></FONT></CENTER>
<FONT FACE="Times New Roman" SIZE="3">
<P>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<table width="90%" border="1" cellspacing="0" cellpadding="5">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<div align='Left'>Please, kick off your
shoes, relax, and</div>
<div>Enjoy the articles included in the links below</div>
<P>This Archive was made JUST FOR YOU!</P>
<P>_</P>
<Div><A HREF="link3.html">Link3</A
<P>_</P>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<br>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>More Links</B><BR></FONT>
<hr width="100%" align=center>
<P><A HREF="Link4.html">Link4</A
<P><A HREF="Link5.html">Link5</A
<P><A HREF="Link6.html">Link6</A
</BODY>
</HTML>
----------------------
After Submit:
---------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<style>
a:link {font:8pt/11pt verdana; color:red}
a:visited {font:8pt/11pt verdana; color:#4e4e4e}
</style>
<meta HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
<title>HTTP 404 Not Found</title>
</head>
<script>
function Homepage(){
// in real bits, urls get returned to our script like this:
// res://shdocvw.dll/http_404
//For testing use DocURL = "res://shdocvw.dll/http_40
DocURL = document.location.href;
//this is where the http or https will be, as found by searching for :// but skipping the res://
protocolIndex=DocURL.index
//this finds the ending slash for the domain server
serverIndex=DocURL.indexOf
//for the href, we need a valid URL to the domain. We search for the # symbol to find the begining
//of the true URL, and add 1 to skip it - this is the BeginURL value. We use serverIndex as the end marker.
//urlresult=DocURL.substri
BeginURL=DocURL.indexOf("#
if (protocolIndex - BeginURL > 7)
urlresult=""
urlresult=DocURL.substring
//for display, we need to skip after http://, and go to the next slash
displayresult=DocURL.subst
// Security precaution: must filter out "urlResult" and "displayresult"
forbiddenChars = new RegExp("[<>\'\"]", "g"); // Global search/replace
urlresult = urlresult.replace(forbidde
displayresult = displayresult.replace(forb
document.write('<A target=_top HREF="' + urlresult + '">' + displayresult + "</a>");
}
function doSearch()
{
saOC.NavigateToDefaultSear
}
function initPage()
{
document.body.insertAdjace
}
</script>
<body bgcolor="white" onload="initPage()">
<table width="400" cellpadding="3" cellspacing="5">
<tr>
<td id="tableProps" valign="top" align="left"><img id="pagerrorImg" SRC="pagerror.gif"
width="25" height="33"></td>
<td id="tableProps2" align="left" valign="middle" width="360"><h1 id="errortype"
style="COLOR: black; FONT: 13pt/15pt verdana"><span id="errorText">The page cannot be found</span></h1>
</td>
</tr>
<tr>
<td id="tablePropsWidth" width="400" colspan="2"><font
style="COLOR: black; FONT: 8pt/11pt verdana">The page you are looking for might have been
removed, had its name changed, or is temporarily unavailable.</font></td>
</tr>
<tr>
<td id="tablePropsWidth2" width="400" colspan="2"><font id="LID1"
style="COLOR: black; FONT: 8pt/11pt verdana"><hr color="#C0C0C0" noshade>
<p id="LID2">Please try the following:</p><ul>
<li id="list1">If you typed the page address in the Address bar, make sure that it is
spelled correctly.<br>
</li>
<li id="list2">Open the <script> Homepage(); </script> home page, and then look for links to the information
you want. </li>
<li id="list3">Click the <a href="javascript:history.b
<li ID="list4">Click <a href="javascript:doSearch(
</ul>
<p><br>
</p>
<h2 id="ietext" style="font:8pt/11pt verdana; color:black">HTTP 404 - File not found<br>
Internet Explorer <BR>
</h2>
</font></td>
</tr>
</table>
</body>
</html>
--------------------------
hi,
alright thanks for that - you really need to get html parsed as php if you're determined to have the index.html parsed. is it possible to get in touch with your server admin and get them to change the httpd.conf to allow html to be parsed? AddType application/x-httpd-php .html i think
loz
alright thanks for that - you really need to get html parsed as php if you're determined to have the index.html parsed. is it possible to get in touch with your server admin and get them to change the httpd.conf to allow html to be parsed? AddType application/x-httpd-php .html i think
loz
ASKER
Hi loz,
I think I found one reason why it's not working. I don't know how to fix it, though.
When I click "Submit", it goes to this URL for the 404 Not Found Error:
http://www.myurl.com/test/<?name=First+Last&email=me @email.com &altsubjec t=Test+Sub ject&comme nts=Test+C omments+Go +Here%21%0 D%0A%0D%0A And+some+M ore%21%21% 21&submit= Submit&sub mit=Submit
INSTEAD OF: http://www.myurl.com/test/
Can this be the problem? and if so, how can it be fixed?
------------
Also, Even if I use the .php file (named .php instead of .html,) it will Not Load the Text Input Boxes with Your Newer Script. It will load with the "No information sent to script" and I don't Need ANY Thing sent to the script UNTIL The User Submits the Information.
Thanks...
:)
FirstBorn
I think I found one reason why it's not working. I don't know how to fix it, though.
When I click "Submit", it goes to this URL for the 404 Not Found Error:
http://www.myurl.com/test/<?name=First+Last&email=me
INSTEAD OF: http://www.myurl.com/test/
Can this be the problem? and if so, how can it be fixed?
------------
Also, Even if I use the .php file (named .php instead of .html,) it will Not Load the Text Input Boxes with Your Newer Script. It will load with the "No information sent to script" and I don't Need ANY Thing sent to the script UNTIL The User Submits the Information.
Thanks...
:)
FirstBorn
nope that's not the problem, it just needs the form action set correctly (i.e. hard coded rather than action="<?php print $_SERVER["PHP_SELF"]; ?>"
in index.php, change } else {
print "No information sent to script";
}
to:
}
and if there are more problems, give me your current code listing from the file
cheers,
loz
in index.php, change } else {
print "No information sent to script";
}
to:
}
and if there are more problems, give me your current code listing from the file
cheers,
loz
ASKER
Hi loz,
k, Here's the Source Code of when it loads.
When it loads, it doesn't have Any Text Input Boxes.
That Section Still Remains Blank.
(no Input Text Boxes and no Submit buttons)
Thanks...
:)
FirstBorn
-------------------------- -------
<HTML>
<HEAD>
<TITLE>Test Page
</TITLE>
</HEAD>
<BODY>
<table width="100%" border="0" cellpadding="0">
<tr>
<td width="20%" valign="top"><table cellpadding="0"
cellspacing="0" border="0" height="100%">
<tr>
<td><div align="center"><font face="Verdana, Arial,
Helvetica, sans-serif" color="#000000" size="5"> Title
</font></div></td>
</tr>
<tr>
<td><img src="/_blnk.gif" width="150" height="5"></td>
</tr>
<tr>
<td width="169" height="100%" valign="top"
style="padding-top:10px;pa dding-bott om:10px;pa dding-left :10px;">
<table width="95%" border="0" cellpadding="10">
<tr>
<td><div align="center"></div></td>
</tr>
<tr>
<td><div align="center"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">My Page
</div></td>
</tr>
<tr>
<td><div align="center"><a href="link1.html"><font
size="2" face="Verdana, Arial, Helvetica,
sans-serif">link1</font></ a></div><B R>
<BR>
<div align="center"><a href="link2"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">Link 2</font></a></div></td>
</td>
<TR>
<TD>
<BR>
<BR>
<BR>
<div align="center"><B>This is what I need to Work, Thanks! ... :)
</B>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
</TD>
</TR>
</font>
</div></td>
</tr>
</font></a></div></td>
</tr>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td width="80%" valign="top"><p><a name="top"></a></p>
<table width="95%" border="0" align="center" cellpadding="10">
<tr>
<td valign="top"><table width="100%" border="1"
align="center" cellpadding="10">
<TABLE>
<TR>
<TR>
<TD>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>Title</B><BR>< /FONT>
<hr width="100%" align=center>
</TD>
</TR>
</TABLE>
<CENTER><FONT FACE="Times" SIZE="8" COLOR="#FF0000"><B>
</B></FONT></CENTER>
<FONT FACE="Times New Roman" SIZE="3">
<P>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<table width="90%" border="1" cellspacing="0" cellpadding="5">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<div align='Left'>Please, kick off your
shoes, relax, and</div>
<div>Enjoy the articles included in the links below</div>
<P>This Archive was made JUST FOR YOU!</P>
<P>_</P>
<Div><A HREF="link3.html">Link3</A ></Div>
<P>_</P>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<br>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>More Links</B><BR></FONT>
<hr width="100%" align=center>
<P><A HREF="Link4.html">Link4</A ></P>
<P><A HREF="Link5.html">Link5</A ></P>
<P><A HREF="Link6.html">Link6</A ></P>
</BODY>
</HTML>
k, Here's the Source Code of when it loads.
When it loads, it doesn't have Any Text Input Boxes.
That Section Still Remains Blank.
(no Input Text Boxes and no Submit buttons)
Thanks...
:)
FirstBorn
--------------------------
<HTML>
<HEAD>
<TITLE>Test Page
</TITLE>
</HEAD>
<BODY>
<table width="100%" border="0" cellpadding="0">
<tr>
<td width="20%" valign="top"><table cellpadding="0"
cellspacing="0" border="0" height="100%">
<tr>
<td><div align="center"><font face="Verdana, Arial,
Helvetica, sans-serif" color="#000000" size="5"> Title
</font></div></td>
</tr>
<tr>
<td><img src="/_blnk.gif" width="150" height="5"></td>
</tr>
<tr>
<td width="169" height="100%" valign="top"
style="padding-top:10px;pa
<table width="95%" border="0" cellpadding="10">
<tr>
<td><div align="center"></div></td>
</tr>
<tr>
<td><div align="center"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">My Page
</div></td>
</tr>
<tr>
<td><div align="center"><a href="link1.html"><font
size="2" face="Verdana, Arial, Helvetica,
sans-serif">link1</font></
<BR>
<div align="center"><a href="link2"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">Link 2</font></a></div></td>
</td>
<TR>
<TD>
<BR>
<BR>
<BR>
<div align="center"><B>This is what I need to Work, Thanks! ... :)
</B>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
</TD>
</TR>
</font>
</div></td>
</tr>
</font></a></div></td>
</tr>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td width="80%" valign="top"><p><a name="top"></a></p>
<table width="95%" border="0" align="center" cellpadding="10">
<tr>
<td valign="top"><table width="100%" border="1"
align="center" cellpadding="10">
<TABLE>
<TR>
<TR>
<TD>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>Title</B><BR><
<hr width="100%" align=center>
</TD>
</TR>
</TABLE>
<CENTER><FONT FACE="Times" SIZE="8" COLOR="#FF0000"><B>
</B></FONT></CENTER>
<FONT FACE="Times New Roman" SIZE="3">
<P>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<table width="90%" border="1" cellspacing="0" cellpadding="5">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<div align='Left'>Please, kick off your
shoes, relax, and</div>
<div>Enjoy the articles included in the links below</div>
<P>This Archive was made JUST FOR YOU!</P>
<P>_</P>
<Div><A HREF="link3.html">Link3</A
<P>_</P>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<br>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>More Links</B><BR></FONT>
<hr width="100%" align=center>
<P><A HREF="Link4.html">Link4</A
<P><A HREF="Link5.html">Link5</A
<P><A HREF="Link6.html">Link6</A
</BODY>
</HTML>
can i see the php source i mean (i.e. the raw file before being processed)
loz
loz
ASKER
Sure...
(I modified contact info as to keep privacy...)
Thanks...
:)
-------------
<HTML>
<HEAD>
<TITLE>Test Page
</TITLE>
</HEAD>
<BODY>
<?php
if($_POST["submit"]) {
// Load up from POST
$name=$_POST['name'];
$email=$_POST['email'];
$altsubject=$_POST['altsub ject'];
$allinfo=$_POST['comments' ];
$allinfo=nl2br($allinfo);
// Build message parts
//$recipient = "me@me.com";
$recipient = "me@me.com";
$subject = "Here's My Subject";
$message = "Name: $name\nEmail: $email\nAltSubject:
$altsubject\ncomments:" . $_POST["comments"] . "\n";
$from = "$email";
// Send mail
mail($recipient,$subject,$ message,$f rom,$altsu bject);
}
?>
<table width="100%" border="0" cellpadding="0">
<tr>
<td width="20%" valign="top"><table cellpadding="0"
cellspacing="0" border="0" height="100%">
<tr>
<td><div align="center"><font face="Verdana, Arial,
Helvetica, sans-serif" color="#000000" size="5"> Title
</font></div></td>
</tr>
<tr>
<td><img src="/_blnk.gif" width="150" height="5"></td>
</tr>
<tr>
<td width="169" height="100%" valign="top"
style="padding-top:10px;pa dding-bott om:10px;pa dding-left :10px;">
<table width="95%" border="0" cellpadding="10">
<tr>
<td><div align="center"></div></td>
</tr>
<tr>
<td><div align="center"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">My Page
</div></td>
</tr>
<tr>
<td><div align="center"><a href="link1.html"><font
size="2" face="Verdana, Arial, Helvetica,
sans-serif">link1</font></ a></div><B R>
<BR>
<div align="center"><a href="link2"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">Link 2</font></a></div></td>
</td>
<TR>
<TD>
<BR>
<BR>
<BR>
<div align="center"><B>This is what I need to Work, Thanks! ... :)
</B>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<?php
if($_POST["submit"]) {
?>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<div align=left><B>Name</B></di v>
<?php print $name; ?>
<div align=left><B>E-mail</B></ div>
<?php print $email; ?>
<div align=left><B>Subject</B>< /div>
<?php print $altsubject; ?>
<div align=left><B>Comments</B> </div>
<?php print $allinfo; ?>
} else {
?>
<form action="<?php print $_SERVER["PHP_SELF"]; ?>" method="post">
<div align=left><B>Name</B></di v>
<input type="text" name="name" size="20" maxlength="100">
<div align=left><B>E-mail</B></ div>
<input type="text" name="email" size="20" maxlength="100">
<div align=left><B>Subject</B>< /div>
<input type="text" name="altsubject" size="20" maxlength="100">
<div align=left><B>Comments</B> </div>
<textarea wrap=phyiscal rows="12" name="comments" cols="15" ></textarea>
<BR>
<input type="hidden" name="submit" value="Submit">
<input type="submit" name="submit" value="Submit">
<input type="reset">
<BR>
</form>
<?php } ?>
</TD>
</TR>
</font>
</div></td>
</tr>
</font></a></div></td>
</tr>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td width="80%" valign="top"><p><a name="top"></a></p>
<table width="95%" border="0" align="center" cellpadding="10">
<tr>
<td valign="top"><table width="100%" border="1"
align="center" cellpadding="10">
<TABLE>
<TR>
<TR>
<TD>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>Title</B><BR>< /FONT>
<hr width="100%" align=center>
</TD>
</TR>
</TABLE>
<CENTER><FONT FACE="Times" SIZE="8" COLOR="#FF0000"><B>
</B></FONT></CENTER>
<FONT FACE="Times New Roman" SIZE="3">
<P>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<table width="90%" border="1" cellspacing="0" cellpadding="5">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<div align='Left'>Please, kick off your
shoes, relax, and</div>
<div>Enjoy the articles included in the links below</div>
<P>This Archive was made JUST FOR YOU!</P>
<P>_</P>
<Div><A HREF="link3.html">Link3</A ></Div>
<P>_</P>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<br>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>More Links</B><BR></FONT>
<hr width="100%" align=center>
<P><A HREF="Link4.html">Link4</A ></P>
<P><A HREF="Link5.html">Link5</A ></P>
<P><A HREF="Link6.html">Link6</A ></P>
</BODY>
</HTML>
(I modified contact info as to keep privacy...)
Thanks...
:)
-------------
<HTML>
<HEAD>
<TITLE>Test Page
</TITLE>
</HEAD>
<BODY>
<?php
if($_POST["submit"]) {
// Load up from POST
$name=$_POST['name'];
$email=$_POST['email'];
$altsubject=$_POST['altsub
$allinfo=$_POST['comments'
$allinfo=nl2br($allinfo);
// Build message parts
//$recipient = "me@me.com";
$recipient = "me@me.com";
$subject = "Here's My Subject";
$message = "Name: $name\nEmail: $email\nAltSubject:
$altsubject\ncomments:" . $_POST["comments"] . "\n";
$from = "$email";
// Send mail
mail($recipient,$subject,$
}
?>
<table width="100%" border="0" cellpadding="0">
<tr>
<td width="20%" valign="top"><table cellpadding="0"
cellspacing="0" border="0" height="100%">
<tr>
<td><div align="center"><font face="Verdana, Arial,
Helvetica, sans-serif" color="#000000" size="5"> Title
</font></div></td>
</tr>
<tr>
<td><img src="/_blnk.gif" width="150" height="5"></td>
</tr>
<tr>
<td width="169" height="100%" valign="top"
style="padding-top:10px;pa
<table width="95%" border="0" cellpadding="10">
<tr>
<td><div align="center"></div></td>
</tr>
<tr>
<td><div align="center"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">My Page
</div></td>
</tr>
<tr>
<td><div align="center"><a href="link1.html"><font
size="2" face="Verdana, Arial, Helvetica,
sans-serif">link1</font></
<BR>
<div align="center"><a href="link2"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">Link 2</font></a></div></td>
</td>
<TR>
<TD>
<BR>
<BR>
<BR>
<div align="center"><B>This is what I need to Work, Thanks! ... :)
</B>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<?php
if($_POST["submit"]) {
?>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<div align=left><B>Name</B></di
<?php print $name; ?>
<div align=left><B>E-mail</B></
<?php print $email; ?>
<div align=left><B>Subject</B><
<?php print $altsubject; ?>
<div align=left><B>Comments</B>
<?php print $allinfo; ?>
} else {
?>
<form action="<?php print $_SERVER["PHP_SELF"]; ?>" method="post">
<div align=left><B>Name</B></di
<input type="text" name="name" size="20" maxlength="100">
<div align=left><B>E-mail</B></
<input type="text" name="email" size="20" maxlength="100">
<div align=left><B>Subject</B><
<input type="text" name="altsubject" size="20" maxlength="100">
<div align=left><B>Comments</B>
<textarea wrap=phyiscal rows="12" name="comments" cols="15" ></textarea>
<BR>
<input type="hidden" name="submit" value="Submit">
<input type="submit" name="submit" value="Submit">
<input type="reset">
<BR>
</form>
<?php } ?>
</TD>
</TR>
</font>
</div></td>
</tr>
</font></a></div></td>
</tr>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td width="80%" valign="top"><p><a name="top"></a></p>
<table width="95%" border="0" align="center" cellpadding="10">
<tr>
<td valign="top"><table width="100%" border="1"
align="center" cellpadding="10">
<TABLE>
<TR>
<TR>
<TD>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>Title</B><BR><
<hr width="100%" align=center>
</TD>
</TR>
</TABLE>
<CENTER><FONT FACE="Times" SIZE="8" COLOR="#FF0000"><B>
</B></FONT></CENTER>
<FONT FACE="Times New Roman" SIZE="3">
<P>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<table width="90%" border="1" cellspacing="0" cellpadding="5">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<div align='Left'>Please, kick off your
shoes, relax, and</div>
<div>Enjoy the articles included in the links below</div>
<P>This Archive was made JUST FOR YOU!</P>
<P>_</P>
<Div><A HREF="link3.html">Link3</A
<P>_</P>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<br>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>More Links</B><BR></FONT>
<hr width="100%" align=center>
<P><A HREF="Link4.html">Link4</A
<P><A HREF="Link5.html">Link5</A
<P><A HREF="Link6.html">Link6</A
</BODY>
</HTML>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi loz,
Thanks!
This Worked!!!
:)
FirstBorn
Thanks!
This Worked!!!
:)
FirstBorn
why not just combine it into one php script? all i've done below is combine the two scripts together, add a clause so the mail is only sent if the form has been submitted, change the form to point to itself in the action and changed the input fields' values to be whatever's in the POST array
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Test Page
</TITLE>
</HEAD>
<?
if($_POST["name"]) {
// Load up from POST
$name=$_POST['name'];
$email=$_POST['email'];
$altsubject=$_POST['altsub
$allinfo=$_POST['comments'
$allinfo=nl2br($allinfo);
// Build message parts
//$recipient = "me@me.com";
$recipient = "me@email.com";
$subject = "Here's My Subject";
$message = "Name: $name\nEmail: $email\nAltSubject:
$altsubject\ncomments: $allinfo\n";
$from = "$email";
// Send mail
mail($recipient,$subject,$
}
?>
<table width="100%" border="0" cellpadding="0">
<tr>
<td width="20%" valign="top"><table cellpadding="0"
cellspacing="0" border="0" height="100%">
<tr>
<td><div align="center"><font face="Verdana, Arial,
Helvetica, sans-serif" color="#000000" size="5"> Title
</font></div></td>
</tr>
<tr>
<td><img src="/_blnk.gif" width="150" height="5"></td>
</tr>
<tr>
<td width="169" height="100%" valign="top"
style="padding-top:10px;pa
<table width="95%" border="0" cellpadding="10">
<tr>
<td><div align="center"></div></td>
</tr>
<tr>
<td><div align="center"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">My Page
</div></td>
</tr>
<tr>
<td><div align="center"><a href="link1.html"><font
size="2" face="Verdana, Arial, Helvetica,
sans-serif">link1</font></
<BR>
<div align="center"><a href="link2"><font size="2" face="Verdana,
Arial, Helvetica, sans-serif">Link 2</font></a></div></td>
</td>
<TR>
<TD>
<BR>
<BR>
<BR>
<div align="center"><B>This is what I need to Work, Thanks! ... :)
</B>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<form action="<? print $_SERVER["PHP_SELF"]; ?>" method="post">
<div align=left><B>Name</B></di
<input type="text" name="name" size="20" maxlength="100"
value="<? print $_POST["name"]; ?>">
<div align=left><B>E-mail</B></
<input type="text" name="email" size="20" maxlength="100"
value="<? print $_POST["email"]; ?>">
<div align=left><B>Subject</B><
<input type="text" name="altsubject" size="20" maxlength="100"
value="<? print $_POST["altsubject"]; ?>">
<div align=left><B>Comments</B>
<textarea wrap=phyiscal rows="12" name="comments" cols="15" ><? print $_POST["comments"]; ?></textarea>
<BR>
<input type="Submit" name="submit" value="Submit">
<input type="Reset">
<BR>
</form>
</TD>
</TR>
</font>
</div></td>
</tr>
</font></a></div></td>
</tr>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td width="80%" valign="top"><p><a name="top"></a></p>
<table width="95%" border="0" align="center" cellpadding="10">
<tr>
<td valign="top"><table width="100%" border="1"
align="center" cellpadding="10">
<TABLE>
<TR>
<TR>
<TD>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>Title</B><BR><
<hr width="100%" align=center>
</TD>
</TR>
</TABLE>
<CENTER><FONT FACE="Times" SIZE="8" COLOR="#FF0000"><B>
</B></FONT></CENTER>
<FONT FACE="Times New Roman" SIZE="3">
<P>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<table width="90%" border="1" cellspacing="0" cellpadding="5">
<tr>
<!-- Row 1 Column 1 -->
<td align="left">
<div align='Left'>Please, kick off your
shoes, relax, and</div>
<div>Enjoy the articles included in the links below</div>
<P>This Archive was made JUST FOR YOU!</P>
<P>_</P>
<Div><A HREF="link3.html">Link3</A
<P>_</P>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<br>
<hr width="100%" align=center>
<FONT FACE="Times" SIZE="5"><B>More Links</B><BR></FONT>
<hr width="100%" align=center>
<P><A HREF="Link4.html">Link4</A
<P><A HREF="Link5.html">Link5</A
<P><A HREF="Link6.html">Link6</A
</BODY>
</HTML>
cheers,
loz