TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 06-30-2011, 06:47 PM   #1 (permalink)
The Visitor
 
Join Date: Jun 2011
Posts: 2
Thanks: 0
Sla6hter32 is on a distinguished road
Smile Show code only HTML once every 24 hours to each user?

I would like to show one piece of HTML once per day for one user.
Can someone please help me do that..

Sorry for bad English.

Thank you.
Sla6hter32 is offline  
Reply With Quote
Old 06-30-2011, 07:51 PM   #2 (permalink)
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Default

We need more information. Like where is the html stored (are they files, in database ...) and more or less how is the database structure relating to html codes and users.

and what do you mean buy showing a piece of html code a day? is it a big piece or just 1 tag or like an ad.

P.S. Your English is good :)
tony is offline  
Reply With Quote
Old 07-01-2011, 02:08 PM   #3 (permalink)
The Visitor
 
Join Date: Jun 2011
Posts: 2
Thanks: 0
Sla6hter32 is on a distinguished road
Default

I would like to increase my click count on some topsites with iframes..
So basicly i would like this (below) iframe code to be loaded once per day for a user.

Example:
<IFRAME SRC='http://TOPSITE.COM/MYWEBSITE' SCROLLING='no' WIDTH='1' HEIGHT='1' FRAMEBORDER='no'></IFRAME>


Could you please show me a code i could use as i suck at coding, i tried but it seems a bit to hard for me...

Thanx
Sla6hter32 is offline  
Reply With Quote
Old 07-02-2011, 03:31 PM   #4 (permalink)
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Default

so everyday is going to be a different SRC='http://TOPSITE.COM/MYWEBSITE'? If you have a database I would save a table of sites_urls with an id field. then in the users tables also have a shown_sites field that would be a string of ids separated by a coma, another field with current_site with the id of the current site url. Also a last_date_shown field in the users table having the date that the current. From then it is just a checking if the last_date_shown has expired (if it is already the next day) then save a new id that hasn't been shown to the current_site field and also append that new id to the shown_sites list field. Then just show the current_site. Sorry I can't provide code. I am in a bit of a hurry. Hopefully it helps.
tony is offline  
Reply With Quote
Old 07-02-2011, 06:12 PM   #5 (permalink)
The Acquainted
 
Join Date: Nov 2009
Location: nr Stratford-Upon-Avon
Posts: 137
Thanks: 3
maeltar is on a distinguished road
Default

why not just drop a cookie, and check it every visit ?

http://www.tizag.com/phpT/phpcookies.php

Just use different times, some examples below

Code:
$sixhours = 21600 + time(); // current time + 6 hours
$halfday= 42300 + time();  // current time + 12 hours
$fullday = 86400 + time();  // current time + 24 hours

setcookie('lastVisit', date("G:i - m/d/y"), $sixhours);
I'd be tempted to set it at 6 or 12 hours, the cookie will expire, so if you test for it's existence and it's not there you can show your page.

So the code is shown here the wrong way round as you would test for the cookies existence first, then set it at the end of your page.

Code:
<?php
if(isset($_COOKIE['lastVisit']))
	$visit = $_COOKIE['lastVisit']; 
else
	echo "You've got some stale cookies!";

echo "Your last visit was - ". $visit;
?>
__________________
Thanks... Simon

Sex, Drugs & Linux Rules

Last edited by maeltar : 07-02-2011 at 06:44 PM.
Send a message via MSN to maeltar
maeltar is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB 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
Writing Clean Code Village Idiot Tips & Tricks 10 06-25-2012 12:35 PM
Easy to Modify Login Script with Hierarchical User Permissions and XML Account File Wildhoney Script Giveaway 4 05-04-2011 06:11 AM
Show database to HTML multy columm hacku Absolute Beginners 2 10-21-2008 11:16 PM
how to capture and show error in oop php to user? kokjj87 Advanced PHP Programming 5 10-02-2008 06:37 PM
Show code only once every 24 hours to each user? Sled General 10 12-14-2007 12:33 PM


All times are GMT. The time now is 10:28 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design