SOLVED: How to pass ezvariabele through POST?

Author Message

Maarten Holland

Wednesday 22 September 2004 6:34:37 am

Hi all,

I have a PHP script on another server with the following content:

<?php
/* grabs the POST variables and puts them into variables that we can use */
$relatieCode=$_POST['relatieCode'];
echo("code:".$relatieCode."");
?>

I have a clickable image in ezpublish, which should open the PHP script and pass the user-id of the logged in user as 'relatieCode'. Unfortunately I don't know how to pass the user-id. In my eZ template I've got the following code:

{let user=fetch( 'user', 'current_user' )}
{$user.contentobject.name}
{$user.email}
{$user.login}
{/let}
<form method="POST" action="http://mysite.com/myform.php" name="form">
<input type="hidden" name="relatieCode" id="relatieCode" value={$user.login}>
<input type="image" name="formbutton" onClick="return validate(form)" SRC={"buttons/bt_contact.png"|ezimage} class=button alt="My alt text">
</form>

In my eZ site I can see the right user id (user.login), so the fetch is OK. But my PHP script doesn't show the user ID. When I change:

<input type="hidden" name="relatieCode" id="relatieCode" value={$user.login}>

into

<input type="hidden" name="relatieCode" id="relatieCode" value="MYVALUE">

then my PHP script does show 'MYVALUE'.

Can anyone please tell me what I'm doing wrong?

Thanks,

Maarten

UPDATE;

Sorry, my bad: I closed the let too early...

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 31 2025 10:08:52
Script start
Timing: Jan 31 2025 10:08:52
Module start 'layout'
Timing: Jan 31 2025 10:08:52
Module start 'content'
Timing: Jan 31 2025 10:08:52
Module end 'content'
Timing: Jan 31 2025 10:08:52
Script end

Main resources:

Total runtime0.0252 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0088 588.2656151.2266
Module start 'layout' 0.00880.0044 739.492236.6797
Module start 'content' 0.01330.0098 776.171990.0469
Module end 'content' 0.02310.0021 866.218829.9922
Script end 0.0251  896.2109 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002710.8390140.0002
Check MTime0.00124.7479140.0001
Mysql Total
Database connection0.00135.113510.0013
Mysqli_queries0.005320.990330.0018
Looping result0.00051.990310.0005
Template Total0.00156.010.0015
Template load0.00124.592510.0012
Template processing0.00031.350910.0003
Override
Cache load0.00072.821110.0007
General
dbfile0.003915.532980.0005
String conversion0.00000.043640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs