FuG5333 Posted July 10, 2006 Share Posted July 10, 2006 Well, so far I've made a calendar and it looks and functions the way I need it to. The issue is, how do I do something like: "If it's tuesday, put a link to signup. But only on Tuesdays."? Link to comment https://forums.phpfreaks.com/topic/14223-php-calendar/ Share on other sites More sharing options...
micah1701 Posted July 10, 2006 Share Posted July 10, 2006 I think you could do something like[code]<?php$datestamp = n; //wherever you get your date fromif(strtotime("l",$datestamp) == "Tuesday"){ //do whatever}?>[/code]note: that is a lower case 'L' and not a number "1" Link to comment https://forums.phpfreaks.com/topic/14223-php-calendar/#findComment-55822 Share on other sites More sharing options...
ShogunWarrior Posted July 10, 2006 Share Posted July 10, 2006 I think micah meant [b]if(date("l",$datestamp)=="Tuesday")[/b] instead of [b]if(strtotime("l",$datestamp) == "Tuesday")[/b] Link to comment https://forums.phpfreaks.com/topic/14223-php-calendar/#findComment-55842 Share on other sites More sharing options...
FuG5333 Posted July 10, 2006 Author Share Posted July 10, 2006 Here's what I have so far. The error is something about "T_ENCAPSED_AND_WHITESPACE".[code]<?php$todaysdate = ".$_SERVER['PHP_SELF']."?date=".mktime(0,0,0,$month -1,$d,$year)."; if(strtotime("l",$datestamp) == "Tuesday"){ echo "$todaysdate"; }?>[/code]My goal is to get only Tuesdays to show up with a signup link. This is the first step. If I can figure how to put something in only Tuesdays, then I get put a link later. The problem is, I'm trying to eventually save each signup as a 20060610 type of date so the signups can be linked to that date only. Making sense? Link to comment https://forums.phpfreaks.com/topic/14223-php-calendar/#findComment-55845 Share on other sites More sharing options...
redarrow Posted July 10, 2006 Share Posted July 10, 2006 <?$date=getdate();$today_date=$date[weekday];echo $today_date;if ($today_date =="Tuesday") {//add code}?> Link to comment https://forums.phpfreaks.com/topic/14223-php-calendar/#findComment-55891 Share on other sites More sharing options...
micah1701 Posted July 11, 2006 Share Posted July 11, 2006 [quote]I think micah meant if(date("l",$datestamp)=="Tuesday") instead of if(strtotime("l",$datestamp) == "Tuesday")[/quote]I think I meant that too. oops :-[ Link to comment https://forums.phpfreaks.com/topic/14223-php-calendar/#findComment-56191 Share on other sites More sharing options...
Daniel0 Posted July 11, 2006 Share Posted July 11, 2006 [quote author=redarrow link=topic=100105.msg394792#msg394792 date=1152569986]<?$date=getdate();$today_date=$date[weekday];echo $today_date;if ($today_date =="Tuesday") {//add code}?>[/quote]You need to enclose weekday in single or double quotes, else it's a constant. Like [code]$today_date=$date['weekday'][/code] Link to comment https://forums.phpfreaks.com/topic/14223-php-calendar/#findComment-56195 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.