taint

(PECL taint >=0.1.0)

taintTaint a string

说明

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

Make a string tainted. This is used for testing purpose only.

参数

string

strings

返回值

Return TRUE if the transformation is done. Always return TRUE if the taint extension is not enabled.

添加备注

用户贡献的备注 5 notes

up
-3
ramon dot vanidoso at gmail dot com
3 years ago
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>
up
-4
ramon dot vanidoso at gmail dot com
3 years ago
I think the real problem u have is the use of bucle 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='Introducir un coche'><br>";
echo
"</form>";
echo
"<form action='borrar.php' method='GET'>";
echo
"<input type='submit' value='Borrar un coche'><br>";
echo
"</form>";
echo
"<form action='alugar.php' method='GET'>";
echo
"<input type='submit' value='Alugar un coche'><br>";
echo
"</form>";
echo
"<form action='desaluga.php' method='GET'>";
echo
"<input type='submit' value='Desalugar un coche'><br>";
echo
"</form>";
echo
"<form action='xestionFlota.php' method='GET'>";
echo
"<input type='submit' name='garda' value='Gardar o array nun ficheiro'><br>";
echo
"</form>";
echo
"<form action='xestionFlota.php' method='GET'>";
echo
"<input type='submit' name='ler' value='Ler o array dun ficheiro'><br>";
echo
"</form>";
echo
"<form action='xestionFlota.php' method='GET'>";
echo
"<input type='submit' name='del' value='Borrar e saír'><br>";
echo
"</form>";
echo
"Hai un total de ".vehiculo::$numVehiculos." vehículos en total na empresa, e un total de ".vehiculo::$numVehiculosAlugados." alugados<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
"O vehículo ".$vehiculo->getModelo()." con matrícula ".$vehiculo->getMatricula()." e ".$vehiculo->getKms()." kms<br>Imaxe: <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
"O vehículo ".$vehiculo->getModelo()." con matrícula ".$vehiculo->getMatricula()." e ".$vehiculo->getKms()." kms<br>Imaxe: <br><img width='200' height='100' src='imaxes/".$vehiculo->getImaxe().".jpg'><br>";
}
}
up
-4
ramon dot vanidoso at gmail dot com
3 years ago
I think the real problem u have is the use of bucle 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='Introducir un coche'><br>";
echo
"</form>";
echo
"<form action='borrar.php' method='GET'>";
echo
"<input type='submit' value='Borrar un coche'><br>";
echo
"</form>";
echo
"<form action='alugar.php' method='GET'>";
echo
"<input type='submit' value='Alugar un coche'><br>";
echo
"</form>";
echo
"<form action='desaluga.php' method='GET'>";
echo
"<input type='submit' value='Desalugar un coche'><br>";
echo
"</form>";
echo
"<form action='xestionFlota.php' method='GET'>";
echo
"<input type='submit' name='garda' value='Gardar o array nun ficheiro'><br>";
echo
"</form>";
echo
"<form action='xestionFlota.php' method='GET'>";
echo
"<input type='submit' name='ler' value='Ler o array dun ficheiro'><br>";
echo
"</form>";
echo
"<form action='xestionFlota.php' method='GET'>";
echo
"<input type='submit' name='del' value='Borrar e saír'><br>";
echo
"</form>";
echo
"Hai un total de ".vehiculo::$numVehiculos." vehículos en total na empresa, e un total de ".vehiculo::$numVehiculosAlugados." alugados<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
"O vehículo ".$vehiculo->getModelo()." con matrícula ".$vehiculo->getMatricula()." e ".$vehiculo->getKms()." kms<br>Imaxe: <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
"O vehículo ".$vehiculo->getModelo()." con matrícula ".$vehiculo->getMatricula()." e ".$vehiculo->getKms()." kms<br>Imaxe: <br><img width='200' height='100' src='imaxes/".$vehiculo->getImaxe().".jpg'><br>";
}
}
up
-4
Anonymous
3 years ago
The answer of your question is:

<?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 ('Usuario o contraseña incorrectos');
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 ('Usuario o contraseña incorrectos');
window.location='login.php';
</script>"
;}
}

}

if(isset(
$_SESSION['usuario'])){
//lo que se muestra na la pagina.
$conexion=mysqli_connect("localhost","root","","folla14")or die(mysqli_error());

if(
$conexion){
mysqli_set_charset($conexion,"UTF8");
echo
"
<input type='submit' value='Lista completa' name='listac'>
"
;}
}
else{
echo
"
<script>
alert ('Usuario o contraseña incorrectos');
window.location='login.php';
</script>"
;
}

?>
up
-5
else_2do at gmail dot com
3 years ago
<?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";
}
}

?>
To Top