RipCurl
|
| Posted: 03/28/2003, 2:27 PM |
|
Having many of my pages done in CC, I want to know if there is a way to "redirect" someone if they try to plug-in the direct file on the site via their browser.
For Example:
I have 2 files
series.php (Grid)
seriesinfo.php (Record)
So parameters passed to seriesinfo.php would be seriesid
the url ends up being seriesinfo.php?seriesid=# (# is the id its assigned in th DB).
Now, how can I prevent someone who just plugs-in seriesinfo.php into the browser and accessing that page that way? (or redirect them to the seriesinfo.php page or my default index.php page).
Otherwise, they get a display of EVERYHING found in the DB the record is looking at.
Working wih PHP + Templates and CC 2.0.5
Good example is:
http://us.imdb.com/Title?0305669
vs
http://us.imdb.com/Title?
|
|
|
 |
RipCurl
|
| Posted: 03/31/2003, 5:05 PM |
|
Anyone?
|
|
|
 |
MHamilton
|
| Posted: 04/03/2003, 10:11 AM |
|
There are at least 2 ways.
One way is to utilize the script below or one like it... which forces a given page to be loaded within the main page/frame.
You could also do something like this;
If Len(Request.Querystring("seriesid") = 0 Then Response.Redirect "series.php"
This code would probably be best placed in Page:On Initialize View
Sorry for the ASP code, you'll need to translate it to php.
============================================================
Script: Open Page in Frameset Script
Functions: If a page is intended to be opened only within
a frameset, this script refers the browser
immediately to the frameset page
Browsers: All
Author: etLux
============================================================
Put the following script in the head of your page. Set the
url of the frameset page where shown below.
<script>
// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header
if (parent.location.href == self.location.href){
// change the url below to the url of the
// frameset page...
window.location.href = 'index.html'
}
</script>
============================================================
|
|
|
 |
Ripcurl
|
| Posted: 04/03/2003, 12:04 PM |
|
I got teh answer and its done in php.
|
|
|
 |
|