pznmynd Posted January 12, 2009 Share Posted January 12, 2009 Greetings Guys, New to php and having a little problem with a script im working on, i recieve the error, Fatal error: Call to undefined function: array() in /usr/home/web/users/a0028977/html/const/temp/login.php on line 7 Originally i thought it was a synax error but after a few hours of checking and debugging i cant find the problem.... Thanks in advance for your assistance and nice community you have here, Here is the start of my code, and the reference to Line 7. FULL CODE: <?php require_once("connect.php"); //database connection session_start(); // catch feild data varabiles $userid = $_POST('userid'); $password = $_POST('password'); $submitted = $_POST('submitted'); if ($userid && $password){ //////////////////////////////////////////////// $query = sprintf("SELECT * FROM users where user_name = '$userid' and user_password = '$password'"); $result = @mysql_query($query); $rowAccount = @mysql_fetch_array($result); /////////////////////////////////////////////// } if ($rowAccount){ $_SESSION['id'] = $rowAccount['user_id']; header("location: welcome.php"); exit; } elseif ($submitted){ . . . . . Because i am calling connect.php is line 7 realy line 5 of connect? CODE CONNECT.PHP: <?php ////////////////////////////// $database = "****"; $username = "*****"; $password = "*****"; ///////////////////////////// $link = @mysql_connect('localhost', $username, $password); $db = mysql_select_db($database, $link); ?> /scott Quote Link to comment Share on other sites More sharing options...
DarkWater Posted January 12, 2009 Share Posted January 12, 2009 // catch feild data varabiles $userid = $_POST('userid'); $password = $_POST('password'); $submitted = $_POST('submitted'); Those should be [ ], not ( ). Quote Link to comment Share on other sites More sharing options...
ratcateme Posted January 12, 2009 Share Posted January 12, 2009 try $userid = $_POST['userid']; $password = $_POST['password']; $submitted = $_POST['submitted']; but that is not the error i would have thought would have come from that but could be it that kind of syntax gives Fatal error: Function name must be a string when i tried Scott. Quote Link to comment Share on other sites More sharing options...
pznmynd Posted January 12, 2009 Author Share Posted January 12, 2009 Thanks alot guys, Very fast help and spot on, i can not believe that was the problem lol...... i swear it should of worked.. ::SOLVED:: thanks to the extreamly fast response from the guys at phpfreaks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.