WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Advanced Poll 2.03 (14 posts)

  1. Palindrome
    Member
    Posted 9 years ago #

    Has anyone successfully embedded a poll from Advanced Poll 2.03 in their sidebar? When I attempt to embed a poll in my sidebar, the MySQL connection breaks for some reason. When I create a PHP page by itself it does not. Anyone have any ideas where to start?

    This is the code I'm trying to embed in my sidebar:

    <?php
    // Important! You have to include it before your html code
    include_once "/home/willtoex/public_html/polls/poll_cookie.php";
    ?>

    <html>
    <body>
    <?php
    include_once "/home/willtoex/public_html/polls/booth.php";
    echo $php_poll->poll_process(4);
    ?>
    </body>
    </html>

    The error message is:

    Warning: mysql_connect(): Access denied for user: 'willtoex@localhost' (Using password: NO) in

    MySQL Error : Connection Error
    Error Number: 0
    Date : Mon, May 23, 2005 13:16:09
    IP : 65.82.xxx.xxx
    Browser : Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2
    Referer : http://willtoexist.com/wp-admin/theme-editor.php?file=wp-content/themes/modified-elegance/style.css&theme=Modified+Elegance&a=te
    PHP Version : 4.3.10
    OS : Linux
    Server : Apache/1.3.33 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_ssl/2.8.22 OpenSSL/0.9.7a PHP-CGI/0.1b
    Server Name : http://www.willtoexist.com
    Script Name : /index.php

    Any tips would be appreciated.

  2. vkaryl
    Member
    Posted 9 years ago #

    By "include before html code", doesn't it mean AHEAD of the <html> tag?

    Or maybe not - I've seen it in something somewhere later in the page.... let me look some....

  3. Palindrome
    Member
    Posted 9 years ago #

    vkaryl, I did add the include before code snippet to the very beginning of the sidebar.

    It the second portion of code that, no matter where I insert it into the page, causes problems.

  4. vkaryl
    Member
    Posted 9 years ago #

    Well, hmm. The only stuff I can find is done in the php files themselves for various plugins. So I really haven't a clue, not being a php code-jockey of any sort! Sorry!

    Only other thing might be to put the required include line in the header.php?

  5. Palindrome
    Member
    Posted 9 years ago #

    I think I'm going to need to study some PHP.

  6. rajanr
    Member
    Posted 9 years ago #

    The HTML header isn't in sidebar.php so putting it there wouldn't really help. I tried putting it in index.php in themes/default/ as well as wp-blog-header.php - no difference.

    I don't think the problem is with where include_once "...booth.php"

  7. SmilingJack
    Member
    Posted 9 years ago #

    Using output buffering will solve your problem.

    http://jackborn.com/blog/2005/06/05/adding-functionality-to-templates/

  8. NitaScript
    Member
    Posted 8 years ago #

    Warning: mysql_connect(): Access denied for user: 'willtoex@localhost' (Using password: NO) in

    This error means the poll's database information has not been set in the poll/include/config.inc.php file. It needs the following information:

    $POLLDB["dbName"] = "database name";
    $POLLDB["host"] = "localhost";
    $POLLDB["user"] = "database username";
    $POLLDB["pass"] = "database user's password";
    $POLLDB["class"] = "class_mysql.php";

  9. temp
    Member
    Posted 8 years ago #

    I have everything well configured on the config.inc.php file and still get the same rror he does! :S

  10. estjohn
    Member
    Posted 8 years ago #

    take the info from the config sheet and place it in that file where it needs the info.. make sure the paths are right

    "database name"; <-- repalce "database name" with your database name
    "database username"; <-- repalce "user" with your database username
    "database user's password"; <-- replace "pass" with your database password
    "class_mysql.php"; <-- not sure what that is.. I would assume it needs the path to where this file is?

  11. jalenack
    Member
    Posted 8 years ago #

    Hey. I'm the author of an alternate WordPress polling option that you'll find easier to install. http://blog.jalenack.com/archives/democracy/

    I humbly suggest you try Democracy and forget about Advanced Poll.

  12. nieuws
    Member
    Posted 8 years ago #

    You should try democratie based on the Ajax polling system.

  13. Soniczilla
    Member
    Posted 8 years ago #

    Jalenack,

    I've been using Democracy for a while on my site, but I gotta say, it's pretty weak. I'm only using it because I can't find any other solution.

    Please take a look at other polling solutions on other websites and try to catch up with the times.

  14. Palindrome
    Member
    Posted 8 years ago #

    Thanks, I've switched to Democracy and it's way better than I ever hoped for from a WordPress plugin. Awesome job.

    Does exactly what I want. Don't consider it weak at all. Simple, easy install and fits into my sidebar.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags