Jump to content

Search the Community

Showing results for tags 'submit blank page'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. Hi all, Having some problems getting my HTML <form> to work correctly when I press the 'Submit' button. When I put data in the 'text' field and then press Submit, the page goes 'white' with no response, but the URL is still the same. What I'm really trying to do at this point, is to just make sure that my <form> and related GetFormData.php file are setup correct as I get ready to try to send data to my mariadb on my local test server. Have checked out a lot of forum posts, but not finding the missing link, lol. Using my test web site for fun: Here are important parts from MainPage Html file (<form> section has 5 q's, I'll pull 1st): ** This line in the <head> section: <link href="http://localhost/GetFormData.php" type="text/php" rel="stylesheet"> ** Here is <form> from <body>: <!-- This section is for: Take a quick Godzilla survey /--> <div id="survey-div"> <form id="survey-form" class="MainPgTxtBckgColor" action = "GetFormData.php" method = "post"> <fieldset id="survey-fieldset"> <legend>Take one of our quick surveys.</legend> <p> <label>1. Who is your <strong>favorite monster</strong> character (Godzilla related or not):</label> <input id="FavMonster" type = "text" value = "" /> </p> <p> <label>Press 'Submit' when you are done.</label> <input type="submit" value="Submit" name="submit_button"> </p> </fieldset> </form> </div> ** Here is contents of GetFormData.php file: <!DOCTYPE html> <html lang = "en-US"> <head> <meta charset = "UTF-8"> <title>GetFormData.php</title> </head> <body> <p> <?php // define variables and set to empty values $favmonsterErr = ""; $favmonster = ""; // verify that field is not empty if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["favmonster"])) { $favmonsterErr = "Favorite Monster is required"; } else { $favmonster = test_input($_POST["favmonster"]); // check if name only contains letters and whitespace if (!preg_match("/^[a-zA-Z ]*$/",$favmonster)) { $favmonsterErr = "Only letters and white space allowed"; } } // validate all form data function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } ?> </body> </html> ** Am I missing something with how <form> Submits work or am I just, missing something!
×
×
  • Create New...