Windows 10: php forms help

Discus and support php forms help in Windows 10 Software and Apps to solve the problem; Hi guys, I'm trying to create a form to insert data into database and losing. here is my code. Any help?... Discussion in 'Windows 10 Software and Apps' started by 1Tsme1941, Oct 21, 2020.

  1. 1Tsme1941 Win User

    php forms help


    Hi guys, I'm trying to create a form to insert data into database and losing.
    here is my code. Any help?
    -------------------------------------------------------------------------------------
    <!DOCTYPE html><html>
    <head>

    </head>
    <body>
    <?php
    if(isset($_POST['submit']))
    {
    $name = $_POST['name'];
    echo "User Has submitted the form and entered this name : <b> $name </b>";
    echo "<br>You can use the following form again to enter a new name.";
    }
    ?>
    <form name="test" action="<?php...

    Read more
     
    1Tsme1941, Oct 21, 2020
    #1

  2. windows10 xdebug, godaddy, html submit form, php heredoc

    Don't know if these are windows10 problems but all was okay until one of w10 updates (I think) added xdebug. Since then, godaddy has trouble providing a listing of my html and php code files. My html form submit button no longer sends me to the php server
    script. There seems to be other problems but I will wait until the rest is resolved , they may goaway .
     
    Lee and JackieNeat, Oct 21, 2020
    #2
  3. ShiBDiB Win User
    Looking to make a form

    I'm looking to make a web form that will write to a mysql table. What's a basic step by step of what ill need. (Plan on doing it via php)

    Already have the mysql db setup.

    edit--

    Figured it out *Big Grin php forms help :D
     
    ShiBDiB, Oct 21, 2020
    #3
  4. Karamas Win User

    php forms help

    PHP Email Form Help

    I'm working on finishing up the template for my portfolio website and need to use PHP to create an email form. I found many examples but, I am not familiar with PHP as to asp.net (which my host does not use).

    The code sends emails to my inbox if all of the required fields are filled out and meet validation. But when an error occurs from a requirement not being met, it loads a new page explaining what the error is. (You can test this here.) I would rather have a red text warning to pop up next to the required field in which the validation failed. The same thing also happens when the email submission was successful. I would rather a small text box show saying the email was successful or something like that rather than another plank page loading.

    This is the code I am currently using. The php file is external (not embedded).

    I would greatly appreciate any help people are able to give.

    Here is the html code I have so far where the php file is called.

    Code: <div id="my_contact_form"> <form name="contact_form" method="post" action="php_files/email_form.php"> <label for="first_name">First Name*</label> <label for="first_name_error" style="color: "Red"/><br /> <input type="text" name="first_name" maxlength="50" size="30" /><br /> <label for="last_name">Last Name*</label><br /> <input type="text" name="last_name" maxlength="50" size="30" /><br /> <label for="email">Email Address*</label><br /> <input type="text" name="email" maxlength="80" size="30" /><br /> <label for="telephone">Phone Number</label><br /> <input type="text" name="telephone" maxlength="30" size="30" /><br /> <br /> <label for="subject">Subject</label><br /> <input type="text" name="subject" maxlength="100" size="30" /><br /> <label for="comments">Comments*</label><br /> <textarea name="comments" cols="30" rows="6" ></textarea><br /> <p style="color: Red;">* Indicates a required field</p><br /> <input type="submit" value="Submit" /> </form> </div>[/quote] And, here is my external php file.

    Code: <?php // Most of the Php Email form was aquired from..... // How to create a simple HTML contact form // Thanks for the help. if(isset($_POST['email'])) { $email_to = "bcornett24@gmail.com"; $email_subject = $_POST['subject']; // not required if($email_subject == "") { $email_subject = "READ NOW: This is an email from my website."; } $first_name = $_POST['first_name']; // required $last_name = $_POST['last_name']; // required $email_from = $_POST['email']; // required $telephone = $_POST['telephone']; // not required $comments = $_POST['comments']; // required $error_message = ""; $email_exp = "^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$"; if(!eregi($email_exp,$email_from)) { $error_message .= 'The Email Address you entered does not appear to be valid.<br />'; } $string_exp = "^[a-z .'-]+$"; if(!eregi($string_exp,$first_name)) { $error_message = "The First Name you entered does not appear to be valid."; $_POST['first_name_error'] = $error_message; } if(!eregi($string_exp,$last_name)) { $error_message .= 'The Last Name you entered does not appear to be valid.<br />'; } if(strlen($comments) < 2) { $error_message .= 'The Comments you entered do not appear to be valid.<br />'; } // create email headers $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); ?> <?php } ?>[/quote]
     
    Karamas, Oct 21, 2020
    #4
Thema:

php forms help

Loading...
  1. php forms help - Similar Threads - php forms help

  2. help with google form!

    in Windows 10 Gaming
    help with google form!: Help! So i have been trying to answer questions in the google form and I saw the date and birth question it is the question with like the arrow but when i try clicking on it it won't let me type or select and when i spammed it it said this is a required question can someone...
  3. html and php

    in Windows 10 Software and Apps
    html and php: Hi, samplefacebook, i want to login in my account variables: url, mail and password via html and php. Thank youpic https://answers.microsoft.com/en-us/windows/forum/all/html-and-php/9c65b520-fac6-49e4-bc70-c4c8e6a36aa8
  4. html and php

    in Windows 10 Network and Sharing
    html and php: Hi, samplefacebook, i want to login in my account variables: url, mail and password via html and php. Thank youpic https://answers.microsoft.com/en-us/windows/forum/all/html-and-php/9c65b520-fac6-49e4-bc70-c4c8e6a36aa8
  5. PHP

    in Windows 10 BSOD Crashes and Debugging
    PHP: Hiwon't let me send an email that says I need a PHP server what does that mean?Thank you https://answers.microsoft.com/en-us/windows/forum/all/php/4e99d17f-a423-44d3-9387-2ae3f8f13083
  6. help w/form

    in Windows 10 Software and Apps
    help w/form: Hello nice peoples. I have this form that has me puzzled(what me no way). It works(with needless warnings) if I submit it twice. I know it's a lot but can you see my error? ------------------------------------------------- this is code: <!DOCTYPE HTML><html> <head>...
  7. php ini.Mcrypt PHP extension required.

    in Windows 10 Drivers and Hardware
    php ini.Mcrypt PHP extension required.: Where can I find my php ini. on windows 10 to enable or install it? https://answers.microsoft.com/en-us/windows/forum/all/php-inimcrypt-php-extension-required/69c7f857-a936-4097-9e31-6b00ab344ed2
  8. php location

    in Windows 10 Software and Apps
    php location: I want to go to a different page depending on different if results but don't know the correct syntax;as in: if (count == 1) { echo 'look at these cars';} go to page1.php elseif (count == 2) { echo 'look at these cars';} go to page2.php
  9. php not working?

    in Windows 10 Software and Apps
    php not working?: Hi, I just loaded new os (windows7 proessional) to my machine along with later version of xampp and when I run php files I get php code I could use some advice. thanks! here is the code: <html><body> <hr> <center><b><font size=+2> 515 Certification Expiration...
  10. update to php?

    in Windows 10 Software and Apps
    update to php?: Trying to update our html website ubertool.org to a php platform does web4 work for this or I have also been recommended Wordpress. Or does anyone have any experience or recommend using this Azure?...