Thanks Marc and all the rest that worked and put in all the help. the code finally works and now I will have some fun adding levels to the login accounts.
komanche
Posts
-
login script returns blank page -
login script returns blank pageThanks alot for all the input I have tried a couple of the solutions. I have had different outcomes with the same result. At the moment I am using Marc Firth's solution and getting "-Invalid username / password" with a wrong or correct password. With no values entered it returns "You must supply a username and password." Am not really good at reading and understanding the "IF" "ELSE" working but would appreciate if someone gives a clue to what to do.
-
login script returns blank pageI have changed the query script and done a var_dump it returns the values entered but it still does not run the query script even with a wrong password.
-
No idea how because if you dont enter any fields it returns the error of supply username and password? any help anyone ??
-
login script returns blank pageI have written a login page but each time I login it returns a blank page even with a wrong password please help: the login page is as follows:
<body>
<form action="methods/login.php" method="post"> * <label>Username:</label><input type="text" name="username" size="10" value="" /> * <label>Password:</label><input type="password" name="password" size="10" value="" /> * <input type="submit" name="login" value="Log In" /> * <input type="submit" name="join" value="Join" /> </form>
</body>
</html>and the php login script is
any help will be greatly appreciated
-
php and div tagsI have a two column page that am desperately trying avoid using an IFRAME as the target. I have spent the last two days unsuccessfully. Is there anyone who has this problem solved or knows where or how to solve it. Any help is greatly appreciated.
-
mysql_query errorHello all. Am having a major problem with my code.I cant find an error in the code but i keep getting this messages "Warning: mysql_query() expects parameter 2 to be resource, null given in C:\xampp\htdocs\nicks\includes\database.php on line 223 Warning: mysql_query() expects parameter 2 to be resource, null given in C:\xampp\htdocs\nicks\includes\database.php on line 202 Warning: mysql_num_rows() expects parameter 1 to be resource, null given in C:\xampp\htdocs\nicks\includes\database.php on line 203 Warning: mysql_query() expects parameter 2 to be resource, null given in C:\xampp\htdocs\nicks\includes\database.php on line 251 Warning: mysql_query() expects parameter 2 to be resource, null given in C:\xampp\htdocs\nicks\includes\database.php on line 194 Warning: mysql_num_rows() expects parameter 1 to be resource, null given in C:\xampp\htdocs\nicks\includes\database.php on line 195 Warning: mysql_query() expects parameter 2 to be resource, null given in C:\xampp\htdocs\nicks\includes\database.php on line 261 Warning: mysql_query() expects parameter 2 to be resource, null given in C:\xampp\htdocs\nicks\includes\database.php on line 202 Warning: mysql_num_rows() expects parameter 1 to be resource, null given in C:\xampp\htdocs\nicks\includes\database.php on line 203" and the php code is
<?php
/** this is the database connections specification files
can only be changed by an administrator
*/
//connect to databaserequire\_once("constants.php"); class MySQLDB { var $connection; //the mysql database connection var $num\_active\_user; //number of active users viewing site var $num\_active\_guests; //number of guests viewing site var $num\_members; //number of signed users //class constructor function MySLQDB() { $this->connection = mysql\_connect(DB\_SERVER, DB\_USER, DB\_PASS) or die (mysql\_error()); mysql\_select\_db(DB\_NAME, $this->connection) or die(mysql\_error()); //only query database to find out number of members when getnummembers() is called for the first time, until then //default value is set $this->num\_members = -1; if(TRACK\_VISITORS) { //calculate number of users at site $this->calcNumActiveUsers(); //calculate number of guests at site $this->calcNumActiveGuests(); } } //confirm users pass function confirmUserpass($username, $password) { //add slashes if necessary if(!get\_magic\_quotes\_gpc()) { $username =
-
dynamic dropdown listHi am back again after weeks of trying to populate multiple combo box from a mysql database. I have a script that loads one combo box / drop down list well by populating car make. The lists are supposed to be first "car make" then second "car model" third "car badge" fourth is "car description" the code at present is
<?php
include("../includes/store.php"); //echo mysql command $query = "SELECT make FROM cars"; $result = mysql\_query($query) or die(mysql\_error()); //excute or return if there is an error echo "Make"; $dropdown = "<select name='make'>"; while ($row = mysql\_fetch\_assoc($result)) { $dropdown .= "\\r\\n<option value='{$row\['make'\]}'>{$row\['make'\]}</option>"; } $dropdown .= "\\r\\n</select>"; echo $dropdown; echo "<br>" . "<br>"; $query1 = "SELECT model FROM carmodel WHERE makeid = {$row\['id'\]}"; $carmodel = mysql\_query($query1) or die(mysql\_error()); //execute query and load fields to page echo "Model"; $list2 = "<select name='model'>"; while ($row = mysql\_fetch\_assoc($carmodel)) { $list2 .= "\\r\\n<option value='{$row\['model'\]}'>{$row\['model'\]}</option>"; } $list2 .= "\\r\\n</select>"; echo $list2;
?>
The database table are table 1 cars = "carid" & "make" table 2 carmodel = "modelid" & "makeid" & "model" table 3 badge = "badgeid" & "modelid" & "badge" table 4 cardesc = "descid" & "badgeid" & "yearofman" & "transmission" & "drivetype" & "fueltype" I can populate the first dropdown list but how to get the second drop down to populate with the car model records based on the selected car make then the cars badge of the filtered car model the description is proving to be a pickle. Please help as after days of searching and playing with code cant seem to nail it right. Thanks in advance.
-
populate combo box / dropdown list from mysqlI have been trying hours in to populate combo box with data from a mysql database using php. So far the combo box displays nothing. Anyhelp will be greatly appreciated as the end result I want to have four combo boxes which are based on the first and subsequent selection of each record e.g "country" = "state" = "city" = "suburb" $row[1]\n"; ?>