I have a script that allows users to view a downloads page.
In my script, if the if statement is yes, then a page is included (whatever.php) If the if returns no (false) then another page is included (error.php).
Instead of having to include whatever.php I want the actual HTML to be shown if the if returns true. Here is the code:
<?php
/* Connecting, selecting database */
$link = mysql_connect("localhost", "zingbats", "my pwl")
or die("Could not connect");
mysql_select_db("tycooneden_com") or die("Could not select database");
$query = "SELECT * FROM phpbb_users WHERE username = '$username' AND user_password = md5('$password')";
$result = mysql_query($query) or die("Query failed");
$foo=mysql_fetch_array($result);
/* Start the userdetail defining */
$user_points=$foo['user_points'];
mysql_close($link);
?>
<?
if ($user_points >= 4) {
include "whatever.php";
} else {
include "error.php";
}
?>
Any help would be much appreciated 😃