Jump to content

$_POST empty ???

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1
dimitry

dimitry

    Learning Programmer

  • Members
  • PipPipPip
  • 40 posts
Hello,

I'm starting a new php project and this time php make me sick; I've put a
<form method= "post" action= "login.php">

     <input type= "text" name= "nickname_us"/>

</form>
and in login.php
echo " before the condition ";

echo "/nickname: ";

echo $_POST['nickname_us'];

if($_POST['nickname_us'] != NULL)

{

     echo " /the variable contain something ";

}

and when I arrive on my login.php page wich will control if the nickname_us exists, the page display nothing(just echo messages before the condition).
I've tried to display some messages to check if the $_POST contain something but $_POST display nothing...
I've deleted all other conditions just to look at the $_POST and it's empty... I don't anderstand; it always work but now it doesn't work...
Have you got an idea?
Lord Darkdriver by Dimitry

#2
exile

exile

    Newbie

  • Members
  • PipPip
  • 14 posts
it works fine on my side...

#3
dimitry

dimitry

    Learning Programmer

  • Members
  • PipPipPip
  • 40 posts
Yes, it should be working on my side too! Perhaps is it just bad energies???:laugh:
And I've tried it on IE7 and on my portable firefox on windows; it doesn't work too... I really don't know what's the problem. I'll wait monday to look again at my code; it could be better...
Thank you, "exile", for testing!
Lord Darkdriver by Dimitry

#4
BlaineSch

BlaineSch

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,448 posts
It should need a value to be anything - you declared the post variable but it equals nothing

<input type= "text" name= "nickname_us" value="true"/> 

You can always use this to test for post data PHP: var_dump - Manual

#5
dimitry

dimitry

    Learning Programmer

  • Members
  • PipPipPip
  • 40 posts
So, thanks for your suggest, I'm trying to restart my project.
For the moment that's ok.
My problems are always strange.

yes, I've found the error: it's because my browser doesn't let me use the post methode, it returns all informations in get methode. anyone knows how to force it to use post methode?

So many posts just to find the so simple mistake; in my form I've written <form methode ...> like we spell it in french...
so stupid mistake...:rolleyes:
Thank you for your help. Now the subject can be closed.

Edited by WingedPanther, 20 July 2009 - 03:08 AM.
Triple post

Lord Darkdriver by Dimitry

#6
BlaineSch

BlaineSch

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,448 posts
What kind of browser wont let you use post? I bet your setting it up wrong lol.