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
Share on other sites

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

$data = mysql_query("SELECT * FROM members WHERE emailaddress='2fr3sh@gmail.com'") or die(mysql_error());

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.