Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
How to include session log file?
Old 12-10-2009, 08:52 PM How to include session log file?
Average Talker

Posts: 24
Trades: 0
Hi there... help plzz..
Code:
<?
//this page named as record.php
session_start();
if(!isset($_SESSION['uniqueID']))
{
    $_SESSION['uniqueID'] = uniqid();
}

$filename = "./logs/".$_SESSION['uniqueID'].".php" ; // output 4b1e7b3489549.php

$data = "bla..bla..\n".

$data = stripcslashes($data);

/* Writing file configurations */
    $buat = fopen($filename, "w+");
    fwrite($buat, "$data");
    fclose($buat);
?>
Now whe i call the output file from $filename (record.php) from page click.php below:
Code:
<?
//this page named as click.php
$filelog1 = "./logs/".$_SESSION['uniqueID'].".php" ;

$filelog2 = "./logs/config.php";

    if(file_exists($filelog1)){
        require_once $filelog1;
    }else{
        require_once $filelog2;
    }

echo "$filelog1 , $filelog2";// test
?>
When i go to page click.php i got Page load error in my firefox browser below, what this problem?


Redirect Loop

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

The browser has stopped trying to retrieve the requested item. The site is redirecting the request in a way that will never complete.

* Have you disabled or blocked cookies required by this site?
jones is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-11-2009, 12:05 AM Re: How to include session log file?
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
The error message probably means you are using the header() function, with some logic error to make the page load itself, over and over.
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is offline
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 12-11-2009, 12:39 AM Re: How to include session log file?
Average Talker

Posts: 24
Trades: 0
Quote:
Originally Posted by lizciz View Post
The error message probably means you are using the header() function, with some logic error to make the page load itself, over and over.
Ok, thank You boss,
but what the solution to include the log file saved from session id so the same visitor automatically read his/her own log config?
thank You... sorry b'cause i am a new php coder ...
jones is offline
Reply With Quote
View Public Profile
 
Old 12-11-2009, 11:16 AM Re: How to include session log file?
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
I fail to see any reason as to why your code above should post any errors at all, it should work as it is. The error is most likely in another file.
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is offline
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Reply     « Reply to How to include session log file?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.47805 seconds with 12 queries