PHP - Moved: Question Regarding Scrolling To Anchor After Post.
This topic has been moved to HTML Help.
http://www.phpfreaks.com/forums/index.php?topic=353723.0 Similar TutorialsThis topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=356942.0 This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=347032.0 This topic has been abducted by aliens, probed, and dropped off in JavaScript Help http://www.phpfreaks.com/forums/index.php?topic=359251.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=331209.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=319419.0 I have some code that pulls the field names from a table to create form form submitting information. I am trying to write this code so that someone who knows nothing about databases, tables and MySQL can make a table of their own by filling in a few text boxes. Now what I was wondering is since I have no idea what people are going to name their table columns so I won't know what information Post information I will be sending to the next step of the process. Is there a way with PHP that will allow me to get unknown post variables? If there is how would I do that? When you submit an HTML form using POST, what are the $key->$value pairs?? Debbie This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=307126.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=353240.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=348057.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=349304.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=333014.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=342166.0 Hey y'all, I'm trying to write a PHP script for a login function. There are three elements, two text fields (username and password) and a button which calls the script. Segment from index.php file: <form action = "login.php" method = "POST"> Admin Login: <br> Username: <input type = "text" name = "usernameField"/><br> <!-- Password field--> Password: <input type = "password" name = "passwordField"/><br> <!-- Username field --> <input type = "button" value = "Login" name = "submitButton"/> <!-- Login button --> </form> Segment from login.php file: <?php $connect = mysql_connect("localhost", "root", "root"); if(!$connect){//If user can't connect to database die('Could not connect: ' . mysql_error()); //Throw an error } mysql_select_db("colin_db", $connect); //Get given username and password from username field and password field $givenUsername = $_POST["usernameField"]; $givenPassword = $_POST["passwordField"]; $myQuery = "SELECT * FROM ADMINS WHERE USERNAME = '$givenUsername' AND PASSWORD = '$givenPassword'"; $queryResult = mysql_query($myQuery); $numRows = mysql_num_rows($queryResult); if($numRows == 1){ //If the details are correct... //Reload the page and login echo "<script type = 'text/javascript'> window.location.reload() </script>"; } elseif($numRows == 0){ //Else if the details are not found //Display error accordingly echo "Details not correct!"; } mysql_close($connect); ?> The problem is, when I click the login button, it doesn't do anything. What am I missing? (The information in the database is correct) Thanks, Jake This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=359184.0 This topic has been moved to PHP Freelancing. http://www.phpfreaks.com/forums/index.php?topic=334867.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=348171.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=343888.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=346243.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=315683.0 |