http variable existance

Author Message

Piotr Switkowski

Friday 19 August 2005 2:00:22 pm

I could not find any way to verify in template, if http variable (POST or GET) exists. So I have to always call ezhttp to retrieve variables and sometimes I am getting an error - variable does not exists.

In fact nothing wrong happens, but this does not look like elegent practise. So could anyone advice how to check if variable exists before calling ezhttp

Arran Price

Sunday 21 August 2005 3:52:02 pm

Hi Piotr,
typically I would check the variable content to make sure its both set and valid (so someone dosent try doing anything malicious) before using it in any operation.
If you do that, then you will already catch errors before trying any operation.

Hope thats of some help.

Arran

Marko Žmak

Monday 22 August 2005 12:31:13 am

I don't think that content can be checked in that way for http variables. Because the values of POST and GET are gathered through an eZ operator, and not via an eZ variable. And it's the operator that genrates an error, and it seems there's no way to check the exsistance of a http variable.

Maybe someone from eZ crew could give us a better answer to this.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

noam s

Monday 05 September 2005 1:24:00 am

maybe you could try checking the parameters before posting the form?

Piotr Switkowski

Monday 05 September 2005 3:01:01 am

Whenever this is possible I make forms to include all parameters. However sometimes it is not possible.

From this discussion I see then that checking the existance of POST vars is not possible

Marko Žmak

Monday 05 September 2005 10:36:47 am

Or you could just ignore the warnings and continue with your life... :)

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:37:58
Script start
Timing: Jan 18 2025 19:37:58
Module start 'layout'
Timing: Jan 18 2025 19:37:58
Module start 'content'
Timing: Jan 18 2025 19:37:58
Module end 'content'
Timing: Jan 18 2025 19:37:58
Script end

Main resources:

Total runtime0.5864 sec
Peak memory usage4,096.0000 KB
Database Queries70

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 589.3359152.6250
Module start 'layout' 0.00630.0035 741.960939.4453
Module start 'content' 0.00990.5754 781.4063633.4922
Module end 'content' 0.58520.0012 1,414.898412.4844
Script end 0.5864  1,427.3828 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.5702160.0002
Check MTime0.00130.2260160.0001
Mysql Total
Database connection0.00100.171710.0010
Mysqli_queries0.535891.3622700.0077
Looping result0.00060.1081680.0000
Template Total0.556594.920.2782
Template load0.00220.376320.0011
Template processing0.554294.510520.2771
Template load and register function0.00050.080010.0005
states
state_id_array0.00090.159410.0009
state_identifier_array0.00070.126620.0004
Override
Cache load0.00190.3300230.0001
Sytem overhead
Fetch class attribute can translate value0.00080.136640.0002
Fetch class attribute name0.00080.141770.0001
XML
Image XML parsing0.00090.147340.0002
class_abstraction
Instantiating content class attribute0.00000.002380.0000
General
dbfile0.00080.1431180.0000
String conversion0.00000.001740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs