ezhttp doesn't work

Author Message

Philip K.

Thursday 18 October 2007 2:46:44 am

Hello.

I have a problem using ezhttp.

My URL is
http://<myurl>/?<myvarname>=<myvardata>

{def $data=ezhttp('myvarname','get')}

doesn't show any result. So I tried it using a form

<form name="formname" action={$node.url_alias|ezurl} method="post">
<input type="hidden" name="myvarname" value="myvardata">
<input type="submit" name="submitbtn" value="Submit">
</form>
{def $data=ezhttp('myvarname','post')}

and

{def $data=ezhttp('myvarname')}

doesn't show any result.

In the documentation I found the new operator "ezhttp_hasvariable" to check if the variable is set. But this operator doesn't show any results, too...

Is there anyone who can tell me what to do now?

I'm using eZ 3.9.0 with PHP 4.4.4

Thanks a lot,
Philip

Linux is like a wigwam; no windows, now gates, and apache inside!

Nabil Alimi

Thursday 18 October 2007 3:25:11 am

Philip,

You're trying to retrieve GET vars where your form sends POST vars. :)
Try to change either to corresponds.

My blog : http://www.starnab.com/ezpublish / http://www.starnab.com/ / http://www.assiki-consulting.com
eZ Publish Freelance developper. Feel free to contact me +33 674 367 057
nabil at assiki d0t fr

Philip K.

Thursday 18 October 2007 3:34:17 am

Hi Nabil,

no I don't:

I tried to fetch a GET var when I used:
http://<myurl>/?<myvarname>=<myvardata>

with:
{def $data=ezhttp('myvarname','get')}

No Result

-------------------------------

After that I tired to fetch a POST when I used:
<form name="formname" action={$node.url_alias|ezurl} method="post">
<input type="hidden" name="myvarname" value="myvardata">
<input type="submit" name="submitbtn" value="Submit">
</form>

with:
{def $data=ezhttp('myvarname','post')}
and
{def $data=ezhttp('myvarname')}

No Result

Linux is like a wigwam; no windows, now gates, and apache inside!

Sébastien Morel

Thursday 18 October 2007 4:28:10 am

Hi,

On 3.9.0, and other I use :

{def $region = cond(ezhttp('region', 'get',true())|eq(1), ezhttp('region', 'get', false()), true(), '')}

And it's works perfectly !
You can test this ?

Are you sure that you use the $data before the {undef} ?

++

--
eZ c'est plus fort que toi !
http://www.ez-france.org
http://blog.plopix.net
@Novactive (http://www.novactive.com)

Philip K.

Thursday 18 October 2007 5:42:23 am

Hey Sébastien,

that's a solution I haven't testet yet - but even no result...

I've no idea what to do next... I tried it with a different eZ version and on another webserver.

Nothing...

Linux is like a wigwam; no windows, now gates, and apache inside!

André R.

Thursday 18 October 2007 6:12:33 am

Are you running in cgi mode?

One other thing you can try is to use view parameters instead.

my.com/my/url/(id)/value

{def $value = first_set( $view_parameters.id, false())}

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Sébastien Morel

Thursday 18 October 2007 6:24:40 am

Can you show your template if it is not too big ?

--
eZ c'est plus fort que toi !
http://www.ez-france.org
http://blog.plopix.net
@Novactive (http://www.novactive.com)

Philip K.

Thursday 18 October 2007 6:28:46 am

Hi André,

thanks a lot - now it works!! :)

Thanks to all for your help.

Philip

Linux is like a wigwam; no windows, now gates, and apache inside!

Damien Pobel

Thursday 18 October 2007 2:08:11 pm

HI,

In fact it's a ViewCache related problem. In fact ViewCache doesn't take GET parameters in account. So your page is probably cached on the first call without a GET parameter and when you call it with your parameter, eZ Publish uses the cache and does not use your template. As André said, the solution is to use view parameters because a different cache file is generated for every different $view_parameters array.

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

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 14:57:29
Script start
Timing: Jan 18 2025 14:57:29
Module start 'layout'
Timing: Jan 18 2025 14:57:29
Module start 'content'
Timing: Jan 18 2025 14:57:30
Module end 'content'
Timing: Jan 18 2025 14:57:30
Script end

Main resources:

Total runtime1.3976 sec
Peak memory usage4,096.0000 KB
Database Queries81

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0092 587.7891152.6094
Module start 'layout' 0.00920.0042 740.398439.4297
Module start 'content' 0.01341.3825 779.8281756.6328
Module end 'content' 1.39590.0017 1,536.460924.1875
Script end 1.3976  1,560.6484 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.2658160.0002
Check MTime0.00140.0970160.0001
Mysql Total
Database connection0.00110.077510.0011
Mysqli_queries1.302193.1685810.0161
Looping result0.00090.0615790.0000
Template Total1.353096.820.6765
Template load0.00230.162620.0011
Template processing1.350796.641720.6753
Template load and register function0.00010.010510.0001
states
state_id_array0.00160.112810.0016
state_identifier_array0.00230.161120.0011
Override
Cache load0.00250.1815770.0000
Sytem overhead
Fetch class attribute can translate value0.00070.048950.0001
Fetch class attribute name0.00110.0782140.0001
XML
Image XML parsing0.00450.318750.0009
class_abstraction
Instantiating content class attribute0.00000.0023180.0000
General
dbfile0.00400.2856410.0001
String conversion0.00000.001040.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
9content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
9content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
19content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
8content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 51
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs