unsider Posted February 20, 2008 Share Posted February 20, 2008 <?php if (!isLoggedIn()) { if (isset($_POST['cmdlogin'])) { if (checkLogin($_POST['username'], $_POST['password'])) { show_userbox(); } else { echo "Incorrect Login information !"; show_loginform(); } } else { show_loginform(); } } else { show_userbox(); } ?> Fatal error: Call to undefined function isLoggedIn() in ..website name.. on line 2 Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted February 20, 2008 Share Posted February 20, 2008 Read the message: Fatal error: Call to undefined function isLoggedIn() in ..website name.. on line 2 Notice the important parts: Fatal error: Call to undefined function isLoggedIn() in ..website name.. on line 2 Look at your line 2: if (!isLoggedIn()) Now show me where in your code you defined that function. i.e. where in your code do you have this: function isLoggedIn(){ // does something } Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted February 20, 2008 Share Posted February 20, 2008 probably should do the same for the rest of your functions show_userbox(); etc. Quote Link to comment Share on other sites More sharing options...
unsider Posted February 20, 2008 Author Share Posted February 20, 2008 Thanks, I'll try to sort it out. Quote Link to comment Share on other sites More sharing options...
unsider Posted February 21, 2008 Author Share Posted February 21, 2008 <?php include ("db_connect.inc.php"); if ( $_GET["op"] == "reg" ) ---------------------------11 { $bInputFlag = false; foreach ( $_POST as $field ) { if ($field == "") { $bInputFlag = false; } else { $bInputFlag = true; } } if ($bInputFlag == false) { die( "Problem with your registration info. " ."Please go back and try again."); } $q = "INSERT INTO `members` (`username`,`password`,`email`) " ."VALUES ('".$_POST["username"]."', " ."PASSWORD('".$_POST["password"]."'), " ."'".$_POST["email"]."')"; $r = mysql_query($q); if ( !mysql_insert_id() ) { die("Error: User not added to database."); } else { Header("Location: register.php?op=thanks"); } } elseif ( $_GET["op"] == "thanks" ) ------------------------------- 55 { echo "<h2>Thanks for registering!</h2>"; } else { echo "<form action=\"?op=reg\" method=\"POST\">\n"; echo "Username: <input name=\"username\" MAXLENGTH=\"16\"><br />\n"; echo "Password: <input type=\"password\" name=\"password\" MAXLENGTH=\"16\"><br />\n"; echo "Email Address: <input name=\"email\" MAXLENGTH=\"25\"><br />\n"; echo "<input type=\"submit\">\n"; echo "</form>\n"; } // EOF ?> Notice: Undefined index: op in ..website.. on line 11 Notice: Undefined index: op in ..website.. on line 55 Marked #s Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted February 21, 2008 Share Posted February 21, 2008 Add this at the top: $op = isset($_GET['op']) ? $_GET['op'] : ''; Then everywhere in your code where you have $_GET['op'], use $op instead. The error is saying the index is not defined, or that $_GET has no index named 'op' associated with it. The line you put at the top of the script will set $op equal to $_GET['op'] if the index is set and the empty string if it is NOT set. Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted February 21, 2008 Share Posted February 21, 2008 Your other option is to change the level of error reporting so that PHP doesn't complain about undefined variables. Quote Link to comment Share on other sites More sharing options...
unsider Posted February 21, 2008 Author Share Posted February 21, 2008 How would you go about doing that? I'm going to do research, but incase you post it before I figure it out. 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.