Forum Moderators: open
If a member tries to access one of those features without being logged in, they're redirected to a generic login page.
The problem is, I'd like to display separate messages depending on what feature they were trying to access. For instance, instead of the generic login page I have now, I'd like to say, "You're trying to post in our forums, but are not logged in. Please login to continue." And the same concept of feature-specific messages, depending on the feature they're trying to use.
I thought that if I came up with an SSI for each message I wanted, I'd be able to accomplish my object. The idea would be to look at the referring URL, and display the corresponding SSI.
The problem is, it gets a little more complex. For instance, my forums main page might be:
[mydomain.com...]
But, the user might be redirected from:
[mydomain.com...]
So I'd need the "SSI-Chooser" script to look for "URL contains X" instead of "URL = X"
I don't expect anyone to take the time to program something just for me (though if anyone wants to, I'd not object!), but if someone could just say whether or not I'm even on the right track, I'd appreciate it. If you know of any helpful resources, I'd also like to know about them. Basically I'm interested in any suggestions that might help me accomplish this concept.
Thanks in advance,
Matthew
Add this tidbit to your generic login page where you want the include to appear:
<?php
$inc = $_SERVER['REQUEST_URI'];
$p = strpos($inc, '?');
if (!$p === false) {
$inc = substr($inc, $p + 1, strlen($inc));
if (!@include("$inc.inc")) {
echo "You must login to participate.";
}
}
?>
Then call your login page from the other pages like...
login.php?store (to include store.inc)
login.php?forum (to include forum.inc)
login.php?somethingelse (to include somethingelse.inc)
HTH
Jordan