- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如标题:php 挂断我的代码
请告诉我为什么或者有什么问题
这是我的代码
<?php
$group = $_GET['group'] ;
$email = $_GET['email'] ;
include("../includes/config.php") ;
if($group != '')
{
$query = mysql_query(" SELECT email FROM users WHERE `group`='$group' ") ;
$emails = '' ;
while($res = mysql_num_rows($query))
{
$emails .= $res[0] ;
}
}
$emails .= $email ;
echo $emails ; die();
?>
While循环之前
我尝试检查我的查询,它没问题
循环后
服务器没有响应
我正在使用 php 5.2.6
最佳答案
为避免 SQL 注入(inject),您应该替换
$group = $_GET['group'] ;
对于
$group = mysql_real_escape_string($_GET['group']) ;
然后,您必须执行查询然后遍历结果集,而不是您正在做的是遍历结果中的行数(这对于每个结果集都是常量并且始终计算为真,创建无限循环)
$res = mysql_query($query);
while ($row = mysql_fetch_row($res)) {
$email .= $row[0];
}
关于php - 在我的代码中挂断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7712501/
这个问题已经有答案了: Can the HWND from CreateWindow/CreateDialog be GetMessage'd from another thread? (7 个回答)
作为我的应用程序的一部分,我需要阻止来电。也就是说,当我的应用程序正在运行时,我将挂断所有调用并简单地通知调用者用户正忙或类似的事情。 我想用android SDK做这个,希望能支持Android 2
我正在尝试在 Android 上使用 Asmack API 实现一个简单的 XMPP 信使。这是代码: private final String XMPP_SERVER = "jabber.o
我刚刚安装了 watir,在 exec 之后 require 'watir-webdriver' browser = Watir::Browser.new :firefox 它只是打开浏览器,但一直挂
我有一个简单的问题,我需要找到波形的峰值。现在,我在使用 scipy 库中的 find_peaks_cwt 方法之前已经完成了此操作。然而,在这种情况下,我的程序在尝试找到峰值时只是挂起。我认为这与波
我不确定我的程序在哪里/如何挂起。我非常有信心它是在发送或接收链接中......但即使在互联网上搜索一些帮助并从我的教授那里获得帮助后,我仍然迷失,至于为什么这不起作用。 #include #inc
我正在尝试通过 appcelerator studio 为 android 应用程序商店打包我的应用程序,但在处理 javascript 文件后,控制台显示此错误 2017-04-17T22:47:3
const https = require("https"); const fs = require("fs"); const options = { hostname: "en.wikipedi
我有一个使用 Twilio 运行的应用程序。这个想法是你将调用一个电话号码,twilio 会接听并为你提供菜单选项。一旦你按下一个数字,它就会提交发布数据然后挂断(这部分工作正常)答案...我在他们的
Java 解决方案不是问题: public boolean killCall(Context context) { try { // Get the boring old Te
我试图在我的服务器上运行 jenkins,但我总是收到相同的消息,然后等待,等待,什么也没有。在官方网站上他们报告了这个问题,但我想问问是否有人知道如何解决这个问题,知道吗? 最佳答案 因为对我来说采
您好,在给定大量 json 对象的情况下,我在 NodeJS 上执行 HTTP 请求时遇到问题。给定小的 json 对象数组,请求工作正常。但是,如果我尝试增加 json 数组的大小,我会收到错误:套
我真的不知道发生了什么,直到今天早上我才检查这一切是否正常。我在 IDE 中看到的唯一异常(exception)是这个 IndexNotReadyException: Please change ca
我正在制作一个 ASP.NET (C#) 应用程序,它基本上是运行 Powershell 脚本以执行日常管理任务的网关。其中一些脚本使用 ActiveDirectory RSAT 模块,我发现其中一些
我是一名优秀的程序员,十分优秀!