Need A PHP CODER Now

Discussion in 'Programming' started by Matbell, Nov 18, 2007.

Thread Status:
Not open for further replies.
  1. #1
    I need a PHP coder,

    he will have to write a php file that will

    get Data from a <form>big form here</form> tag after visitors hit the submit button

    and write it to a text file.

    ill pay 10$ for this one .php file

    via paypal
     
    Matbell, Nov 18, 2007 IP
  2. projectshifter

    projectshifter Peon

    Messages:
    394
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    I really don't have the time right now for ten bucks to write a form, but I'll give you the quick basics so you can do it. In your form, you want to name the elements, so for example <input type="text" name="email" /> would result in getting $_POST['email'] when it's been passed (assuming you do <form method="post" rather than method="get", otherwise it would be $_GET['email']). You do NOT want to use just $email because that assumes register_globals is enabled, and it's generally bad practice to use it anyway. Then on the receiving side, you just need to do if ($_POST) (which means that the form has been submitted), and then $f = fopen('filename.txt', 'w'); and then for all the elements you want to toss in, do fwrite($f, 'Email: '.$_POST['email']."\n"); This writes to the file the data you put in the second parameter, and the \n (double quotes or it will print real text if you do single, or you can do chr(10) instead) is a linebreak. When you're done writing to the file, do fclose($f) and there you have it. Hope this helps.
     
    projectshifter, Nov 18, 2007 IP
  3. Matbell

    Matbell Guest

    Messages:
    215
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    ohh this is easy man, thnx a ton

    will try it :)
     
    Matbell, Nov 18, 2007 IP
  4. projectshifter

    projectshifter Peon

    Messages:
    394
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    NP. Yeah this stuff is so basic, whatever is in the name= part of the form element, you get it as a variable when you submit the form. You can do more stuff like form validation if you want, but for a basic form, this stuff is child's play. If you're having trouble with this, or really any code at all, the best place to start debugging is to echo out your variables. It's best to do this yourself and get used to it, it'll save you a ton of cash in the long run and it's nice to be able to do your own work, that's what got me coding in the first place :)
     
    projectshifter, Nov 18, 2007 IP
  5. Matbell

    Matbell Guest

    Messages:
    215
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #5
    for name="something", its ok

    but wat about drop down options?

    <option> tag data?, how to parse that in my text file
     
    Matbell, Nov 18, 2007 IP
  6. projectshifter

    projectshifter Peon

    Messages:
    394
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #6
    For options it's really the same thing, <select name="blah"> and then $_POST['blah'] is the value you have in <option value="1234">
     
    projectshifter, Nov 18, 2007 IP
  7. Scoding

    Scoding Well-Known Member

    Messages:
    1,091
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    155
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #7
    If you still need let me know
     
    Scoding, Nov 18, 2007 IP
  8. Matbell

    Matbell Guest

    Messages:
    215
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #8
    plz close this topic, i did it myself, thanx to help by projectshifter
     
    Matbell, Nov 18, 2007 IP
  9. AdnanAhsan

    AdnanAhsan Well-Known Member

    Messages:
    601
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    110
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #9
    wel you have no time for $10, but you have extra time to write a long paragraph and keep away other programmers from these type of projects lol .
     
    AdnanAhsan, Nov 19, 2007 IP
  10. TheBiaatch

    TheBiaatch Peon

    Messages:
    435
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #10
    Better not have any problems with that lol, love the free world ;)
     
    TheBiaatch, Nov 19, 2007 IP
  11. AdnanAhsan

    AdnanAhsan Well-Known Member

    Messages:
    601
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    110
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #11
    ok than give me money for free :p
     
    AdnanAhsan, Nov 19, 2007 IP
Thread Status:
Not open for further replies.