我想这样做,以便标签上的可点击区域的大小LI.
我的HTML看起来像:
<li>
<a href="#">Link</a>
</li>
Run Code Online (Sandbox Code Playgroud) 您是否担心您的网络主机可以访问您的所有文件并能够基本上下载您的整个网络应用程序?您可以采取哪些措施来保护自己?更具体地说,我有兴趣了解如何保护我对WordPress支持的网站所做的自定义开发?
我有一个PHP文件,我的数据库配置设置被定义为常量,例如:
<?php
define(DB_HOST,"localhost");
define(DB_USERNAME,"root");
define(DB_PASSWORD,"password");
define(DB_NAME,"db_users");
define(DB_TABLE_1,"table_1");
define(DB_TABLE_2,"table_2);
?>
Run Code Online (Sandbox Code Playgroud)
每当我想连接到我的数据库时,我显然都包含上面的文件.但是,当我将表定义常量插入SQL查询(见下文)时,它似乎不起作用.我是否需要正确地逃避常量或以某种方式连接它?
$query = "SELECT users FROM DB_TABLE_1";
Run Code Online (Sandbox Code Playgroud) 以下代码有什么问题?我想在<li>单击相应元素时动态插入"当前"CSS类.谢谢!
<?php
$pg = $_SERVER['PHP_SELF'];
?>
<section>
<aside>
<nav>
<ul>
<li class="<?php if($pg == 'index.php?page=about.php'){echo 'current';} ?>"><a href="index.php?page=about.php">About</a></li>
<li class=""><a href="">Services</a></li>
</ul>
</nav>
</aside>
<section>
Run Code Online (Sandbox Code Playgroud) 我在我的网站上进行了速度测试,其中一个建议是减少我的外部请求.我正在使用3个Google Web Fonts,实际上有3个单独的请求.是否可以将这些组合成1个请求?
我正在使用jQuery来简单地切换<div>.我将项目设置为切换显示:inline; 在我的CSS中,它没有显示,当项目切换时,我在Chrome的Inspector中看到项目设置为display:block;
是否可以将此设置显示:内联块而不是?如果这还不够清楚,我会向你提供我的代码......我现在没碰巧遇到它.
我怎样才能将HTML表格(我将在下面提供代码)转换为<div>元素?简而言之,我使用的是一个将内容输出到HTML表格中的PHP脚本,事实证明编辑PHP并将表格元素转换为非常困难<div>.下面是HTML表格代码:
<table><tbody><tr data-marker="0"><td class="mapp-marker"><img class="mapp-icon" src="http://www.walmartchicago.com/wp-content/plugins/mappress-google-maps-for-wordpress/icons/walmart-yellow.png"></td><td><b>Walmart Neighborhood Market<br></b><a href="#" class="poi_list_directions">Get Directions</a></td></tr><tr data-marker="1"><td class="mapp-marker"><img class="mapp-icon" src="http://www.walmartchicago.com/wp-content/plugins/mappress-google-maps-for-wordpress/icons/walmart-red.png"></td><td><b>Walmart Express<br></b><a href="#" class="poi_list_directions">Get Directions</a></td></tr><tr data-marker="2"><td class="mapp-marker"><img class="mapp-icon" src="http://www.walmartchicago.com/wp-content/plugins/mappress-google-maps-for-wordpress/icons/walmart-red.png"></td><td><b>Walmart Express<br></b><a href="#" class="poi_list_directions">Get Directions</a></td></tr><tr data-marker="3"><td class="mapp-marker"><img class="mapp-icon" src="http://www.walmartchicago.com/wp-content/plugins/mappress-google-maps-for-wordpress/icons/walmart-blue.png"></td><td><b>Walmart Supercenter<br></b><a href="#" class="poi_list_directions">Get Directions</a></td></tr><tr data-marker="4"><td class="mapp-marker"><img class="mapp-icon" src="http://www.walmartchicago.com/wp-content/plugins/mappress-google-maps-for-wordpress/icons/walmart-blue.png"></td><td><b>Walmart Supercenter<br></b><a href="#" class="poi_list_directions">Get Directions</a></td></tr></tbody></table>
Run Code Online (Sandbox Code Playgroud) 当它遇到检查电子邮件和密码长度的一系列"if"语句时,这个脚本似乎挂断了.如果我删除这些语句,它会正确地将数据插入到数据库中.
<?php
ob_start();
session_start();
if (!empty($_POST['email']) && !empty($_POST['password']) && !empty($_POST['confirmpassword'])) {
$email = strip_tags($_POST['email']);
$password = md5(strip_tags($_POST['password']));
$confirmpassword = md5(strip_tags($_POST['confirmpassword']));
$errors = array();
if (strlen($email) < 6) {
$errors[] = "Email too short.";
}
if (strlen($email) > 25) {
$errors[] = "Email too long.";
}
if (strlen($password) < 2) {
$errors[] = "Password too short.";
}
if (strlen($password) > 25) {
$errors[] = "Password too short.";
}
if ($password !== $confirmpassword) {
$errors[] = "Passwords do not match.";
}
if …Run Code Online (Sandbox Code Playgroud) php ×4
css ×3
html ×3
jquery ×2
mysql ×2
css3 ×1
fonts ×1
performance ×1
registration ×1
security ×1
sql ×1
web-hosting ×1
webfonts ×1
wordpress ×1