Page 1 of 1
PHP Configuration Error
Posted: Thu Sep 18, 2003 3:28 pm
by ronni_e
Can someone tell me what setting I need to change in my PHP.INI file to get this error to go away?
http://ronnie.vonetwork.com/index2.php? If you visit my current website at
http://www.ronniewilliams.net/index2.php you will see that error isnt there but I dont have access to the PHP.INI file there so I cant see how its set. I need to know what setting to change at the vonetwork site to get this error to go away.
Posted: Thu Sep 18, 2003 5:35 pm
by m3rajk
in this case you don't wanna touch the error reporting level. why? they turn it most if not allt he way off for security.
this is a simple matter.
my guess is you have an include for functions, and other stuff.
you have a function in that particular page
so you include the file twice. wanna get around it?
adjust your includes like this:
a: include two files elsewhere, just the variables and not the functins in a page's functions
b:
make an include file that includes the two files that you include elsewhere and only include variables in functions in a page.
in either of those cases split the functions and ariables.
you see the issue is simple: you're declaring a function twice and if you plan on using the second version then you need to be warned because you'll only be using the first.
i had that same issue when i modularized the site i'm working on. i did the latter since i now have two variables files
Posted: Thu Sep 18, 2003 5:52 pm
by JAM
You could post the 116th line in the class_poll.php file, and we'll see what that gives us...
I'm thinking that the poll-file uses the $_GET enviroment to get pollvalues (uhmmm sounded wierd) and it cant grasp the fact that the ? at the end of the URI isn't have to mean anything...
Don't think you should touch them ini file for various reasons...
Code in Question
Posted: Fri Sep 19, 2003 6:54 am
by ronni_e
Here is the code in question:
Code: Select all
function set_max_bar_length($max_bar_length='') {
if ($max_bar_length && $max_bar_length>0) {
$this->pollvars['img_length'] = $max_bar_length;
return true;
} else {
return false;
}
}
function set_max_bar_height($max_bar_height='') {
if ($max_bar_height && $max_bar_height>0) {
$this->pollvars['img_height'] = $max_bar_height;
return true;
} else {
return false;
}
}
function get_poll_tpl($tpl) {
$filename = "$this->include_path/templates/$this->template_set/$tpl.html";
if (file_exists("$filename")) {
$fd = fopen ($filename, "r");
$template = fread ($fd, filesize ($filename));
fclose ($fd);
$template = ereg_replace(""", """, $template);
return $template;
} else {
return false;
}
}
function set_max_bar_length($max_bar_length='') {
if ($max_bar_length && $max_bar_length>0) {
$this->pollvars['img_length'] = $max_bar_length;
}
return $this->pollvars['img_length'];
}
Line 116 is the last function set_max_bar_length. This is a pre-written code so I dont know how to modify it to make it work to my needs. I dont understand why it works on my current web host but not on the new webhost im going to.
Posted: Fri Sep 19, 2003 7:28 am
by twigletmac
Have you changed the code at all when moving your site? Is it possible that you're including the code for the poll twice?
If you're using include() or require() to include the file try include_once() or require_once() instead.
Mac
follow up
Posted: Fri Sep 19, 2003 11:51 am
by ronni_e
the only code that was changed was the file that contains my database settings. other than that all was left the same as on the web host where the script is working fine. the script that is working fine has PHP 4.2.2 while the version that isnt working has 4.3.3.. any changes in the versions of PHP that might affect this?
Re: Code in Question
Posted: Fri Sep 19, 2003 2:21 pm
by m3rajk
ronni_e wrote:Here is the code in question:
Code: Select all
function set_max_bar_length($max_bar_length='') {
if ($max_bar_length && $max_bar_length>0) {
$this->pollvarsї'img_length'] = $max_bar_length;
return true;
} else {
return false;
}
}
function set_max_bar_length($max_bar_length='') {
if ($max_bar_length && $max_bar_length>0) {
$this->pollvarsї'img_length'] = $max_bar_length;
}
return $this->pollvarsї'img_length'];
}
Line 116 is the last function set_max_bar_length. This is a pre-written code so I dont know how to modify it to make it work to my needs. I dont understand why it works on my current web host but not on the new webhost im going to.
i removed some of your code.... notice anything????
note: i was wrong with why you were getting the error but not what it was. if i'm not mistaken they are identical. try removing one. it should still work perfectly
removed one
Posted: Fri Sep 19, 2003 6:31 pm
by ronni_e
I removed one like you said.. it now displays.. however try to place a vote..
http://ronnie.vonetwork.com/index2.php
Posted: Tue Sep 23, 2003 1:51 pm
by m3rajk
workd for me