php form

Discussion in 'Web Programming' started by Chandler789, May 24, 2007.

php form
  1. Unread #1 - May 24, 2007 at 8:10 PM
  2. Chandler789
    Joined:
    May 29, 2006
    Posts:
    190
    Referrals:
    0
    Sythe Gold:
    0

    Chandler789 Active Member

    php form

    can some one give me a link to a tut or example of a php form that u can submt and it will send to an e-mail address or save in a database or file. (I'm trying to make a request for emails, becuase u have to make them in vDeck -.-)
     
  3. Unread #2 - May 25, 2007 at 11:51 AM
  4. MellowYellow
    Referrals:
    0

    MellowYellow Guest

  5. Unread #3 - May 25, 2007 at 12:39 PM
  6. Chandler789
    Joined:
    May 29, 2006
    Posts:
    190
    Referrals:
    0
    Sythe Gold:
    0

    Chandler789 Active Member

    php form

    thats not a form, and it doesnt descibe it very well, thats sora like forum mail


    heres what i'm looking for, and i want it to email me or save intoa database/ file


    <div align="right">
    <html><body>
    <h4>Email request forum</h4>
    <form method="post" enctype="multipart/form-data" action=getemail.php">
    current email:(for contact) <input type="text" name="Contact Info" />
    <br>Requested email: <input type="text" name="Requested email" />
    <br>Requested password: <input type="text" name="requested email password" name="requested email password" />
    <br>EO Forum name: <input type="text" name="Eternity Online Forum name" />
    <br>RK Forum name: <input type="text" name="RuneKeep Forum name" />
    <br><input type="submit" />
    </form>
    </body></html></div>
     
  7. Unread #4 - May 27, 2007 at 1:19 PM
  8. night
    Joined:
    Apr 21, 2005
    Posts:
    60
    Referrals:
    1
    Sythe Gold:
    5

    night Member
    Banned

    php form

    ok so in your getmail.php file, those values would be.
    $_POST['Contact Info'];
    $_POST['Requested email'];
    etc etc etc

    so you can then use those values to store in db.
     
  9. Unread #5 - May 28, 2007 at 1:22 PM
  10. Chandler789
    Joined:
    May 29, 2006
    Posts:
    190
    Referrals:
    0
    Sythe Gold:
    0

    Chandler789 Active Member

    php form

    oh, i have thoughs aswell, i just need to know how to store it...
     
  11. Unread #6 - May 28, 2007 at 4:18 PM
  12. MellowYellow
    Referrals:
    0

    MellowYellow Guest

    php form

    I'm confused, do you even know PHP or HTML?

    You said you wanted form data sent to your email or stored in a database or file, right? I gave you the mail function. If the mail function is too difficult for you I'm sure the file i/o or mysql functions will be aswell. Anyways, check these out:
    http://us2.php.net/manual/en/function.file.php
    Look for fopen(), fwrite(), fread(), and fclose().

    http://us2.php.net/manual/en/ref.mysql.php
    Code:
    <div align="right">
    <html><body>
    [color=red]DIV outside of HTML/BODY. Not allowed.[/color]
    <h4>Email request forum</h4>
    <form method="post" enctype="multipart/form-data" action=getemail.php">
    [color=red]Multipart enctype is for uploading. Remove it. Missing a quote on your action.[/color]
    current email: (for contact) <input type="text" name="Contact Info" />
    <br>Requested email: <input type="text" name="Requested email" />
    <br>Requested password: <input type="text" name="requested email password" name="requested email password" />
    [color=red]Duplicate name attribute. Remove one.[/color]
    <br>EO Forum name: <input type="text" name="Eternity Online Forum name" />
    <br>RK Forum name: <input type="text" name="RuneKeep Forum name" />
    <br><input type="submit" />
    </form>
    </body></html></div>
    [color=red]You should keep your form data names simpler, aswell.[/color]
    
     
  13. Unread #7 - May 28, 2007 at 6:27 PM
  14. Chandler789
    Joined:
    May 29, 2006
    Posts:
    190
    Referrals:
    0
    Sythe Gold:
    0

    Chandler789 Active Member

    php form

    .... i need to know how to make it send it to the file, i relise if its file (perfibly) it has to be chome 777
     
  15. Unread #8 - May 29, 2007 at 11:28 PM
  16. MellowYellow
    Referrals:
    0

    MellowYellow Guest

    php form

    I give up. I showed you how to already.. Several times, several ways.
     
  17. Unread #9 - May 30, 2007 at 3:39 PM
  18. Puzzle
    Joined:
    May 6, 2005
    Posts:
    846
    Referrals:
    0
    Sythe Gold:
    0

    Puzzle Apprentice

    php form

    i agree, mellow showed you the way to do it. if you dont know ANY html or php go learn some.
     
  19. Unread #10 - May 31, 2007 at 1:28 AM
  20. Chandler789
    Joined:
    May 29, 2006
    Posts:
    190
    Referrals:
    0
    Sythe Gold:
    0

    Chandler789 Active Member

    php form

    -.o I've never done somthing liek that before, and i followed a tutrail the first time and it dint work... and that one dint work to well either, i want it to POST it in a file or data base then, let me get that straight, rather then going thogh the STMP proccess
     
  21. Unread #11 - Jun 20, 2007 at 6:49 PM
  22. Xcalibur
    Referrals:
    0

    Xcalibur Guest

    php form

    lol this is probably so he can make a "Become a Mod" website and steal accounts
     
  23. Unread #12 - Jul 9, 2007 at 3:50 AM
  24. Chandler789
    Joined:
    May 29, 2006
    Posts:
    190
    Referrals:
    0
    Sythe Gold:
    0

    Chandler789 Active Member

    php form

    wtf? no it isnt, it to request emails lol. google Eternity Online. or RuneKeep. EO was shut off, because i dint have $200 more for hosting lol.
     
  25. Unread #13 - Jul 21, 2007 at 2:52 PM
  26. emuse
    Referrals:
    0

    emuse Guest

    php form

    I will help you man, have you ever used a database system before? like mysql? and do you currently host a website?
     
  27. Unread #14 - Jul 21, 2007 at 2:54 PM
  28. emuse
    Referrals:
    0

    emuse Guest

    php form

    woth mysql when someone inserts text into your form in sends there info and stores it in a table in the database. and then you need to program a script to view the info that was submitted to I suggest you have me program you a form that will send the info to your e-mail. is that ok?
     
  29. Unread #15 - Jul 22, 2007 at 1:16 PM
  30. TehDan
    Referrals:
    0

    TehDan Guest

    php form

    Code:
    <form method="post" action="<?php echo($PHP_SELF) ?>">
     <fieldset>
     <legend>Email Form</legend>
     <p><label>Name:</label><input type="text" name="name" id="name"></p>
     <p><label>Email:</label><input type="text" name="email" id="email"></p>
     <p><label>Comments:</label><input type="text" name="comments"  id="comments"></p>
     <p><input type="submit" name="submit" id="submit" value="Send Message"></p>
     </fieldset>
    </form>
    
    <?php
      
      # Add your email address
      $to = '[email protected]';
      # Add a default subject
      $subject = 'You Have Mail From Your Website';
      $loc = $_SERVER['PHP_SELF'];
      $name = $_REQUEST['name'];
      $email = $_REQUEST['email'];
      $comments = $_REQUEST['comments'];
      $submit = $_REQUEST['submit'];
      $body = "You have received an email from $name \n ($email) \n \n $name wanted to tell you: $comments \n \n He sent this message from $loc";
    
      if(isset($submit)) {
    
      mail($to, $subject, $body);}
    
      ?> 
    Custom job by me.
     
  31. Unread #16 - Jul 22, 2007 at 6:04 PM
  32. Chandler789
    Joined:
    May 29, 2006
    Posts:
    190
    Referrals:
    0
    Sythe Gold:
    0

    Chandler789 Active Member

    php form

    Thanks but I made one more complex so it just write to the actual email database, thanks for the examples though
     
  33. Unread #17 - Jul 23, 2007 at 6:56 AM
  34. TehDan
    Referrals:
    0

    TehDan Guest

    php form

    More complex? These aren't complex to begin with.

    Email Entry Form
    Code:
    <form action="save.php" method="post">
    <input type="name" name="content">
    <br>
    <input type="submit" value="Save">
    </form> 
    save.php
    Code:
    <?
    $content = $_POST['content'];
        $entry_line = "$content \n";
        $fp = fopen("emails.txt", "a");
        fputs($fp, $entry_line);
        fclose($fp);    
    ?> 
    CHmod emails.txt to 777 for world-access or 222 to access only from your FTP client (as this would cause a 403 error if accessed from site.)

    Another custom by me.

    (You can VERY easily customize this to more forms just by some simple copying + pasting, if you can't do that - then go learn PHP/HTML. http://w3schools.com)
     
< Paying for image upload script | why no javaScript? >

Users viewing this thread
1 guest


 
 
Adblock breaks this site