Hableet Posted October 29, 2011 Share Posted October 29, 2011 Hey im kind of new to PHP me and my mate was working on a script and we can not seem to get this working: Its connected through mysql. And it shows Notice: Undefined index: username in C:\xampp\htdocs\stick_arena.php on line 21 Notice: Undefined index: userpass in C:\xampp\htdocs\stick_arena.php on line 22 Notice: Undefined index: action in C:\xampp\htdocs\stick_arena.php on line 23 Notice: Undefined index: usercol in C:\xampp\htdocs\stick_arena.php on line 24 Notice: Undefined index: stats in C:\xampp\htdocs\stick_arena.php on line 25 Here are the lines // declare variables $username = sanitize($_POST['username']); $password = sanitize(md5($_POST['userpass'])); $action = sanitize($_POST['action']); $usercol = sanitize($_POST['usercol']); $stats = sanitize($_POST['stats']); Here is the full script for that page: Click here please help as soon as possible. Link to comment https://forums.phpfreaks.com/topic/250026-unknown-problem/ Share on other sites More sharing options...
Network_ninja Posted October 29, 2011 Share Posted October 29, 2011 it's a notice. and it only means that you are accessing an uninitialize variable. eg... $_POST['username'] Link to comment https://forums.phpfreaks.com/topic/250026-unknown-problem/#findComment-1283183 Share on other sites More sharing options...
Network_ninja Posted October 29, 2011 Share Posted October 29, 2011 read about php error reporting Link to comment https://forums.phpfreaks.com/topic/250026-unknown-problem/#findComment-1283184 Share on other sites More sharing options...
PFMaBiSmAd Posted October 29, 2011 Share Posted October 29, 2011 You should not access any of the form data until you have confirmed that a form has been submitted, typically by checking if $_SERVER['REQUEST_METHOD'] == 'POST' Link to comment https://forums.phpfreaks.com/topic/250026-unknown-problem/#findComment-1283188 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.