Diferències
Ací es mostren les diferències entre la revisió seleccionada i la versió actual de la pàgina.
Següent revisió | Revisió prèviaUltima revisióAmbdós costats nova versio | ||
inscripcions_genere [d/m/Y H:i] – creat perecomellas | inscripcions_genere [d/m/Y H:i] – edició externa 127.0.0.1 | ||
---|---|---|---|
Línia 1: | Línia 1: | ||
- | <?php | + | <php> |
- | $nom = $_POST["n"]; | + | echo '< |
- | $lloc = $_POST["l"]; | + | echo '< |
- | $estudiant | + | < |
- | $correu | + | < |
- | function nom_cor($nom) { | + | < |
- | $l = strlen($nom) - 1; | + | </ |
- | for ($i=0; $i<$l; ++$i) { | + | < |
- | if ($nom[$i]==' ') return true; | + | < |
- | } | + | < |
- | return false; | + | </ |
- | } | + | < |
- | function correu_cor($correu) { | + | <td align=" |
- | $l = strlen($correu); | + | < |
- | $a=false; | + | </ |
- | $b=false; | + | < |
- | for ($i=0; $i<$l; ++$i) { | + | < |
- | if (!$a and $correu[$i]==' | + | < |
- | if (!$b and $correu[$i]==' | + | </ |
- | } | + | < |
- | return ($a and $b); | + | < |
- | } | + | <td align=" |
- | function get_num() { | + | </ |
- | $num = file(' | + | < |
- | return $num; | + | <td align="right">& |
- | } | + | < |
- | function suma_num() { | + | </ |
- | $num = get_num(); | + | < |
- | ++$num; | + | < |
- | unlink(' | + | <td align=" |
- | $fp = fopen(' | + | </ |
- | fwrite($fp, $num); | + | < |
- | fclose($fp); | + | <td align="right">& |
- | } | + | < |
- | if (!nom_cor($nom) and !correu_cor($correu)) { | + | </ |
- | header("Location: http:// | + | < |
- | exit; | + | < |
- | } | + | <td align=" |
- | else if (!nom_cor($nom)) { | + | </ |
- | header("Location: http://gela.cat/ | + | < |
- | exit; | + | < |
- | } | + | < |
- | else if (!correu_cor($correu)) { | + | </tr> |
- | header("Location: http:// | + | < |
- | exit; | + | < |
- | } | + | < |
- | else { | + | </ |
- | $num = get_num(); | + | </ |
- | suma_num(); | + | </ |
- | $file = ' | + | </php> |
- | $fp = fopen($file, | + | |
- | $text = array($nom, | + | |
- | fwrite($fp, | + | |
- | fclose($fp); | + | |
- | header("Location: http:// | + | |
- | exit; | + | |
- | } | + | |
- | ?> | + |