You are here: Re: newbie form help « PHP Programming Language « IT news, forums, messages
Re: newbie form help

Posted by Geoffrey on 10/31/06 22:32

Hello --

The problem that stands out the most is that you're attempting to pull
data from $_GET when your form method is set to POST. Change the
variable in your script from $_GET['board_no'] to $_POST['board_no']
and everything should be well with the world again. :)

Geoffrey


Auddog wrote:
> I have a search form that I have created. When you submit the form, I want
> to run an my update form based upon the search criteria.
>
> Here is most of my code for my search page:
>
> <form name="search_board" method="post" action="process_order.php">
> <p>&nbsp;</p>
> <table width="640" border="1" cellpadding="5" style='border-collapse:
> collapse'>
> <tr>
> <td width="606" bgcolor="#CCCCCC"><div align="center"><strong>Search
> for a Project</strong></div></td>
> </tr>
> <tr>
> <td height="131"><div align="center">
> <table width="100%" border="0">
> <tr>
> <td>&nbsp;</td>
> <td>&nbsp;</td>
> </tr>
> <tr>
> <td width="34%"><div align="right">Board Number: </div></td>
> <td width="42%"><div align="left">
> <input name="board_no" type="text" size="25">
> </div></td>
> </tr>
> <tr>
> <td colspan="3">&nbsp;</td>
> </tr>
> </table>
> <input type="submit" name="Submit" value="Submit">
> </div></td>
> </tr>
> </table>
> </form>
>
> Here is the start of my code for the process_order page:
>
> <?php
>
> $bn = $_GET['board_no'];
>
> include 'config.php';
>
> /*** create a new mysqli object with default database***/
> $connection = mysqli_connect($hostname, $username, $password,
> $dbname) or die ("Unable to connect");
>
> /*** our SELECT query ***/
> $query = "SELECT id, board_no, mac_address
> FROM production where board_no = '$bn'";
>
> //excute query
> $result = mysqli_query($connection, $query) or die ("Error in query:
> $query. ".mysqli_error());
>
> //create list of variables from query results
> list($id, $board_no, $mac_address) = @mysqli_fetch_row($result);
>
> // free result set memory
> mysqli_free_result($result);
>
> // close connection
> mysqli_close($connection);
> ?>
>
> When I run the page(s) I get the following error:
>
> Notice: Undefined index: board_no in
> c:\Inetpub\wwwroot\production\process_order.php on line 3 (which is $bn =
> $_GET['board_no'];)
>
> Not sure why I'm having troubles with this. Any help would be greatly
> appreciated. Thanks.
>
> A

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация