a php question, i think its simple
- rmbrstrongbad18
-
rmbrstrongbad18
- Member since: Dec. 23, 2005
- Offline.
-
- Forum Stats
- Member
- Level 06
- Blank Slate
is it possible to retrieve hidden inputs from forms and set them as variables?
such as
www.site.com?something=something
$something = $_POST('something');
I am not sure whether you would specify the name or the value in the variable, or if it would be $_POST, but can someone tell me how to do it?
Anyone need a voice actor?
http://www.newgrounds.com/audio/lis ten/251414
- rmbrstrongbad18
-
rmbrstrongbad18
- Member since: Dec. 23, 2005
- Offline.
-
- Forum Stats
- Member
- Level 06
- Blank Slate
I'm talking about for "input type='hidden''s." Would you define the names and the values? Would it be $_POST or something else?
Anyone need a voice actor?
http://www.newgrounds.com/audio/lis ten/251414
- harryjarry
-
harryjarry
- Member since: May. 15, 2005
- Offline.
-
- Forum Stats
- Member
- Level 57
- Blank Slate
It would be $_POST if you had the form method as post, but if you set the form method as get it will be $_GET.
So it is up to you on how you want to retrieve them, but it is possible.
- rmbrstrongbad18
-
rmbrstrongbad18
- Member since: Dec. 23, 2005
- Offline.
-
- Forum Stats
- Member
- Level 06
- Blank Slate
thanks, i know what you mean but the reason I'm asking is because they're input type=hiddens. I don't know how they would be retrieved, or whether you would use the name or the value to set the variable.
Anyone need a voice actor?
http://www.newgrounds.com/audio/lis ten/251414
- rmbrstrongbad18
-
rmbrstrongbad18
- Member since: Dec. 23, 2005
- Offline.
-
- Forum Stats
- Member
- Level 06
- Blank Slate
i take it back, this question isn't that simple.
Anyone need a voice actor?
http://www.newgrounds.com/audio/lis ten/251414
- harryjarry
-
harryjarry
- Member since: May. 15, 2005
- Offline.
-
- Forum Stats
- Member
- Level 57
- Blank Slate
You would use the name attribute to get it with $_POST or $_GET.
If you had something like
<form action="file.php" method="post">
<input type="hidden" name="data" value="stuff"/>
<input type="submit" value="Submit"/>
</form>
On file.php you would use
$variable = $_POST['data'];
Or you could use $_GET as well if you make the method get. The value attribute is what you wnat the variable to have in it, such as if you did
echo $variable;
It would return
stuff
- rmbrstrongbad18
-
rmbrstrongbad18
- Member since: Dec. 23, 2005
- Offline.
-
- Forum Stats
- Member
- Level 06
- Blank Slate
Anyone need a voice actor?
http://www.newgrounds.com/audio/lis ten/251414
- rmbrstrongbad18
-
rmbrstrongbad18
- Member since: Dec. 23, 2005
- Offline.
-
- Forum Stats
- Member
- Level 06
- Blank Slate
now im having another problem, when a user types in something from the input type=hiddens, only one word is shown.
Anyone need a voice actor?
http://www.newgrounds.com/audio/lis ten/251414
- rmbrstrongbad18
-
rmbrstrongbad18
- Member since: Dec. 23, 2005
- Offline.
-
- Forum Stats
- Member
- Level 06
- Blank Slate
how do I get it so that what they type is transferred to "word"+"word"+"word" etc.
Anyone need a voice actor?
http://www.newgrounds.com/audio/lis ten/251414
- Pilot-Doofy
-
Pilot-Doofy
- Member since: Sep. 13, 2003
- Offline.
-
- Send Private Message
- Browse All Posts (12,142)
- Block
-
- Forum Stats
- Member
- Level 37
- Musician
At 11/5/06 09:07 PM, rmbrstrongbad18 wrote: how do I get it so that what they type is transferred to "word"+"word"+"word" etc.
Are they in 3 separate fields? If so, do something like this:
echo $_GET['field1'] . $_GET['field2'] . $_GET['field3'];
If only one word is appearing when multiple words are typed in the same field, I'd have to see the page to diaginos it.
- rmbrstrongbad18
-
rmbrstrongbad18
- Member since: Dec. 23, 2005
- Offline.
-
- Forum Stats
- Member
- Level 06
- Blank Slate
the method is POST, actually.
Go here, take a survey, and then when you copy the code and paste it somewhere, you'll see that only one word of your question appears.
Anyone need a voice actor?
http://www.newgrounds.com/audio/lis ten/251414
- rmbrstrongbad18
-
rmbrstrongbad18
- Member since: Dec. 23, 2005
- Offline.
-
- Forum Stats
- Member
- Level 06
- Blank Slate
you might actually want to make a survey first, because the survey there's question is already only one word.
Anyone need a voice actor?
http://www.newgrounds.com/audio/lis ten/251414
- rmbrstrongbad18
-
rmbrstrongbad18
- Member since: Dec. 23, 2005
- Offline.
-
- Forum Stats
- Member
- Level 06
- Blank Slate
I fixed that problem, but now the answers for questions 3, 4, and 5 won't show up and I don't know why
Anyone need a voice actor?
http://www.newgrounds.com/audio/lis ten/251414
- harryjarry
-
harryjarry
- Member since: May. 15, 2005
- Offline.
-
- Forum Stats
- Member
- Level 57
- Blank Slate
You have a few mistakes in your html.
- Fix the name in answer3 by putting a single quote at the beginning of the name attribute.
- Put answer4 for the name in andswer4, right now it doesn't have a name at all.
- Fix the name in answer5, put a single quote in from of answer5, you only have one at the beginning.
That should do the trick :).
- rmbrstrongbad18
-
rmbrstrongbad18
- Member since: Dec. 23, 2005
- Offline.
-
- Forum Stats
- Member
- Level 06
- Blank Slate
well like i said, i already fixed that part of the thing, and then i fixed the other part later so i dont need a lot of help anymore
Anyone need a voice actor?
http://www.newgrounds.com/audio/lis ten/251414
- rmbrstrongbad18
-
rmbrstrongbad18
- Member since: Dec. 23, 2005
- Offline.
-
- Forum Stats
- Member
- Level 06
- Blank Slate
to whoever used my site to spam and make it a redirection to another site, I took down the file that wrote up the link, and im working on fixing the problem. Please don't attempt to mess with my site.
Anyone need a voice actor?
http://www.newgrounds.com/audio/lis ten/251414


