Jump to content

Form POST help


NLT

Recommended Posts

Ok so I've got trouble with a form I'm creating, I've got this:

<form id="login" name="login" action="URL"

          method="post">

and then Input fields like:

<input tabindex="3" type="text" class="login-field" name="acc.username" id="login-username"

                           value="" maxlength="48"/>

 

Now, if I go and submit that, and on the "URL" page I've had it echo $_POST['acc.username'] but it doesn't echo anything. I think it may be a problem with the form itself.. although I can't see one.

 

The code I got for URL:

<?PHP 
include('global.php');

if(isset($_POST['acc.username'])) 
{
echo "lol";
}
else
{
echo mysql_error();
}
?>

Link to comment
https://forums.phpfreaks.com/topic/260210-form-post-help/
Share on other sites

your form action is not set to post, it is set to URL which I have never even seen, pretty sure that's not valid. post and get are valid. (get is the ones in the url, post are hidden).

 

That's what I get for skimming. Plus the method was on the next line. :) thanks for correcting this.

Link to comment
https://forums.phpfreaks.com/topic/260210-form-post-help/#findComment-1333720
Share on other sites

I forgot to mention - URL was a URL to a valid link  ;)

 

Anyways, I just removed the .'s and now they work.

 

Now I've come across another error checking if it has been submitted with isset().

 

Part of the form for submit:

<input type="submit" name="loginbuttonnlol" value="Login" />

 

Then in the URL link I've got this:

if (isset($_POST['loginbuttonnlol'])){ echo "lolol logged in"; } else { echo "lolno.jpg"; } 

But when I click "Login" it displays "lolno.jpg" as if it isn't been submitted.

 

EDIT: URL == mywebsite.com/login.php ;)

Link to comment
https://forums.phpfreaks.com/topic/260210-form-post-help/#findComment-1333724
Share on other sites

I'm curious what browser/OS are you using? Someone said something on another thread about the submit button not always being processed into POST, I am curious if this related. I have never heard of that before.

Windows 7.

Google Chrome.

 

Although, I do have this code also for the Login button, I don't know if it may be causing it but..

<a href="lol.php" tabindex="5" id="login-submit-new-button"><span>Login</span></a>

Link to comment
https://forums.phpfreaks.com/topic/260210-form-post-help/#findComment-1334075
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.