小编Ale*_*een的帖子

对于较大的可点击区域,如何将<a>标记设置为其父<li>标记的大小?

我想这样做,以便标签上的可点击区域的大小LI.

我的HTML看起来像:

<li>
 <a href="#">Link</a>
</li>
Run Code Online (Sandbox Code Playgroud)

html css

40
推荐指数
3
解决办法
4万
查看次数

我应该/如何保护来自Web主机的源代码?

您是否担心您的网络主机可以访问您的所有文件并能够基本上下载您的整个网络应用程序?您可以采取哪些措施来保护自己?更具体地说,我有兴趣了解如何保护我对WordPress支持的网站所做的自定义开发?

php security wordpress web-hosting copy-protection

6
推荐指数
1
解决办法
1338
查看次数

如何将PHP常量插入SQL查询?

我有一个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)

php mysql sql

6
推荐指数
2
解决办法
8642
查看次数

如何使用PHP动态插入CSS类?

以下代码有什么问题?我想在<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)

css php css3

5
推荐指数
1
解决办法
3万
查看次数

如果我使用多种字体,是否可以将Google Web字体缩减为一个请求?

我在我的网站上进行了速度测试,其中一个建议是减少我的外部请求.我正在使用3个Google Web Fonts,实际上有3个单独的请求.是否可以将这些组合成1个请求?

performance fonts httpwebrequest webfonts google-webfonts

5
推荐指数
2
解决办法
2869
查看次数

是否可以将jQuery默认值从display:block更改为:toline-block to toggleing?

我正在使用jQuery来简单地切换<div>.我将项目设置为切换显示:inline; 在我的CSS中,它没有显示,当项目切换时,我在Chrome的Inspector中看到项目设置为display:block;

是否可以将此设置显示:内联块而不是?如果这还不够清楚,我会向你提供我的代码......我现在没碰巧遇到它.

html css jquery

3
推荐指数
1
解决办法
1865
查看次数

如何使用jQuery将HTML表转换为<div>?

我怎样才能将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)

html jquery

3
推荐指数
1
解决办法
1万
查看次数

我的PHP注册脚本有困难

当它遇到检查电子邮件和密码长度的一系列"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 mysql registration

-1
推荐指数
2
解决办法
208
查看次数