Free Scripts
 
Banner Ads
Chat
Form Processor
GuestBook
MailFile
PostCard
 
Free Snippets
 
Cookies
Header/Footer
Random Text
Text Counter
 
Scripts Directory
 
ASP
ASP.NET
Java
Javascript
Perl
PHP
Python
XML
 
Misc.
 
Resources 1 2 3 4 5
Web Hosting
Website Promotion
Add Listing
Contact Us
Webmaster Forums
Web Hosting Guide
Free PHP scripts
Web Hosting Services
Dedicated Hosting
Ecommerce Hosting
Domain Registration Tools
JavaScript Search
Free Website Solutions
Ecommerce & Web Developers Directory
DataCenter Dicussion
Free Software Downloads
Reseller Hosting
Free Website Templates
OMG Software
Web Hosting
JSP Web Hosting
Web Hosting
Cgi2yoU.com
Hot Software Novelties
 
 
  Jumpline Hosting
With the ability to host 6 domains on one account, you can?t beat this low price. More Information.
 
Netfirms Web Hosting
Trusted by over 1,000,000 people and growing
 
Interland
Sell and Market Your Products Online
 
Dot5 Hosting
Award Winning Web Hosting JUST $5p/m
 
Partners
 
Link Partners
CCNA
 
 
 





Description

This script will include a simple text counter on the page of your choice. The scripts do not require a database of any kind.

Setting Cookies in PHP

Use the following code before your <html> tags to set a cookie.
<?
$fName = "Linus"        //variables for the cookie
$lName = "Torvalds"
setcookie('firstName', $fName);   //set cookies
setcookie('lastName', $lName);
?>

Use the following code to retrieve existing cookie data and print it to the screen.

<?
echo $_COOKIE["firstName"];    //outputs data in cookie
echo $_COOKIE["firstName"];    //outputs data in cookie
?>

Setting Cookies in ASP

Use the following code before your <html> tags to set a cookie.
<%
fName = "Linus"        'variables for the cookie
lName = "Torvalds"
Response.Cookies("name")("fname") = fname    'set the cookies value
Response.Cookies("name")("lname") = lname    'set the cookies value
Response.Cookies("name").Domain = "www.freescripts.com"   'set to your domain
Response.Cookies("name").Expires = Date + 365  'when the cookie expires
%>

Use the following code to retrieve existing cookie data and print it to the screen.

<%
Response.Write(Request.Cookies("name")("fname")  'outputs data in cookie
Response.Write(Request.Cookies("name")("lname")  'outputs data in cookie
%>

Copyright © 1996 - 2003 JumpBug Enterprises
Read our Privacy Statement
Read our License Agreement