[PHP] session_id()

2001-12-07 Thread Gede Gilijk

This is a simple autentification script using session
I try to echo the session_id().
But to my surprise, the value of session_id() is different - in
configuration -
if I use difference browser.

IE :
9ff68d81039d9ece3ba9840328b91488

Opera :
7aa4895172b5a4785c9fb754eaf792aa

NN :
1007630964

Anybody face this thing ?

?
session_start();

 echo h1Members only/h1;

 // Check session variable
 if (session_is_registered(valid_user))
 {
 echo pYou log in as $valid_user./p;
 $sess_id = session_id();
 echo $sess_idbr;
 } else {
 echo pYou have not login yet/p;
 }

 echo a href=\authmain.php\Back to main page/a;

 ?

Regards,

Gede Gilijk



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Download File Problem - text not appearing on downloaded file

2001-11-20 Thread Gede Gilijk

Joe,
I have been there:-)
I use this scripts

?

function detect_browser($variable)
{
if(eregi((msie) ([0-9]{1,2}.[0-9]{1,3}), $variable))
{
$content = ie;
} else {
$content = nn;
}
return $content;
}

# Send the file to the downloaders browser #

$file_dl = $base_dir.$file;

if (detect_browser($HTTP_USER_AGENT) == ie) {
Header(Content-type: application/force-download);
} else {
Header(Content-type: application/octet-stream);
}
Header(Content-Length: .filesize($file_dl));
Header(Content-Disposition: attachment; filename=$file);
Header(Cache-Control: no-cache, must-revalidate);//HTTP/1.1
Header(Pragma: no-cache);//HTTP/1.0
readfile($file_dl);

?

The first time I run this script, I works fine. The file downloads properly
to the client machine with the right size and content. Most of the file is
text file.
After some times, I met the same problem as yours. The file size is 0.
I don't know, perhaps I change the browser setting or my Admin change the
Apache settings, PHP or some thing else.
I ask everywhere, many mailing list. and I gave up.
I just change it to
Header(Location: $url.$filename);
It works but there is a funny things.
The file can be downloaded properly if the file (with such an extension) has
been opened with notepad. If not, the file will opened in the browser.

:-)...it's an experience.

Gilijk


- Original Message -
From: Joe Van Meer [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, November 19, 2001 10:43 PM
Subject: [PHP] Download File Problem - text not appearing on downloaded file


 Hi there. I managed to get the prompt for a file download when a user
clicks
 on a text link. The file downloads properly to the client machine, howevr,
 when I open up the file there is no content. What do I have to add to the
 following code to get the content sent back to the user?

 Thx Joe :)

 ?PHP

 header(Content-type: application/octet-stream);
 header(Content-Disposition: attachment; filename=file.txt);

 ?




 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Upload problem

2001-10-02 Thread Gede Gilijk

Dear PHPmania,

I am new to PHP and I start to write some script.

$folder = USER_ENV(ID_user);
// echo $folder;
$destination = /home/gilijk/data/.$folder;
// echo $destination;

if ($filename1!=none) {
copy($filename1,$destination./.$filename1_name);
echo $filename1_name telah berhasil dikirim.;
}


The problem, when I run this script with ID_User ABC, the file uploaded to
/home/gilijk/data/namafile.xtc
not to
/home/gilijk/data/ABC/namafile.xtc 
as I expected.

The script works if I use hardcode :
$destination = /home/gilijk/data/ABC;

When I try to echo $folder and $destination, both works ok.
echo $folder; (output ABC)
echo $destination ; (ouput /home/gilijk/data/ABC )

Thanks for any help !

Gilijk





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]