For Programmers: Free Programming Magazines  


Home > Archive > PHP SQL > November 2004 > Getting the result from a form









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Getting the result from a form
G.Delafond

2004-11-24, 4:00 pm

Hi all !

I am new in php programming, and I am in trouble with getting the result of
a form back

The first line is :

echo "<TD><input $checkbox type=\"checkbox\" name=\"c[]\" value=\""
$ligne['ID']."\"></TD>\n";

This one works, and I get $checkbox back.

Then, I have some lines like these :

<TD><?php print ($ligne["nom"]) ?></td>
<td><input NAME="horaire" type="text" VALUE="<?php print
($ligne["horaires"]) ?>"></TD>
<td><input NAME="resultat" type="text" VALUE="<?php print ($ligne
["resultat"]) ?>" ></TD>

or

echo
"<TD>".$ligne["nom"]."</td>
<td><input name=\"horaire\" type=\"text\" VALUE=\"".$ligne
["horairesgarde"]."\"></TD>
<td><input name=\"resultat\" type=\"text\" VALUE=\"".$ligne
["resultat"]."\"></TD>

In any case, I cannot get neither $horaire nor $resultat back. They are
always empty.

I tried many combinations of " , \", ', etc.

What do I do wrong ??

Many thanks

Gerard

--
G.Delafond
http://www.delafond.org
J.O. Aho

2004-11-24, 4:00 pm

G.Delafond wrote:
> Hi all !
>
> I am new in php programming, and I am in trouble with getting the result of
> a form back
>
> The first line is :
>
> echo "<TD><input $checkbox type=\"checkbox\" name=\"c[]\" value=\""
> $ligne['ID']."\"></TD>\n";
>
> This one works, and I get $checkbox back.
>
> Then, I have some lines like these :
>
> <TD><?php print ($ligne["nom"]) ?></td>
> <td><input NAME="horaire" type="text" VALUE="<?php print
> ($ligne["horaires"]) ?>"></TD>
> <td><input NAME="resultat" type="text" VALUE="<?php print ($ligne
> ["resultat"]) ?>" ></TD>
>
> or
>
> echo
> "<TD>".$ligne["nom"]."</td>
> <td><input name=\"horaire\" type=\"text\" VALUE=\"".$ligne
> ["horairesgarde"]."\"></TD>
> <td><input name=\"resultat\" type=\"text\" VALUE=\"".$ligne
> ["resultat"]."\"></TD>
>
> In any case, I cannot get neither $horaire nor $resultat back. They are
> always empty.
>
> I tried many combinations of " , \", ', etc.
>
> What do I do wrong ??


I do prefera to use pure HTML as far as possible, and it's a bit faster than
let PHP to echo out everything

?>
<td><?PHP echo $ligne['nom']; ?></td>
<td><input name="horaire" type="text"
value="<?PHP echo $ligne['horairesgarde']; ?>"></td>
<?PHP

As you see, it's a lot easier to follow too.

In your case I think your problem lies in how you transfeared the values into
$ligne from your $_REQUEST.


//Aho
G.Delafond

2004-11-24, 8:56 pm

J.O. Aho wrote:


> I do prefera to use pure HTML as far as possible, and it's a bit faster
> than let PHP to echo out everything

OK. I'll try to do this.
>
> ?>
> <td><?PHP echo $ligne['nom']; ?></td>
> <td><input name="horaire" type="text"
> value="<?PHP echo $ligne['horairesgarde']; ?>"></td>
> <?PHP

I tried this code, but no better result.
>
> As you see, it's a lot easier to follow too.
>
> In your case I think your problem lies in how you transfeared the values
> into $ligne from your $_REQUEST.

This sentence is very cryptic for me.

I tried with no VALUE at all, and I still cannot get my $horaire.


It's very kind to you to try to help me.
>
>

Gerard

--
G.Delafond
http://www.delafond.org
J.O. Aho

2004-11-25, 3:56 am

G.Delafond wrote:

>
> This sentence is very cryptic for me.
>
> I tried with no VALUE at all, and I still cannot get my $horaire.
>

<td><?PHP echo $ligne['nom']; ?></td>
<td><input name="horaire" type="text"
value="<?PHP echo $_REQUEST['horaire']; ?>"></td>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com