Tengo este formulario para que los usuarios entren desde el movil,
El problema es que al entrar los envia a esta url: http://chatdelmundo.com.es/index.php?p=dashboard
esa url tiene vista para el PC.
¿Que hago? cuando entren lleguen a la url para moviles: http://chatdelmundo.com.es/mobile
Código PHP:
global $client,$offset,$num_per_page, $page;
if ($act == 'login') {
$atempts = get_tmp($togkey);
if (!$atempts) $atempts = 0;
if ($client['id'] > 0) {
redirect('mobile');
}
if ($att == 's') {
sys_notice(t('Congratulations! You have successfully signed up. You can now login with your account'));
}
if ($_POST['step'] == 'post') {
if ($atempts > 3 && !get_gvar('disable_recaptcha_login')) {
if ($_POST["recaptcha_challenge_field"]) {
if (!$resp->is_valid) {
c('<script language="javascript" >
$(document).ready( function(){
$("#recaptcha_response_field").focus();
});
</script>');
$captchaerror = $resp->error;
$hold = 1;
}
}
else {
c('<script language="javascript" >
$(document).ready( function(){
$("#recaptcha_response_field").focus();
});
</script>');
$hold = 1;
}
}
if (!$hold) {
$password = md5($_POST['password'].'jcow');
$res = sql_query("select * from `".tb()."accounts` where (email='".$_POST['username']."' or username='".$_POST['username']."') and password='$password' limit 1");
if (sql_counts($res)) {
$newss = get_rand(12);
$row = sql_fetch_array($res);
if ($_POST['remember_me']) {
sql_query("UPDATE `".tb()."accounts` SET jcowsess='$newss' WHERE id='{$row['id']}' ");
setcookie('jcowss', $newss, time()+3600*24*365,"/");
setcookie('jcowuid', $row['id'], time()+3600*24*365,"/");
}
$_SESSION['uid'] = $row['id'];
set_tmp($togkey,'deleteit');
redirect(url('mobile'));
}
else {
$atempts++;
$_SESSION['login_cd']--;
set_tmp($togkey,$atempts);
sys_notice(t('<div style="margin-left:0px;"><span style="font-size: 12px;"><span class="form_label">Wrong account or password</span></span> </div> '));
}
}
}
set_title(t('login'));
if ($client['id']) redirect('mobile');
section_content('
<div style="margin-left:0px;"><span style="font-size: 1.5em;"><span class="form_label">'.t('Welcome to '.get_gvar('site_name').'').'</span></span> </div>
<div style="margin-left:0px;"><span style="font-size: 15px;">'.t(''.get_gvar('site_name').' help you connect all people in
the world.').'</span> </div>
<script language="javascript" >
$(document).ready( function(){
$("#recaptcha_response_field").attr("tabindex",3);
});
</script>
<form method="post" name="loginform" id="form1" action="member/loginpost" >
'.t('Username or Email').':<br />
<input type="text" size="10" name="username" style="width:120px" value="'.h($_POST['username']).'" tabindex=1 /><br /><br />
'.t('Password').':<br />
<input type="hidden" name="step" value="post" />
<input type="password" size="10" name="password" style="width:120px" value="'.h($_POST['password']).'" tabindex=2 />
');
c('
<div class="sub">
( <input type="checkbox" name="remember_me" value="1" '.$remember_check.' tabindex=4 /> '.t('Remember me').' )
</div>
<input type="submit" value="'.t('Login').'" tabindex=5 />
<div class="sub">'.url('mobile/member/chpass',t('Forgot password?')).'</div>
</form>
<div class="sub"><span style="font-size: 15px;">'.t('Still dont have account with '.get_gvar('site_name').'?').'</h3>'.url('mobile/member/signup',t('sign up now')).'</h3></span></div>
<br /> <br />
<script language="javascript" >
document.form1.username.focus();
</script>
');
section_close(t(''));
}