Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running external php file from HTML page 1

Status
Not open for further replies.

lupidol

Programmer
Apr 23, 2008
125
0
0
IL
Hi everyone
This is my "hello.php" file:
Code:
 <?php 
 	$myConnection = NEW MYSQLI('localhost','root','a','b');
 	IF(!$myConnection)
 	DIE('ccc' .MYSQLI_CONNECT_ERROR());
 	echo 'Hello world';
 ?>
When I load it thorough my browser typing at the address bar:
I get an "Hello world" declaration on my display.
Then I create an hello.HTML file with the following code:
Code:
 <!DOCTYPE>
 <html>
 <head>	
 </head>
 <body>
 	<a href="hello.php">php</a>				
 </body>
 </html>
when I load "hello.html" and click "php" anchor, what I get at my display is the php file's source code.
I dont get the desired "Hello world".
Could anyone tell me why and what should I change to make the browser show "Hello" and not the source code?
Thanks
 
How are you loading the HTML page?

Are you loading it as " in a browser? Or are you just double clicking the html file in a folder?





----------------------------------
Phil AKA Vacunita
----------------------------------
OS-ception: Running Linux on a Virtual Machine in Windows which itself is running in a Virtual Machine on Mac OSx.

Web & Tech
 
You got me there :)
I double clicked [blush]
Uploadind the way you indicated solved that annoying problem.
Thanks a lot !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top