Amiga.org
Amiga computer related discussion => Amiga/MorphOS/AROS Programmers Forum => Topic started by: Omega Space Protons on November 21, 2014, 08:04:50 PM
-
I am in the process of creating a simple text based browser game. However when i attempt to log in in via IWeb, it keeps refreshing the page. It's supposed to check the log in info when the form is "posted". It leads me to believe that IWeb isn't sending "post" data. Any assistance in this matter would be greatly appreciated.
Sincerely,
Omega Space Protons
-
IWeb
IBrowse or AWeb, which one is it?
It's supposed to check the log in info when the form is "posted"
Who should check what log in info?
It leads me to believe that IWeb isn't sending "post" data
Both IBrowse and AWeb are perfectly capable of posting data.
Any assistance in this matter would be greatly appreciated.
You need to provide way more information if you want some sensible input.
- which browser?
- what server (what software? is it local or remote?)?
- what does the login form look like?
- what is the script doing *exactly*?
- are cookies involved?
-
Sorry, forgot to include the required info. :(
IBrowse or AWeb, which one is it?
AWeb
Who should check what log in info?
PHP Server Side Script
Both IBrowse and AWeb are perfectly capable of posting data.
You need to provide way more information if you want some sensible input.
- which browser?
AWeb
- what server (what software? is it local or remote?)?
Remote Aphache running PHP 5 and MySQL Server
- what does the login form look like?
Link (https://github.com/Aleeious/AleeiousMMO/blob/master/templates/index.tpl)
- what is the script doing *exactly*?
Checking if the form was posted and if it was then check the login info against the mysql database and return if it matches. Otherwise show the log in page. Source Code (https://github.com/Aleeious/AleeiousMMO/blob/master/index.php)
Snip
// if the form wasn't submited else if(!isset($_POST["submit"])) { // display it $chops->display('index.tpl');
// and terminate exit; } // otherwise the form was submitted else { // if the username is empty if(empty($_POST["username"])) { // set the dialog title $chops->title = 'Error';
// set the dialog message stating the username is empty $chops->message = 'username is empty';
// set the back link $chops->backurl = 'index.php';
// and display it $chops->display('messagedialog.tpl');
// and terminate exit; } // if the username is too short or too big elseif(strlen($_POST["username"]) < 4 || strlen($_POST["username"]) > 16) { // set the dialog title $chops->title = 'Error';
// set the dialog message stating the username is too short or too big $chops->message = 'username must be 4-16 characters long';
// set the back link $chops->backurl = 'index.php';
// and display it $chops->display('messagedialog.tpl');
// and terminate exit; } elseif(!preg_match("#^[a-z0-9]*$#", $_POST["username"])) { // set the dialog title $chops->title = 'Error';
// set the dialog message stating the username contains invalid characters $chops->message = 'username contains invalid characters';
// set the back url $chops->backurl = 'index.php';
// and display it $chops->display('messagedialog.tpl');
// and terminate exit; } // otherwise the username is filled in else { // so sanitize it $_POST["username"] = trim(strip_tags($_POST["username"])); }
// if the password is empty if(empty($_POST["password"])) { // set the dialog title $chops->title = 'Error';
// set the dialog message stating the password is empty $chops->message = 'password is empty';
// set the back url $chops->backurl = 'index.php';
// and display it $chops->display('messagedialog.tpl');
// and terminate exit; } // if the password is too short or too big elseif(strlen($_POST["password"]) < 6 || strlen($_POST["password"]) > 32) { // set the dialog title $chops->title = 'Error';
// set the dialog message stating the password is too short or too big $chops->message = 'password must be 6-32 characters long';
// set the back url $chops->backurl = 'index.php';
// and display it $chops->display('messagedialog.tpl');
// and terminate exit; } // otherwise the password is ok else { // so sanitize it $_POST["password"] = trim(strip_tags($_POST["password"])); }
// create instance of database class $database = new Database();
// create instance of user class $user = new User($database);
// check the users login info if($user->checkLogin($_POST["username"], $_POST["password"])) { // store info in session data $_SESSION['username'] = $user->getUsername(); $_SESSION['password'] = $user->getPassword();
// sanatize user info $user->sanitize();
// redirect to the game header("Location: main.php"); }
- are cookies involved?
No PHP Sessions
Thanks,
Sincerely,
Omega Space Protons
-
Hey it's been a month since i last posted and no one has answered seemed to figure out why this is happening. I also tried figuring it out to no avail. If anyone could please take a look and see if they can spot anything obvious it would be greatly appreciated.
Sincerely,
Omega Space Protons
-
Sorry to bump this topic but it seems not many Amiga programmers here, or no one can figure out what's wrong. Still working on this.
Sincerely,
Omega Space Protons