Jump to content

phpMyEdit Question: URL form filter from another page?


justaleaf

Recommended Posts

Was hoping someone here could help me (seems pretty dead at platon.sk). I just used phpMyEdit to generate a simple php form for one of my tables so I can browse/edit/view the entries there.

 

I want to link someone else to it, but only link them to a specific entry.

 

I tried "http://myurl.com/phpfolder/my_form.php?qf2=NAME" to specify the column I wanted to use for the filter, but nothing happens when I do this.

 

I'm a beginner with both php and phpMyEdit, so I'm just looking for a simple implementation. Any help would be greatly appreciated!

 

-Garrett

Looking over some generated code, I notice this:

 

/* Table-level filter capability. If set, it is included in the WHERE clause

  of any generated SELECT statement in SQL query. This gives you ability to

  work only with subset of data from table.

 

$opts['filters'] = "column1 like '%11%' AND column2<17";

$opts['filters'] = "section_id = 9";

$opts['filters'] = "Table0.sessions_count > 200";

*/

 

Without testing it, I'd say that if you added the $opts['filters'] declaration to provide the field name and value for the row you want to display AND a method of abstracting the passed variables that would achieve what you want.  If that's logical, then you need to have a link url that passes two parameters ... /my_form/php?colname=animal&colvalue=wombat.

 

The obvious downside is that a URL like that exposes your data to other uses.  It might be better to create a duplicate of the original phpMyEdit file (my_form.php), hard code the $opts['filter'], and rename the file to allow a user access to only that version.

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.