Page 1 of 1

PHP files don't seem to work properly inside localhost

PostPosted: 08. December 2010 01:19
by Pano
Hi to all.

I have just installed xampp and try to create a Mysql database.
I'm using windows 7 64 bit.
I installed xampp succesfully and opened phpMyAdmin in order to create a database. I start by creating a table, adding information inside that table and saving it. Then creating 2 php files mysql.php and connect.php .

mysql.php looks like this:

Code: Select all
<?php

require("connect.php");

?>

and connect.php like this

Code: Select all
<?PHP


$connect = mysql_connect("localhost","root","password") or die("connection failed!");

echo "connected!";


?>


The problem is that when i try to run any of those two files, i get no response, just a blank page.

I tried to create an html file under same directory, just to check and it worked, but for a reason i can't get the php files to work. All files are under C:/xampp/htdocs , as they should.
Does anyone have a clue on that? Why php files don't run normally?

Thank you

Re: PHP files don't seem to work properly inside localhost

PostPosted: 08. December 2010 07:44
by Altrea
If you can use phpmyadmin, your Apache, MySQL and PHP are working.

How do you access/open the php file in your browser?

Re: PHP files don't seem to work properly inside localhost

PostPosted: 08. December 2010 10:00
by Pano
To access the file i type http://localhost/mysql.php in browser address bar or http://127.0.0.1/mysql.php .
i also created a subfolder and placed both files in there http://localhost/firstdatabase/mysql.php which didn't change anything.

Re: PHP files don't seem to work properly inside localhost

PostPosted: 08. December 2010 15:52
by Pano
sorry, my mistake
i used the windows notebook to write the code and saved it in unicode instead of utf-8. :evil:
thanks again