Hi,
I want to create a sort of page in a page, whereby a certain page is displayed if the "if" variable returns the correct information.
I have two possible codes, look where the different } are
<?php
mysql_connect("localhost","zingbats","whatever");
mysql_select_db (tycooneden_com);
$user_id = ( isset($HTTP_GET_VARS['user_id']) ) ? intval($HTTP_GET_VARS['user_id']) : 0;
$sql = "SELECT FROM phpbb_users WHERE username = '$user'";
$result = mysql_query($sql);
while($r=mysql_fetch_array($result)) /this causes the loop to be ran until the query is empty*/
{
$userpoints = $r["user_points"];
$username = $r["username"];
}
if ($userpoints >= 5) {
include "http://www.tycooneden.com/whatever/whatever.php";
} else {
print " you do not have 5 points yet. Your score: $userpoints";
}
?>
That one shows a blank, white screen
<?php
mysql_connect("localhost","zingbats","WHEVER PWL");
mysql_select_db (tycooneden_com);
$user_id = ( isset($HTTP_GET_VARS['user_id']) ) ? intval($HTTP_GET_VARS['user_id']) : 0;
$sql = "SELECT FROM phpbb_users WHERE username = '$user'";
$result = mysql_query($sql);
while($r=mysql_fetch_array($result)) /this causes the loop to be ran until the query is empty*/
{
$userpoints = $r["user_points"];
$username = $r["username"];
if ($userpoints >= 5) {
include "http://www.tycooneden.com/whatever/whatever.php";
} else {
print " you do not have 5 points yet. Your score: $userpoints";
}
}
?>
That one shows the else words (you do not have 5 points yet. Your score: $userpoints).
The $userpoints is NOT shown though
None of the work. I'd appreciate advice.
Alex.