Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/07/2011, 07:31
marcelo0856
 
Fecha de Ingreso: diciembre-2008
Mensajes: 4
Antigüedad: 15 años, 4 meses
Puntos: 0
Hola que tal, no entiendo el sig. codigo .. .

Hola a que tal queria saber si alguien me puede ayudar a decirme que hace el siguiente codigo ya que no los dieron en la facultad y no explicaron mucho, se trata de un acumlador y contador, en el cual me pide que ingrese informacion y no se para que:

<?php
session_start();
?>
<html>
<head><title></title></head>
<body>
<form action="pruebasesion.php" method="post">
<br>
<input type="text" name="v1">
<br>
<input type="text" name="v2">
<br>
<input type="submit" value="enviar">
<br>
</body>
</html>

<?php
//session_start();
if ($_POST["v1"]==$_POST["v2"]){
if (!isset($_SESSION["cont"]))
$_SESSION["cont"]=0;
else
$_SESSION["cont"]++;
}
echo ("Cantidad de ingresos :");
echo $_SESSION["cont"] ;
?>

<?php
session_start();
?>
<html>
<head><title></title></head>
<body>
<form action="pruebasesionacum.php" method="post">
<br>

<br>
</body>
</html>

<?php
//session_start();
if ((!isset($_SESSION["ac"]))&&($_POST["v1"]!=""))
$_SESSION["ac"]=0;
else
{
$_SESSION["ac"]=$session["ac"] + $_POST["v1"];
$t=$_SESSION["ac"];
}
echo $t;
?>

Si alguien me da una manito seria de mucha ayuda ya que lo tengo que entregar funcionando en la semana, desde ya muchas gracias Marce.