[FX.php List] links to refine search

Tim 'Webko' Booth tim at nicheit.com.au
Wed Jul 16 18:57:10 MDT 2008


On 17/07/2008, at 10:46 AM, biscuit technologies wrote:

> Thanks Tim,
> I understand what you're getting at, but I don't understand what to  
> do about it. Can you explain a bit more please?

OK, on your search.php page you have a form (method="post") and a link  
(method="get")

On your results.php, you'll have a section that sets the search  
variables to be used to get the list back. I think your might look like:

$firstLetter = $_POST['cfDatabaseNameFirstLetter'];

to get the first letter to search by. This will work great for a form,  
but will not get populated by a link request, because it is using GET

Easy Solution:

Change to using $_REQUEST['cfDatabaseNameFirstLetter'] - captures both  
POST and GET requests

There are some security implications to this, but I think for your  
purposes these won;t be an issue.

Hope this helps
>
>
> - David
>
> On Wed, Jul 16, 2008 at 5:35 PM, Tim 'Webko' Booth  
> <tim at nicheit.com.au> wrote:
>
> On 17/07/2008, at 10:24 AM, biscuit technologies wrote:
>
> Hi Nick,
> I thought something like that would work, but it doesn't. I'm  
> guessing I've got something wrong somewhere, but I'm not sure where.
>
> here's the form and the link as html:
>
> <form action="databases.php" method="post">
> <table>
> <tr><td><input type="text" size=1 name="<?php echo  
> 'cfDatabaseNameFirstLetter' ?>" value=""></td><td  
> align="left">(database by first letter)</td></tr>
> <tr><td><input type="text" size=12 name="<?php echo 'Database' ?>"  
> value=""></td><td align="left">(database)</td></tr>
> <tr><td><input type="text" size=12 name="<?php echo  
> 'Vendors_ALL_by_Database::Vendor' ?>" value=""></td><td  
> align="left">(vendor)</td></tr>
> <tr><td colspan="2">
> <input type="submit" name="currentQuery" value="Find Database and/or  
> Vendor"> or <input type="submit" name="currentQuery" value="Show  
> All..."></td></tr></table>
> </form>
> </p>
> <p>Find by First Letter of DB name: <a href="databases.php? 
> cfDatabaseNameFirstLetter=a">A</a></p>
>
> The search for cfDatabaseNameFirstLetter works for any letter in the  
> form, but never as a coded string.
>
> And your results page is using $_POST in order to process the  
> request, which doesn;t work for a GET request (ie, a link...)
>
> $_REQUEST
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list

Tim 'Webko' Booth :: Niche IT Pty Ltd, Sydney, Australia
[e] tim at nicheit.com.au :: [m] 0418 993 306





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20080717/be78ec6f/attachment.html


More information about the FX.php_List mailing list