Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: using ssi exec |
|
Author |
|
edwardsmarkf
Joined: 20 Feb 2013 Posts: 25 Location: cottonwood, az
|
Posted: Thu 06 Feb '14 21:27 Post subject: using ssi exec |
|
|
hello all - newbie posting here
this is the first time i have attempted something like this, but i am trying to set up an if-then-else for a parameter in the URL. here is what i have done so far:
Code: | <!--#if expr='($QUERY_STRING != /teacherEmail\=mark@markyboy.com/)' -->
NO we are not marky!
<!--#else -->
YES we are marky!
<!--#endif --> |
so if the url contains ?teacherEmail=mark@markyboy.com it will show one set of html, and if not, it shows another set.
i specifically choose to use != because during testing, it seemed like if the apache code testing failed for any reason, it created a permanent true condition.
it seems to be working with any test i can throw at it, but i am looking for more knowledgeable opinions than my own!
any thought or suggestions on this? yes this is probably handled better using php, but i needed a quick solution. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 06 Feb '14 23:41 Post subject: |
|
|
I can't do SSI, but PHP would be
Code: |
<?php
if(!isset($_GET['teacher'] || $_GET['teacher'] != 'mark@markyboy.com'){
die('SORRY you can\'t access this page');
}
?>
|
|
|
Back to top |
|
|
|
|
|
|