make changes in main page after login: php | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

make changes in main page after login: php

Hello I have already made registration and login pages for my web page. The question is that I want to display the name and the image of the user after login, in other words I want to make some changes in my main page after login. I do sth like this: <?php if(checkUser($username,$password)){ logIn($username, $password); header("Location: index.php"); ?> <li><a href="#">Hello, <?php echo $username; ?></a></li> <script type="text/javascript" src="js/jquery-1.10.2.min.js"></script> <script type="text/javascript"> console.log("successfull"); $(".nav_header").remove(); </script> <?php } ?> I tried to do it with jQuery, or just adding some html tags, but it doesn't work, it just goes to index.php and the changes that I try to make doesn't appear there.

1st May 2017, 8:28 AM
Ani Naslyan
Ani Naslyan - avatar
1 Answer
+ 11
i think changing main page is not necessary. how if someone login then the other access main page? the best way in my opinion is redirect user to validation page then from there go to other page.
1st May 2017, 9:09 AM
Agus Mei
Agus Mei - avatar