Search results for 'Redirection'. 2 post(s) found.
- 2007/10/16 How to redirect browser in PHP ?
- 2007/08/30 Cookie Redirect (1)
Using the php header function, a browser can be Redirected to another page.
<?php
// Redirect Browser
header("Location: http://www.example.com/");
// stop executing this script
exit;
?>
Another posts included in "PHP"
| PHP date and time formatting (0) | 2007/10/16 |
| How to declare array in PHP like C/C++ (0) | 2007/10/16 |
| How to pass variables via url (0) | 2007/10/16 |
| How to get current filename as variable ? (0) | 2007/10/16 |
| email validation, simple (0) | 2007/10/16 |
| How to ban / block IP addresses (0) | 2007/10/16 |
| for loop - simple (0) | 2007/10/16 |
| form action - detect form post (0) | 2007/10/16 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/28 22:59
moneyideas
-
Subject different money making ideas
2010/01/29 07:14
moneyideas
-
Subject different money making ideas
2010/01/31 16:42
moneyideas
When a page has performed it's purpose,a Cookie can be set to redirect the browser to a different page on subsequent visits. Easily implemented. (Because it will redirect after one visit,the example is not shown on this site.)
CookieRedirect.js
/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: William Bontrager | http://www.bontragerconnection.com/ */
// Copyright 2006 Bontrager Connection,LLC
// This version of the script redirects automatically.
// The Web site has a few other methods for directing also:
// http://www.bontragerconnection.com/library/redirect_with_a_Cookie.shtml
// Three items can be customized (values between quotation marks):
//
// 1. What URL shall the browser be redirected
// to if a Cookie was previously set?
var RedirectURL = "http://shamar.org";
// 2. How many days shall the Cookie live in
// the visitor's browser (0 means remove
// Cookie whenever browser closes)?
var DaysToLive = "365";
// 3. What name shall the Cookie have (any
// sequence of alphabetical characters
// is okay,so long as the name doesn't
// conflict with any other Cookies that
// this web page might be setting.)?
var CookieName = "HasVisited";
// No other customization is required.
function Action() {
location.href = RedirectURL;
}
DaysToLive = parseInt(DaysToLive);
var Value = 'bypass page next time';
function GetCookie() {
var Cookiecontent = '';
if(document.Cookie.length > 0) {
var Cookiename = CookieName '=';
var Cookiebegin = document.Cookie.indexOf(Cookiename);
var Cookieend = 0;
if(Cookiebegin > -1) {
Cookiebegin = Cookiename.length;
Cookieend = document.Cookie.indexOf(";",Cookiebegin);
if(Cookieend < Cookiebegin) { Cookieend = document.Cookie.length; }
Cookiecontent = document.Cookie.substring(Cookiebegin,Cookieend);
}
}
if(Cookiecontent.length > 0) { return true; }
return false;
}
function SetCookie() {
var exp = '';
if(DaysToLive > 0) {
var now = new Date();
then = now.getTime() (DaysToLive * 24 * 60 * 60 * 1000);
now.setTime(then);
exp = '; expires=' now.toGMTString();
}
document.Cookie = CookieName '=' Value exp;
return true;
}
if(GetCookie() == true) { Action(); }
SetCookie();
The JavaScript Source!! http://javascript.internet.com
Created by: William Bontrager | http://www.bontragerconnection.com/ */
// Copyright 2006 Bontrager Connection,LLC
// This version of the script redirects automatically.
// The Web site has a few other methods for directing also:
// http://www.bontragerconnection.com/library/redirect_with_a_Cookie.shtml
// Three items can be customized (values between quotation marks):
//
// 1. What URL shall the browser be redirected
// to if a Cookie was previously set?
var RedirectURL = "http://shamar.org";
// 2. How many days shall the Cookie live in
// the visitor's browser (0 means remove
// Cookie whenever browser closes)?
var DaysToLive = "365";
// 3. What name shall the Cookie have (any
// sequence of alphabetical characters
// is okay,so long as the name doesn't
// conflict with any other Cookies that
// this web page might be setting.)?
var CookieName = "HasVisited";
// No other customization is required.
function Action() {
location.href = RedirectURL;
}
DaysToLive = parseInt(DaysToLive);
var Value = 'bypass page next time';
function GetCookie() {
var Cookiecontent = '';
if(document.Cookie.length > 0) {
var Cookiename = CookieName '=';
var Cookiebegin = document.Cookie.indexOf(Cookiename);
var Cookieend = 0;
if(Cookiebegin > -1) {
Cookiebegin = Cookiename.length;
Cookieend = document.Cookie.indexOf(";",Cookiebegin);
if(Cookieend < Cookiebegin) { Cookieend = document.Cookie.length; }
Cookiecontent = document.Cookie.substring(Cookiebegin,Cookieend);
}
}
if(Cookiecontent.length > 0) { return true; }
return false;
}
function SetCookie() {
var exp = '';
if(DaysToLive > 0) {
var now = new Date();
then = now.getTime() (DaysToLive * 24 * 60 * 60 * 1000);
now.setTime(then);
exp = '; expires=' now.toGMTString();
}
document.Cookie = CookieName '=' Value exp;
return true;
}
if(GetCookie() == true) { Action(); }
SetCookie();
test.html
<script type="text/javascript" src="CookieRedirect.js"></script>
Another posts included in "HTML, Javascript"
| Cookie enabled browser checking in Javascript (0) | 2007/08/30 |
| Access Granted (0) | 2007/08/30 |
| Greeting For The Time Of Day (0) | 2007/08/30 |
| New content notifier in Javascript (0) | 2007/08/30 |
| Let popup once for event dialog or something like that in Javascript (0) | 2007/08/30 |
| Save And Restore Form Cookies in Javascript (0) | 2007/08/30 |
| How to record visitor's name by Cookie (0) | 2007/08/29 |
| Javascript & Cookie based Visitor Application (0) | 2007/08/29 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/29 01:20
moneyideas
-
Subject different money making ideas
2010/01/29 09:38
moneyideas
-
Subject different money making ideas
2010/01/31 16:44
moneyideas

Prev

Rss Feed