Accessing Variable before it is Parsed
Posted: Sun Feb 26, 2006 1:56 pm
Hello,
I guess it is impossible to access a variable before it has been parsed.
I need help re-arranging this page so the title var will be from the database.
top.php
bottom.php
I guess it is impossible to access a variable before it has been parsed.
I need help re-arranging this page so the title var will be from the database.
Code: Select all
<?
$page = $row['Name'];
include("/home/muot/public_html/site/includes/top.php");
?>
<!--START CONTENT-->
<table border=2 width=450><tr><td>
<?php
$username5= "muot_video";
$password5= "passwords";
$database5= "muot_videos";
$connection5 = mysql_connect('localhost',$username5,$password5);
mysql_select_db($database5);
$clause = '';
if (!empty($_GET['ID'])) {
$clause = 'WHERE ';
$clause .= (is_numeric($_GET['ID'])
? '`ID` '
: '`Filename` '
);
$clause .= '= \''. mysql_real_escape_string($_GET['ID']) .'\' LIMIT 1';
}
$sql5 = 'SELECT `Filename`, `ID` FROM `videos` '. $clause;
$result5 = mysql_query($sql5) or die(mysql_error());
if (mysql_num_rows($result) == 1) {
$row = mysql_fetch_assoc($result5);
echo '<EMBED SRC="/pages/videos/'.$row['Filename'].'" AUTOSTART=true width="490" height="380" controller="true"></EMBED>';
}
else {
while ($row = mysql_fetch_assoc($result5)) {
echo '<a href="/newsite/play2.php?ID='.$row['ID'].'">'.$row['Filename'].'</a> <br />';
}
}
?>
</tr></td>
</table>
<!--END CONTENT-->
<?
include("/home/muot/public_html/site/includes/bottom.php");
?>Code: Select all
<title>muot.net - <? echo $page ?></title>
</head>
<body>
<div id=alltop>
<div id=muot>
muot.net
</div>
<div id=menu>
<a class=alltop href=/site>main</a> :: <a class=alltop href=/site/muotPages/muotVideos.php>videos</a> :: <a class=alltop href=/site/muotPages/muotReport.php>muot report</a>
</div>
</div>
<br>
<span style="float:right;" id=ads>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</span><br><br>
<div id=contents align=center>Code: Select all
</div>
</body>
</html>