School Map:
Home / Enroll
$ Student Records; Class
$ News @ LIVE
Tech Radio * Support/FAQ
| Store | FORUMS
|
prezbedard
|
Ok it works but I am not sure this is the exact format it was asking for
I used variables for day of the week url and concatination to print the string descriptions. |
|
anti
|
|
|
anti
|
|
|
DrgnLdy
|
OK....a simple week 2 just changing urls for each day - worked good on second try. Now I'm going for a pic of the day - any advice or assistance would be appreciated
|
|
mrgoodrat
|
<?
//Get Date $today = date("w"); //Select URL switch($today) { case 1: $myLink = "www.mrgoodrat.com"; $myDesc = "Mr. Goodrat Web Development"; break; // escape the switch since we had a true result case 2: $myLink = "www.russellblock.com"; $myDesc = "Russell Block Paintings and Drawings"; break; // escape the switch since we had a true result case 3: $myLink = "www.brooksideglen.org"; $myDesc = "Brookside Glen Community"; break; // escape the switch since we had a true result case 4: $myLink = "www.milliondollaradventures.com"; $myDesc = "Million Dollar Adventures"; break; // escape the switch since we had a true result case 5: $myLink = "www.puddlebug.com"; $myDesc = "Puddle Bug Creations of Whimsy"; break; // escape the switch since we had a true result case 6: $myLink = "www.sssra.org"; $myDesc = "South Suburban Special Recreation Association"; break; // escape the switch since we had a true result case 7: $myLink = "www.marleycandles.com"; $myDesc = "Marley Candles Since 1965"; break; // escape the switch since we had a true result default: // when nothing is true do this } //Display Result print ($myDesc."<br><a href=\"http://$myLink\" target=\"newWin\">".$myLink."</a>"); ?> |
|
ZeusXena
|
I did the week 2 basic assignment.
Ready For Three I hope. Any comments are Weclome I Can't see this colorize checkbox
Working Url <a href='http://www.http://www.zeus-site.com/week2.php'>Working URL</A> |
|
ZeusXena
|
Hi, Sorry to post twice but I haved made a mistake.
/* «»*«»*«»*«»*«»*«»*«»*«»*«» «»*«»*«»*«»*«»*«»*«»*«»*«» ‹(•¿•)›‹(•¿•)›‹(•¿•)›‹(•¿•)› Working Url <a href='http://www.http://www.zeus-site.com/week2.php'>Working URL</A> ‹(•¿•)›‹(•¿•)›‹(•¿•)›‹(•¿•)› «»*«»*«»*«»*«»*«»*«»*«»*«» «»*«»*«»*«»*«»*«»*«»*«»*«» */ This should be? <a target="_blank" href="http://www.zeus-site.com/week2.php">Working Url</a> |
|
Russell
|
<?
$day=date("w"); switch("$day") { case "0": $url="http://www.sunday.com"; $description="Sundays link"; break; case "1": $url="http://www.monday.com"; $description="Monday's link"; break; case "2": $url="http://www.tuesday.com"; $description="Tuesday's link"; break; case "3": $url="http://www.wednesday.com"; $description="Wednesday's link"; break; case "4": $url="http://www.thursday.com"; $description="Thursday's link"; break; case "5": $url="http://www.friday.com"; $description="Friday's link"; break; case "6": $url="http://www.saturday.com"; $description="Saturday's link"; break; } print("Welcome! ".$description." is <a href=\"".$url."\">Here</a>. Enjoy!"); ?> |
|
GH0ST
|
I need help, could someone tell my why my URL's always start with the directory of my server that the script is in? http://www.whatever.com/blah/w....whatswrong.com
this has been killing me. Any clue what i did wrong? |
|
lestat
|
Ghost, I'm not sure I understand your question. If your scipt is located at http://yourdomain.com/folder then thats where your scripts will run. |
|
isiahw1
|
|
|
Rythm
|
I think i have done this assignment, it taken my few time but i did after repairing my bugs.. hope this will work..
|
|
Andrius2a
|
<HTML>
<HEAD> <TITLE>2 week assignment</TITLE> </HEAD> <BODY> <?php // This script will show active url depending on day of the week $day = date("w"); switch ($day) { // This is a day and URL assignments for SUNDAY case 0: $day="Sunday"; $url="PHP world on: <a href='http://www.php.net/'>www.php.net</a>"; break; // This is a day and URL assignments for MONDAY// case 1: $day="Monday"; $url="Amazon search: <a href='http://www.amazon.com/'>www.amazon.com</a>"; break; // This is a day and URL assignments for TUESDAY case 2: $day="Tuesday"; $url="Google search: <a href='http://www.google.com/'>www.google.com</a>"; break; // This is a day and URL assignments for WEDNESDAY case 3: $day="Wednesday"; $url="Yahoo mail: <a href='http://mail.yahoo.com/'>mail.yahoo.com</a>"; break; // This is a day and URL assignments for THURSDAY case 4: $day="Thursday"; $url="Script learning school: <a href='http://www.adultnetsurprise.com/'>www.www.adultnetsurprise.com</a>"; break; // This is a day and URL assignments for FRIDAY case 5: $day="Friday"; $url="Ebay: <a href='http://www.ebay.com/'>www.ebay.com</a>"; break; // This is a day and URL assignments for SATURDAY case 6: $day="Saturday"; $url="Download center: <a href='http://www.download.com/'>www.download.com</a>"; break; default: print("Error"); } // DISPLAY DAY and Active URL print("Today is a <b><i>$day</i></b><br><br> and you can visit only <b><i>$url</i></b>"); ?> </BODY> </HTML> |
|
mrnaked69
|
|
|
Webby
|
I don't get this assigment. It works but I don't understand how does the case understand which date it is? What is the control factor of case? This is not explained very well.
I change the $today to "w" like everyone else, but I used "l" in my own code. Why didn't it work? Does the switch/case only work on dates? |
|
Webby
|
Ok now things make sense after reading Class #3. I have the answers to my questions now :)
Thanks |
|
SoonMe
|
Hi.
First of all this forum is doing soo good so far, i'm new here so i have one question. Can someone writte me php code for one website because today i begin to learn about php and i need basic knowlegde for beginning and also i want to learn about creating table with mysql and to be connected with php. Thanks |
|
Xena
|
<?php
$today = date('w'); //numeric value of the day $today2=date('l'); //letter Value of the day readable $macaveli = "Today 's Link is"; //Select URL switch($today){ case 1://Monday $site = "Ad mesofish Ad Web site Advertising :<a href="http://www.mesofish.com">mesofish.com</a>"; break; case 2: $site = "Kislen Loans :<a href='http://www.kislen.com">Welcome To Kislen</a>"; break; case 3: $site = "Visit flowers :<a href='http://www.visitflowers.com'>Visit Flowers.com</a>"; break; case 4: $site ="Training Marathon Web Site :<a href="http://www.trainingmarathon.com">Training Marathon</a>"; break; case 5: $site = "2 Pac s Web site :<a href="http://www.macaveli.com">2 Pac s</a>"; break; case 6: $site = "Movies Made Site :<a href="http://www.moviesmade.com">Movies Made</a>"; break; case 0: $site = "Are You Thirsty :<a href="http:www.water.com">Water</a>"; break; default: echo "The day is Thousand Miles Away"; } print("Is $today2'''and'''$macaveli<br>$site") ?> </td></tr></table> </center> </body> </html> |
View Previous Thread Print This Page |
School Map:
Home / Enroll
$ Student Records; Class
$ News @ LIVE
Tech Radio * Support/FAQ
| Store
Advertising
| Link To Us | Privacy
Copyright 2000-2002 Script School Productions / KMR
Enterprises
No part of this website may be reproduced, copied and/or distributed
in any medium
without express written permission