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.