blondieUA Posted November 12, 2009 Share Posted November 12, 2009 Hello guys! I have some problem with creating the result page I need to create a web-page for my college course in Computer Science. I decided to create a site about Horoscopes. So if a person picks the date, he will be taken to a page with the results for different Horoscopes, e.g. Chinese, Zodiac, Astrological. The problem is that they all have different results for different periods of time. How can I arrange it? Like if some1 will pick a date 1 Jan 1981, than he will be a Rooster due to Japanese Horo, and a Capricorn for Zodiac horo. So there will be different results for the same date. I have results for different periods of times in txt files for all horoscopes and same with image results. How can I make this, so the person will proceed to a page where he will see his result in a form of a list: Image for Chinese horo, than the text; than image for Zodiac Hore and the text... Please, give me some simple ideas, I am so lost and noone can help me I am sorry for the language, I am not from English speaking country. Quote Link to comment https://forums.phpfreaks.com/topic/181269-php-pick-a-date-show-results/ Share on other sites More sharing options...
chauffeur Posted November 12, 2009 Share Posted November 12, 2009 Get_date method + if (date in date_set) { go to here; } set up date set to look at dates ie 22/11/ - 22/12 = Capricorn Would be easier as piped dates I know, I was a well known astrologer in Asia Quote Link to comment https://forums.phpfreaks.com/topic/181269-php-pick-a-date-show-results/#findComment-956353 Share on other sites More sharing options...
chauffeur Posted November 12, 2009 Share Posted November 12, 2009 You'd be better of here. get answers quick and plenty of them http://forums.devnetwork.net/ucp.php?mode=login Quote Link to comment https://forums.phpfreaks.com/topic/181269-php-pick-a-date-show-results/#findComment-956357 Share on other sites More sharing options...
chauffeur Posted November 12, 2009 Share Posted November 12, 2009 PM me and I'll help set you up with a bit of code I wrote for a dating website. Ray Quote Link to comment https://forums.phpfreaks.com/topic/181269-php-pick-a-date-show-results/#findComment-956361 Share on other sites More sharing options...
chauffeur Posted November 12, 2009 Share Posted November 12, 2009 What the heck? Here, have it! Make it work. while ($row = mysql_fetch_array($select)) { $birthdate = $row["birthdate"]; $seperate_date = explode("/", $birthdate); //Seperate Bday into seperates and remove the / $day = $seperate_date[0]; //Seperate Birth DAY $month = $seperate_date[1]; //Seperate Birth MONTH $year = $seperate_date[2]; //Seperate Birth YEAR $day_count = strlen($day); $month_count = strlen($month); if($day_count==1){$day = sprintf("%02d", $day);} if($month_count==1){$month = sprintf("%02d", $month);} $chinese_format = "$year$month$day"; //Combine into format yyyymmdd } $lunar_file = "../java/year.txt"; #for ease only. Set it up as you want. alter the file at your peril! $year = file($lunar_file); #puts file into array for($x=1;$x<count($year);$x++){ #loops through the array $data = explode("=", $year[$x]); $date = explode("|", $data[1]); if(isset($date[0]) AND isset($date[1])){#looks for two dates to match with or between if($chinese_format>=$date[0] AND $chinese_format<=$date[1]){ $sign = $data[0]; #stores star-sign only. This is passed to chris' site } } } if(file_exists('http://horoscope.netfirms.com/horoscopes/new/'.$typo.'.php')){#check file exists AKA Chris-Critchlow.com you'll also need this as a txt file ox=19010219|19020207 ox=19130206|19140125 ox=19250125|19260212 ox=19370211|19380130 ox=19490129|19500216 ox=19610215|19620204 ox=19730203|19740122 ox=19850220|19860208 ox=19970207|19980127 rat=19000131|19010218 rat=19120218|19130205 rat=19240205|19250124 rat=19360124|19370210 rat=19480210|19490128 rat=19600128|19610214 rat=19720215|19730202 rat=19840202|19850219 rat=19960219|19970206 See how they are piped? You can work out the rest foe yourself. I might return with a new site but for now, enjoy! Ray CC Quote Link to comment https://forums.phpfreaks.com/topic/181269-php-pick-a-date-show-results/#findComment-956379 Share on other sites More sharing options...
chauffeur Posted November 12, 2009 Share Posted November 12, 2009 "he will be a Rooster due to Japanese Horo, and a Capricorn for Zodiac"?????? Get it right before you start! Rooster = Chinese = Zodiac Capricorn = Western = Horoscope or Sun Sign Quote Link to comment https://forums.phpfreaks.com/topic/181269-php-pick-a-date-show-results/#findComment-956403 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.