こんにちは、私は mysql 登録フォームを持っていますが、問題があります。50% の時間は問題なく正常に動作し、残りの 50% の時間は失敗します。
試行に失敗した後、ブラウザのキャッシュを空にすると機能することがあります。
これは誰にとっても意味がありますか、誰かがこの問題を解決できる方法があれば教えてください、ありがとう。
<?php ob_start();
// CONNECT TO THE DATABASE
require('../includes/_config/connection.php');
// LOAD FUNCTIONS
require('../includes/functions.php');
$username = $_POST['username'];
$password = $_POST['password'];
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$email = $_POST['email'];
$number = $_POST['number'];
$dob = $_POST['dob'];
$accounttype = $_POST['accounttype'];
$query="INSERT INTO ptb_registrations (id,
username,
password,
firstname,
lastname,
email,
number,
dob,
accounttype,
date_created )
VALUES('NULL',
'".$username."',
'".$password."',
'".$firstname."',
'".$lastname."',
'".$email."',
'".$number."',
'".$dob."',
'".$accounttype."',
now()
)";
mysql_query($query) or dieerr();
function dieerr() {
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title></title>
<link rel="stylesheet" type="text/css" href="css/style.css" media="all" />
</head>
<body background="../assets/img/form/backdrop.png" style="background-repeat:no-repeat; background-size: 100% 2000px;">
<div id="container">
<h1>REGISTRATION WAS UNSUCCESFULL</h1><br/><br/><br/><br/>
<div class="textarea">
<h3>Oooops! I tried my hardest to register you onto our system but it looks like one of us has made an error :-( Try and have another go and if there is still a problem then contact one of the Tech Team at <a href=\"mailto:support@playtimeboys.com\">Support@PlaytimeBoys.com</a></h3>
</div>
<div class="man_reg"><img src="../assets/img/help_support/man.png" alt="" width="210" height="214" /></div></div>
<div id="progress_bar">
<div id="progress"></div>
<div id="progress_text">Registration Completed</div>
</div>
<style>
.textarea{
padding-left:55px;
padding-right:55px;
text-align:center;
}
.man_reg{
margin-top:54px;
margin-left:450px;
}
</style>
</body>
</html>';
exit;
}
$pass = $_GET['pass'];
$query="INSERT INTO ptb_users (id,
user_id,
first_name,
last_name,
email,
password )
VALUES('NULL',
'NULL',
'".$firstname."',
'".$lastname."',
'".$email."',
MD5('".$password."')
)";
mysql_query($query) or dieerr();
$result = mysql_query("UPDATE ptb_users SET ptb_users.user_id=ptb_users.id");
$query="INSERT INTO ptb_stats (id,
user_id,
display_name )
VALUES('NULL',
'NULL',
'".$username."'
)";
mysql_query($query) or dieerr();
$result2 = mysql_query("UPDATE ptb_stats SET ptb_stats.user_id=ptb_stats.id");
$query="INSERT INTO ptb_profiles (id,
user_id,
display_name, bio, status )
VALUES('NULL',
'NULL',
'".$username."',
'Welcome, Tell us about yourself?',
'Whats on your mind?'
)";
mysql_query($query) or dieerr();
$result3 = mysql_query("UPDATE ptb_profiles SET ptb_profiles.user_id=ptb_profiles.id");
$query="INSERT INTO ptb_profiles_rates (id,
profile_id )
VALUES('NULL',
'NULL'
)";
mysql_query($query) or dieerr();
$result4 = mysql_query("UPDATE ptb_profiles_rates SET ptb_profiles_rates.profile_id=ptb_profiles_rates.id");
?>