www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > HTML

    HTML Discussion and technical support for building, using and deploying HTML sites.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 05-08-2003, 10:29 AM
    moondance moondance is offline
    Registered User
     
    Join Date: Mar 2003
    Posts: 191
    Unhappy Email Form without Outlook

    This question has been asked on here before, but i need something slightly different.

    I want to post this form. Nice and simple, nothing complex about it. I don't want outlook express to mail it though; i want it to be sent directly. I know that i need PHP to do this. But i DON'T want a reply or confirmation automatically sent back to the sender or anything like that, just to simply post it without using OExpress.

    Heres my form:

    <form action="MAILTOoohead@poofarm.com" method="post" enctype="text/plain">
    <p>Your Name: </p>
    <input TYPE="text" NAME="persons-name" SIZE="40" MAXLENGTH="40">
    <p>Subject: </p>
    <input TYPE="text" NAME="persons-name" SIZE="40" MAXLENGTH="40">
    <br>
    <p>Comments: </p>
    <textarea NAME="comments" ROWS="5" COLS="30"></textarea>
    <br>
    <center><input TYPE="submit" NAME="Request" VALUE=" Send "></center>
    </form>

    If anyone knows the PHP for this i'd appreciate it.

    Any help will be rewarded in heaven. Remember - jesus loves you.
    Reply With Quote
      #2  
    Old 05-08-2003, 11:07 AM
    pyro's Avatar
    pyro pyro is offline
    Registered User
     
    Join Date: Dec 2002
    Location: High on life
    Posts: 10,183
    Here is the PHP that I use for this:

    PHP Code:
    <?PHP

    #######################################################
    # This script is Copyright 2003, Infinity Web Design  #
    # Written by Ryan Brill - [email]ryan@infinitypages.com[/email]      #
    # All Rights Reserved - Do not remove this notice     #
    #######################################################

    ## The lines below need to be edited...

    ###################### Set up the following variables ######################
    #                                                                          #
    $to = "you@your.com"; #set addres to send for to
    $subject = "Results from your Request Info form"; #set the subject line
    $headers = "From: Form Mailer"; #set the from address
    $forward = 1; # redirect? 1 : yes || 0 : no
    $location = "thankyou.htm"; #set page to redirect to, if 1 is above
    #                                                                          #
    ##################### No need to edit below this line ######################

    ## set up the time ##

    $date = date ("l, F jS, Y");
    $time = date ("h:i A");

    ## mail the message ##

    $msg = "Below is the result of your feedback form.  It was submitted  on $date at $time.\n\n";
        
    foreach (
    $_POST as $key => $value) {
        
    $msg .= ucfirst ($key) ." : ". $value . "\n";
    }

    mail($to, $subject, $msg, $headers);
    if (
    $forward == 1) {
        
    header ("Location:$location");
    }
    else {
        echo (
    "Thank you for submitting our form. We will get back to you as soon as possible.");
    }

    ?>
    __________________

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!
    Reply With Quote
      #3  
    Old 05-08-2003, 11:15 AM
    moondance moondance is offline
    Registered User
     
    Join Date: Mar 2003
    Posts: 191
    Talking

    ok cheers i'll give that a try



    Reply With Quote
      #4  
    Old 05-08-2003, 11:29 AM
    DaveSW's Avatar
    DaveSW DaveSW is offline
    Registered User
     
    Join Date: Feb 2003
    Location: Wales, UK
    Posts: 3,183
    Cool script pyro. Are there any corporate licences required? Or is it free provided the copyright stays in?

    Dave
    __________________
    In a world without walls and fences - who needs Windows and Gates?! - Unknown Author
    "And there's Bill Gates, the...most...famous...man in the...ah...Microsoft." -- A TV commentator for the 2000 Olympics.


    Web Design Faq? | W3C | Validator | Accessibility testing | Speed up your PC | Wura | Box Model Research
    Reply With Quote
      #5  
    Old 05-08-2003, 11:34 AM
    pyro's Avatar
    pyro pyro is offline
    Registered User
     
    Join Date: Dec 2002
    Location: High on life
    Posts: 10,183
    Hmmm... corporate licencing, now there is an idea. Seriously, go ahead and use it, just leave the copyright, and don't start passing it around like it's yours.
    __________________

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!
    Reply With Quote
      #6  
    Old 05-08-2003, 11:56 AM
    DaveSW's Avatar
    DaveSW DaveSW is offline
    Registered User
     
    Join Date: Feb 2003
    Location: Wales, UK
    Posts: 3,183
    Thanks super moderator!!
    __________________
    In a world without walls and fences - who needs Windows and Gates?! - Unknown Author
    "And there's Bill Gates, the...most...famous...man in the...ah...Microsoft." -- A TV commentator for the 2000 Olympics.


    Web Design Faq? | W3C | Validator | Accessibility testing | Speed up your PC | Wura | Box Model Research
    Reply With Quote
      #7  
    Old 05-08-2003, 11:57 AM
    pyro's Avatar
    pyro pyro is offline
    Registered User
     
    Join Date: Dec 2002
    Location: High on life
    Posts: 10,183
    No problem...

    Cheers!
    __________________

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!
    Reply With Quote
      #8  
    Old 05-08-2003, 12:54 PM
    DaveSW's Avatar
    DaveSW DaveSW is offline
    Registered User
     
    Join Date: Feb 2003
    Location: Wales, UK
    Posts: 3,183
    I keep getting this error

    Parse error: parse error in /homepages/40/d73801884/htdocs/form/phpmail.php on line 14

    When I use the code as on this link.
    http://www.emdevelopments.co.uk/form/form.htm
    How exactly should I insert it (never used php before)? Should it be a .php file targeted in the form action, or pasted at the top of the page and saved (the html) as a .php file? If the second option, what is the form action?

    dave
    __________________
    In a world without walls and fences - who needs Windows and Gates?! - Unknown Author
    "And there's Bill Gates, the...most...famous...man in the...ah...Microsoft." -- A TV commentator for the 2000 Olympics.


    Web Design Faq? | W3C | Validator | Accessibility testing | Speed up your PC | Wura | Box Model Research
    Reply With Quote
      #9  
    Old 05-08-2003, 01:17 PM
    pyro's Avatar
    pyro pyro is offline
    Registered User
     
    Join Date: Dec 2002
    Location: High on life
    Posts: 10,183
    Post the script that you are using (with your changes) Also, you just make a php page and then link to it with your forms action (first method)
    __________________

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!
    Reply With Quote
      #10  
    Old 05-08-2003, 01:23 PM
    DaveSW's Avatar
    DaveSW DaveSW is offline
    Registered User
     
    Join Date: Feb 2003
    Location: Wales, UK
    Posts: 3,183
    <?PHP


    _##################################################

    #####

    # This script is Copyright 2003, Infinity Web Design__#

    # Written by Ryan Brill - ryan@infinitypages.com______#

    # All Rights Reserved - Do not remove this notice_____#

    _##################################################

    #####


    ## The lines below need to be edited...


    ###################### Set up the following variables ######################

    #__________________________________________________________________________#

    $to_=_"dave@999man.co.uk";_#set addres to send for to

    $subject_=_"Results from your Request Info form";_#set the subject line

    $headers_=_"Form Mailer";_#set the from address

    $forward_=_1;_# redirect? 1 : yes || 0 : no

    $location_=_"ta.htm";_#set page to redirect to, if 1 is above

    #__________________________________________________________________________#

    ##################### No need to edit below this line ######################


    ## set up the time ##


    $date_=_date_("l, F jS, Y");

    $time_=_date_("h:i A");


    ## mail the message ##


    $msg_=_"Below_is_the_result_of_your_feedback_form.__It_was_submitted__on_$date_at_$time.\n\n";

    ____

    foreach_($_POST_as_$key_=>_$value)_{

    ____$msg_.=_ucfirst_($key)_." : "._$value_._"\n";

    }


    mail($to,_$subject,_$msg,_$headers);

    if_($forward_==_1)_{

    ____header_("Location:$location");

    }

    else_{

    ____echo_("Thank you for submitting our form. We will get back to you as soon as possible.");

    }


    ?>
    __________________
    In a world without walls and fences - who needs Windows and Gates?! - Unknown Author
    "And there's Bill Gates, the...most...famous...man in the...ah...Microsoft." -- A TV commentator for the 2000 Olympics.


    Web Design Faq? | W3C | Validator | Accessibility testing | Speed up your PC | Wura | Box Model Research
    Reply With Quote
      #11  
    Old 05-08-2003, 01:24 PM
    DaveSW's Avatar
    DaveSW DaveSW is offline
    Registered User
     
    Join Date: Feb 2003
    Location: Wales, UK
    Posts: 3,183
    hey - where did all those lines come from?

    Is it post or get?

    Edit: Here's the html:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
    <HTML>
    <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
    <TITLE></TITLE>
    </HEAD>
    <BODY>
    <DIV ALIGN="CENTER">
    <FORM ACTION="phpmail.php" METHOD="POST">
    <DIV>Name: <INPUT TYPE="TEXT" NAME="Name"></DIV>
    <DIV>Company/Brigade: <INPUT TYPE="TEXT" NAME="Company"></DIV>
    <DIV>Job Position: <INPUT TYPE="TEXT" NAME="Job"></DIV>
    <DIV>Email: <INPUT TYPE="TEXT" NAME="Email"></DIV>
    <P></P>
    <DIV>Tick this box if you wish to receive more information on
    Ironmongers sales<INPUT TYPE="CHECKBOX" NAME="IronmongerInfo"></DIV>
    <DIV>Tick this box if you wish to receive more information on Fire
    Equipment sales<INPUT TYPE="CHECKBOX" NAME="FireEquip"></DIV>
    <DIV>Tick this box if you wish to receive more information on Conveyors
    sales<INPUT TYPE="CHECKBOX" NAME="Conveyors"></DIV>
    <P></P>
    <DIV><INPUT TYPE="SUBMIT" NAME="Send" VALUE="Send"><INPUT TYPE="RESET"
    NAME="Clear" VALUE="Clear"></DIV></FORM></DIV> </BODY>
    </HTML>
    __________________
    In a world without walls and fences - who needs Windows and Gates?! - Unknown Author
    "And there's Bill Gates, the...most...famous...man in the...ah...Microsoft." -- A TV commentator for the 2000 Olympics.


    Web Design Faq? | W3C | Validator | Accessibility testing | Speed up your PC | Wura | Box Model Research

    Last edited by DaveSW; 05-08-2003 at 01:46 PM.
    Reply With Quote
      #12  
    Old 05-08-2003, 02:02 PM
    pyro's Avatar
    pyro pyro is offline
    Registered User
     
    Join Date: Dec 2002
    Location: High on life
    Posts: 10,183
    Alright... which line out of all that is line 14? If it is this one:

    PHP Code:
    $forward = 1; # redirect? 1 : yes || 0 : no
    try this instead:

    PHP Code:
    $forward = "1"; # redirect? 1 : yes || 0 : no
    __________________

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!
    Reply With Quote
      #13  
    Old 05-08-2003, 02:41 PM
    DaveSW's Avatar
    DaveSW DaveSW is offline
    Registered User
     
    Join Date: Feb 2003
    Location: Wales, UK
    Posts: 3,183
    <?PHP


    _##################################################

    #####

    # This script is Copyright 2003, Infinity Web Design__#

    # Written by Ryan Brill - ryan@infinitypages.com______#

    # All Rights Reserved - Do not remove this notice_____#

    _##################################################

    #####


    ## The lines below need to be edited...


    ###################### Set up the following variables ######################

    #__________________________________________________________________________#

    $to_=_"dave@999man.co.uk";_#set addres to send for to

    $subject_=_"Results from your Request Info form";_#set the subject line

    $headers_=_"Form Mailer";_#set the from address

    $forward_=_"1";_# redirect? 1 : yes || 0 : no

    $location_=_"ta.htm";_#set page to redirect to, if 1 is above

    #__________________________________________________________________________#

    ##################### No need to edit below this line ######################


    ## set up the time ##


    $date_=_date_("l, F jS, Y");

    $time_=_date_("h:i A");


    ## mail the message ##


    $msg_=_"Below_is_the_result_of_your_feedback_form.__It_was_submitted__on_$date_at_$time.\n\n";

    ____

    foreach_($_POST_as_$key_=>_$value)_{

    ____$msg_.=_ucfirst_($key)_." : "._$value_._"\n";

    }


    mail($to,_$subject,_$msg,_$headers);

    if_($forward_==_1)_{

    ____header_("Location:$location");

    }

    else_{

    ____echo_("Thank you for submitting our form. We will get back to you as soon as possible.");

    }


    ?>

    Like this? It doesn't work either my line 14 was a blank one! Must have miscounted!
    __________________
    In a world without walls and fences - who needs Windows and Gates?! - Unknown Author
    "And there's Bill Gates, the...most...famous...man in the...ah...Microsoft." -- A TV commentator for the 2000 Olympics.


    Web Design Faq? | W3C | Validator | Accessibility testing | Speed up your PC | Wura | Box Model Research
    Reply With Quote
      #14  
    Old 05-08-2003, 05:54 PM
    pyro's Avatar
    pyro pyro is offline
    Registered User
     
    Join Date: Dec 2002
    Location: High on life
    Posts: 10,183
    Hmm... why don't you try .zipping the file that you are using, so I can look at it/try it...
    __________________

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!
    Reply With Quote
      #15  
    Old 05-08-2003, 06:17 PM
    DaveSW's Avatar
    DaveSW DaveSW is offline
    Registered User
     
    Join Date: Feb 2003
    Location: Wales, UK
    Posts: 3,183
    Ok thanks a lot.
    Attached Files
    File Type: zip dave.zip (1.5 KB, 108 views)
    __________________
    In a world without walls and fences - who needs Windows and Gates?! - Unknown Author
    "And there's Bill Gates, the...most...famous...man in the...ah...Microsoft." -- A TV commentator for the 2000 Olympics.


    Web Design Faq? | W3C | Validator | Accessibility testing | Speed up your PC | Wura | Box Model Research
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes 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 Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 05:36 AM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.