Forums / General / ezhttp doesn't work

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

eZ debug

Timing: Jan 18 2025 10:38:34
Script start
Timing: Jan 18 2025 10:38:35
Module start 'content'
Timing: Jan 18 2025 10:38:35
Module end 'content'
Timing: Jan 18 2025 10:38:35
Script end

Main resources:

Total runtime0.7101 sec
Peak memory usage4,096.0000 KB
Database Queries218

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0097 587.6016180.8516
Module start 'content' 0.00970.5652 768.4531761.6953
Module end 'content' 0.57490.1350 1,530.1484344.4688
Script end 0.7100  1,874.6172 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.5824210.0002
Check MTime0.00160.2190210.0001
Mysql Total
Database connection0.00110.158610.0011
Mysqli_queries0.607885.59422180.0028
Looping result0.00270.38242160.0000
Template Total0.677195.420.3386
Template load0.00200.286920.0010
Template processing0.675195.069420.3375
Template load and register function0.00010.015610.0001
states
state_id_array0.00120.173910.0012
state_identifier_array0.00090.126920.0005
Override
Cache load0.00190.2619770.0000
Sytem overhead
Fetch class attribute can translate value0.00230.328760.0004
Fetch class attribute name0.00180.2529140.0001
XML
Image XML parsing0.00280.390460.0005
class_abstraction
Instantiating content class attribute0.00000.0043180.0000
General
dbfile0.00240.3311520.0000
String conversion0.00000.001030.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 51
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs