Trying to connect to MySQL for the first time

I am tring to connect to my database.
I am using xampp with PhPmyadmin. (v 4.9.0.1)
I read a help page ( https://www.homeandlearn.co.uk/php/php12p4.html ) which had some code to check if you are connecting to MySQL. and to put it in xampp/htdocs/test/test.php.
The code is:

<html>
	<head>
		<title>PHPTest</title>
	</head>
		<body>
			<?php echo '<p>Hello World</p>' ;?>			
		</body>
</html>

When I open it in Firefox I get:

Hello World

' ;?> 

When opened in Chrome I get:

<html>
	<head>
		<title>PHPTest</title>
	</head>
		<body>
			<?php echo '<p>Hello World</p>' ;?>			
		</body>
</html>

I also tried the code outside of xampp , and I get the same results.

What URL did you use in your browser(s)? It should be http://localhost/test/test.php

:grinning:
Thanks. that works, That was what I thought I was using… but I wasnt. I was using
xampp/htdocs/test/test.php
Now it all makes sense.

Sponsor our Newsletter | Privacy Policy | Terms of Service