Jump to content

[SOLVED] WAMP displaying php code


Recommended Posts

hello.... im only learning php (working through some tutorials and looking at other peoples scripts)

i have just installed and configured WAMP with the passwords need and everyhing is working fine apart from when i try and view php scripts.

 

the scripts run fine in my php enabled website one looks like this

php%20frpm%20internet.png

 

but when i run the same script in wamp i get this

php%20from%20wamp.png

 

please help

this is really making things hard to learn and not very enjoyable

 

Thanks heaps

Martin

Link to comment
https://forums.phpfreaks.com/topic/181168-solved-wamp-displaying-php-code/
Share on other sites

yes it does use the short tags <?

i went through and changed all the short tags to long tags on all the php scripts (gotta love find and replace  :D)

 

i ran it again and got

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'your_name'@'localhost' (using password: YES) in G:\~~WEBSERVER~~\wamp\www\martin.site11.com\include\database.php on line 24

Access denied for user 'your_name'@'localhost' (using password: YES)

 

i had a look over line 24 of the database script and could find nothing that i would need to change to allow access (after all so far all i have changed is <? to <?php)

here is the code that is having the access issue

wamp%20access%20error.PNG

 

so now i have another error that i dont know how to deal with

Assuming the code is unchanged from the live server I imagine the password/hostname/username is different on your localhost than it is on your live server. Somewhere in your code you will probably have define('DB_SERVER', "something"); etc for each of server, user, password and database name. These will all need changing to be appropriate for your WAMP server.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.