PDA

View Full Version : Help! Publishing problem


doogle
02-10-2011, 10:09 PM
Hello, i have created my first website using some html pages and some php. It puts the files fine onto my remote server but when i go onto the wesbite, the html pages are fine but when i click to a php page it asks me where i want to save the php file. What am i doing wrong? I'm all out of ideas!

Thanks so much

Corrosive
02-11-2011, 07:46 AM
Are you sure your hosting is running PHP?

gentleone
02-11-2011, 11:16 AM
If you get the download dialog that's a sign that you don't have PHP installed on your web server.

doogle
02-11-2011, 01:46 PM
thanks for that - my package didn't have php, i have upgraded now, it displays the page but when i try to login, as its a login script i have on the page, i get these errors -

Warning: mysql_connect() [function.mysql-connect (http://www.woodbridgetownpastors.org.uk/function.mysql-connect)]: Lost connection to MySQL server at 'reading initial communication packet', system error: 111

doogle
02-11-2011, 01:46 PM
thanks for that - my package didn't have php, i have upgraded now, it displays the page but when i try to login, as its a login script i have on the page, i get these errors -

Warning: mysql_connect() [function.mysql-connect (http://www.woodbridgetownpastors.org.uk/function.mysql-connect)]: Lost connection to MySQL server at 'reading initial communication packet', system error: 111

Corrosive
02-11-2011, 01:52 PM
So what is the code you have for your database connection?

doogle
02-11-2011, 04:37 PM
i hope i don't sound really stupid, but it is my first time doing a website! i followed the building a dynamic website tutorial on the dreamweaver site. here is the code i think you mean, if its not right then tell me where to locate it and i will copy it in for you -
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_wtp = "127.0.0.1";
$database_wtp = "town";
$username_wtp = "root";
$password_wtp = "123";
$wtp = mysql_pconnect($hostname_wtp, $username_wtp, $password_wtp) or trigger_error(mysql_error(),E_USER_ERROR);
?>

thanks so much for your help, its very much appreciated :)

Corrosive
02-11-2011, 07:06 PM
i hope i don't sound really stupid, but it is my first time doing a website!

Don't worry about that. Every single person here has been there!

I'm going to ask the obvious question (based on the fact you didn't have php earlier). You have created your database right?

doogle
02-11-2011, 07:46 PM
Thanks :)

Yes i have created them, i'm using phpmyadmin on xampp with apache. Within dreamweaver when i test mysql connection to the database, that all works fine, and also when i preview the pages in the web browser, everything works great. Its just when i then put all the files onto the host, i then get the errors.

Thanks again for your help! :)

johnMoss
02-11-2011, 09:36 PM
Sounds like you have a path error. Isn't your host server going to be a different server path than your local installation?

Corrosive
02-12-2011, 08:39 AM
Sounds like you have a path error. Isn't your host server going to be a different server path than your local installation?

Yes, agreed. This is a local ip;

$hostname_wtp = "127.0.0.1";

I'd expect it to be something like;

$hostname_wtp = "localhost";