NYCPHP Meetup

NYPHP.org

[nycphp-talk] Help using a variable

Néstor rotsen at gmail.com
Fri Dec 19 01:05:46 EST 2008


I sat down and re wrote all of the code and things are working.
Thnaks,

Nestor :-)

On Wed, Dec 17, 2008 at 7:38 PM, Néstor <rotsen at gmail.com> wrote:

> Register Globals are OFF
> :-)
>
>
> On Wed, Dec 17, 2008 at 7:24 PM, Anirudhsinh Zala <arzala at gmail.com>wrote:
>
>> On Thursday 18 December 2008 05:49:15 Néstor wrote:
>> > I am passing a variable and value using the query method to
>> myreport.php.
>> >
>> > I can see using phpinfo() the query string and the var and the value:
>> > _GET["drange"]AND (proj_adv_date >=
>> > DATE_FORMAT(\'2008-12-17\',\'%Y-%m-%d\') AND proj_adv_date <=
>> > DATE_FORMAT(\'2009-12-17\', \'%Y-%m-%d\'))
>> >
>> _SERVER["QUERY_STRING"]show=1&proj_owner=Engineering&drange=AND+%28proj_adv
>>
>> >_date+%3E%3D+DATE_FORMAT%28%272008-12-17%27%2C%27%25Y-%25m-%25d%27%29+AND+pr
>>
>> >oj_adv_date+%3C%3D+DATE_FORMAT%28%272009-12-17%27%2C+%27%25Y-%25m-%25d%27%29
>> >%29
>> >
>> >
>> _SERVER["REQUEST_URI"]/opps/eco_reports/rep/uco_report.php?show=1&proj_owne
>>
>> >r=Engineering&drange=AND+%28proj_adv_date+%3E%3D+DATE_FORMAT%28%272008-12-17
>>
>> >%27%2C%27%25Y-%25m-%25d%27%29+AND+proj_adv_date+%3C%3D+DATE_FORMAT%28%272009
>> >-12-17%27%2C+%27%25Y-%25m-%25d%27%29%29
>> >
>> >
>> > but when I put the following code in the program dies:
>> >  $drange  = $_GET['drange'];
>>
>> Difficult to analyse but Is directive "register_globals" set to "On"
>> either in
>> php.ini or in your script?
>>
>> Btw, passing SQL chunk (i.e implementation logic) via query string is not
>> good
>> method. Instead you should pass just necessary values of dates etc.
>>
>> Thanks
>>
>> Anirudh Zala
>>
>> >
>> > I jjust discovered that if I change the variable to $xdrange the program
>> > does nto stop
>> >  $xdrange  = $_GET['drange'];
>> >
>> > What????
>> >
>> > I need the variable to be $drange because it is a date range that I use
>> to
>> > create the query and this program calls itself.
>> >
>> > What could be causing the problem?  What should I do to use this
>> variable
>> > $drange?
>> >
>> > Thanks,
>> >
>> > Nestor :-)
>>
>>
>> _______________________________________________
>> New York PHP User Group Community Talk Mailing List
>> http://lists.nyphp.org/mailman/listinfo/talk
>>
>> http://www.nyphp.org/show_participation.php
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20081218/4d02caaa/attachment.html>


More information about the talk mailing list