Jump to content

[SOLVED] why isset doesnt seem to be working?


marksie1988

Recommended Posts

why does this script show information that isnt set in mysql the script with the isset function is still displaying the image when the field has no information in it. why? is it to do with my code below?

 

	<?php
		$req_user = trim($_GET['user']);
		if(!$req_user || strlen($req_user) == 0 ||
		   !eregi("^([0-9a-z])+$", $req_user) ||
		   !$database->usernameTaken($req_user)){
		   die("Username not registered");
		}
		/* Display requested user information */
		$req_user_info = $database->getUserInfo($req_user);

		/* Username */
		echo "<strong>Username:</strong> <br>".$req_user_info['username']."<br><br>";

		/* real name */
		echo "<strong>Real Name:</strong> <br>".$req_user_info['rnme']."<br><br>";

		/* Gender */
		echo "<strong>Gender:</strong> <br>".$req_user_info['Gender']."<br><br>";

		/* Age */
		echo "<strong>D.O.B:</strong> <br>".$req_user_info['dob']."<br><br>";

		/* Location */
		echo "<strong>Location:</strong> <br>".$req_user_info['location']."<br><br>";

		/* Info */
		echo "<strong>Bio/Info:</strong> <br>".$req_user_info['info']."<br><br>";

		echo "<strong>Other Stuff:</strong><br><br>";

		if(isset($req_user_info['skype'])){
		/* Skype */
		echo "<a href='callto://".$req_user_info['skype'] ."'><img src='../images/icons/skype.gif' border='0'/></a>";}
		else{echo"";}
		if(isset($req_user_info['myspace'])){
		/* myspace */
		echo "<a href='http://".$req_user_info['myspace'] ."'><img src='../images/icons/myspace.gif' border='0'/></a>";}
		else{echo"";}
		if(isset($req_user_info['www'])){
		/* myspace */
		echo "<a href='http://".$req_user_info['www'] ."'><img src='../images/icons/www.gif' border='0'/></a>";}	
		else{echo"";}
	?>	

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.