Jump to content

Redesign Poll for new site design.


gaogier

Recommended Posts

Hello

 

I am looking to redesign an old poll system what approved to work effeciantly, however I now need to get the poll to work on my new site.

 

I am getting these errors.

 

Warning: mysql_query() [function.mysql-query]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/gaogier/public_html/includes/polls.php on line 4

 

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/gaogier/public_html/includes/polls.php on line 4

 

Warning: mysql_query() [function.mysql-query]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/gaogier/public_html/includes/polls.php on line 52

 

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/gaogier/public_html/includes/polls.php on line 52

 

 

Code is on pastebin - 24 hours.

 

http://pastebin.com/1u19Xwwk

 

Now here is where my files are located

 

includes/connect.php

includes/polls.php

pages/ - my pages.php - displayed as a new folder almost using mod rewrite.

tpl/sidebar.tpl - where my poll will be displayed using php - include.

Link to comment
https://forums.phpfreaks.com/topic/253845-redesign-poll-for-new-site-design/
Share on other sites

Isn't it pretty obvious? Warning: mysql_query() [function.mysql-query]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/gaogier/public_html/includes/polls.php on line 4

 

So check your database connection code.

You include connect.php in your poll.php file with a relative file path.  This will work if you are accessing poll.php itself, but will not work if poll.php is included in another file, as that file will do the include. So, PHP is looking in the pages/ folder for the file connect.php.  You should put an absolute file path to the connect file.

require_once ('absolute/path/to/connect.php');

 

This is the exact reason that so many of us stress that you must use absolute file paths to every included file.

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.