Jump to content

Syst3m

New Members
  • Posts

    3
  • Joined

  • Last visited

Syst3m's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am now getting this error Catchable fatal error: Object of class mysqli could not be converted to string in /home/nebulafiles/public_html/testlog.php on line 11 <?phperror_reporting(-1);ini_set('display_errors',1); $host = "localhost"; $username= "nebulafi_syst3m"; $password = "Kuxx#Hd6u9gC"; $db_name = "nebulafi_syst3m"; $connect = mysqli_connect("$host", "$username", "$password")or die("Connection Failed."); $selectdb = mysqli_select_db("$db_name", "$connect")or die("DB Not Found."); ?> <html> <h1>LOGIN</h1> <form action='' method='POST'> <table> <tr> <td> <b>Username:</b> </td> <td> <input type='text' name='username' placeholder='Enter your username'> </td> </tr> <tr> <td> <b>Password:</b> </td> <td> <input type='password' name='password' placeholder='Enter your password'> </td> <td> <input type='submit' value='login' name='submit'> </td> </tr> </form> </html>
  2. Hey so this is my login script but when i enter something into the username and password box and submit it, the page just refreshes. <?php echo " <h1>LOGIN</h1> <form action='' method='POST'> <table> <tr> <td> <b>Username:</b> </td> <td> <input type='text' name='username' placeholder='Enter your username'> </td> </tr> <tr> <td> <b>Password:</b> </td> <td> <input type='password' name='password' placeholder='Enter your password'> </td> <td> <input type='submit' value='login' name='submit'> </td> </tr> </form> "; $host = "localhost"; $username = "root"; $password = ""; $db_name = "website"; mysql_connect("$host", "$username", "$password") or die("Could not connect"); mysql_select_db("$db_name") or die("Could not find database"); if(isset($_POST['submit'])) { if(!empty($_POST['username'])) { $sql = "SELECT * FROM members WHERE username='$username' AND password='$password'"; $result = mysql_query($sql); $count = mysql_num_rows($result); if($count==1) { $row = mysql_fetch_array($sql); $bancheck = mysql_query($row); if($row['active']==0 && count==0) { include 'userban.html'; } else if($count==1 && $bancheck==1) { $_SESSION['username'] = "$username"; include '/home/user/index.php'; } else { echo "You entered invalid information"; } } } } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.