Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Author Topic: Locating snews.php outside the root directory  (Read 1796 times)

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Locating snews.php outside the root directory
« on: February 16, 2007, 07:01:37 PM »

There is an easy way to hide your snews.php file... by placing it outside the root directory in another folder. And you can do this with any php file. Let's say we placed the snews.php file inside a folder called misc. We would then create a new php file with the following string:
Quote
<?php include("misc/snews.php"); ?>
We can then save this new file with any name, in the root directory where snews.php used to be. For this example... let's call it buffer.php.
Then, in the top of index.php, we include our new buffer.php file:
Quote
<?php session_start();
   include('buffer.php');
?>
All we are really doing here is calling the functions of snews.php through another file from another location... the end result is the same.
« Last Edit: June 12, 2012, 04:34:46 PM by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Jim

  • Newbie
  • *
  • Karma: 1
  • Posts: 10
Re: Locating snews.php outside the root directory
« Reply #1 on: June 12, 2012, 07:12:53 AM »

Hello Keyrocks,

I'm interested in your post but apparently the first quote, under your first paragraph, is erased. Would it be possible to quote that piece of information again ? Many thanks for your help.
Oh, btw, this is a great program, lightweight and easy to use. I like it. Well done to you all !

Regards
Jim
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: Locating snews.php outside the root directory
« Reply #2 on: June 12, 2012, 04:40:23 PM »

Fixed Jim - see above.
You may come across other old posts on this site with blank quote boxes.
This happened when our site was upgraded a few years ago. The data itself is still in the database... just doesn't show. We don't know why, but we've found just opening the post for an edit and re-saving brings it back into view.
If you come across any others like that, just let us know and one of our volunteer admins will fix it.

We hope you find sNews useful for your projects.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Jim

  • Newbie
  • *
  • Karma: 1
  • Posts: 10
Re: Locating snews.php outside the root directory
« Reply #3 on: June 12, 2012, 06:01:52 PM »

Keyrocks,
Many thanks for your help and prompt reply, much appreciated. Will report any blank quote boxes if I come accross with them. Thanks again !
Jim
Logged