我刚刚创建了我的第一个jQuery移动网站.
我想让那些用手机查看我的"完整网站"的人自动转移到"移动网站".但也可以单击链接以查看完整站点(如果需要).
我不知道从哪里开始.我可以使用一些JavaScript吗?
如果您想查看网站的外观,请访问以下网站:http://www.solera-restaurant.com,移动网站仍在我的测试服务器上:http://graves-incorporated.com/test_sites/solera_mobile /
(这是我第一次尝试使用php)
我有一个非常基本的注册页面. http://graves-incorporated.com/test_sites/member_test/register/register.php
*我只记得PHP代码没有出现在源代码中,所以这里是:
enter code here
<?php
include('connection.php');
if(isset($_POST['form'])){
if(empty($_POST['username']) || empty($_POST['password']) || empty($_POST['conf_pass']) || empty($_POST['email'])){
echo '<b>Please fill out all fields.</b>';
}elseif($_POST['password'] != $_POST['conf_pass']){
echo '<b>Your Passwords do not match.</b>';
}else{
$url = 'http://graves-incorporated.com/test_sites/plantation_park_2012/';
echo '<META HTTP-EQUIV=Refresh CONTENT="2; URL='.$url.'">';
echo '<b>Congrats, You are now Registered.</b>';
mysql_query("INSERT INTO users VALUES(NULL, '$_POST[username]', '$_POST[password]', '$_POST[email]')");
}
}
?>
Run Code Online (Sandbox Code Playgroud)
我想确保我没有在数据库中获得重复的用户和/或电子邮件地址.我在MySQL中为用户名和电子邮件设置了一个唯一密钥,这可以防止它,但是实际表单上的用户不知道,它仍然告诉他们"恭喜,你已经注册"或者其他什么......哈哈
那么我可以添加到php代码(以及代码中的哪个位置)来阻止这种情况呢?
感谢帮助这个主要的菜鸟,丹格雷夫斯