Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-07-2006, 06:20 PM   PM User | #1
bufhal
New Coder

 
Join Date: Apr 2004
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
bufhal is an unknown quantity at this point
display fields from contact form

Hi;
hope someone can help me.
I have a conact form with the following post command:
<form action="thankyou.php" method="post" name="contactform" id="contactform">
<input type="hidden" name="recipient" value="contactform" />
<input type="hidden" name="subject" value="Response from Web Form" />

My question is: How can I have the contact form typed input from the user display on my PHP page (i.e. the contact form uses <input type="text" name="Username" size="45" /></td>). How can the PHP display the results?


Below is the thankyou.php page.



Thank you very much in advance..I appreciate any help.


<?php
session_cache_limiter('nocache');
session_start();

include "subs.php";

Print_header ("Get Password","",0);
?>

<br><center><h1>Thank You!</h1></center><br>
<TABLE border="0" bgcolor="#FFFFFF" cellpadding="0" cellspacing="0">
<TR>
<TD width=600><BR>
<BR>

</TD></TR></TABLE>
<?
Print_footer ();

?>
bufhal is offline   Reply With Quote
Old 06-07-2006, 06:25 PM   PM User | #2
harsh789
New Coder

 
Join Date: May 2006
Posts: 99
Thanks: 0
Thanked 1 Time in 1 Post
harsh789 is an unknown quantity at this point
use echo or print to display values in php, see below code.

Code:
<? echo $_GET['Username']; ?>
harsh789 is offline   Reply With Quote
Old 06-07-2006, 06:40 PM   PM User | #3
bufhal
New Coder

 
Join Date: Apr 2004
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
bufhal is an unknown quantity at this point
thanks for the reply

Thank you.
will that display the data entered into the form on the previous page after the form is submitted?

I appreciate your time
bufhal is offline   Reply With Quote
Old 06-07-2006, 07:02 PM   PM User | #4
harsh789
New Coder

 
Join Date: May 2006
Posts: 99
Thanks: 0
Thanked 1 Time in 1 Post
harsh789 is an unknown quantity at this point
yes, it will.
harsh789 is offline   Reply With Quote
Old 06-07-2006, 07:18 PM   PM User | #5
bufhal
New Coder

 
Join Date: Apr 2004
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
bufhal is an unknown quantity at this point
thanks Harsh

Thank you. One last question, please.
In am trying to find the new line char in PHP so the info will break to the next line. I tries /r
but got parse error.
Thanks for your help
bufhal is offline   Reply With Quote
Old 06-07-2006, 07:26 PM   PM User | #6
harsh789
New Coder

 
Join Date: May 2006
Posts: 99
Thanks: 0
Thanked 1 Time in 1 Post
harsh789 is an unknown quantity at this point
Code:
echo "\r";
harsh789 is offline   Reply With Quote
Old 06-07-2006, 07:29 PM   PM User | #7
bufhal
New Coder

 
Join Date: Apr 2004
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
bufhal is an unknown quantity at this point
like this?

sorry to bother you again but is this what you mean?

<?
echo $_POST['Realname']echo "\r";

echo $_POST['Username']echo "\r";

echo $_POST['Title']echo "\r";

echo $_POST['Company']echo "\r";
bufhal is offline   Reply With Quote
Old 06-08-2006, 06:48 AM   PM User | #8
Tynan
Regular Coder

 
Join Date: Oct 2004
Location: London E4 UK
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Tynan is an unknown quantity at this point
I'm awful at this but only one echo at the start of the line

PHP Code:
echo $_POST['Realname']."\r"
something like that anyway

Last edited by Tynan; 06-08-2006 at 06:52 AM..
Tynan is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:49 PM.


Advertisement
Log in to turn off these ads.