Jump to content

[SOLVED] Polling php install question


Recommended Posts

Hello -

 

I am installing a polling php script and have created the mysql database, uploaded the sql.txt file to create the tables and adjusted the config.php file.

 

So, I think I did everything right, but I get this message on the polling admin index page:

 

Warning: file(): URL file-access is disabled in the server configuration in /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/admin/functions.inc.php on line 94

 

Warning: file(http://www.catholic-interactive.com/poll/templates/admin_header.html): failed to open stream: no suitable wrapper could be found in /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/admin/functions.inc.php on line 94

 

Warning: implode(): Bad arguments. in /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/admin/functions.inc.php on line 94

 

Warning: file(): URL file-access is disabled in the server configuration in /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/admin/functions.inc.php on line 94

 

Warning: file(http://www.catholic-interactive.com/poll/templates/admin_poll.html): failed to open stream: no suitable wrapper could be found in /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/admin/functions.inc.php on line 94

 

Warning: implode(): Bad arguments. in /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/admin/functions.inc.php on line 94

 

Warning: file(): URL file-access is disabled in the server configuration in /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/admin/functions.inc.php on line 94

 

Warning: file(http://www.catholic-interactive.com/poll/templates/admin_footer.html): failed to open stream: no suitable wrapper could be found in /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/admin/functions.inc.php on line 94

 

Warning: implode(): Bad arguments. in /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/admin/functions.inc.php on line 94

 

Please help!!!  Thanks in advance!!

Link to comment
Share on other sites

Due to PHP's configuration you're not allowed to use web based file paths within file, fopen etc,

 

You'll want to change your scripts configuration so you use relative paths instead.

 

All those errors are caused by the first error. Fix the first one and you're good to go.

Link to comment
Share on other sites

OK - cool - I'm not that good at this.....so I changed the web-based file path from "http://www.catholic-interactive.com/poll/templates/" to just "/home/poll/templates/" and some errors went away but many stayed on page, so now it reads:

 

Warning: file(/home/poll/templates/admin_header.html): failed to open stream: No such file or directory in /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/admin/functions.inc.php on line 94

 

Warning: implode(): Bad arguments. in /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/admin/functions.inc.php on line 94

 

Warning: file(/home/poll/templates/admin_poll.html): failed to open stream: No such file or directory in /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/admin/functions.inc.php on line 94

 

Warning: implode(): Bad arguments. in /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/admin/functions.inc.php on line 94

 

Warning: file(/home/poll/templates/admin_footer.html): failed to open stream: No such file or directory in /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/admin/functions.inc.php on line 94

 

Warning: implode(): Bad arguments. in /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/admin/functions.inc.php on line 94

 

 

Am I using the correct relative file path? 

 

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 (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 for your continued help - I appreciate it!

Link to comment
Share on other sites

Hi - thanks SO MUCH for replying back again.  I appreciate your help!!

 

OK - I cut and pasted your suggestion into the config.php file, so now it looks like this:

 

// directory where templates are located (must end foward slash)

define(templatedir,, $_SERVER['DOCUMENT_ROOT'] . '/poll/templates/");

 

// url to the script main directory (must end foward slash)

define(simplepollurl,"http://www.catholic-interactive.com/poll/");

?>

 

All of the prior warning messages went away, BUT, now I get this message when I pull up that same admin area page (http://www.catholic-interactive.com/poll/admin/index.php):

 

Parse error: parse error, unexpected ',' in /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/admin/config.inc.php on line 27

 

What do you think causes this new warning message?

 

Thanks again!

Link to comment
Share on other sites

Wait - never mind - it was the extra comma (,) in there - my bad.  I took that out and now it says:

 

 

Parse error: parse error, unexpected $ in /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/admin/config.inc.php on line 31

 

Then I took out the "$" and I got:

 

 

Parse error: parse error, unexpected '[' in /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/admin/config.inc.php on line 27

Link to comment
Share on other sites

Cool - thanks! 

 

This is the original config.inc.php file from the download:

 


<?
#########################################################
# Simple Poll                                           #
#########################################################
#                                                       #
# Author: CodeMunkyX                                    #
#                                                       #
# This script and all included functions, images,       #
# and documentation are copyright 2003                  #
# free-php.net (http://free-php.net) unless             #
# otherwise stated in the module.                       #
#                                                       #
# Any copying, distribution, modification with          #
# intent to distribute as new code will result          #
# in immediate loss of your rights to use this          #
# program as well as possible legal action.             #
#                                                       #
#########################################################

// 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 have configured it so it looks like this (currently):

 


<?
#########################################################
# Simple Poll                                           #
#########################################################
#                                                       #
# Author: CodeMunkyX                                    #
#                                                       #
# This script and all included functions, images,       #
# and documentation are copyright 2003                  #
# free-php.net (http://free-php.net) unless             #
# otherwise stated in the module.                       #
#                                                       #
# Any copying, distribution, modification with          #
# intent to distribute as new code will result          #
# in immediate loss of your rights to use this          #
# program as well as possible legal action.             #
#                                                       #
#########################################################

// change to match your server's configuration
define(hostname,"MYSERVERNAME");  // mysql server host name
define(dbname,"MYDBNAME");   // mysql database name
define(username,"MYUSERNAME"); // mysql user name
define(password,"MYPASSWORD"); // mysql password

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

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

 

Let me know your thoughts - thanks so much (again)!

Link to comment
Share on other sites

Hi -

 

http://www.catholic-interactive.com/poll/admin/index.php

 

Here's what the page above shows:

 

Warning: file(templates/admin_header.html): failed to open stream: No such file or directory in /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/admin/functions.inc.php on line 94

 

Warning: implode(): Bad arguments. in /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/admin/functions.inc.php on line 94

 

Warning: file(templates/admin_poll.html): failed to open stream: No such file or directory in /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/admin/functions.inc.php on line 94

 

Warning: implode(): Bad arguments. in /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/admin/functions.inc.php on line 94

 

Warning: file(templates/admin_footer.html): failed to open stream: No such file or directory in /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/admin/functions.inc.php on line 94

 

Warning: implode(): Bad arguments. in /home/content/m/b/d/mbdonner/html/catholic-interactive/poll/admin/functions.inc.php on line 94

 

Thanks.....

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.