+ 1
Header tag doesnât work after a user validation
Hey guys, any ideas why the validation of user is not directing me to the right page once the user is correct? https://code.sololearn.com/wUB1mDG1eM95/?ref=app
8 Respostas
0
Hey guys! I did a deep cleaning on my code, eliminating unnecesary commnets and empty spaces and it finally work.
Thanks for helping! âđœ
+ 5
I see that you are doing this in your local server, so did you get any error message from the browser? if so, can you tell what it says? does redirection work if you use URL of another page? can you access that URL (you set in header location) directly from browser (possibly cause of wrong path?)
+ 4
Carlos Martinez Alright, so there was no error message, nothing but blank page.
Did you try to assign a different URL, for the header location code, as I suggested? check if it works with different URL (does page load successfully)
Also does it work if you access that URL directly from the browser, does the page show up normally?
Sorry, I don't understand what you mean by "I printed the values of the array ..." which array are we talking about here? and where you print the array? in the welcome.php page?
(Edit)
Could it be, that you meant this URL:
http://localhost:8888/FinalProject/welcome.php
Instead of this URL:
http://localhost:8888/MAMP/htdocs/FinalProject/welcome.php
+ 2
Carlos Martinez What did you try already, sorry I'm not understanding what you mean.
Can you post the welcome.php content please? I don't see any array dump code in the first code above, I don't understand how and where you get that output.
+ 1
Ipang I tried that already, this is what i see on the screen:
arra(1) { [âusernameâ]=>string(7)âAnthonyâ}
where Anthony is a valid user.
+ 1
Ipang what i ment is that I tried changing the URL already.
The welcome.php is just a simple page with literally just a welcome message.
<?php
echo âWELCOMEâ;
?>