0
votes

this is my code to connect my .php file to my databse:

$serverName="localhost";
$username="root";
$password="ichhya123";
$dbName="teacher";

$conn=mysqli_connect("$serverName","$username","$password","$dbName");
echo "Connected";
if(!$conn){
die("Connection failed:".mysqli_connect_error());}

however, when i try to run it using xampp in google chrome using http://localhost/phpmyadmin/teacher-login.php, it gives me this error message:

Object not found! The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster.

Error 404 localhost Apache/2.4.29 (Win32) OpenSSL/1.1.0g PHP/7.2.0

1
put teacher-login.php in www folder and run http://localhost/teacher-login.php. - Harshad Pansuriya
The URL you use is not correct. - halojoy

1 Answers

0
votes

XAMPP cannot find your .php file. Please check:

  1. Your file should be here: xampp\htdocs\
  2. File name (it should be: teacher-login.php)