Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Editors and Tools > Other PHP Tools

Other PHP Tools This is were to discuss other non-desktop PHP related tools.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2004-06-05, 04:26 PM
beachnut
Guest
 
Posts: n/a
Default

Here is the code I'm trying to send to mysql and to mail back a copy to me.

The mysql part works. How do I mail it to me and redirect to a thank you page??

Any help is appreciated.

Thanks

Beachnut
**************
<?php

include "../config.php"; //the file is outside this directory
// Success messages


$sql_txt = "insert into names (fname, email, assnname, city, state, upass) VALUES('$fname','$email','$assnname','$city','$sta te','$upass')";
mysql_query($sql_txt) or die ($err_query);

echo "

<FORM name=\"AdUserForm\" method=\"POST\" action=\"1-adduser.php\">

<tr>
<td><font size=2><font color=RED>*</font>Full Name:</font></td>
<td align=left><input type=\"text\" name=\"fname\" size=\"25\"></td>
</tr>
<tr>
<td><font style=verdana><font size=2><font color=RED>*</font>Email:</font></font></td>
<td align=left><input type=\"text\" name=\"email\" size=\"25\"></td>
</tr>
<tr>
<td><font style=verdana><font size=2><font color=RED>*</font>Assn Name:</font></font></td>
<td align=left><input type=\"text\" name=\"assnname\" size=\"25\"></td>
</tr>
<tr>
<td><font size=2><font color=RED>*</font>City:</font></font></td>
<td align=left><input type=\"text\" name=\"city\" size=\"25\"></td>
</tr>
<tr>
<td><font size=2><font color=RED>*</font>State:</font></font></td>
<td align=left><input type=\"text\" name=\"state\" size=\"25\"></td>
</tr>
<tr>
<td><font size=2><font color=RED>*</font>Over 18? Yes or No!:</font></font></td>
<td align=left><input type=\"text\" name=\"age\" size=\"3\"></td>
</tr>
<tr>
<td><font size=2>UserName is Provided:</font></td>
<td align=left><input type=\"text\" name=\"user\" size=\"5\"></td>
</tr>
<tr>
<td><font size=2><font color=RED>*</font>Passw'd you want (5-Max 8):</font></td>
<td align=left><input type=\"text\" name=\"upass\" size=\"8\"></td>

</tr>
<tr>
<td colSpan=2 align=center><INPUT type=\"Submit\" name=\"BtnSubmit\" value=\"Create account\"></td>
</tr>
</font>
</table>
</TD>
</TR>
</TABLE>
</CENTER>
</FORM>";
?>
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 2004-06-05, 09:25 PM
Moderator
 
Join Date: May 2004
Location: Portugal
Posts: 143
gesf is an unknown quantity at this point
Send a message via ICQ to gesf Send a message via MSN to gesf Send a message via Skype™ to gesf
Default

Please take a look at php's header() and mail() functions!

If you need help, just postreply!

Cheers,
Gesf
__________________
Best Regards,
Gonçalo "GesF" Fontoura

Website : gesf.org
Reply With Quote
  #3 (permalink)  
Old 2004-06-06, 01:34 AM
Junior Member
 
Join Date: Jun 2004
Posts: 1
beachnut
Default

Thanks for your reply.

I have looked at mail(), however, I could not see how I can insert this into my code??

Would I do something like this?

<FORM name=\"AdUserForm\" method=\"POST\" action=\"1-adduser.php\"mail.php\">

and refer it to a 'mail.php' page, which would forward the data??

As you can probably tell, I am rather new at this.

How would I redirect? I know how to do it in HTML, using 'hidden'.
When I use the same in PHP, I get an error reading!

Thanks for bearing with me.

beachnut
Reply With Quote
  #4 (permalink)  
Old 2004-06-06, 02:16 AM
Moderator
 
Join Date: May 2004
Location: Portugal
Posts: 143
gesf is an unknown quantity at this point
Send a message via ICQ to gesf Send a message via MSN to gesf Send a message via Skype™ to gesf
Default

Nop, that´s not a valid action for the form.
Your form action will be the file (including url to it), where you´ll make the verification of the submitted data and/or send the email!

You can have all that verification, send email and/or sucess messages codes in the same file!

If you don´t know how to verify the data and/or send the email, please see this post!

BTW, why you want to use php's header() or like you said redirect!? Becose of the form!? It already does it to the given action!

Cheers,
Gesf
__________________
Best Regards,
Gonçalo "GesF" Fontoura

Website : gesf.org
Reply With Quote
  #5 (permalink)  
Old 2004-06-30, 08:22 PM
Guest
Guest
 
Posts: n/a
Default

Quote:
Originally posted by gesf@Jun 5 2004, 08:25 PM
Please take a look at php's header() and mail() functions!

If you need help, just postreply!

Cheers,
Gesf
Reply With Quote
  #6 (permalink)  
Old 2004-06-30, 09:54 PM
Moderator
 
Join Date: May 2004
Location: Portugal
Posts: 143
gesf is an unknown quantity at this point
Send a message via ICQ to gesf Send a message via MSN to gesf Send a message via Skype™ to gesf
Default

Quote:
Originally posted by beachnut+--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>QUOTE (beachnut)</td></tr><tr><td id='QUOTE'>... How do I mail it to me and redirect to a thank you page?? ...[/b]

<!--QuoteBegin--gesf

... Please take a look at php's header() and mail() functions! ...[/quote]

What !?
:P
__________________
Best Regards,
Gonçalo "GesF" Fontoura

Website : gesf.org
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.0 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.0 (a popular PHP IDE) and NuCoder 1.4 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:07 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.