+ 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

24th Jan 2019, 5:14 PM
Carlos Martinez
Carlos Martinez  - avatar
7 ответов
0
Hey guys! I did a deep cleaning on my code, eliminating unnecesary commnets and empty spaces and it finally work. Thanks for helping! ✌🏽
9th Feb 2019, 6:53 PM
Carlos Martinez
Carlos Martinez  - avatar
+ 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?)
24th Jan 2019, 6:21 PM
Ipang
+ 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
24th Jan 2019, 7:06 PM
Ipang
+ 2
Emma this is only the code that validates the user and password. I get the info from my local database. Ipang when the user is valid it takes me to a blank page. no errors at all, thats why i cant figure out. i printed the values of the array and i can see those but is just a blabk page.
24th Jan 2019, 6:55 PM
Carlos Martinez
Carlos Martinez  - avatar
+ 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.
25th Jan 2019, 5:46 PM
Ipang
+ 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.
25th Jan 2019, 5:40 PM
Carlos Martinez
Carlos Martinez  - avatar
+ 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’; ?>
29th Jan 2019, 4:57 PM
Carlos Martinez
Carlos Martinez  - avatar