Forum Moderators: coopster

Message Too Old, No Replies

Is this possible?

session unregister

         

ikke

10:16 am on Apr 1, 2005 (gmt 0)

10+ Year Member



I have the following code:


<FORM METHOD=POST ACTION=<?"$PHP_SELF?action=view_product&session_unregister('itemsInMandje')";?>>
<INPUT TYPE='submit' VALUE='Leegmaken'></FORM>

The deal is when I push the Leegmaken button it doesn`t unregister the itemsInMandje variable the name is correct. Does anyone know if it is possible to unregister an session in this way and if it is not how should I do other way?

Maybe this is usefull to know when I is send the form trough to bla.php and in the beginning I set the session_unregister in that page that the session unregister.

Thanks.

ikke

11:03 am on Apr 1, 2005 (gmt 0)

10+ Year Member



Hello a new breaktrough:
This code won`t work:

<FORM METHOD=POST ACTION=<?'$PHP_SELF?action=view_product&sessie=vol';?>>
<INPUT TYPE='submit' VALUE='Leegmaken'>

And this works well:


<? echo
"<A HREF='$PHP_SELF?action=view_product&
sessie=leeg');\">leeg</A>";
?>

Why does the first code not work and the second works just fine? has anyone have an idea?

Thanks

mcibor

11:11 am on Apr 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



there's nothing that writes the $PHP_SELF. you need:

FORM METHOD=POST ACTION=<? echo '$PHP_SELF?action=view_product&sessie=vol';?>>
<INPUT TYPE='submit' VALUE='Leegmaken'>

And in the first question you cannot call a php function on client side. PHP is a server side language.
best regards
Michal Cibor

ikke

11:38 am on Apr 1, 2005 (gmt 0)

10+ Year Member



FORM METHOD=POST ACTION=<? echo '$PHP_SELF?action=view_product&sessie=vol';?>>
<INPUT TYPE='submit' VALUE='Leegmaken'>

Still doesn`t work I even get an error page not found?

I used this:

<FORM METHOD=POST ACTION=<?'$PHP_SELF?action=view_product&pa=0';?>>
<INPUT TYPE='submit' VALUE='Leegmaken'>
before and this one works perfect

mcibor

1:49 pm on Apr 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



True! you cannot put single quotes, because then the variable is written as a text, not parsed as a variable.

I would do:

<FORM METHOD="POST" ACTION="<?php echo $PHP_SELF."?action=view_product&sessie=vol";?>">
<INPUT TYPE='submit' VALUE='Leegmaken'>

BTW why don't you use hidden values?

<FORM METHOD="POST" ACTION="<?php echo $PHP_SELF;?>">
<INPUT TYPE="hidden" NAME="action" value="view_product">
<INPUT TYPE="hidden" NAME="sessie" value="vol">
<INPUT TYPE="submit" VALUE="Leegmaken">

And look what is being written in the source code.
Michal