CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 REDIRECT PAGE BASE ON INSERT VALUE

Print topic Send  topic

Author Message
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
View profile  Send private message
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.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.