Jump to content

[SOLVED] Help please.. form won't submit hidden properly


twilightnights

Recommended Posts

Hi, I'm having a problem with a form not receiving values properly.  Any help appreciated.  Slashes are used in PHP.

form code
[code]
<form action=\"http://www.omgjokes.com/submitjoke2.php\" method=\"post\">
<B>Does this look alright? </b> <br><br>
<INPUT type=\"hidden\" name=\"author\" value=\"$subauthor\">
<INPUT type=\"hidden\" name=\"jokename\" value=\"$subname\">
<INPUT type=\"hidden\" name=\"strcat1\" value=\"$strcat1\">
<INPUT type=\"hidden\" name=\"jokebody\" value=\"$subbody\">
<INPUT type=\"hidden\" name=\"jokeanswer\" value=\"$subanswer\">
<input type=\"submit\" value=\"yes\">
</form>
[/code]

when viewing my website source:
[code]<form action="http://www.omgjokes.com/submitjoke2.php" method="post">
<B>Does this look alright? </b> <br><br>

<INPUT type="hidden" name="author" value="">
<INPUT type="hidden" name="jokename" value="sda">
<INPUT type="hidden" name="strcat1" value="Blonde,Insults,Medical">
<INPUT type="hidden" name="jokebody" value="sad">
<INPUT type="hidden" name="jokeanswer" value="none">
<input type="submit" value="yes">
</form>[/code]

Receiving the posted values

[code]
$subname = $_POST['jokename'];
$strcat1 = $_POST['strcat1'];
$subbody = $_POST['jokebody'];
$subauthor= $_POST['author'];
$subanswer= $_POST['jokeanswer'];
[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.