0

Brain going mushy, please help!
My code:

$reguser = $_COOKIE['ID_my_site'];
function curPageName() {
 return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
}
$currentpage = curPageName();
echo "$currentpage";

Connect to the db then:

$query = ("SELECT rstextresume FROM scuserspro WHERE profilemng = '$currentpage'")or die(mysql_error());
$result = mysql_query($query);
if($result == false)
{
   user_error("Query failed: " . mysql_error() . "<br />\n$query");
}
elseif(mysql_num_rows($result) == 0)
{
   echo "<p>Sorry, no rows were returned by your query.</p>\n";
}
else
{
   while($query_row = mysql_fetch_assoc($result))
   {
      foreach($query_row as $key => $string)
      {
         echo "$key: $string<br />\n";

Finally:

$filename = $result;
$file = fopen($filename, 'r');
$contents = fread($file, filesize($filename));
fclose($file);
echo nl2br($contents);

In a nutshell:
1. Get name of current page.
2. Look up name in DB and get file name.
3. Open/read file into page.

It's not working. I am sure it is a very stupid thing or multiple thereof.
I bow and pray to you Gods on the Mount of Good Coding to answer this neophyte's call for help and offer thanks and sacrafice's on the alter of Linux.

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by mobo57
0

what do you mean by not working, what exact problem you are facing?
what is there in db, because i dont see any relation between your db code and final code.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.