Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

phb forum stopped working for no apparent reason

Status
Not open for further replies.

ukmastiff

Technical User
May 23, 2002
1
GB
is there a charitable sould out there who could look at my forum at
it was installed 3 days ago and peeps are joining daily , suddenly without me touching it it now comes up with 2 errors below on peeps trying to see the main page.

Wrong datatype in sort() call in /home/mastifuk/public_html/forum/index.php on line 17
Warning: Variable passed to reset() is not an array or object in /home/mastifuk/public_html/forum/index.php on line 18

i am worried that i will have lost all of the postings and this will make members walk. i could re install the whole thing of course but then i lose all the topics and postings . i think the tecxt based data files are whats corrupted not the actual index page ?

i am no programmmer !! just basic html

the mastiffassociation will be in debt to ne1 who can help :)
 
Has website host recently upgraded site to PHP version 4.2.0 as I had similar prublems with a number of scripts on my site. It transpired that version 4.2.0 has register_globals set to off where previous version this was on. I picked up the following script (can't remember from where) which resolved the problems on my site. Simply upload this to you webserver then place the following in all your existing php scripts which have stopped working, if the errors are due to a version upgrade.
[script]

<?
///////////////////////////////////////////////////////////////////////////////
// php4-1-0_varfix.php January 09, 2001
// by Tom Harrison (thetomharrison@hotmail.com)
//
// According the the PHP Changelog, the version 4.1.0 release of PHP contains
// a drastic change in the way form, cookie and server values are made
// available. Instead of the old way
// (file.php?myvar=foobar yielding $myvar = &quot;foobar&quot;), such values are only
// assigned to associative arrays ($_GET, $_POST, $_COOKIE, $_SERVER
// and $_ENV). This has the effect of not only deprecating the $HTTP_*_VARS
// arrays and $fieldname = &quot;fieldvalue&quot; variables, but also
// voiding hundreds, if not thousands of existing web applications. As of
// 4.1.1, the $HTTP_*_VARS variables still exist, but the
// $fieldname = &quot;fieldvalue&quot; variables are completely gone.
//
// In an effort to preserve backwards compatability, this script cycles through
// these new structures and creates variables out of the field values. This
// means if you include this script at the top of your own scripts and run them
// on php 4.1.0, $yourformvalue or $yourcookievalue will contain the value
// you're expecting instead of nothing (as is the case if you ran your script
// without some kind of fix like this).
//
// The entire situation can be avoided by enabling register_globals. In 4.1.0,
// register_globals is deprecated but still on by default. In 4.1.1 however, it
// is off by default. This snippet is intended for those who don't have control
// over php's settings (such as virtually hosted sites) and need a quick fix
// while they transition their scripts to this arguably more secure method
// of making data available.
//
// For more information, see ///////////////////////////////////////////////////////////////////////////////

if (isset($_REQUEST)) {
while(list($varname, $varvalue) = each($_REQUEST)) { $$varname = $varvalue; }
}
if (isset($_SERVER)) {
while (list($varname, $varvalue) = each($_ENV)) { $$varname = $varvalue; }
while (list($varname, $varvalue) = each($_SERVER)) { $$varname = $varvalue; }
}

/*
There is no use yet for this function, but is included in anticipation of the
possibility of the $HTTP_*_VARS being fully deprecated.

function create_HTTP_VARS($type)
{
$temp = array();
switch(strtoupper($type))
{
case 'POST': $temp2 = &$_POST; break;
case 'GET': $temp2 = &$_GET; break;
case 'COOKIE': $temp2 = &$_COOKIE; break;
case 'SERVER': $temp2 = &$_SERVER; break;
case 'ENV': $temp2 = &$_ENV; break;
default: return 0;
}
while (list($varname, $varvalue) = each($temp2)) {
$temp[$varname] = $varvalue;
}
return ($temp);
}

if (!isset($HTTP_POST_VARS)) {
$HTTP_POST_VARS = create_HTTP_VARS('POST');
$HTTP_GET_VARS = create_HTTP_VARS('GET');
$HTTP_COOKIE_VARS = create_HTTP_VARS('COOKIE');
$HTTP_SERVER_VARS = create_HTTP_VARS('SERVER');
$HTTP_ENV_VARS = create_HTTP_VARS('ENV');
}
*/
?>

[/script]
hope this helps
Ian McCormack
 
Oops sorry didn,t add in the bit of script you need to include in you existing scripts as mentioned above. This is it
[script]
<?php include (&quot;scriptname.php&quot;); ?>
[/script]

thats it
Ian McCormack
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top