View Single Post
Old May 3rd, 2004, 04:44 AM
richard.york's Avatar
richard.york richard.york is offline
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts

Hi Thomas,

This isn't a properly nested <form> tag! You've left out the start of the table.

<form method="get" action="<?php echo cnfg('deDir'); ?>search.php?doSearch=1">
                Enter Keyword:
            <td valign="top">
                <input type="text" name="search" size="30" />
            <td valign="top">
                Search In Category:
            <td valign="top">
                <select name="category">
                    <option value="none">All Categories</option>
                </select><br />
                <input type="submit" name="submit" value="Submit" />
    <input type="hidden" name="searchType" value="keyword" />
What did I do to your code? I made it readable and XHTML conformant:

Are you using the $_GET superglobal in search.php to access the variables?

How about error reporting, is error_reporting set to E_ALL in php.ini? And does display_errors have a value of 'on' (it's turned off by default in more recent installations of PHP)? php.ini is the PHP configuration file, you can find this file in the Windows directory, open it with a text editor to make changes. Be sure to restart Apache after any changes to the file.

Ok, that all isn't going to do you any good if you aren't seeing the query string in the URL after pressing submit. You didn't tell me whether you saw the query string in the URL. If not, try modifying your mark-up like that shown so that every tag has both an opening and closing tag. I've never tried doing the GET method with the form action already containing a query string, so I dunno about that. For the sake of consistency I'd recommend you place that value in a hidden field.



The Spicy Peanut Project