sending form info to email

This is a discussion on "sending form info to email" within the PHP Forum section. This forum, and the thread "sending form info to email are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Oct 26th, 2007, 15:27
Up'n'Coming Member
Join Date: Oct 2007
Location: london
Age: 25
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
sending form info to email

Hi im pretty new to php and I need to send the information from a form to a email, the code looks like this:
Code: Select all
<form class="register" action="callmeback-action.php" method="post" name="callmeback_form" onsubmit="return validate_form ( );"><input type="hidden" name="previous" value="<?PHP echo $_SERVER["HTTP_REFERER"]; ?>" />
<div id="regtype">
<div><label for="radnow">Call me NOW:</label><input type="radio" name="when" id="radnow" value="now" class="radio" checked="checked" onclick="regenable();" /></div>
<div><label for="rad30min">Call me in 30 Minutes:</label><input type="radio" name="when" id="rad30min" value="30min" class="radio" onclick="regenable();" /></div>
<div><label for="radtime">Call me at a specific time:</label><input type="radio" name="when" id="radtime" value="time" class="radio" onclick="regenable();" /></div>
</div>

<div>
<div><label for="name" id="namelabel">Name:</label><input name="name" id="name" type="text" class="text" /></div>
<div><label for="telephone" id="telephonelabel">Telephone No:</label><input name="telephone" id="telephone" type="text" class="text" /></div>
<div><label for="time" id="timelabel">Time:</label>
<?php
function get_avail_times() {
    $svrhour = date('H');
    $svrmin = date('i');
    $arrayitem = 0;
    $arr = array();
    for($i = $svrhour; $i <= 18; $i++) {
        if($i == date('H')) { // if it's the first iteration
            if(date('i') >= 0 && date('i') < 30) {
                $svrmin = 30;
                $arr[$arrayitem] = $i . ":" . $svrmin;
                $arrayitem++;
            }
            else if(date('i') >= 30 && date('i') < 0) {
                break; // continue on to the next hour, so break from loop
            }
        }
        else {
            $svrmin = 00;
            $arr[$arrayitem] = $i . ":" . $svrmin . "0";
            $arrayitem++;
            if($i < 18) {
                $svrmin = 30;
                $arr[$arrayitem] = $i . ":" . $svrmin;
                $arrayitem++;
            }
        }
    }
    return $arr;
}

$arr = get_avail_times();
echo("<select name=\"time\" id=\"time\" class=\"text\">");
foreach($arr as $tempvalue) {
echo("<option value=\" " . $tempvalue . "\"> " . $tempvalue . "</option>");
}
echo("</select>");
?>
</div>

<input type="submit" class="submit" value="Call me Back"/>
</div>
</form>
Can someone please point me in the right direction on how to do this.

Thanks in advance. Dan.
Reply With Quote

  #2 (permalink)  
Old Oct 26th, 2007, 15:32
c010depunkk's Avatar
SuperMember

SuperMember
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 593
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to c010depunkk
Re: sending form info to email

Have you looked at the sticky on this subject?
Reply With Quote
  #3 (permalink)  
Old Oct 26th, 2007, 15:34
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: sending form info to email

C010depunkk wrote a great tutorial post for just this thing

PHP mail() --> Making a Form / Validating Input / Sending an email

Start with that then post back with any problems that may arise.

Cheers
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Reply With Quote
Reply

Thread Tools

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP mail() --> Making a Form / Validating Input / Sending an email c010depunkk PHP Forum 4 Jan 17th, 2008 06:35
[SOLVED] sending email once form submitted Emzi PHP Forum 5 Nov 21st, 2007 14:25
PHP email form not sending email Kurt PHP Forum 1 Oct 12th, 2007 04:26
Flash email form php info into newsletter Nuwud PHP Forum 4 Aug 26th, 2007 06:52
About sending form-data to an email address a.jenery Web Page Design 4 Mar 3rd, 2006 12:17


All times are GMT. The time now is 11:46.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43