Passing variables in PHP from one file to another
问题 So this is my code. Now how do I use $pubname in another file. mysqli_select_db($connect,"membership"); $retname = "select username from users where email='$globalname' limit 1"; $rn = mysqli_query($connect,$retname) or die(mysqli_error($connect)); $name = mysqli_fetch_array($rn); //connecting for mathcing username with fullname and displaying it $pubname = mysqli_real_escape_string($name['username']); include('profile.php'); echo $pubname; and also is this code secure? I did that...does not