有可能做出这样的事吗?
// file.php
$string = require('otherfile.php');
echo $string;
// otherfile.php
<!DOCTYPE html>
<html>
<head><title>Test</title></head>
<body>
<?php require 'body.php';?>
</body>
</html>
// body.php
<p>Lorem ipsum something</p>
Run Code Online (Sandbox Code Playgroud)
得到这个输出?
<!DOCTYPE html>
<html>
<head><title>Test</title></head>
<body>
<p>Lorem ipsum something</p>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我知道代码不起作用,但我希望你理解我的意思.
可能重复:
PHP密码的安全散列和盐
我正在建立一个网站,我需要一个安全的算法来存储密码.我第一次想到bcrypt,但后来发现我的主机不支持它,我无法更改主机.
我的主机允许这种加密:
而这些哈希:
那么,你们中的任何人都能用这个和一个盐来修复一个好的算法吗?
我正在尝试使用simplexml_load_file()PHP函数加载一个gzip压缩文件,但我不知道如何解码它所以我可以使用它中的数据.
好吧,我在C#中的新手,但我需要创建一个简单的GUI,但我没有的Visual Studio(我用Geany和单声道).
问题是,当我尝试使用Google发现的以下代码时:
using System;
using System.Windows.Forms;
using System.ComponentModel;
using System.Drawing;
public class FirstForm : Form
{
private Container components;
private Label howdyLabel;
public FirstForm()
{
InitializeComponent();
}
private void InitializeComponent()
{
components = new Container ();
howdyLabel = new Label ();
howdyLabel.Location = new Point (12, 116);
howdyLabel.Text = "Howdy, Partner!";
howdyLabel.Size = new Size (267, 40);
howdyLabel.AutoSize = true;
howdyLabel.Font = new Font (
"Microsoft Sans Serif",
26, System.
Drawing.FontStyle.Bold);
howdyLabel.TabIndex = 0;
howdyLabel.Anchor = AnchorStyles.None;
howdyLabel.TextAlign = …
Run Code Online (Sandbox Code Playgroud) 我正在尝试加载的页面是这样的(尽管,"text"类的段落数量每次都不同):
<html>
<body>
<div id="container">
<p class="text">1</p>
<p class="text">2</p>
<p class="text">3</p>
<p class="text">4</p>
<p class="text">5</p>
<p class="text">6</p>
<p class="text">7</p>
<p class="text">8</p>
<p class="text">9</p>
<p class="text">10</p>
<p class="text">11</p>
<p class="text">12</p>
<p class="text">13</p>
<p class="text">14</p>
<p class="text">15</p>
<p class="text">16</p>
<p class="text">17</p>
<p class="text">18</p>
<p class="text">19</p>
<p class="text">20</p>
<p class="sometext">Some other text here</p>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
有可能只用jQuery加载前十个段落$('#text').load('other_file.html #container .p');
吗?
我有这个代码:
function get_id_from_coords (x, y)
{
x = parseInt(x);
y = parseInt(y);
if (x < 0)
{
x = (x + 6) * 60;
}
else
{
x = (x + 5) * 60;
}
if (y < 0)
{
y = (y + 6) * 60;
}
else
{
y = (y + 5) * 60;
}
$('#planets').children().each(function(){
if ($(this).attr('x') == x) {
if ($(this).attr('y') == y) {
alert (parseInt($(this).attr('id')));
return parseInt($(this).attr('id'));
}
}
});
}
alert(get_id_from_coords(x, y));
Run Code Online (Sandbox Code Playgroud)
但是,从这段代码我得到两个弹出窗口:首先,从函数内部,我得到正确的值(如63),但是当我提醒返回值时,我只是得到了未定义.
所以,我有一个这样的图像:http://imgur.com/qBGvP
它看起来总是那样,尽管数字可能不同.它是一个gif,背景是透明的,数字是白色的.
我需要一些方法来解析它在脚本中使用的数字.我有什么想法可以解决这个问题?
我正在寻找一种良好的单向加密/散列方法,可以使用我的主机提供的算法之一来安全地存储密码.
以下是主持人提供的所有算法列表:http://www.eresig.tk/hash.php