Jump to content

[SOLVED] Echoing a file content?


shag

Recommended Posts

Basically I have an admin area in /admin.  Once going there it will check to see if you are logged in, and if not show the login page.  Once you provide valid login details it shows the main admin area.  I have no problem simply doing echo "Admin area"; etc... But I want it to be styled to look like the rest of my website.

 

My index.php is

<? 

session_start(); 
include("database.php");
include("login.php");

?>

<html>
<link media="screen" href="style.css" type="text/css" rel="stylesheet">
<title>Admin Are</title>
<body>

<? displayLogin(); ?>

</body>
</html>

 

I saved the whole html layout of how i want the site to look as "style.txt" in login.php I have:

 

$template = file_get_contents("style.txt");

 

Then further down after it decides whether the user is logged in and if they are logged in i have:

 

function displayLogin(){
   global $logged_in;
   if($logged_in){
  echo $template;
   }
   else{ display login form again...

 

Any advice on how I can style the admin area? Or see an area where i mixed something up?  Thanks.

Link to comment
Share on other sites

I understand what you are saying... I have the .css file and can

<link media="screen" href="style.css" type="text/css" rel="stylesheet">

 

But what my question is to how to get the .html in there without going through every single line... Maybe provide an example?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.