I have a simple PHP login script http://www.grahamsimmons.co.uk/dhtmlx/1 which on authentication success loads another php file. Viewing this on the iPhone Safari browser looks rubbish, so I want to use the Touch framework to make it look nice.
I’ve loaded the touchui.css and touch.js fiels in the and in the body added the required code to show the username and password fields and a submit button, but the button does nothing. Goto this link on the iPhone http://www.grahamsimmons.co.uk/dhtmlx/2
Not sure if I’m even doing this right, so can someone please please help me?
index.php
[code]<?php
session_start();
$link = mysql_connect('my-host', 'my-username', 'my-password');
if (!$link) {die('Could not connect: ' . mysql_error());}
$db_selected = mysql_select_db('my-database', $link);
if (!$db_selected) {die ('Can\'t use dhtmlx : ' . mysql_error());}
$userid = mysql_real_escape_string($_POST["userid"]);
$pwd = mysql_real_escape_string($_POST["pwd"]);
//Validate username and password
if ($userid != "" && $pwd != "") {
$res = @mysql_query("SELECT * FROM users WHERE userid='".$userid."' AND pwd=PASSWORD('".$pwd."')");
if(!$res){
header("Location: index.php");
} elseif (mysql_num_rows($res) == 0) {
header("Location: index.php");
} else {
$_SESSION["authenticated"] = array("userid"=>$userid, "pwd"=>$pwd);
header("Location: home.php");
}
}
?>
DHTMLX Test [/code]home.php
[code]<?php
session_start();
if (!isset($_SESSION[“authenticated”])) {header(“Location: index.php”);}
?>
You are now logged in <?php echo $_SESSION["authenticated"]["userid"]; ?>.
[/code]Many thanks for any help.