[Solved] Login PHP it’s not working [closed]

You have many errors in your code : $result = mysql_query(“SELECT * FROM utilizatori WHERE username=”” . $loginUsername . “” and parola=””. $loginUsername.”””); You check username and parola on same var. You probably want : $result = mysql_query(“SELECT * FROM utilizatori WHERE username=”” . $loginUsername . “” and parola=””. $loginPassword.”””); You are also affecting vars … Read more

[Solved] PHP Session ID issue [closed]

You have one fundamental problem: if ( !isset( $_SESSION ) ) $_SESSION = null; if ( ( !is_array( $_SESSION ) ) xor ( !isset( $_SESSION[‘nzshpcrt_cart’] ) ) xor ( !$_SESSION ) ) session_start(); You can’t access the session before it is started. Try starting it and then accessing it… Also xor is a bitwise comparison…I’m … Read more

[Solved] I want to print age in my bill from dob. dob is stored in $_SESSION but its not printing the age in html page

<?php session_start(); ?> <?php $dob = $_SESSION[‘dob’]; ?> <html> <head> </head> <body> Age:<?php $from = new DateTime($dob); $to = new DateTime(‘today’); echo $from->diff($to)->y; ?> </body> </html> You didnt start the session on that page. And I changed new DateTime(‘$dob’) to new DateTime($dob) because is variable. 0 solved I want to print age in my bill … Read more

[Solved] Update the Session value from database [closed]

If I understood the question correctly you want to read a value from a Database. I assume, you have got an id, stored in $_SESSION[‘Auth’][‘ID’], that provides the User ID of the user in the Database. First you request your new Value from the Database (Notice that I need to know the ID of the … Read more