Jump to content

Recovery of datafields from a special GET form


wobuck

Recommended Posts

I generate php form lines from a database but cannot work out how to recover the text fields for lines 1, 2 & 4 using get or post - can anyone help?  :(

 

The url string below(get to see what is happening) contains titles BF and SG in lines 1 and 2 for the field name 'book' and then TG for line 4 but no title for line 3:

 

http://localhost/test/test.php

?book%5BArray%3F%5D=BF&row_count=Array%3F

&book%5BArray%3F%5D=SG&row_count=Array%3F

&book%5BArray%3F%5D=&row_count=Array%3F

&book%5BArray%3F%5D=TG&row_count=Array%3F

Apologies, I have not explained my issue very well.

 

I am using the 'print' command within a php form to display a number of lines from a database so that I can then enter more data against the displayed lines as <Input type=text>

 

The command lines looks like this:

 

print("<form id=\bookform\" action=\"book.php\" method=\"get\">");

while($row = mysql_fetch_row($result))

{

print("<td><input type=\"text\" style=\"width: 60px\" name=\"book[$row?]\"></td>");

print("<td><INPUT TYPE=\"hidden\" name=\"row_count\" value=\"$row?"></INPUT></td>");

}

print("<td><input value=\"UPDATE BOOKS\" type=\"Submit\"></td></tr>");

 

 

I then try to retrieve the entered data from the form in the book.php program thus:

$book = $_GET[book'];

$row_count = $_GET['row_count'];

 

$row=0;

while ($row<$row_count) {

echo('<tr><td><font face="Arial" size="2"><strong>*'.book[$row_count].'*</strong></font></td></tr>');

$row++;

}

Nothing appears to be retrieved to echo?

I have tried both post and get

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.