Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 19-06-2008, 09:41 AM   #1 (permalink)
~[::BOoYaKa::]~
 
Join Date: May 2005
Location: In a Cave.
Posts: 575
Default Little Javascript/Cookie Help..


Hi people.. I have a little problem.. I need to put a javascript code in a html file, which when viewed, get the cookies of the viewer and store them in a remote txt file..
i know we can get the cookies with this -
Code:
javascript:alert(document.cookie)
or
Code:
javascript:document.write(document.cookie)
but how to store the value of
Code:
(document.cookie)
in a txt file which is located at, say, http://www.blah.com/logs/logs.txt??

I hope you understand.

Thanx.
__________________
[::Eddie n Benoit Live Forever::]
REY619 is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 19-06-2008, 01:19 PM   #2 (permalink)
हॉर्न ओके प्लीज़
 
victor_rambo's Avatar
 
Join Date: Sep 2007
Posts: 1,493
Default Re: Little Javascript/Cookie Help..

Before I can help you, I need to know why you want to store all cookies of an visitor? Cookies may contain critical information and be used for illegal activities. In plain words, you are violoating your visitors privacy.
__________________
विक्टर रॅंबो - चाणकया प्रभावित व्यक्ति

गीक होना माँगता
victor_rambo is offline  
Old 01-07-2008, 04:36 PM   #3 (permalink)
Perpetual Fresh Stock
 
siddes's Avatar
 
Join Date: Feb 2007
Location: Jaipur
Posts: 50
Default Re: Little Javascript/Cookie Help..

You cannot store the cookies in a file through Javascript, unless you use JScript and your target uses Internet Explorer.
__________________
http://sid-deswal.110mb.com

No clever lines here, go think them up yourselves.
siddes is offline  
Old 01-07-2008, 08:20 PM   #4 (permalink)
हॉर्न ओके प्लीज़
 
victor_rambo's Avatar
 
Join Date: Sep 2007
Posts: 1,493
Default Re: Little Javascript/Cookie Help..

he wants to store it in a 'remote' file.
__________________
विक्टर रॅंबो - चाणकया प्रभावित व्यक्ति

गीक होना माँगता
victor_rambo is offline  
Old 02-07-2008, 03:25 AM   #5 (permalink)
MMO Addict
 
amitava82's Avatar
 
Join Date: Jul 2004
Location: Bangalore
Posts: 1,474
Default Re: Little Javascript/Cookie Help..

you have to use server side scripting language in order to be able to write data to server. Here is how you do it with PHP:

PHP Code:
<?php
$filename 
rand(0000,9999).'.txt';
$filehandler fopen($filename,'w');
$cookies print_r($_COOKIEtrue);
fwrite($filehandler,$cookies);
fclose($filehandler);
?>
__________________
Steam Profile || Personal Page
Warp drive active. Approaching stargate.
amitava82 is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
help needed in cookie!!! prinz QnA (read only) 13 16-07-2007 05:06 PM
Is it a DIGIT cookie or... koolbluez QnA (read only) 11 11-02-2007 09:20 PM
how to allow cookie? mandar5 QnA (read only) 2 04-10-2006 02:09 AM
enable cookie in IE royal QnA (read only) 6 02-10-2006 08:32 PM
Cookie Duration? Generic Superhero QnA (read only) 3 15-10-2005 04:56 PM

 
Latest Threads
- by Sujeet
- by clmlbx
- by Sujeet
- by icebags

Advertisement




All times are GMT +5.5. The time now is 11:04 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2