我有两个箭头设置,点击第二天,接下来的两天,很快和前一天,两天前,很快.代码似乎不起作用?因为它只能获得下一天和前一天.
<a href="home.php?date=<?= date('Y-m-d', strtotime('-1 day', strtotime($date))) ?>" class="prev_day" title="Previous Day" ></a>
<a href="home.php?date=<?= date('Y-m-d', strtotime('+1 day', strtotime($date))) ?>" class="next_day" title="Next Day" ></a>
Run Code Online (Sandbox Code Playgroud)
有没有办法,如果我点击下一个按钮,日期将连续更改为第二天.一会儿它只会提前一天
我想将价格降低到所有div中的所有输入值,只有一个除外div sale_wrap
.如何使用jquery进行异常处理?
<div id="one_wrap">
<input type="checkbox" name="1" value="">
<input type="checkbox" name="1" value="">
</div>
<div id="two_wrap">
<input type="checkbox" name="2" value="">
<input type="checkbox" name="2" value="">
</div>
<div id="sale_wrap">
<input type="checkbox" name="3" value="">
</div>
Run Code Online (Sandbox Code Playgroud)
jQuery的:
if($("div").attr("id") != "sale_wrap") {
t_balance;
} else {
var sale = t_balance*((100-window.discount_p)/100);
t_balance = sale;
}
Run Code Online (Sandbox Code Playgroud) 我从这个链接http://www.gaijin.at/en/scrphpfilelist.php获得了php list目录脚本.如何从directoy中删除单个文件?我试过unlink
,但它删除了该目录中的所有文件.这是我从链接获得的短代码!
while ($file = readdir ($hDir)) {
if ( ($file != '.') && ($file != '..') && (substr($file, 0, 1) != '.') &&
(strtolower($file) != strtolower(substr($DescFile, -(strlen($file))))) &&
(!IsFileExcluded($Directory.'/'.$file))
) {
array_push($FilesArray, array('FileName' => $file,
'IsDir' => is_dir($Directory.'/'.$file),
'FileSize' => filesize($Directory.'/'.$file),
'FileTime' => filemtime($Directory.'/'.$file)
));
}
}
$BaseDir = '../_cron/backup';
$Directory = $BaseDir;
foreach($FilesArray as $file) {
$FileLink = $Directory.'/'.$file['FileName'];
if ($OpenFileInNewTab) $LinkTarget = ' target="_blank"'; else $LinkTarget = '';
echo '<a href="'.$FileLink.'">'.$FileName.'</a>';
echo '<a …
Run Code Online (Sandbox Code Playgroud) 我不知道,我的代码中有什么不对.我尝试获取最新的插入ID,它回显0?任何的想法?
public function __construct() {
$this->mysqli = new mysqli(MYSQLI_SERVER, MYSQLI_USER, MYSQLI_PWD, MYSQLI_DBNAME) or die ('Error with connecting to the database!');;
}
public function insert_id(){
return $this->mysqli->insert_id;
}
$db->query("INSERT INTO user(f_name, l_name) VALUES('$f_name', '$l_name')");
var_dump($db->insert_id()); // return 0?
Run Code Online (Sandbox Code Playgroud) 如何拆分URL然后获取其值并将值存储在每个文本输入上?
网址:
other.php?add_client_verify&f_name=test&l_name=testing&dob_day=03&dob_month=01&dob_year=2009&gender=0&house_no=&street_address=&city=&county=&postcode=&email=&telp=234&mobile=2342&newsletter=1&deposit=1
Run Code Online (Sandbox Code Playgroud)
PHP:
$url = $_SERVER['QUERY_STRING'];
$para = explode("&", $url);
foreach($para as $key => $value){
echo '<input type="text" value="" name="">';
}
Run Code Online (Sandbox Code Playgroud)
上面的代码将返回:
l_name=testing
dob_day=3
doby_month=01
....
Run Code Online (Sandbox Code Playgroud)
我尝试了另一种方法:
$url = $_SERVER['QUERY_STRING'];
$para = explode("&", $url);
foreach($para as $key => $value){
$p = explode("&", $value);
foreach($p as $key => $val) {
echo '<input type="text" value="" name="">';
}
}
Run Code Online (Sandbox Code Playgroud) 如何检查日期是否是星期六.
<input id="datePicker" name="datePicker" type="text" class="textinput date-pick">
Run Code Online (Sandbox Code Playgroud)
我的代码:
if(date('Y-m-d', strtotime('this Saturday')) == $_SESSION['search_date']) {
echo 'Event this saturday';
} else {
echo 'Event on the others day';
}
Run Code Online (Sandbox Code Playgroud)
上面的代码只响应下周的事件!如果我搜索一周后或三周等,是不是显示结果?
如何在没有数字键的情况下推送新阵列?
$array = array('connect' => array('mydomain.com' => 1.99) );
$new_array['mynewdomain.com'] = 2.99;
array_push($array['connect'], $new_array);
Run Code Online (Sandbox Code Playgroud)
目前返回:
Array
(
[connect] => Array
(
[mydomain.com] => 1.99
[0] => Array
(
[mynewdomain.com] => 2.99
)
)
)
Run Code Online (Sandbox Code Playgroud)
我期待以下输出:
Array
(
[connect] => Array
(
[mydomain.com] => 1.99
[mynewdomain.com] => 2.99
)
)
Run Code Online (Sandbox Code Playgroud) 我如何计算总数rel value
?如果选中一个复选框,则总计将自动更新
我如何获得dropdown rel ="30"值?
<select id="t_dermal_name">
<option value="1" rel="30">Between Eyebrows</option>
<option value="7" rel="30">Individual Line Softening</option>
<option value="2" rel="30">Lip Contouring</option>
</select>
Run Code Online (Sandbox Code Playgroud)
jQuery的:
$("#t_dermal_name").change(onSelectChange);
function onSelectChange(){
var selected = $("#t_dermal_name option:selected");
var output = "";
if(selected.val() != 0){
output = selected.rel();
}
$("#output").html(output);
}
Run Code Online (Sandbox Code Playgroud) 如何禁用onclick事件?
我试过了onclick="this.disabled=true;"
,但它不起作用.
这是一个HTML表格:
<table>
<tr>
<td onclick="parent.location='home.php'">Available</td>
<td onclick="parent.location='home.php'">Available</td>
</tr>
<tr>
<td onclick="parent.location='home.php'"><div onclick="this.disabled=true;">Booked</div></td>
<td onclick="parent.location='home.php'">Available</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
使用上面的代码它仍然是home.php,即使我点击标记为"Booked"的表格单元格.
php ×6
jquery ×3
arrays ×2
checkbox ×1
class ×1
date ×1
events ×1
foreach ×1
html-table ×1
if-statement ×1
javascript ×1
mysqli ×1
onclick ×1
parameters ×1
url ×1