Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Dec 2008
    Posts
    12
    Member #
    17856
    I have seen many posts on having a form "post" to PHP on a server to have the information set to a certain email address. I am still confused a bit. I created a form in HTML that can be viewed here: http://www.heeterins.com/homeowners_quote.html
    My problem is first how to get it to "connect" to the PHP file on the server and they the 2nd part that I haven't found any information on is how to direct the form to an email to be viewed? The only thing that I've been seeing in response to these types of questions is this piece of coding <form action="" method="post" name="homequote" id="homequote">. I kind of understand that I need to put in a form action and I'm guessing it will point to the server but how to I redirect it to an email address?
    These are what are in the cgi-bin folder on the company's server: PHP4-cgi, PHP5-cgi, PHP-cgi, printenv and test-cgi.
    This is Greek to me so any info would help.
    Also if I build a site with .aspx would the form still be in PHP or .aspx. I am asking this question for a different website I'm building different website.
    Thanks for the help!!!

  2.  

  3. #2
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    You are right, the forms' action tag must point to a processing file.

    It is inside this file that you a PHP variable (or constant) that is assigned the e-mail address you want to send to, for example

    PHP Code:
    $to 'myaddress@mydomain.com'
    Inside that same file you will have some other code that sets the subject, body, headers of an e-mail and code that actually sends the e-mail.

    I am not sure what you mean by

    how to direct the form to an email to be viewed?
    Do you want to use PHP to check your e-mail?

    And regarding the ASP.NET issue, it depends if you mean a server side controls (form controls) or if you just mean having bog standard HTML form elements in a ASP.NET page. If it is the latter then the form is still HTML but it just happens to appear in a .php or a .aspx page

    I must dash but if you have other questions feel free to ask more.

  4. #3
    Junior Member
    Join Date
    Dec 2008
    Posts
    12
    Member #
    17856
    Thanks for the reply. What I mean by, "how to direct the form to an email to be viewed?" was kind of confusing. I was just wanting to "view" it in an email so you basically answered my question. So in the php file is where I will need to edit the recipient, the subject, etc? I downloaded these file from the server but was unable to open them. What program do I need to view the php file? I think I might know but not 100%.
    Thanks again for your great help!

  5. #4
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    Yes, the action of the form is where you would set the recipient, subject, the actual content of the e-mail, everything.

    Any text editor can be used to edit PHP files. For instance you could Notepad (Windows) or a fully fledged PHP editor such as Crimson Editor or HydraPHP (I used to use Hydra years ago, not sure if it is still in development.

    To show you what I mean I just opened up Notepad and typed the following

    PHP Code:
    <?php
    // Always use <?php and not <?
      
    echo "Mary had a little lamb.";
    ?>
    I saved that as dpmdesigndemo.php (also remember to change Save As Type to All Files) and put that on my PHP Server and voila, whnen I view it through my browser I see

    Quote Originally Posted by dpmdesigndemo.php
    Mary had a little lamb.

  6. #5
    Junior Member
    Join Date
    Feb 2009
    Location
    Hyde, Cheshire
    Posts
    3
    Member #
    18345
    I'm having similar problems. I've created this form:
    http://tamesideuserforum.freehostia....tionairre.html
    and I've tried several php scripts ia an attempt to get the results sent to me via e-mail but none of them have worked - this is despite displaying the message that says the results have been submitted.
    I cant figure out what i'm doing wrong. I'm not sure if the problem is with my host (freehostia) or with the scripts that I have used.
    Any help would be greatly appreciated


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 09:29 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com