Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
after form submit navigate back to site.
Old 03-07-2008, 10:37 AM after form submit navigate back to site.
matt w's Avatar
Super Talker

Posts: 136
Location: kalamazoo
Trades: 0
I have a web page:
http://sifaka888.x10hosting.com/reco...tact_page.html

where I collect information from a form, pass it to a php script (separate file) which sends it to my email. It works.
Now how do I get over the blank screen while informing the visitor their e-mail was sent?
I'm tempted to do it by creating a nice html page filled with php variables. How do you do that? Any other ideas?
I'm reluctant to do it by submitting the form data to a php script in the same page, becuase I thinks it's illegal html.
In case you can use it, here is the script "recov_mail_send.php" that sends the form contents to my e-mail:
PHP Code:
<?php
$username
="root";
$password="";
$host="localhost";
$first=$_POST['first'];
$last=$_POST['last'];
$phone=$_POST['phone'];
$mobile=$_POST['mobile'];
$email=$_POST['email'];
$message=$_POST['message'];
 
//replace dot with double one for smtp servers
$text str_replace("\n.""\n.."$text);
// Use wordwrap() if lines are longer than 70 characters
$message wordwrap($message,70);
// set to variable
$to 'mattwilliams59@yahoo.com' ', ';
$to .= 'mattwilliams59@aol.com';
$space " ";
// set subject variable
$subject 'Recovery website e-mail';
//set "from" header
$headers "From: $email";
// build $msg variable (message)
$msg $message;
$msg .= "Sender of e-mail: ";
$msg .= $first;
$msg .= $space;
$msg .= $last;
// Send email
mail($to,$subject,$msg,$headers);
?>
Thanks,
Matt W
matt w is offline
Reply With Quote
View Public Profile Visit matt w's homepage!
 
 
Register now for full access!
Old 03-07-2008, 10:46 AM Re: after form submit navigate back to site.
Super Spam Talker

Latest Blog Post:
PSD Squirrel Launched
Posts: 932
Trades: 7
redirect them to a complete page?

PHP Code:
header('Location: http://www.page/thanks.page'); 
or just put echo statements at the start of your script....

PHP Code:
echo("Emailing being sent...");

// and at the end of the script...
echo("...email sent."); 
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Sir P is offline
Reply With Quote
View Public Profile Visit Sir P's homepage!
 
Old 03-07-2008, 11:11 AM Re: after form submit navigate back to site.
matt w's Avatar
Super Talker

Posts: 136
Location: kalamazoo
Trades: 0
I want them to get a screen or a pane where they see a message like this:

Your message: $php_variable, $php-variable.....
Has been sent.

Click here to go back to some page. Click here to go back to another page.

......the above page would be formatted to look like the rest of the pages in my site, and would include the visitor's message reiterated through php combined with html? How do I do that? The whole idea is to acknowledge that I have received their form, and to let them go back to somewhere they might want to go after they've filled out the form.

Matt
matt w is offline
Reply With Quote
View Public Profile Visit matt w's homepage!
 
Old 03-07-2008, 11:15 AM Re: after form submit navigate back to site.
Super Spam Talker

Latest Blog Post:
PSD Squirrel Launched
Posts: 932
Trades: 7
ok matt so add this to the bottom of your php code ...

PHP Code:
include 'sent.php'
and design your sent.php page to look as you like in HTML and where you want the two $php_variables to display just use the following in the HTML code..

PHP Code:
<? print $phpvariable;?>
Crude but gets your job done fast!
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Sir P is offline
Reply With Quote
View Public Profile Visit Sir P's homepage!
 
Old 03-08-2008, 04:21 AM Re: after form submit navigate back to site.
Super Spam Talker

Latest Blog Post:
PSD Squirrel Launched
Posts: 932
Trades: 7
well I got talkupation for this thread, does that mean you managed to get it working matt? --- I hope so
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Sir P is offline
Reply With Quote
View Public Profile Visit Sir P's homepage!
 
Reply     « Reply to after form submit navigate back to site.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.56586 seconds with 12 queries