taint

(PECL taint >=0.1.0)

taint污染字符串

描述

taint(string &$string, string ...$strings): bool

使字符串被污染。这仅用于测试目的。

参数

string

strings

返回值

如果转换完成,则返回 TRUE。如果未启用污染扩展,则始终返回 TRUE。

添加注释

用户贡献的注释 6 个注释

-3
ramon dot vanidoso at gmail dot com
3 年前
if (isset($_GET['aluga'])) {
foreach ($_SESSION['flota'] as $id=>$vehiculo) {
if($vehiculo->getMatricula()==($_GET['mat'])){
$indice=$id;
$dias=$_GET['dias'];
$_SESSION['flota'][$indice]->aluga($dias);
}
}
foreach ($_SESSION['flota'] as $id=>$vehiculo) {
if($vehiculo->getDiasAlugado() > 1 ){
echo "O vehículo ".$vehiculo->getModelo()." con matrícula ".$vehiculo->getMatricula()." foi alugado durante ".$vehiculo->getDiasAlugado()." días <br>Imaxe: <br><img width='200' height='100' src='imaxes/".$vehiculo->getImaxe().".jpg'><br>";
}
}
}
if (isset($_GET['desalugar'])) {
foreach ($_SESSION['flota'] as $id=>$vehiculo) {
if($vehiculo->getMatricula()==($_GET['mat'])){
$indice=$id;
$kms=$_GET['kms'];
$_SESSION['flota'][$indice]->devolveAlugado($kms);
}
}
foreach ($_SESSION['flota'] as $id=>$vehiculo) {
if($_GET['mat'])
echo "O vehículo ".$vehiculo->getModelo()." con matrícula ".$vehiculo->getMatricula()." terminou o período de alugamento con un total de ".$vehiculo->getKms()." kms<br>Imaxe: <br><img width='200' height='100' src='imaxes/".$vehiculo->getImaxe().".jpg'><br>";
}
}
if (isset($_GET['garda'])) {
$fich=fopen('flota.txt',"w");
$XD=serialize($_SESSION['flota']);
fwrite($fich,$XD);
fclose($fich);
}
if (isset($_GET['ler'])) {
$fich=fopen('flota.txt',"r");
$lerarray=fread($fich,filesize('flota.txt'));
$_SESSION['flota']=unserialize($lerarray);
foreach ($_SESSION['flota'] as $key => $coche) {
echo "Matrícula: ".$coche->getMatricula()."<br>Modelo: ".$coche->getModelo()."<br>KMS: ".$coche->getKms()." km <br>";
}
fclose($fich);

}
if (isset($_GET['del'])) {
unset($_SESSION['flota']);
session_destroy();
}
?>
</body>
</html>
-5
else_2do at gmail dot com
3 年前
<?php

class nave {
private
$nome;
private
$prezoDiario;
private
$alugado;
private
$nomeImaxe;

function
__construct($nome,$prezoDiario,$nomeImaxe){
$this->nome=$nome;
$this->prezoDiario=$prezoDiario;
$this->alugado="no";
$this->nomeImaxe=$nomeImaxe;
}
function
getNome(){
return
$this->nome;
}
function
getPrezodiario(){
return
$this->prezoDiario;
}
function
getAlugado(){
return
$this->alugado;
}
function
getNomeimaxe(){
return
$this->nomeImaxe;
}
function
alugar(){
return
$this->alugado="si";
}
function
desalugar(){
$this->alugado="no";
}
}

?>
-4
ramon dot vanidoso at gmail dot com
3 年前
我认为您遇到的真正问题是使用循环 for

<?php
require 'vehiculos.class.php';
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>

<?php
echo "<form action='introducir.php' method='GET'>";
echo
"<input type='submit' value='添加一辆车'><br>";
echo
"</form>";
echo
"<form action='borrar.php' method='GET'>";
echo
"<input type='submit' value='删除一辆车'><br>";
echo
"</form>";
echo
"<form action='alugar.php' method='GET'>";
echo
"<input type='submit' value='租用一辆车'><br>";
echo
"</form>";
echo
"<form action='desaluga.php' method='GET'>";
echo
"<input type='submit' value='退租一辆车'><br>";
echo
"</form>";
echo
"<form action='xestionFlota.php' method='GET'>";
echo
"<input type='submit' name='garda' value='将数组保存在文件中'><br>";
echo
"</form>";
echo
"<form action='xestionFlota.php' method='GET'>";
echo
"<input type='submit' name='ler' value='从文件中读取数组'><br>";
echo
"</form>";
echo
"<form action='xestionFlota.php' method='GET'>";
echo
"<input type='submit' name='del' value='删除并退出'><br>";
echo
"</form>";
echo
"公司共有 ".vehiculo::$numVehiculos." 辆车,其中 ".vehiculo::$numVehiculosAlugados." 辆被租用<br>";
if(! isset(
$_SESSION['flota'])){
$flota = array();
$_SESSION['flota']=$flota;
}
if (isset(
$_GET['intro'])) {
$novoVehiculo = new vehiculo ($_GET['mat'],$_GET['mod'],$_GET['kms'],$_GET['imaxe']);
$_SESSION['flota'][]=$novoVehiculo;
foreach (
$_SESSION['flota'] as $id=>$vehiculo) {
echo
"该车为 ".$vehiculo->getModelo().",车牌号为 ".$vehiculo->getMatricula().",行驶了 ".$vehiculo->getKms()." 公里<br>图片:<br><img width='200' height='100' src='imaxes/".$vehiculo->getImaxe().".jpg'><br>";
}
}
if (isset(
$_GET['borrar'])) {
foreach (
$_SESSION['flota'] as $id=>$vehiculo) {
if(
$vehiculos->getMatricula()==($_GET['mat'])){
$indice=$id;
unset(
$_SESSION['flota'][$indice]);
$_SESSION['flota']=array_values($_SESSION['flota']);
}
}
foreach (
$_SESSION['flota'] as $id=>$vehiculo) {
echo
"该车为 ".$vehiculo->getModelo().",车牌号为 ".$vehiculo->getMatricula().",行驶了 ".$vehiculo->getKms()." 公里<br>图片:<br><img width='200' height='100' src='imaxes/".$vehiculo->getImaxe().".jpg'><br>";
}
}
-4
ramon dot vanidoso at gmail dot com
3 年前
我认为您遇到的真正问题是使用循环 for

<?php
require 'vehiculos.class.php';
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>

<?php
echo "<form action='introducir.php' method='GET'>";
echo
"<input type='submit' value='添加一辆车'><br>";
echo
"</form>";
echo
"<form action='borrar.php' method='GET'>";
echo
"<input type='submit' value='删除一辆车'><br>";
echo
"</form>";
echo
"<form action='alugar.php' method='GET'>";
echo
"<input type='submit' value='租用一辆车'><br>";
echo
"</form>";
echo
"<form action='desaluga.php' method='GET'>";
echo
"<input type='submit' value='退租一辆车'><br>";
echo
"</form>";
echo
"<form action='xestionFlota.php' method='GET'>";
echo
"<input type='submit' name='garda' value='将数组保存在文件中'><br>";
echo
"</form>";
echo
"<form action='xestionFlota.php' method='GET'>";
echo
"<input type='submit' name='ler' value='从文件中读取数组'><br>";
echo
"</form>";
echo
"<form action='xestionFlota.php' method='GET'>";
echo
"<input type='submit' name='del' value='删除并退出'><br>";
echo
"</form>";
echo
"公司共有 ".vehiculo::$numVehiculos." 辆车,其中 ".vehiculo::$numVehiculosAlugados." 辆被租用<br>";
if(! isset(
$_SESSION['flota'])){
$flota = array();
$_SESSION['flota']=$flota;
}
if (isset(
$_GET['intro'])) {
$novoVehiculo = new vehiculo ($_GET['mat'],$_GET['mod'],$_GET['kms'],$_GET['imaxe']);
$_SESSION['flota'][]=$novoVehiculo;
foreach (
$_SESSION['flota'] as $id=>$vehiculo) {
echo
"该车为 ".$vehiculo->getModelo().",车牌号为 ".$vehiculo->getMatricula().",行驶了 ".$vehiculo->getKms()." 公里<br>图片:<br><img width='200' height='100' src='imaxes/".$vehiculo->getImaxe().".jpg'><br>";
}
}
if (isset(
$_GET['borrar'])) {
foreach (
$_SESSION['flota'] as $id=>$vehiculo) {
if(
$vehiculos->getMatricula()==($_GET['mat'])){
$indice=$id;
unset(
$_SESSION['flota'][$indice]);
$_SESSION['flota']=array_values($_SESSION['flota']);
}
}
foreach (
$_SESSION['flota'] as $id=>$vehiculo) {
echo
"该车为 ".$vehiculo->getModelo().",车牌号为 ".$vehiculo->getMatricula().",行驶了 ".$vehiculo->getKms()." 公里<br>图片:<br><img width='200' height='100' src='imaxes/".$vehiculo->getImaxe().".jpg'><br>";
}
}
-4
匿名
3 年前
你的问题的答案是

<?php
session_start
();
session_destroy();
?>
<meta charset="UTF-8">
<html>
<form method="GET" action="datos.php">
<?php
if(isset($_GET['usuario'])){
if(
strcmp("ana",$_GET['usuario'])==0){
if(
strcmp("abc123.",$_GET['contraseña'])==0){
$_SESSION['usuario']=$_GET['usuario'];
}
else{
echo
"
<script>
alert ('用户名或密码错误');
window.location='login.php';
</script>"
;}
}

if(
strcmp("xan",$_GET['usuario'])==0){
if(
strcmp("abc123.",$_GET['contraseña'])==0){
$_SESSION['usuario']=$_GET['usuario'];
}
else{
echo
"
<script>
alert ('用户名或密码错误');
window.location='login.php';
</script>"
;}
}

}

if(isset(
$_SESSION['usuario'])){
// 在页面中显示。
$conexion=mysqli_connect("localhost","root","","folla14")or die(mysqli_error());

if(
$conexion){
mysqli_set_charset($conexion,"UTF8");
echo
"
<input type='submit' value='完整列表' name='listac'>
"
;}
}
else{
echo
"
<script>
alert ('用户名或密码错误');
window.location='login.php';
</script>"
;
}

?>
-6
primerito_carlos at gmail dot com
3 年前
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<form method="GET" action="opcions.php">
<p>用户名</p>
<input type="text" name="usu"><br>
<p>密码</p>
<input type="password" name="con"><br>
<input type="submit" name="enviar" value="提交">
</form>
</body>
</html>
<?php
@session_start();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<?php
$usu
=$_GET["usu"];
$con=$_GET["con"];
if ((
$usu=="Xan" && $con=="abc123.") OR ($usu=="Ana" && $con=="abc123.")){
$SESSION["usu"]=$usu;
echo
"用户正确<br>";
$conexion=mysqli_connect("192.168.2.201","exame","abc123.","musica");
if (
$conexion != FALSE) {
echo
"已连接到数据库";

echo
"<form method='GET' action='lista.php'><br>
<input type='submit' name='completo' value='列出所有专辑'>
<input type='submit' name='orden_titulo' value='按标题排序列出'>
<input type='submit' name='orden_autor' value='按作者排序列出'>
<select name='Autor'>
<option>Beatles</option>
<option>Rolling</option>
<option>xxx</option>
<input type='submit' name='Enviar'>
</select>
</form>"
;
if(
$usu=="Ana"){
echo
"<br>
<input type='submit'name='engadir' value='添加记录'>
<input type='submit'name='editar' value='编辑记录'>
<input type='submit'name='eliminar' value='删除记录'>
</form>"
;
}
}
}else{
echo
"用户错误";
}
echo
"<form method='GET' action='login.php'>
<input type='submit' name='volver' value='返回登录'"
;
?>
</body>
</html>
--------------
<article id="contenedor">
<?php
$conexion
=mysqli_connect("192.168.2.201","exame","abc123.","musica");
if (
$conexion) {
if (isset(
$_GET['completo'])) {
$consulta="SELECT * FROM tema";
}
elseif (isset(
$_GET['orden_titulo'])) {
$consulta="SELECT * FROM tema ORDER BY Titulo";
}
elseif (isset(
$_GET['orden_autor'])) {
$consulta="SELECT * FROM tema ORDER BY Autor";
}
elseif (isset(
$_GET['Autor'])) {
if (
$_GET['Autor']=="The Beatles") {
$consulta="SELECT * FROM tema WHERE Autor='The Beatles'";
}
}
$resultado=mysqli_query($conexion,$consulta);
if (
$resultado!=FALSE) {
while (
$fila=mysqli_fetch_array($resultado)) {
echo
"<div class='produto'><img src='imaxes/$fila[Imaxe].jpg'><br>$fila[Titulo]><br>$fila[Autor]<br>$fila[Ano]<br></div>";
}
}
echo
"<form method='GET' action='opcions.php'>
<input type='submit' value='volver'/>"
;
?>
</article>
}
?>
To Top