Example: 1
In this tutorial fully explained about Mysql Database Connection, so for that i have
created the connection.php file for connecting the databse.
connection.php
<?php
error_reporting(0);
$connect = mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("phpacademy") or die(mysql_error());
echo "Connected Succesfully!.<br><br>";
?>
Example: 2
member.php
<?php
session_start();
if($_SESSION['username'])
echo "Welcome, " .$_SESSION['username']."!<br><a href='logout.php'>Logout</a><br> ";
else
die ("You must be logged in!");
?>


No comments:
Post a Comment