$_GET

7 posts by 5 authors in: Forums > CMS Builder
Last Post: February 27, 2009   (RSS)

Re: [seyrich] $_GET

By Dave - October 17, 2008

Hi Seyrich,

Sure no problem. For the second query it doesn't know how to use $_GET['carving'], there's no record number on the end of the url so it's just returning the first record it finds in the database.

Here's what whereRecordNumberInUrl(1) does:

If there's a number on the end of the url it returns: num = '$num'.

So in the case of this url: http://warther.org/index1.php?page=carvingsDetail&carving=2
These two would do the same thing:
'where' => whereRecordNumberInUrl(1),
'where' => " num = '2' ",

If there's no number on the end of the url it returns the value in the brackets. When that is 1 it just returns the first record found (any record).

So for this url: http://warther.org/index1.php?carving=2&page=carvingsDetail
These two would do the same thing:
'where' => whereRecordNumberInUrl(1),
'where' => " 1 ",

If you know you're always going to have the record number in $_GET['carving'] you could use that like this:

'where' => "num = '" .mysql_real_ecape_string(@$_GET['carving']). "'",

Hope that helps, let me know if you have any other questions about that.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] $_GET

By (Deleted User) - October 17, 2008

Thank you. That is exactly what I needed to know. I can do so much more with this now.

The more I use this system the more and more I like it. I'm finding it very flexible and yet thorough compared to other systems I have attempted to use.

-Shane

Re: [Dave] $_GET

That makes sense for me too thank you!

Re: [jposwald] $_GET

On a related note, how do I get CMS Builder to ignore the $_GET items. I am passing info that I don't want built into the WHERE clause.

Thanks,
Doug

Re: [dougdrury] $_GET

By ross - February 27, 2009

Hi Doug

To stop the $_GET[] from being used in the where clause, you can add:

'allowSearch' => '0',

to your list viewer code like this:

list($newsRecords, $newsMetaData) = getRecords(array(
'tableName' => 'news',
'allowSearch' => '0',
));


Does that sound like it would work? Let me know :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] $_GET

ross,
Perfecto! Thank you!!