Jump to content

[SOLVED] Help


sstangle73

Recommended Posts

on my site i have it do a query at the top of everypage with several other functions:

<?php
session_start(); 
include("database.php");
include("login.php");
include("func.php");
mait();
query($_SESSION['ID']);
PageTop($level, $ID, $username, $color);
?>

 

now later down the index i call for this

<?php 
if($logged_in){ 
    echo "Welcome " .  $name . "<br>"; 
    echo "Logged in as " . $username . "     ID Number: " . $ID . " <a href=\"logout.php\">logout</a><br>"; 
    echo "Your registered email is " .  $email . "<br>";
    echo "Your birthday is " . $bdate . "<br>";
    echo "You are " . $age . " years old <br>";
    echo "You are " . $sex . "<br>";
    echo "You live in " . $location . "<br>";
?>

 

for the age and location it comes up blank.

also on a different page $profile comes up blank

 

heres the query:

<?php
function query($ID){
$query="SELECT * FROM users WHERE ID = '$ID' LIMIT 1"; 
$result=mysql_query($query); 
while($array=mysql_fetch_assoc($result)){
$level=$array['level'];
$ID=$array['ID'];
$user=$array['username'];
$name=$array['name'];
$dname=$array['dname'];
$email=$array['email'];
$bdate=$array['bdate'];

$sex=$array['sex'];
$city=$array['city'];
$state=$array['state'];

$schedule=$array['schedule'];
$color=$array['color'];
$quote=$array['quote'];
}
$age=birthday($bdate);
$location="" . $city . ", " . $state . "";
$query2="SELECT * FROM profile WHERE ID = '$ID' LIMIT 1"; 
$result2 = mysql_query($query2);
while($array2=mysql_fetch_assoc($result2)){
$about=$array2['about'];
}
}
?>

 

thanks!

Link to comment
https://forums.phpfreaks.com/topic/67920-solved-help/
Share on other sites

can $_SESSION['about'] be called by $about?

only if register_globals is enabled. register_globals is now depreciated and is disabled by default as it can cause security exploits within your code. However some hosts do still keep this setting enabled for compatibility reasons for older (outdated) scripts.

Link to comment
https://forums.phpfreaks.com/topic/67920-solved-help/#findComment-341417
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.