http://domain.com/xxx.php -vs- www.domain.com/xxx.php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jn148
Forum Newbie
Posts: 1
Joined: Wed Nov 13, 2002 8:45 pm

http://domain.com/xxx.php -vs- www.domain.com/xxx.php

Post by jn148 »

Has anyone ever had any issue where a php script (this specific one is a very simple script to read a mysql db and displays results on the page) runs fine if you visit the page via http://domain.com but errors out if visited at http://www.domain.com

The error is:
>>>>>>>>>
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/***/***-www/shows.php on line 14
Error performing query:
<<<<<<<<<

Any advice would be greatly appreciated!
Thanks!
JN
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Is there some code you can show us?

Mac
f1nutter
Forum Contributor
Posts: 125
Joined: Wed Jun 05, 2002 12:08 pm
Location: London

Post by f1nutter »

Are you sure that http://domain.com and http://www.domain.com point to the same site? I believe that the two can be different sites, owned by different people. Make sure that they are the same site using just HTML.

From the error it looks like you are hosting the site yourself, because you have the full path. Is the address of your page something like /home/usr/www.domain.com/shows.php and so your script is looking for a non-existant file at /home/usr/domain.com/shows.php

Can you get non-db scripts to work on either domain, like "Hello World"?

Are you including your db info from a seperate file, check your include directory in php.ini and phpinfo()

Try these and get back to us.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

/www/ should be it's own folder above the domain name, how come the folder is named /www.domain.com/ ?

I've never seen that before.
Post Reply