PDA

View Full Version : 2 Things I was trying to find out...


Chris M
06-29-2002, 11:41 AM
Hey...

Im looking to find out 2 things...

1.) If I wanted to use .php files on my site, but not on the /forum directory (where the forums are), how would I get them
to be integrated with vB?
2.) How do you make a variable random, and be one value be chosen every 24 hours?
I am trying to make version 1.2 of my "Guessing Game" hack work, and I have got this:
<?php
error_reporting(7);
register_globals;

require('./global.php');

//Start Guessword
rand("$num");
$num = array("blagh", "whoo", "whee", "hello", "testing" );
$message= "";
$num_triesgw= ( isset( $num_triesgw ) ) ? ++$num_triesgw : 0;
if ( ! isset( $guess ) )
eval("$message(\"".gettemplate("gg_guessword")."\");");
elseif ( $guess != $num )
eval("$message(\"".gettemplate("gg_guessword_wrong")."\");");
else { //must be equal to
header( "Location: hooray.php" );
exit;
}
$guess = (int)$guess;
?>

Is that correct? What I am trying to do, for version 1.2, is have 5 words which are chosen at random every 24 hours...

The variable is $num, and it has 5 values...

Any help would be appreciated:)

Satan

Xenon
06-29-2002, 12:43 PM
1)
i think adding require('forum/global.php'); should be enough, but not 100% sure

Admin
06-29-2002, 01:03 PM
Actually that will generate error(s). You must first "go" to the forums dir, then include the file:
chdir('./forum');
require('./global.php');
Because global.php requires other files as well, so the path of the PHP script must be in the forums folder.

Chris M
06-29-2002, 02:57 PM
Ah...Thanks:)

Satan