Avex1983
-
Content Count
5 -
Joined
-
Last visited
Posts posted by Avex1983
-
-
<?phpmysql_connect("localhost", "username", "pass");mysql_select_db("database") or die(mysql_error());$sql = "SELECT * FROM password WHERE ww = '" . $_POST['password']. "' AND nickname = '" . $_POST['nickname']. "' LIMIT 1"; $query = mysql_query($sql) or die(mysql_error()); if (mysql_num_rows($query) == 1){ $name = ucfirst($_POST[nickname]); $_SESSION['WNP'] = "$naam";echo "You are logged in"; echo $_SESSION['WNP']; echo "!<br>click <a href=\"index.php\">here</a> for admin."; }elseif (mysql_num_rows($query) == 0){ $text = "Not logged in!<br><a href=\"inloggen.php\">try</a> again!"; echo "$text";}}?>
Call the database for password this can also an txt or php extension
Calls every page with this code<?phpinclude('variabel.php'); if($_SESSION['WNP'] == "") { echo "Je bent niet ingelogd!<br>Klik <a href=\"inloggen.php\">hier</a> om in te loggen!";} elseif($_SESSION['WNP'] != "") { Here the whole code }
this is it.
Its simple but handy for unauthorized people
-
Hi i'am ronald.
I make a website for my cafĂŠ and read this topic.
First we make contact to a database (your database name!).<?$conn = mysql_connect("localhost", "username", "password");mysql_select_db("yourdatabase", $conn) or die(mysql_error());?>
This is the connection to the database.
Select or Update or Delete ?
When you are select some data the most simple line is$sql = select * from tabelname;mysql_query($sql) or die(mysql_error());
* means a wildcard this seems to call all names in the tabel.
When you are update some data the most simple line is$sql = "update tabelname set name=$_POST['name']";mysql_query($sql) or die(mysql_error());
When you are delete some data then call$sql = "delete * from tabelname where id='"$_POST['id']"'";mysql_query($sql) or die(mysql_error());
This is the simple way to connect php to a MySQL database!
-
Hi my name is ronaldI would ask something i have made my personel computer as testserver.But my pc cant make connection to administrator password login my pc connects to the database and shows all tabels perfect but admin tabel he cant see. I thought it was the session. But i dont know it for sure Who can help me Contact me at Ronaldavex21_AT_hotmail_DOT_com
Need Help: PHP Security - Login Script For Site security
in Programming
Posted · Report reply
Webmaster avex
I read this topic and i helps surely
I made a admin secure room
This is the login aera it calls simply the database
And sets a cookie when you are logged in and calls error when you are not registered!
This is the register account name
And this you must copy on each page you want to secure
After the else is your tabel when its a correct login