1) I'm trying to get a last modified time of the current page to be echoed at the bottom of my pages. I had everything working nicely so long as I told the script the name of the current page explicitly. However, once I get to a large number of pages, this won't be efficient. So how do I get the name of the current page being viewed by the user? I tried $SERVER['PHP_SELF'], but that returns the entire path frm the document root which causes problems. I tried $SERVER['SCRIPT_NAME'], but that does the same thing, returns the entire path from document root. Bleh.. Kinda buggin' me. Anyone know how to resolve this issue? $_SERVER['REQUEST_URI'] doesn't work either.
2) Also, using a variable in a query.. Here's the code I'm using that is currently causing errors:
<?
$db = mysql_connect("localhost", "myuserhere", "mypasshere") or die(mysql_error());
mysql_select_db("mybhicom_website") or die(mysql_error());
$aid = $_POST['aid'];
$q = "SELECT * FROM mynews WHERE aid='$aid';";
$r = mysql_query($q, $db) or die(mysql_error());
$row = mysql_fetch_row($r) or die(mysql_error());
?>
I get a completely blank page. I'm able to echo $_POST['aid'] without a problem. SO by my reasoning, it oes exist and is set correctly. 😕 Can anyone spot the syntax error?
Thanks....