Page 1 of 1

get hidden input value

Posted: Tue Nov 07, 2006 6:46 pm
by lmh85
i had tried
<input type="hidden" name="hiddenFields" value=<?php print($hiddenFields); ?>>
and yes it works when i just call out $hiddenFields and parsing it into a session. But when i tried calling it using $_POST['hiddenFields'] , it can't work. Is there any way else i can get the values of my hidden fields instead of the above method(bcos its not working in my web hosting server). Please help! thanks in advance!

Posted: Tue Nov 07, 2006 6:53 pm
by timvw
To me it appears that you're trying to stuff the value of an array in a single hidden field?? In that case i suggest that you look at the generated html to get an idea of why the print $hiddenfields is not the value that you're expecting....

Posted: Tue Nov 07, 2006 8:22 pm
by feyd
Probably for a lack of quotes. Why not transfer the data via sessions so the user cannot directly affect the data contained inside?

Posted: Wed Nov 08, 2006 3:32 am
by lmh85
it works in apache.. but not in IIS.. i wonder why.. hmmm.. i can't get it to be in the session as the values all gone when my button is clicked...

Posted: Wed Nov 08, 2006 6:53 pm
by lmh85
anybody help? :(

Posted: Wed Nov 08, 2006 6:56 pm
by brendandonhue
Try making your form field like this
<input type="hidden" name="hiddenFields" value="<?php echo $hiddenFields; ?>">
Then use $_POST['hiddenFields'] to get the value. Be aware that the user could change that value, it's not necessarily going to be the same as what you put in the hidden field.

Posted: Wed Nov 08, 2006 7:22 pm
by RobertGonzalez
lmh85 wrote:anybody help? :(
Please do not bump your threads.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:4. All users of any level are restricted to bumping (as defined here) any given thread within twenty-four (24) hours of its last post. Non-trivial posts are not considered bumping. A bump post found in violation will be deleted, and you may or may not recieve a warning. Persons bumping excessively be considered as spammers and dealt with accordingly.
As for the problem you are having, if there is an issue with not being to use sessions in IIS, it might be a permissions issue.

As for passing a hidden field, it should work fine as long as what is in the hidden field is what you expect. As has been mentioned in this thread, try looking at the generated output of the PHP you are trying put into the hidden field and see what it is. That might help.

Posted: Wed Nov 08, 2006 11:06 pm
by wyrmmage
why are you calling print"" inside your value="" part of your tag? I'm pretty sure you don't need to do that...
-wyrmmage

Posted: Thu Nov 09, 2006 11:00 am
by RobertGonzalez
Its inside the PHP tag, so he will either need a print() or an echo().

Posted: Thu Nov 09, 2006 11:14 am
by wyrmmage
ah, ok.
If it's possible, I would just echo('') the entire form, it makes it much easier to insert php variables into it.
-wyrmmage