Jump to content

PHP sessions


iThaos

Recommended Posts

PHP Sessions seems to be working fine for me. Check your script for errors.

 

http://byrondallas.heliohost.org/php/tools...annotator-s.php

 

http://byrondallas.heliohost.org/php/tools...annotator-s.txt

 

 

 

Try this simple piece of code and see if it returns a sessions number for you:

 

<?php
session_start();
echo session_id();
?>

 

 

Link to comment
Share on other sites

1. heliohost uses php5 so register_globals is disabled. Declare all your globals in functions if you need to use them. [global $variablename;]

2. The header is already sent because a mysql_error has been issued and so the session cannot start. You must fix mysql before you can use sessions.

3. mysql_numrows is an old function. Use mysql_num_rows instead. For better performance if you just want the row no.s and not the actual query result, use

[

$query=mysql_query("Select count(*) from tablename where field = 'condition'")

echo mysql_fetch_array($query);

]

Link to comment
Share on other sites

1. heliohost uses php5 so register_globals is disabled. Declare all your globals in functions if you need to use them. [global $variablename;]

2. The header is already sent because a mysql_error has been issued and so the session cannot start. You must fix mysql before you can use sessions.

3. mysql_numrows is an old function. Use mysql_num_rows instead. For better performance if you just want the row no.s and not the actual query result, use

[

$query=mysql_query("Select count(*) from tablename where field = 'condition'")

echo mysql_fetch_array($query);

]

 

Ok Thanks! B) :D I'll make those changes soon. Thanks for your help!

Link to comment
Share on other sites

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.   Paste as plain text instead

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