Return to Snippet

Revision: 44928
at April 20, 2011 23:35 by BrianHanly


Initial Code
<html>
<head>
<title>
Facebook App
</title>
</head>

<body>

<?

include ('connect.php');
include ('fbconnect.php');

$fidQuery = "Select count(fid) as ct FROM users where fid =".$var4."";
$runfid = mysql_query($fidQuery);
$row1 = mysql_fetch_array($runfid);
	if ($row1['ct'] == 1)
	{
		echo "<br>Welcome Back ".$var1."!<BR>";
	}
	else
	{
	
		echo "<br>Hey...its your first time. Welcome!<br>";
		mysql_query("INSERT INTO users (name, gender, email, fid, link) VALUES ('".$var1."','".$var2."','".$var3."','".$var4."','".$var5."')")or die(mysql_error()); 
	}


?><br /><br />
Classes that students at Hofstra have enrolled in...<br /><br />
<?

$query = "SELECT * from class order by day ASC";
$result = mysql_query($query);

$printedTitle = 0;
$printedTitle2 = 0;

while ($row = mysql_fetch_array($result))
	{

		if ($printedTitle == 0 && $row['day'] == "MWF")
		{	
				echo 	"Classes that run on Monday, Wed & Fridays<br>";
						$printedTitle++;		
		}
				
		if	($printedTitle2 == 0 && $row['day'] == "TTH")
		{	
				echo 	"Classes that run on Tuesdays and Thursdays<br>";
						$printedTitle2++;
		}
			
			
		echo 	$row['className'] ." at ". 
				$row['time']. 
				$row['day']." is in the department of ".$row['dept']."<a href='addfromindex.php?id=".$var4."&coursecode=".$row['className']."&time=".$row['time']."&day=".$row['day']."'>[+]</a><br>";		
	}
?>
<br />
<br />
Dont see your class here?
<a href="addClass.php?id=<? echo $var4;?>">
Lets Insert A Class Now!</a> or <a href="myclasses.php?id=<? echo $var4;?>">take a look at what classes you're in.</a>
</body>
</html>

Initial URL


Initial Description


Initial Title
Classes With Friends (index.php)

Initial Tags
facebook

Initial Language
PHP