Results 1 to 10 of 10
  1. #1
    Join Date
    Jun 2006
    Location
    England
    Posts
    58
    Tokens
    0

    Default php web form - I need one please!

    I need a php webform, not an HTML one because they suck and open windows outlook.

    I want one of those ones that sends it to an email. A php one, if anybody would be so kind as to post the code for one here.

    Why don't I make one myself? I don't know php.

    Thanks, +rep if you do (when I get some rep power. :rolleyes
    Don't accept rep anymore. Pointless when people abuse it. :rolleyes:

    Can you make vBulletin styles?
    PM me!
    (I will pay by PayPal!)


  2. #2
    Join Date
    May 2006
    Location
    New Zealand
    Posts
    4,452
    Tokens
    0

    Latest Awards:

    Default Here You Go

    Rite first make a page called form.php
    add this to that page and save it

    Code:
     <form action="contact_gene.php" method="post">
    <input type="text" size="25" value="Name" name="name"> 
    <br>
    <br>
    <input type="text" size="25" value="Your email" name="email"> 
    <br>
    <br><select size="1" name="option"> 
    <option value="Page Error">Page Error</option> 
    <option value="FeedBack">FeedBack</option> 
    <option value="General Contact">General Contact</option> 
    <option value="User System Problem">User System Problem</option> 
    <option value="-Please Choose One-" selected="selected">-Please Choose One-</option></select>
    <br>
    <br><textarea name="message" rows="10" cols="43"> </textarea> 
    <br>
    <br>
    <input type="hidden" value="<? $ip = getenv('REMOTE_ADDR'); PRINT("$ip"); ?>" name="ip">
    <br>
    <br>
    <input type="submit" value="Submit" name="submit"> </form></p></td>
    Next create a page that sends the dat to an email address, call this page contact_gene.php

    Code:
    <?php 
    if ($_SERVER['REQUEST_METHOD'] != 'GET'){ 
    $name = $_POST['name']; 
    $email = $_POST['email']; 
    $option = $_POST['option']; 
    $mess = $_POST['message']; 
    $ip = $_POST['ip']; 
    $messig = " 
    
    Name: $name 
    \n 
    Email: $email 
    \n 
    Option: $option 
    \n 
    message: $mess 
    \n 
    ip: $ip 
    \n 
    "; 
    $subject = $option; 
    mail("Your email here!", $subject, $messig); 
    Header("Location: index.php"); 
    } 
    else 
    { 
    echo 'ERROR'; 
    } 
    ?> 
    [/cphp] 
    
    This part of the generator gets the info entered to the form: 
    
    [php] 
    <?php 
    if ($_SERVER['REQUEST_METHOD'] != 'GET'){ 
    $name = $_POST['name']; 
    $email = $_POST['email']; 
    $option = $_POST['option']; 
    $mess = $_POST['message']; 
    $ip = $_POST['ip']; 
    $messig = "
    And this bit passes the info on to be sent to your email!
    Code:
     
    Name: $name 
    \n 
    Email: $email 
    \n 
    Option: $option 
    \n 
    message: $mess 
    \n 
    ip: $ip 
    \n
    lastly create a page and put this simple code in that sends the visitor to a selected page once they have sent the form

    Code:
    $subject = $option; 
    mail("Your email here!", $subject, $messig); 
    Header("Location: index.php"); 
    } 
    else 
    { 
    echo 'ERROR'; 
    } 
    ?>
    any problems contact me



    New Zealand Web/Tech News

  3. #3
    Join Date
    Jun 2006
    Location
    England
    Posts
    58
    Tokens
    0

    Default

    Hey dude.

    Thanks very much! +REP

    I need to know where to put
    Code:
    Name: $name 
    \n 
    Email: $email 
    \n 
    Option: $option 
    \n 
    message: $mess 
    \n 
    ip: $ip 
    \n
    And, how would I make it so it fits onto the page (like in the box)..

    Thank you
    Don't accept rep anymore. Pointless when people abuse it. :rolleyes:

    Can you make vBulletin styles?
    PM me!
    (I will pay by PayPal!)


  4. #4
    Join Date
    May 2006
    Location
    New Zealand
    Posts
    4,452
    Tokens
    0

    Latest Awards:

    Default

    u put it in the contact_gene.php page, soz it didnt work for some reason, and thanks for the +rep,
    New Zealand Web/Tech News

  5. #5
    Join Date
    Jun 2006
    Location
    England
    Posts
    58
    Tokens
    0

    Default

    Do I put the last three codes in one page?
    Don't accept rep anymore. Pointless when people abuse it. :rolleyes:

    Can you make vBulletin styles?
    PM me!
    (I will pay by PayPal!)


  6. #6
    Join Date
    May 2006
    Location
    New Zealand
    Posts
    4,452
    Tokens
    0

    Latest Awards:

    Default

    yer i think
    New Zealand Web/Tech News

  7. #7
    Join Date
    Mar 2006
    Location
    a house in a box
    Posts
    1,779
    Tokens
    0

    Latest Awards:


  8. #8
    Join Date
    May 2006
    Location
    New Zealand
    Posts
    4,452
    Tokens
    0

    Latest Awards:

    Default

    very good nick * bravo *
    New Zealand Web/Tech News

  9. #9
    Join Date
    Mar 2006
    Location
    a house in a box
    Posts
    1,779
    Tokens
    0

    Latest Awards:

    Default

    thanks mate

  10. #10
    Join Date
    Aug 2005
    Location
    Tunbridge Wells, Kent
    Posts
    5,063
    Tokens
    1,624

    Latest Awards:

    Default

    Nick its not there lol, Error 404
    Never argue with an idiot, he'll drag you down to his level, and beat you with experience.

    Quote Originally Posted by Recursion
    *oh trust me
    *I would NEVER go ATi
    And 15 mins later...
    Sapphire ATI Radeon HD 5850 1024MB GDDR5 PCI-Express Graphics Card £195.73 1 £195.73
    *ordered.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •