isset

PHP Web 木马扫描器

这一生的挚爱 提交于 2019-11-26 23:27:35
直接放在网站根目录运行即可 <?php /**************PHP Web木马扫描器************************/ /* [+] 版本: v1.0 */ /* [+] 功能: web版php木马扫描工具 */ /* [+] 注意: 扫描出来的文件并不一定就是后门, */ /* 请自行判断、审核、对比原文件。 */ /* 如果你不确定扫出来的文件是否为后门, */ /* 欢迎你把该文件发给我进行分析。 */ /*******************************************************/ ob_start(); set_time_limit(0); $username = "t00ls"; //设置用户名 $password = "t00ls"; //设置密码 $md5 = md5(md5($username).md5($password)); $version = "PHP Web木马扫描器 v1.0"; $realpath = realpath('./'); $selfpath = $_SERVER['PHP_SELF']; $selfpath = substr($selfpath, 0, strrpos($selfpath,'/')); define('REALPATH', str_replace('//','/'

CodeIgniter 结合phpcms模板功能

限于喜欢 提交于 2019-11-26 18:59:37
用了CodeIgniter框架几个月,之前一直习惯用phpcms 来做网站底层框架,后来发现在CodeIgniter 更加适合小站点应用开发,但是他自带的view功能,并不强大了,相反很吃力。 相比之下phpcms的view模板解析就强大多了,结合之前做的一个项目,特地将增强的代码copy出来。 在CodeIgniter libraries中 增加 template_cache.php <?php if (!defined( ' BASEPATH ' )) exit( ' No direct script access allowed ' ); /* * * 模板解析缓存 */ final class template_cache { public $cache_path; public function __construct() { // $CI =& get_instance(); $ this ->cache_path = APPPATH. ' views ' ; } /* * * 编译模板 * * @param $module 模块名称 * @param $template 模板文件名 * @param $istag 是否为标签模板 * @return unknown */ public function template_compile($module,

isset() function is returning true even when item is not set

梦想的初衷 提交于 2019-11-26 18:35:53
问题 Here is my code. For some reason, if I submit the form without placing and passwords in, it still creates the database entry. There are some comments scattered throughout the code, but the code is fairly straightforward. Any ideas? <?php //signup.php include 'connect.php'; include 'header.php'; echo '<h3>Sign up</h3>'; if($_SERVER['REQUEST_METHOD'] != 'POST') { /*The form hasn't been posted yet, display it note that the action="" will cause the form to post to the same page it is on */ echo '

PHP shorthand for isset()? [duplicate]

元气小坏坏 提交于 2019-11-26 17:59:07
问题 This question already has answers here : What is the PHP shorthand for: print var if var exist (11 answers) Closed 6 years ago . Is there a shorthand way to assign a variable to something if it doesn't exist in PHP? if(!isset($var) { $var = ""; } I'd like to do something like $var = $var | ""; 回答1: Update for PHP 7 (thanks shock_gone_wild) PHP 7 introduces the so called null coalescing operator which simplifies the below statements to: $var = $var ?? "default"; Before PHP 7 No, there is no

In where shall I use isset() and !empty()

纵然是瞬间 提交于 2019-11-26 17:12:48
I read somewhere that the isset() function treats an empty string as TRUE , therefore isset() is not an effective way to validate text inputs and text boxes from a HTML form. So you can use empty() to check that a user typed something. Is it true that the isset() function treats an empty string as TRUE ? Then in which situations should I use isset() ? Should I always use !empty() to check if there is something? For example instead of if(isset($_GET['gender']))... Using this if(!empty($_GET['gender']))... dassouki isset vs. !empty FTA: "isset() checks if a variable has a value including (False,

Delete multiple rows by selecting checkboxes using PHP

女生的网名这么多〃 提交于 2019-11-26 15:24:26
I want to delete multiple rows from MYSQL database. I have created this delete.php file to select various links and delete them using checkboxes. <html> <head> <title>Links Page</title> </head> <body> <h2>Choose and delete selected links.</h2> <?php $dbc = mysqli_connect('localhost','root','admin','sample') or die('Error connecting to MySQL server'); $query = "select * from links ORDER BY link_id"; $result = mysqli_query($dbc,$query) or die('Error querying database'); $count=mysqli_num_rows($result); ?> <table width="400" border="0" cellspacing="1" cellpadding="0"> <tr> <td><form name="form1"

Best way to test for a variable&#39;s existence in PHP; isset() is clearly broken

天涯浪子 提交于 2019-11-26 12:41:08
From the isset() docs : isset() will return FALSE if testing a variable that has been set to NULL. Basically, isset() doesn't check for whether the variable is set at all, but whether it's set to anything but NULL . Given that, what's the best way to actually check for the existence of a variable? I tried something like: if(isset($v) || @is_null($v)) (the @ is necessary to avoid the warning when $v is not set) but is_null() has a similar problem to isset() : it returns TRUE on unset variables! It also appears that: @($v === NULL) works exactly like @is_null($v) , so that's out, too. How are we

If isset $_POST

好久不见. 提交于 2019-11-26 12:05:14
I have a form on one page that submits to another page. There, it checks if the input mail is filled. If so then do something and if it is not filled, do something else. I don't understand why it always says that it is set, even if I send an empty form. What is missing or wrong? step2.php: <form name="new user" method="post" action="step2_check.php"> <input type="text" name="mail"/> <br /> <input type="password" name="password"/><br /> <input type="submit" value="continue"/> </form> step2_check: if (isset($_POST["mail"])) { echo "Yes, mail is set"; } else { echo "N0, mail is not set"; }

Calling a particular PHP function on form submit

ぃ、小莉子 提交于 2019-11-26 12:00:40
问题 I was trying to call a particular php function in submit of a form both the form and php scripts are in same page. My code is below.(it is not working and so I need help) <html> <body> <form method=\"post\" action=\"display()\"> <input type=\"text\" name=\"studentname\"> <input type=\"submit\" value=\"click\"> </form> <?php function display() { echo \"hello\".$_POST[\"studentname\"]; } ?> </body> </html> 回答1: In the following line <form method="post" action="display()"> the action should be

JavaScript isset() equivalent

时光总嘲笑我的痴心妄想 提交于 2019-11-26 11:26:37
In PHP you can do if(isset($array['foo'])) { ... } . In JavaScript you often use if(array.foo) { ... } to do the same, but this is not exactly the same statement. The condition will also evaluate to false if array.foo does exists but is false or 0 (and probably other values as well). What is the perfect equivalent of PHP's isset in JavaScript? In a broader sense, a general, complete guide on JavaScript's handling of variables that don't exist, variables without a value, etc. would be convenient. CMS I generally use the typeof operator: if (typeof obj.foo !== 'undefined') { // your code here }