此代码提交了一个表单,并且可以正常工作,但更改textarea的占位符除外 id=message
$('#submit').click(function(){
$.post("mail.php", $("#contact").serialize(), function(response) {
$('#message').attr('placeholder', response);
$('#success').html(response);
});
});
Run Code Online (Sandbox Code Playgroud)
Firebug中没有错误。
if (alev == 1) {
rb1 = apar;
}
else if (alev == 2) {
rb2 = apar;
}
else if (alev == 3) {
rb3 = apar;
}
else if (alev == 4) {
rb4 = apar;
}
else {
rb5 = apar
};
Run Code Online (Sandbox Code Playgroud)
我想有一个更短的方法来做到这一点.
alev是整数,rb始终以该整数结束.
在远程服务器上没有问题,但在localhost(xampp 3.1.)中,我无法关闭报告通知.
<?php
$Fname = $_POST["Fname"];
...
Run Code Online (Sandbox Code Playgroud)
结果:
Notice: Undefined index: Fname in D:\xampp\htdocs\xx\php01\form01.php on line 6
Run Code Online (Sandbox Code Playgroud)
php.ini中
; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
; Development Value: E_ALL
; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
; http://php.net/error-reporting
error_reporting = E_ALL & ~E_NOTICE //shouldn't this line turn off notice reporting ?
Run Code Online (Sandbox Code Playgroud)
有什么建议吗?
这很好用:
$stmt = $db->prepare('SELECT id, title, content FROM table_01 WHERE id = :id');
$stmt->execute(array(':id' => $_GET['id']));
$row = $stmt->fetch();
Run Code Online (Sandbox Code Playgroud)
但这会给出一个错误:
$table = "table_01";
$stmt = $db->prepare('SELECT id, title, content FROM'.$table.'WHERE id = :id');
Run Code Online (Sandbox Code Playgroud) <input type='file' name='inputfile' id='inputfile'>
Run Code Online (Sandbox Code Playgroud)
我正在尝试上传没有表单提交的图片 - 只需在输入file更改后:
$('#inputfile').change(function(){
$.ajax({
url: "pro-img-disk.php",
type: "POST",
data: new FormData('#inpufile'),
contentType: false,
cache: false,
processData:false,
success: function(data){
console.log(data);
}
});
});
Run Code Online (Sandbox Code Playgroud)
PHP
$src = $_FILES['inputfile']['tmp_name'];
$targ = "../images/".$_FILES['inputfile']['name'];
move_uploaded_file($src, $targ);
Run Code Online (Sandbox Code Playgroud)
错误:
Undefined index: inputfile...
有帮助吗?
我需要一些有关cardimg文件夹内图像的信息。
$arr = glob("../cardimg/*.jpg");
foreach ($arr as $item){
list($width, $height) = getimagesize($item);
echo $width . '<br>';
echo $height . '<br>';
}
Run Code Online (Sandbox Code Playgroud)
适用于宽度和高度,但不知道如何查看图像是 72 dpi 还是 300 dpi?
我的 php 正在7.0.20使用
print_r(imageresolution($item));
Run Code Online (Sandbox Code Playgroud)
结果是错误 - Call to undefined function
也就是有没有办法改变300dpi,以72dpi使用PHP?
悬停物品,你会看到wrap将调整大小悬停在第二个标题上.
怎么预防这个?
*{
margin:0;
padding:0;
box-sizing:border-box;
-moz-box-sizing:border-box;
-webkit-box-sizing:border-box;
}
.wrap{
position:fixed;
min-width:140px;
}
.title{
padding:3px 25px 3px 9px;
background:gold;
}
.title:hover{
border-right:10px solid lightseagreen;
}Run Code Online (Sandbox Code Playgroud)
<div class='wrap'>
<div class='title'>lorem</div>
<div class='title'>loremxxxxxxxxxxx</div>
<div class='title'>lorem</div>
<div class='title'>lorem</div>
</div>Run Code Online (Sandbox Code Playgroud)
var path = 'nts/test_01.txt';
div.load(path); // this works
var path = 'nts/test 01.txt';
div.load(path); // error - the file doesn't exists
Run Code Online (Sandbox Code Playgroud)
显然,空间是问题所在。
怎么解决这个问题呢?
我无法更改文件名。
URL of my site is:
http://mc.net46.net/ + folderName + fileName
Run Code Online (Sandbox Code Playgroud)
For example:
http://mc.net46.net/mc/file01.php
http://mc.net46.net/mx/file05.php
Run Code Online (Sandbox Code Playgroud)
folderName is always two characters long.
$address = 'http://mc.net46.net'.$_SERVER["REQUEST_URI"];
Run Code Online (Sandbox Code Playgroud)
result: http://mc.net46.net/mc/file01.php - ok
$fname = substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
Run Code Online (Sandbox Code Playgroud)
result: file01.php - ok
Two questions:
Is this the correct way to get $address and $fname ?
How to get folderName?
let m = 5;
m = m.padStart(2, '0');
Run Code Online (Sandbox Code Playgroud)
错误:
m.padStart is not a function
Run Code Online (Sandbox Code Playgroud)
期待的结果:05;
我使用的是最新版本的Chrome。
有什么帮助吗?