Hey, i'm working with the 2.2 version of moodle and i'm trying to get through a form the values of an array.
What i'm doing with is:
--page1.php--
...
if(!isset($_POST['firstname']) && $_POST['lastname']=="" ) {
$rs = $DB->get_recordset_sql( $query );
foreach( $rs as $r ) {
$nom[] = $r->firstname;
$ape[] = $r->lastname;
}
}
else {
$nom = unserialize(stripslashes($_POST['firstname']));
$ape = unserialize(stripslashes($_POST['lastname']));
}
echo '<FORM METHOD="post" ACTION="crear3.php">
<input type="text" name="tipo" size="20" value="prueba">
<input type="hidden" name="shortname" value="'.$curso.'">
<input type="hidden" name="firstname" value="'.serialize($nom).'">
<input type="hidden" name="lastname" value="'.serialize($ape).'">
<p><input type="submit" value="Enviar datos" name="enviar">
</FORM> ' ;
--crear3.php--
...
$titulo = $_POST["tipo"];
$curso = $_POST["shortname"];
$nombre = $_POST["firstname"];
$apellido = $_POST["lastname"];
...
$pdf->Write(1,"Tipo:".$titulo);
$pdf->SetXY(50, 10);
$pdf->Write(1,"Name: ".$nombre." ".$apellido);
$pdf->SetXY(50, 14);
$pdf->Write(1,"Rut: ");
$pdf->SetXY(50, 18);
$pdf->Write(1,"Curso: ".$curso);
$pdf->Image("acf$k.png",168,0,22);
....
It doesn't show any error field but instead, in the name area, it shows something like this:
Nombre: a:13:{i:0;s:10: a:13:{i:0;s:11:
any ideas of what i'm doing wrong?