0
Well, I’m trying to make a login system, but my $_POST returns "Undefined index" error and everywhere I find the same thing and still error.
Html:
<form action="submit.php" method="post">
<div id="login-columns">
<div id="login-column-1">
<label for="credentials-email">Email</label>
<input tabindex="2" type="text" name="credentials.username" id="credentials-email" value="">
</div>
<div id="login-column-2">
<label for="credentials-password">Senha</label>
<input tabindex="3" type="password" name="credentials.password" id="credentials-password">
</div>
<div id="login-column-3">
<input type="submit" value="Login">
<a href="#" tabindex="4" class="button" id="credentials-submit"><b></b><span>Login</span></a>
</div>...
And php: echo $_POST['credentials.username'];
for me there is no error, but even so it does not return the input value
I’ve never seen a dot used as a separator in this kind of situation... and trade for
credentials-username
?– brasofilo
It automatically switches the point to underscore
– HiHello
Test there to make a foreach creating a new array where you replace (can be with str_replace) the underscore by a point. And then put $_GET = $seu_new_array.
– HiHello
I didn’t understand, how to use the foreach to convert the . in _?
– Vinícius
To get the value do as @Zebradomal spoke use
$_POST['credentials_username']
can test in Submit.php by giving aprint_r($_POST);
so you’ll see the array keys.– rray
It worked :D Vlw.
– Vinícius
Dude, you have two options, either do what I told you with foreach, or use credentials_username.
– HiHello
As I wrote upstairs, php converts the stitch to underscore. You can continue using the dot there in get, but then you need to make a new array where you replace the underscore with a dot and then assign $_GET the value of your new array.
– HiHello
In the Post I had to put _ but in the Input continued . as well as the Zebradomal and lost spoke
– Vinícius