popularanky
Posts: 53
|
| Posted: 06/01/2011, 8:17 AM |
|
I am a page (first.php) with a form (first) and a field (code). I want to code that will will redirect the page based on the value inserted in the code field i.e if it the code begins with "FCK" the page should direct to fck.php and the code begins with "COD", the page should redirect to cod.php.
Thanks All
_________________
EKERE UBONG UBONG
IT Officer
CognitiveDrive |
 |
 |
ckroon
Posts: 869
|
| Posted: 06/01/2011, 9:01 AM |
|
I would have first.php redirect to a redirect.php page.
On that page do this on the Initialize View Event.
$get1 = CCGetFromGet("code","");
$get2 = substr($get1, 0, 3);
if ($get2 == 'COD')
{
$url = "cod.php"
header("Location: $my_url");
}
if ($get2 == "FCK")
{
$url = "fck.php"
header("Location: $my_url");
}
if ($get2 <> "COD" OR $get2 <> "FCK")
{
$url = "first.php"
header("Location: $my_url");
}
_________________
Walter Kempees...you are dearly missed. |
 |
 |
|