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.