NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Parameters


Joined: 18 Sep 2003
Posts: 17
Location: Fl
Reply with quote
Being able to pass parameters is great. There are two problems though.

    1. If the form requests itself then the parameters do not get called again.
    Code:
     "<form name='login' action='$_SERVER[PHP_SELF]' method='POST'>";


    2. The parameters are not persistent. That is they do not keep their setting after you close and reopen the program. This would be very nice, as parameters can be used for other things as well, such as setting flags for conditional compiles (ie local/release versions) etc.


Thanks!
Zany Dog
View user's profileFind all posts by Zany DogSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
in php your call would look different Smile)

<form name='login' action='<?php echo $_SERVER[PHP_SELF];?>' method='POST'>
or
<form name='login' action='<?=$_SERVER[PHP_SELF];?>' method='POST'>

2. agree, parameters are not preserved, yet. It's an issue for the further development.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
parameters


Joined: 18 Sep 2003
Posts: 17
Location: Fl
Reply with quote
Sorry for the confusion on point 1, maybe I didn't make myself clear. I wasn't having a problem getting the above code to work. I realize the code has to be wrapped with the php tag somewhere (ie here document). I just threw the code there to show that if a page uses parameters and it then calls itself on a form submit then the parameters do not get passed on subsequent calls.


Thanks,
Zany Dog
View user's profileFind all posts by Zany DogSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
They would never be passed the way you expect.
You have to include them in the <form>
or have a php session opened.

in more details
if you have some values (regardless parameters or not) and you want them to be submitted to a script (regardless the same or not) you have to add them into the form you are submitting. You can use
<input type="hidden" name="myvariablename" value="myvariablevalue"> for that purpose.

As an alternative way you can store your values in $_SESSION[] array and expect them to be stored (for specified time) in file for later usage.
So you can assign for example $_SESSION['myvariablename']="myvariablevalue"; in one script and expect $_SESSION['myvariablename'] to be set with the same value in the script you do submit to.
See php manual for further details how it works.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Parameters
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic