/    Sign up×
Community /Pin to ProfileBookmark

post and get variables are disappearing

Hi all, for some reason my post or get vars don’t carry over to the php im submitting to

I have the following form:

[CODE]<form style=”border: 1px dotted white; padding: 5px;” name=”accountCreateForm” action=”create_account_submit” method=”POST” accept-charset=”utf-8″>
User Name:<input type=”text” size=”35″ name =”user_name”/>
Password:<input type=”text” size=”35″ name =”password_1″/>
Repeat Password:<input type=”text” size=”35″ name =”password_2″/>
Email:<input type=”text” size=”35″ name =”email”/>
<a href=”javascript:submitForm()” style=”font-size:40px”>LETS GO!!</a>
</form>[/CODE]

Which ends up calling the following function:

[CODE]
function create_account_submit()
{
$returnValue = UserModel::insertNewUser($_post[‘user_name’], $_post[‘password_1’], $_post[‘password_2′], $_post[’email’]);
if(!$returnValue[0])
{
echo $returnValue[1];
}
}
[/CODE]

I did a var_dump inside that function and it came up null. I made the form use GET just to check, and you can see the get vars along the top. They just come up as null when I try to call them through $_get[‘user_name’] for example

And help would be greatly appreciated as always.

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@NogDogJan 02.2009 — $_POST is case-sensitive. (I.e.: "$_post" is [i]not[/i] a pre-defined super-global array in PHP.)
Copy linkTweet thisAlerts:
@jake_dauthorJan 02.2009 — Thanks. I'll see if that's the problem. I got get (or should I say GET) working and that might have been the issue there.
Copy linkTweet thisAlerts:
@jake_dauthorJan 02.2009 — Yup that was it. Thanks a bunch.
×

Success!

Help @jake_d spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...