Jump to content

[SOLVED] help with printing session info


perezf

Recommended Posts

Im trying to print the database information using my session id, on my local machine it works great but when i put it online it does not work at all :(

can someone help me please... it is urgent

<h1><?php print $info['firstname']; ?>'s Account</h1><br> only displays 's Account but no name it seems that the $info['firstname'] is not working

<?php
include('includes/mysql_connect.inc.php');
// start session
session_start();
// check to make sure the session is registered
if(session_is_registered('emailaddress')) {} else { header("Location: login.php"); }
?>
<?php include('includes/header.inc.php'); ?>

<?php
// Collects data from "members" table 
$data = mysql_query("SELECT * FROM members WHERE emailaddress='$emailaddress'") or die(mysql_error());
$info = mysql_fetch_array( $data );
?>

<h1><?php print $info['firstname']; ?>'s Account</h1><br>

Link to comment
https://forums.phpfreaks.com/topic/76922-solved-help-with-printing-session-info/
Share on other sites

echo the query from the php script..

copy and paste it into a query in phpmyadmin.. if this works.. check the selected table (check it twice.. it a common place of error) along with user access right.. if it fails then check the table fields and records

no no,

put this in PMA

SELECT * FROM members WHERE emailaddress='$emailaddress'

replace $emailaddress with a real email (from the database)

 

could you also post the mysql_connect.inc.php script (replace private date with ##'s)

awesome that worked when i changed it to an actual email address

$data = mysql_query("SELECT * FROM members WHERE emailaddress='[email protected]'") or die(mysql_error());

now what how can i fix it to be dynamic it worked locally? ???

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.