[TUT]Professional Styled Externals[/TUT]

TesoMayn

Boredom, it vexes me.
Oct 30, 2011
1,482
1,482
I have no idea if this is posted or not, but I thought I'd share.
_____

This does not protect your externals or DCRs, it just makes it look cleaner and more professional in the source, and I use it because it is faster to write up than to type out the complete URL.
_____

Requirements:
  • Must host own DCRs/Externals
  • PHP Support (If you have a hotel you have this, unless you use flat file)
_____

Create a file and name it whatever you want, I am calling it "Externals.php" for this example.

Inside the file paste the following:

PHP:
if (file_exists($_GET['id'] . '.txt'))
{
    header('Content-type: text/plain; charset=utf-8;');
    include $_GET['id'] . '.txt';
}
else
{
    header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
}

if (empty($_GET['id']))
{
    header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
}

From here, edit your external variables and text, change them to the following:
(Do not add extension at end; normally .txt, sometimes .cfm)

External Text:
Code:
<PATH-TO-YOUR-HOTEL>/<PATH-TO-FILE/<FILE>.php?id=<EXTERNAL-TEXT-NAME>

External Variables:
Code:
<PATH-TO-YOUR-HOTEL>/<PATH-TO-FILE/<FILE>.php?id=<EXTERNAL-VARIABLES-NAME>

_____

Soon I will give a tutorial on how to protect your externals and DCRs.

Thanks for reading, please like if you found this helpful, again, this is mainly a "for looks" thing, many of you might have known this, a lot of you will comment and say you did, but really didn't.

So please, no negative feedback as it is just an excuse to flame, and increase post count (Nub Move)
 

Thom

You can't touch this
Oct 1, 2010
1,305
386
Or you could just use htaccess and remove the .txt extention to make it look good too...
 

Users who are viewing this thread

Top