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 Please with Microsoft Forms and Excel

    in Microsoft Office and 365
    Help Please with Microsoft Forms and Excel: Any help would be appreciated in solving this. I am using Microsoft Forms to update an online Excel sheet. When I open the sheet I want to be able to filter and sum some of the columns. However, when I sum the columns I need to, I always get a zero. I have checked that the...
  3. PHP > Programming Guide

    in Windows 10 Drivers and Hardware
    PHP > Programming Guide: Hi Everyone! Does anyone know how I could get a practical book on SQL Server Tutorials and examples? https://answers.microsoft.com/en-us/windows/forum/all/php-programming-guide/756484e3-23a3-49ef-b743-4eafa6047473
  4. Word form autofill help

    in Microsoft Office and 365
    Word form autofill help: Hello! ive made an app for use in my job. The output sends an email with information, but the information is just picked up from the Database within the app so it is not "presentable" ill give an example of the output here: Name: Testing Tester Snow 1-4 cm: Snow above 4 cm...
  5. how do I open .php and .html files with PHP editor Eclipse?

    in Windows 10 Network and Sharing
    how do I open .php and .html files with PHP editor Eclipse?: when i go to the control panel's option "associate a file type with a default program", my IDE named Eclipse, which is a PHP editor is not in the list of programs to choose from. how can I set .php, .php3, .html and .htm files to open automatically with this program? is...
  6. 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?...
  7. PHP configuration in IIS

    in Windows 10 Customization
    PHP configuration in IIS: Hello Everyone, I am totally new in IIS server but i successfully install the IIS server and view in the browser but when i try with PHP file it's not working then i install php 5.3.28 and php manager for IIS but it's not working in my laptop. I have also gone through the...
  8. how to run php code

    in Windows 10 Support
    how to run php code: hi! old man new on this how do I run the php code after a clean install BTW very interesting subject lx07 thanks a lot for the code and for the help tony 120501
  9. Application forms

    in Windows 10 Network and Sharing
    Application forms: I have received an application form by email but how do I fill the information in on the form https://answers.microsoft.com/en-us/windows/forum/all/application-forms/fa59d055-4317-48d0-b17e-fdf3ad82d978
  10. SQL Server + PHP – What’s new

    in Windows 10 News
    SQL Server + PHP – What’s new: PHP is one of the most widely used programming languages for web developers today. The Microsoft PHP Connector for SQL Server is used to connect PHP applications to SQL Server, whether SQL Server is hosted in the cloud, on-premises or provided as a platform as a service....