Jump to content

One page multi tasker


Zoud

Recommended Posts

[code]<?php require("includes/layout_top.php"); ?>

<?php
  $con = mysql_connect("-","-","-") or die('Error: <br />'. mysql_error());
if (!$con)
  die("Error: ". mysql_error());

mysql_select_db("members", $con) or die("Error: ".mysql_error());

if (isset($_GET['id']))
{
$id = $_GET['id'];
$sql = "SELECT * FROM `profile` WHERE `id`='$id'";
$result = mysql_query($sql) or die("Error: ".mysql_error());
$num = mysql_num_rows($result);
if($num == 0)
echo "There are no users that posses the id ".$id;
else
{
for($i=0; $i < $num; $i++)
{
$user = mysql_result($result,$i,"username");
$date = mysql_result($result,$i,"date");
$email = mysql_result($result,$i,"email");
$pro = mysql_result($result,$i,"profile");


}
}
}

if (!isset($_GET['id']))
{
echo "DISABLED";
echo "<div style=display:none;>";
}
?>

Username: <?php echo $user ?><br>
Email: <?php echo $email ?><br>
Date Joined: <?php echo $date ?><br>
Profile: <?php echo $pro ?><br>

<?php
if (!isset($_GET['id']))
{
echo "</div>";
}
?>

<?php require("includes/layout_bot.php"); ?>[/code]

Here's what I'm trying to accomplish. When viewing the page under no extention (not having ?id=) I want it to show only the echo "DISABLED" without any of the profile content. Now, I've got part of that down, but I'm using the <div style="display:none;"></div> tag.

How could I make it not show the profile content using using only PHP so that when viewing the source, you can't see anything but DISABLED.
Link to comment
https://forums.phpfreaks.com/topic/34321-one-page-multi-tasker/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.