Forum Moderators: coopster
<%
If Mid(Request.ServerVariables("HTTP_REFERER"), 8, 3)="www" thenIf Mid(Request.ServerVariables("HTTP_REFERER"), 12, 16)="site.com" then
%>
<!--#include file="file.asp" -->
<%
End If
ElseIf Mid(Request.ServerVariables("HTTP_REFERER"), 8, 16)="site.com" then
%>
<!--#include file="file.asp" -->
<%
Else
Response.write "Don't Work!"
End If
%>
file.asp
<%
Select case Request.QueryString("dl")
Case "1"
response.redirect "http://www.hotmail.com"
End Select
%>
This is what I have right now:
found the
- Server Varaibles:
<snip>
- IF Statement and Switch Statement for PHP...
<snip>
Now how do I TRIM or request a quantity of characters from the varaible?
Example: Mid(Request.ServerVariables("HTTP_REFERER"), 12, 16)
What that example will do it take the server varaible for HTTP_REFERER and return 16 characters, starting from the 12th character in the varaible.
[edited by: jatar_k at 5:18 pm (utc) on Sep. 5, 2003]
[edit reason] removed urls [/edit]
Here is what I got:
--------------------------------------------------------------------------------
<?if ((substr($HTTP_REFERER, 8, 3)) == 'www')
{
if ((substr($HTTP_REFERER, 12, 16)) == 'webpromo-inc.com')
{include("file.php");}
}elseif
{if ((substr($HTTP_REFERER, 8, 16)) == 'webpromo-inc.com')
{include("file.php");}
}else
echo 'Don't Work!'
{
?>
file.php
--------------------------------------------------------------------------------
<?php
switch ($_GET['dl'])
{
case '1';
echo 'works!';
break;
default:
echo 'can not find.';
}
?>
Just need to get the redirect.
I haven't tested it yet...anyone see anything wrong with it?
<?php
switch ($_GET['dl'])
{
case '1': header("location: http://www.hotmail.com");
exit;
break;
default:
echo 'can not find.';
}
?>
Look at the examples and the user notes on the php docs for the header() function [php.com].