Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jan 2019
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    How to write form data to file?

    Working on a contact sheet which asks multiple questions of user, including email, name and other criteria. How do i send the data to a file (txt, php, js, I'm really not sure) that I can then read to extract that info?

    Thanks

    forbin1138

  2. #2
    Master Coder sunfighter's Avatar
    Join Date
    Jan 2011
    Location
    Washington
    Posts
    7,955
    Thanks
    36
    Thanked 1,064 Times in 1,060 Posts
    Mail it to yourself for the read. Send it to php via ajax https://www.w3schools.com/xml/ajax_intro.asp While your there study up on what you need to know.
    Evolution - The non-random survival of random variants.
    Physics is actually atoms trying to understand themselves.

  3. Users who have thanked sunfighter for this post:

    forbin1138 (Feb 2nd, 2019)

  4. #3
    New to the CF scene
    Join Date
    Jan 2019
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thank you sunfighter. I'll give that a shot. Sometimes it's hard to come up with the question when you don't even know what you need to know.

  5. #4
    New to the CF scene
    Join Date
    Jan 2019
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Following the tutorial given above, I'm a little over my head but I will work it out. My next question though would be, using the html form attribute action to send an email, do I enter my email address directly ( action="[email protected]"), or a url which points to my email addresss?

  6. #5
    Master Coder sunfighter's Avatar
    Join Date
    Jan 2011
    Location
    Washington
    Posts
    7,955
    Thanks
    36
    Thanked 1,064 Times in 1,060 Posts
    action to send an email, do I enter my email address directly
    NO

    Send your email in the PHP file.
    First concat the strings that will be your message. then use this => mail("[email protected]","whateveryouwantthtitletobe",$msg);

    If you post the form [contact sheet] I'll give you the PHP for it.
    Evolution - The non-random survival of random variants.
    Physics is actually atoms trying to understand themselves.

  7. #6
    New to the CF scene
    Join Date
    Jan 2019
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Ok, this is my form so far. It is incomplete, but if you show me the php and I reverse engineer after I finish my form, I can actually learn what you are teaching me. I appreciate it.

    ```
    <form action="" name="survey-form" method="post">
    <label for "name">Name <input type="text" id="name-label" placeholder="Name"></label><br><br>
    <label for "email">Email <input type="email" id="email-label" placeholder="email"></label><br><br>
    <label for="number"> How many times have you visited a secular/freethought website in the last month? (1 to 10) <input type="number" id="number-label" value="0" min="0" max="10"></label><br><br>
    <label for "radio">What information can we provide? (Select all that apply)</label><br><br>
    <label for "Atheism"><input type="radio" id="Atheism"> Atheism</label><br>
    <label for "Humanism"><input type="radio" id="Humanism"> Humanism</label><br>
    <label for "Skepticism"><input type="radio" id="Skepticism"> Skepticism</label><br>
    <label for "List"><input type="radio" id="List"> US and UK Atheist/Humanist organizations</label><br>
    <label for "skepticList"><input type="radio" id="skepticList"> US and UK Skeptic organizations</label><br><br>
    <button type="submit">Submit</button> </form>
    ```

    Thanks,
    forbin1138


 

Tags for this Thread

Posting Permissions

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