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
I need some guidance on PHP coding for a simple form submission
Old 07-08-2008, 11:11 AM I need some guidance on PHP coding for a simple form submission
Average Talker

Posts: 24
Name: Stephen Self
Trades: 0
I've never done this before, and I'm hoping for a little assistance to help me get the hang of it.

If you go to this page...

http://www.platinumbusinessconsultin...ops/contact-us

This is the form that I need sent to my email address.

Does someone have some pre-made code that I can use to fill in with these particular fields?

Thanks for any help!

Stephen H. Self
StephenSelf is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-08-2008, 12:02 PM Re: I need some guidance on PHP coding for a simple form submission
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
This is normally done with the PHP mail() function. Read about it here: http://php.net/manual/en/function.mail.php
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 07-08-2008, 12:24 PM Re: I need some guidance on PHP coding for a simple form submission
Average Talker

Posts: 24
Name: Stephen Self
Trades: 0
Wow, that's alot of info.

I have read through most of it, but it still is not clear to me how to get the parameters in my form to be collected and sent via email.

Is it really as difficult as it seems, or am I just having a "slow" day?

Thanks for patience with me
StephenSelf is offline
Reply With Quote
View Public Profile
 
Old 07-08-2008, 02:42 PM Re: I need some guidance on PHP coding for a simple form submission
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
That's ok, you are asking a very normal and logical question.

The first thing you will do is to target the form at the page containing the code that will send the mail. The first thing this code will do is check for the existance of the "submit" variable, which should be contained inside of the $_POST array, assuming you have created your form like this:

HTML Code:
<form target="somescript.php" method="post">
<input name="from" type="text">
<input name="to" type="text">
<input name="subject" type="text">
<input name="body" type="text">
<input name="submit" type="submit" value="Send!">
The values stored inside of the $_POST array are referenced by the "name" attribute in each input. Thus, to check for the existance of the "submit" button, you do something like this:

PHP Code:
<?php
if(isset($_POST['submit'])) {

}
?>
Inside of this IF statement, you will collect the values from the form like this:

PHP Code:
<?php
if(isset($_POST['submit'])) {
$from $_POST['from'];
$to $_POST['to'];
$subject $_POST['subject'];
$body $_POST['body'];
}
?>
Now you have the values stored conveniently inside of logically named variables, which can be used to plug in to the mail() function.

Hope that gives you something to sink your teeth into!
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 07-09-2008, 10:07 AM Re: I need some guidance on PHP coding for a simple form submission
Average Talker

Posts: 24
Name: Stephen Self
Trades: 0
That is some great information!

Thanks so much for taking the time to get so detailed with it for me. I will let you know if I have anymore questions.
StephenSelf is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to I need some guidance on PHP coding for a simple form submission
 

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.32827 seconds with 12 queries