I have set up a mini wap site & have managed to get php files to generally work with it. I am now trying to add some dynamic features. I have 2 questions:
a) How to redirect?
Usually in my html files I have a form that then posts to a php file that can then redirect the user to a page depending upon the result of a query. I've tried to do this with wml as follows:
<?php header("Content-type: text/vnd.wap.wml" );
header("Pragma: no-cache");
header("Cache-Control: no-cache, must-revalidate");?>
// include files:
if (!isset($COMMON_INC)){include "common.inc";}
if (!isset($ACCOUNT_INC)){include "$CLASSES/account.inc";}
if (!isset($USER_INC)){include "$CLASSES/user.inc";}
global $APP_NAME;
$acc = new account($APP_NAME);
$loginval = $acc->login($form_uname,$form_pword);
if($loginval == 0)
{
// if login unsuccessful, redirect to page:
header"Location:login.php#loginfail");
}
else
{
// get session number and redirect
$seshid = $acc->login $form_uname,$form_pword);
header("Location:welcome.php#index");
}
?>
But the phones & emulators I'm using to test say "Page cannot be displayed" (even if I put the standard doctype line under the php script. Can someone please help!!!
and...
b) If I then get a session var from the code above, how do I pass it to the wml deck? I know in html I would just append ...seshid=$seshid onto the end of the url, but how do I do it with wml?
All help would be v,v much appreciated.
Cheers,
Paul.