Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    New Coder
    Join Date
    Aug 2007
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts

    PHP Polling Install Question

    Hello -

    I am trying to install a php script for polling on my website and have run into a bit of a snag.

    In the config.php file, I'm not sure how to configure the relative path for the templates folder.

    Here is a portion from the config.php file:

    // change to match your server's configuration
    define(hostname,"localhost"); // mysql server host name
    define(dbname,"dbnamehere"); // mysql database name
    define(username,"mysqlusernamehere"); // mysql user name
    define(password,"mysqlpasswordhere"); // mysql password

    // directory where templates are located (must end foward slash)
    define(templatedir,"/home/www/codemunkyx/www/www.free-php.net/htdocs/demo/SimplePoll/templates/");

    // url to the script main directory (must end foward slash)
    define(simplepollurl,"http://www.free-php.net/demo/SimplePoll/");
    ?>


    I got all the database info configured fine, but it seems like I'm not configuring the bottom part correctly.

    Here's is how I've got it configured (FYI - I put all the files into a folder called "poll" in the main directory):


    // directory where templates are located (must end foward slash)
    define(templatedir,"/home/poll/templates/");

    // url to the script main directory (must end foward slash)
    define(simplepollurl,"http://www.catholic-interactive.com/poll/");


    Thanks so much in advance for your help - I appreciate it!

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,638
    Thanks
    2
    Thanked 404 Times in 396 Posts
    My guess would be "templates/" if you're looking for the relative path.

  • #3
    New Coder
    Join Date
    Aug 2007
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks for the reply - but that didn't work either - the thing is...I know this is a simple PHP issue, but I haven't a clue about PHP....

  • #4
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,638
    Thanks
    2
    Thanked 404 Times in 396 Posts
    It's not really a "PHP issue", you just haven't set the path correctly.

    Try: /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/templates/
    Incidentally you should password protect the admin directory asap.

  • #5
    New Coder
    Join Date
    Aug 2007
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts
    AWESOME - that was it. Thanks so much for your reply and your time.

    THANKS!!!

    By the way, how do I password protect the admin directory?

    Seriously, thanks!!!

  • #6
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,638
    Thanks
    2
    Thanked 404 Times in 396 Posts

  • #7
    New Coder
    Join Date
    Aug 2007
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts
    great - thanks - you're going to think I'm a total idiot, but I'm having trouble with a different polling script on a different site.....

    I'm testing which poll script I like best, and tried to install another one. The admin page and testing works great, but when I try to include the php in a page and pull that page up, I get this:

    Warning: main(/home/content/m/b/d/mbdonner/html/toplinepublishing/poll//poll.php): failed to open stream: No such file or directory in /home/content/m/b/d/mbdonner/html/poll1.php on line 9

    Warning: main(/home/content/m/b/d/mbdonner/html/toplinepublishing/poll//poll.php): failed to open stream: No such file or directory in /home/content/m/b/d/mbdonner/html/poll1.php on line 9

    Warning: main(): Failed opening '/home/content/m/b/d/mbdonner/html/toplinepublishing/poll//poll.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/m/b/d/mbdonner/html/poll1.php on line 9


    Again, it's the path or something. I obviously can't figure it out from your help on the other script.

    Any suggestions?

    By the way, here is the config.php file:

    Code:
    <?php
    
    
    /***************************** ADMIN AREA *************************************/
    $id="admin";
    $pw="admin";
    
    
    /************************ Poll4All relative path ******************************/
    // set poll4all folder path from page will display poll.
    // this is the same path used in include statement for poll.php file.
    // example: $scriptPath = "../script/poll4all/";
    $scriptPath = "";
    
    
    
    /**************************** POLL STYLE **************************************/
    
    // General
    $border = 1;                      // poll border
    $width = 300;                     // poll table width
    $cellpadding = 5;                 // poll table padding
    $bgColor = '#FFFFFF';             // poll background color
    $font = 'Verdana';                // poll font (question & answers)
    
    // Question
    $questionAlign = 'center';        // question text align
    $questionColor = '#000000';       // question text color
    $questionBgColor = '#ECECEC';     // question background color
    $questionSize = '10';             // question font size (in pixel)
    
    // Answers
    $optionsAlign = 'left';           // answers text align
    $optionColor = '#000000';         // answers, vote and percentage text color
    $oddBgColor = '#FFFFFF';          // odd answer background color
    $evenBgColor = '#FFFFFF';         // even answer background color
    $answerSize = '12';               // answers,vote and percentage text size
    $barBg = '#FFFFFF';               // progress bar background color
    $percentageBg = '#FFFFFF';        // votes and percentage text background color
    
    // Random Colors Mode ( 0:disable , 1:enable )
    $RandomColors=1;
    
    ?>
    Again, I uploaded all the files into a folder called "poll"

    Thanks so much.....

  • #8
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,638
    Thanks
    2
    Thanked 404 Times in 396 Posts
    The path you're trying to include is wrong. Make sure the path points to a folder that exists, and remove the forward slash at the end.

  • #9
    New Coder
    Join Date
    Aug 2007
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts
    OK, so for example, the main site is http://www.toplinepublishing.com and the folder is "poll"...
    what is the correct path?

    (I don't get this path thing....obviously)

    Thanks!!

  • #10
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,638
    Thanks
    2
    Thanked 404 Times in 396 Posts
    From the script:
    PHP Code:
    /************************ Poll4All relative path ******************************/
    // set poll4all folder path from page will display poll.
    // this is the same path used in include statement for poll.php file.
    // example: $scriptPath = "../script/poll4all/";
    $scriptPath ""
    Also, I get a 404 at http://www.toplinepublishing.com/poll/
    Did you upload the folder elsewhere, and try to include it from toplinepublishing?

  • #11
    New Coder
    Join Date
    Aug 2007
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Do you have Yahoo Messenger IM by the way?

    Or would you be so kind if I called?

    Or I just shut up and keep using the forum?

  • #12
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,638
    Thanks
    2
    Thanked 404 Times in 396 Posts
    No, I don't. You should use the forum =]

  • #13
    New Coder
    Join Date
    Aug 2007
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts
    OK - cool....

    OK - well, I uploaded the files into a folder in toplinepublishing.com called "poll" - there is no index file in "poll" so maybe that's why you get a 404

    Check out http://www.toplinepublishing.com/poll/setup.php

    Also, I know where to enter the path in the config.php file/script above, but WHAT to enter, I don't know.

    In other words, what is the correct path to put in there?

    Thanks!!!!!

  • #14
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,638
    Thanks
    2
    Thanked 404 Times in 396 Posts
    Well, assuming you're using it in the web root directory ie(http://website.com/) you should be able to use
    PHP Code:
    $scriptPath "/poll/"
    or just "poll/".
    Last edited by Inigoesdr; 08-12-2007 at 04:32 AM. Reason: Clarifying earlier statement.

  • #15
    New Coder
    Join Date
    Aug 2007
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts
    OK - I configured the configure.php with that path and then here is the instruction:

    4. In the page you want the poll displayed use this code (must be php file):

    <?php include("AJpoll_path/poll.php"); ?>


    So I created a php file named "poll1.php" and uploaded it into the root directory (http://www.toplinepublishing.com/poll1.php). This file has the following:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
      <meta content="text/html; charset=ISO-8859-1"
     http-equiv="content-type">
      <title></title>
    </head>
    <body>
    <?php include("/poll/poll.php"); ?>
    </body>
    </html>
    and this was the result (at http://www.toplinepublishing.com/poll1.php):

    Warning: main(/poll/poll.php): failed to open stream: No such file or directory in /home/content/m/b/d/mbdonner/html/poll1.php on line 9

    Warning: main(/poll/poll.php): failed to open stream: No such file or directory in /home/content/m/b/d/mbdonner/html/poll1.php on line 9

    Warning: main(): Failed opening '/poll/poll.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/m/b/d/mbdonner/html/poll1.php on line 9


    In case this helps, here is the total README.TXT file:

    Code:
    :: INDEX ::
    
    - About
    - Features
    - Requirements
    - Files Description
    - Installation & Usage
    
    
    .: about:
    --------------------------------------------------------------------------------
     Create and manage your own poll is REALLY easy with AJPoll.
     This free php script lets you create, edit and test your poll (up to 7 answers) through an easy to use web interface.
     You may insert your poll into any page you want simply including one php file. 
     AJPoll show results as colored graphical bars plus votes number and percentage. 
     It  prevent multiple votes using cookies and store all information in a text file so you don't need any database.
     AJPoll is valid XHTML 1.0 code and is viewable with any browser, fully customizable style.
     Note: You can manage and run just one poll, every new poll will replace the older one.
    	   
    
    .: Features:
    --------------------------------------------------------------------------------
    - Display your poll is very simple, just include one php file into your webpage
      and your news will be published automatically.
    - No database needed
    - Fully customizable look to fit well into any page.
    - Up to 7 answers
    - Colored graphical bar (random (different)  color function)
    - Viewable with any browser (tested on Mozilla/Firefox, Ie, Opera).
    - Valid XHTML 1.0 Transitional Code!
    
    
    .: Requirements:
    --------------------------------------------------------------------------------
    Web server with PHP (this tool is tested with PHP 5, but should work with earlier and previous versions).
    
    
    
    .: Files Description:
    --------------------------------------------------------------------------------
    - config.php : settings for AJPoll
    - setup.php : the main script, it manage database-file and allow you to create and edit your poll
    - poll.php : the file to include in your web page to show created poll
    - txt/txtdb.ini.php : database-file used to store information about poll, don't edit manually!
    - includes/configmagik.php : a file reader/writer class by Benny Zaminga
    - includes/functions : some useful functions...
    
    
    .: Installation & Usage:
    --------------------------------------------------------------------------------
    1. Download AJPOll and edit the config.php file to suite your needs.
    		
    2. Place the files anywhere in your web directory: 
    	All files must be placed in the same directory observing directory structure.
    	Set the attributes of the file "txtdb.ini.php" to 666 (meaning read and write access for all parties).
    
    3. Open up your webbrowser to:
    
       http://www.yourserver.com/poll/setup.php
    
       Default user id & password are: admin, admin.
       You can change default values in the "config.php" file.
    
       The script will check database-file (and if is writable) then will show the admin panel to create and edit your poll.
    
    4. In the page you want the poll displayed use this code (must be php file):
    
            <?php include("AJpoll_path/poll.php"); ?>
    Thanks for your continued help!!


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •