我有一个注册表单,其中输入的标题位于文本框中,当您单击该框时,文本消失,但是在密码上我希望预览文本保留为"密码"而不是"•• ••••••".但是当用户点击文本框时应该清除文本,并且输入的文本应该是"•••••••".
这是按钮的代码:
<form method="post" action="register_process.php">
<input type="text" class="button" value="USERNAME" onclick="this.value='';this.onclick='test';this.style.color='#000';" onfocus="if (this.value == 'USERNAME') {this.value = '';}" onblur="if (this.value == '') {this.value = 'USERNAME';}" name="username" />
<input type="text" class="button" value="EMAIL" onclick="this.value='';this.onclick='test';this.style.color='#000';" onfocus="if (this.value == 'EMAIL') {this.value = '';}" onblur="if (this.value == '') {this.value = 'EMAIL';}" name="email" />
<input type="text" class="button" value="PASSWORD" onclick="this.value='';this.onclick='test';this.style.color='#000';" onfocus="if (this.value == 'PASSWORD') {this.value = '';}" onblur="if (this.value == '') {this.value = 'PASSWORD';}" name="password" />
<input type="text" class="button" value="PASSWORD CONFIRM" onclick="this.value='';this.onclick='test';this.style.color='#000';" onfocus="if (this.value == 'PASSWORD CONFIRM') …Run Code Online (Sandbox Code Playgroud) 我正在创建一个配置文件图像上传器,用户可以在其中选择一个文件并上传它,但我收到此错误:
Warning: move_uploaded_file(user_files/profile_img/c3487ff77d.jpg) [function.move- uploaded-file]: failed to open stream: Permission denied in /Applications/XAMPP/xamppfiles/htdocs/projects/lr/core/functions/users.php on line 4
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/Applications/XAMPP/xamppfiles/temp/phpi0WECJ' to 'user_files/profile_img/c3487ff77d.jpg' in /Applications/XAMPP/xamppfiles/htdocs/projects/lr/core/functions/users.php on line 4
Run Code Online (Sandbox Code Playgroud)
第二到第五行是:
function change_profile_image($user_id, $file_temp, $file_extn) {
$file_path = 'user_files/profile_img/' . substr(md5(time()), 0, 10) . '.' . $file_extn;
move_uploaded_file($file_temp, $file_path);
}
Run Code Online (Sandbox Code Playgroud)
在loggedin.php文件中的其余部分是:
if (isset($_FILES['profile_img']) === true) {
if (empty($_FILES['profile_img']['name']) === true) {
echo 'Please choose a file!';
} else {
$allowed = array('jpg', 'jpeg', 'png');
$file_name = $_FILES['profile_img']['name'];
$file_extn = strtolower(end(explode('.', …Run Code Online (Sandbox Code Playgroud)