School Map:
Home / Enroll
$ Student Records; Class
$ News @ LIVE
Tech Radio * Support/FAQ
| Store | FORUMS
|
Ahkorahil
|
eeem.... so little mistake, why didn't I notice it :P
thanks Quicksaver :D |
|
Ash2k4
|
|
|
Sety
|
<?
switch(date("w")) { case "0":$url = "<a href=\"http://www.sety.go.ro\">Sety Power</a>...is my site motherfucker."; break; case "1":$url = "<a href=\"http://www.tranceaddict.com\">Trance music lovers</a><br>...damn good trance music."; break; case "2":$url = "<a href=\"http://www.slsk.org\">Soulseek</a>...a place where u can take music motherfucker."; break; case "3":$url = "<a href=\"http://www.animationcity.com\">Animatin City</a>...there is lots gif formats."; break; case "4":$url = "<a href=\"http://www.cooltext.com\">Cool Text</a>...damn interesting words format are there."; break; case "5":$url = "<a href=\"http://www.radiototal.ro\">Radio TOTAL</a>...the best music that u ever can hear motherfuckers."; break; case "6":$url = "<a href=\"http://www.google.com\">Google</a>Google search engine..you rat !!!"; break; } print ("The day site motherfuker is ". $url); /*NOTE:Where the hell in the lesson 2 are write about site adress and how supouse i read about that.Somebody who didn't know HTML i think it was in hell until now...or probably everybody must have HTML knowleadge when subscribe to this curs? I have damn it with lesson 2!!! Next...what the hell!!! CYA */ ?> |
|
vladdrac
|
hahahaha i know have a migraine.
I cant seem to figure out the error in line 22, looks right to me
help? |
|
vladdrac
|
ok i figured it out, I guess from now on i should actually try to debug it myself before yelling for help. Damn, that means i have to think for myself?
|
|
reaperx
|
Hi again ok took a pop at this one and it seams to work ok.
|
|
gunhoe86
|
i sort of altered what the script does to fit my own needs, but here it is never the less.
it worked like a charm where i used it ~JOSH |
|
nydud55
|
this doesnt seem to be working |
|
smilingdog
|
Why am I getting a dump of all the strings?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <!-- Creation Date: <?=Date("d/m/Y")?> --> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="Generator" content="Dev-PHP 1.9.4"> <title>Document Title</title> </head> <body> <?php $today = date("w"); switch($today) { case "0": print("The link for the day is: http://www.yahoo.com<br>"); case "1": print("The link for the day is: http://www.google.com<br>"); case "2": print("The link for the day is: http://www.altavista.com<br>"); case "3": print("The link for the day is: http://www.excite.com<br>"); case "4": print("The link for the day is: http://www.lycos.com<br>"); case "5": print("The link for the day is: http://www.metacrawler.com<br>"); case "6": print("The link for the day is: http://www.aol.com<br>"); } ?> </body> </html> |
|
Cyb
|
Maybe because you forgot the break; :)
Having a default is normally useful too to be sure it always works. |
|
smilingdog
|
Thanks for the help
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <!-- Creation Date: <?=Date("d/m/Y")?> --> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="Generator" content="Dev-PHP 1.9.4"> <title>Document Title</title> </head> <body> <?php $today = date("w"); switch($today) { case "0": print("The link for the day is: http://www.yahoo.com<br>"); break; case "1": print("The link for the day is: http://www.google.com<br>"); break; case "2": print("The link for the day is: http://www.altavista.com<br>"); break; case "3": print("The link for the day is: http://www.excite.com<br>"); break; case "4": print("The link for the day is: http://www.lycos.com<br>"); break; case "5": print("The link for the day is: http://www.metacrawler.com<br>"); break; case "6": print("The link for the day is: http://www.aol.com<br>"); break; default: print("Today's link is: http://www.cnbc.com<br>"); } ?> </body> </html> |
|
ice52us
|
hi, i just started the assignment, but i do not understand why i have an error. please help
<?php $desc1='yahoo' $link1='?><a href:"www.yahoo.com"><script language="php">$desc1</script></a><?php ' ?> <?php date ("w"); if ("date == 0") { $link1 }; ?> |
|
nymor
|
Here is my completion. However, the browser says something is wrong on line 29, and it expects 'T_DEFAULT'.
<html> <head> <title> Week 2 Assignment </title> </head> <body> <?php //This program prints one URL and link each day //Get date of week, and assign it to a variable $today = date("w"); //Assign URLs $sulink = '<a href="http://www.LangMaker.com">LangMaker.com</a>'; $sudes = 'THE website for creating languages with resources, conlangs, scripts, and more!'; $molink = '<a href="http://www.google.com">Google.com Search Engine</a>'; $modes = 'Those who seek, find. And those who seek with Google find more!'; $tulink = '<a href="http://www.diarenye.net">Diarenye</a>'; $tudes = 'My website, with languages, quizzes, polls, and more!'; $welink = '<a href="http://www.awstage.org">Awstage.org</a>'; $wedes = 'Awstage.org is a non-profit theater company'; $thlink = '<a href="http://www.yahoo.com">Yahoo!</a>'; $thdes = 'A description?'; $frlink = '<a href="http://www.GMtFD.org">GMTFD.org</a>'; $frdes = 'Green Mountain Fife and Drum Corps.'; $salink = '<a href="http://rohan.diarenye.net">News from the North</a>'; $sades = 'A free on-line Tolkien Newsletter.'; // SWITCH switch($today) { case0: print($sulink); print($sudes); break; print($molink); print($modes); break; print($tulink); print($tudes); break; print($welink); print($wedes); break; print($thlink); print($thdes); break; print($frlink); print($frdes); break; print($salink); print($sades); } ?> </body> </html> |
|
dwpreston
|
<TITLE>Script School Assignment 2</TITLE>
<center> <?php /*TO-DO ASSIGNMENT: Write a script to display a different URL each day of the week. The Variables* */ $today =date("w"); $comment = "Todays URL is : "; print "$today"; //Switch switch($today) { case "0"; $url = "<a href=\"http://google.com\">Google </a><br>Great search engine"; break; case "1"; $url = "<a href=\"http://yahoo.com/\">Yahoo</a><br>Very useful place"; break; case "2"; $url = "<a href=\"http://www.php.net/\">PHP</a><br>The PHP Home Page"; break; case "3"; $url = "<a href=\"http://www.prestons-tx.us/dwpreston\">Preston Homepage</a><br>My training ground"; break; case "4"; $url = "<a href=\"http://www.adventurezoneelpaso.com\">Adventure Zone in El Paso, Texas</a><br>Where I earn my livelyhood"; break; case "5"; $url = "<a href=\"http://www.chunkrockrecords\">Record Shop</a><br>Online Record Shop under construction."; break; case "6"; $url = "<a href=\"http://www.hotmail.com\">Hotmail</a><br>Free email site"; break; } Print "$comment $url"; ?> |
|
dwpreston
|
<TITLE>Script School Assignment 2</TITLE>
<center> <?code /*TO-DO ASSIGNMENT: Write a script to display a different URL each day of the week. The Variables* */ $today =date("w"); $comment = "Todays URL is : "; print "$today"; //Switch switch($today) { case "0"; $url = "<a href=\"http://google.com\">Google </a><br>Great search engine"; break; case "1"; $url = "<a href=\"http://yahoo.com/\">Yahoo</a><br>Very useful place"; break; case "2"; $url = "<a href=\"http://www.php.net/\">PHP</a><br>The PHP Home Page"; break; case "3"; $url = "<a href=\"http://www.prestons-tx.us/dwpreston\">Preston Homepage</a><br>My training ground"; break; case "4"; $url = "<a href=\"http://www.adventurezoneelpaso.com\">Adventure Zone in El Paso, Texas</a><br>Where I earn my livelyhood"; break; case "5"; $url = "<a href=\"http://www.chunkrockrecords\">Record Shop</a><br>Online Record Shop under construction."; break; case "6"; $url = "<a href=\"http://www.hotmail.com\">Hotmail</a><br>Free email site"; break; } Print "$comment $url"; / ?> |
|
dwpreston
|
sorry for the double post but don't seem to be able to get the color feature to work what am i doing wrong ?
|
|
slinky
|
|
|
MSX
|
<?
// Define script's variables $today = date("w"); // Starting the script switch($today) { case"0": $url = "<a href="http://zonedout.net">ZonedOut.net - My Site!</a>"; break; case"1": $url = "<a href="http://scriptschool.com">ScriptSchool.com - My PHP teacher!</a>"; break; case"2": $url = "<a href="http://ebay.com">eBay.com - Online Auctions!</a>"; break; case"3": $url = "<a href="http://hbo.com">HBO.com - HBO Website!</a>"; break; case"4": $url = "<a href="http://tutorialforums.com">TutorialForums.com - Great Tutorial Forum!</a>"; break; case"5": $url = "<a href="http://jokes.com">Jokes.com - Funny jokes online</a>"; break; case"6": $url = "<a href="http://espn.com">ESPN.com - All of the latest sports news online!</a>"; break; default: print("Please refresh the page, there was an error"); break; } print("Today's Link is - $url") ?> And it work too, I have it setup locally on my PC...:). |
|
slinky
|
|
|
Emdec
|
|
|
Technel
|
Here's my code:
|
|
infinull
|
This is my week two assignment
why does PHP have to parse single and double quote strings differently. It annoys me, but it hwlped me this case. |
|
enshoku
|
It appears to work.
=============================== |
|
enshoku
|
I had a typo in my earlier post, but now I got it covered. *blushes*
----------- |
|
lklint
|
Hi everybody. Here's my code for week 2. Any comments are appreciated. :-) Lars |
|
wilde1000
|
<?
/*Second week assignment - Write a script to print to the browser a different URL each day of the week using the switch/case statement and comparing to the numeric day of the week (0-6), not the textual (Sunday-Saturday) day of the week. Use only one print() function to do this and make these urls active hyperlinks with the url title hyperlinked and the url description not hyperlinked. Employ the use of concatenation to create the single print function instead of enclosing in interpreted double quotes to demonstrate your understanding of concatenating strings. */ /*Set the $today variable to the proper fomat*/ $today=date("w"); $today_text=date("l");//needed for print format /*Set other print variables*/ $introduction="Welcome, today is "; /*Establish the remaining print variables*/ switch($today) { case 0: $url_text=" -- Check out Google for searching "; ?> <A HREF=http://www.google.com>Google</A><BR> <? break; case 1: $url_text=" -- Check out CNN for news "; ?> <A HREF=http://www.cnn.com>CNN</A><BR> <? break; case 2: $url_text=" -- Check out Yahoo for games "; ?> <A HREF=http://www.yahoo.com>Yahoo</A><BR> <? break; case 3: $url_text=" -- Check out Pogo for games "; ?> <A HREF=http://www.pogo.com>Pogo</A><BR> <? break; case 4: $url_text=" -- Check out ZDNet for downloads "; ?> <A HREF=http://www.zdnet.com>ZDNet</A><BR> <? break; case 5: $url_text=" -- Check out PHP for php scripts "; ?> <A HREF=http://www.php.com>PHP</A><BR> <? break; default: $url_text=" -- Check out Sportline for sports news "; ?> <A HREF=http://www.sportsline.com>Sportsline</A><BR> <? break; } /*using one Print statement.......*/ Print($introduction.$today_text.$url_text); */Have tested script and checked it against assignment requirements ?> |
|
wilde1000
|
<?
/*Second week assignment - Write a script to print to the browser a different URL each day of the week using the switch/case statement and comparing to the numeric day of the week (0-6), not the textual (Sunday-Saturday) day of the week. Use only one print() function to do this and make these urls active hyperlinks with the url title hyperlinked and the url description not hyperlinked. Employ the use of concatenation to create the single print function instead of enclosing in interpreted double quotes to demonstrate your understanding of concatenating strings. */ /*Set the $today variable to the proper fomat*/ $today=date("w"); $today_text=date("l");//needed for print format /*Set other print variables*/ $introduction="Welcome, today is "; /*Establish the remaining print variables*/ switch($today) { case 0: $url_text=" -- Check out Google for searching "; ?> <A HREF=http://www.google.com>Google</A><BR> <? break; case 1: $url_text=" -- Check out CNN for news "; ?> <A HREF=http://www.cnn.com>CNN</A><BR> <? break; case 2: $url_text=" -- Check out Yahoo for games "; ?> <A HREF=http://www.yahoo.com>Yahoo</A><BR> <? break; case 3: $url_text=" -- Check out Pogo for games "; ?> <A HREF=http://www.pogo.com>Pogo</A><BR> <? break; case 4: $url_text=" -- Check out ZDNet for downloads "; ?> <A HREF=http://www.zdnet.com>ZDNet</A><BR> <? break; case 5: $url_text=" -- Check out PHP for php scripts "; ?> <A HREF=http://www.php.com>PHP</A><BR> <? break; default: $url_text=" -- Check out Sportline for sports news "; ?> <A HREF=http://www.sportsline.com>Sportsline</A><BR> <? break; } /*using one Print statement.......*/ Print($introduction.$today_text.$url_text); */Have tested script and checked it against assignment requirements ?> |
|
Helena
|
<?
//Find the day of week $today = date ("w"); $MyDay = Date (" l"); //set variables depending on day switch($today) { case 0://sunday $MySite = "http://www.eurotropic.com/beachfrontapartment/beachfront_apt.htm"; $MyTitle = "This is a wonderful place to spend a holiday"; break; case 1://monday $MySite = "http://www.eurotropic.com/edificiopropisa/apartpropisa.htm"; $MyTitle = "This is the best unspoilt place on the southern coast..."; break; case 2://tuesday $MySite = "http://www.eurotropic.com/villavictoria/villavictoria.htm"; $MyTitle= "Just see this apartment......."; break; case 3://wednesday $MySite = "http://www.eurotropic.com/saliega/villasaliega.htm"; $MyTitle ="Today's link for a lovely villa....."; break; case 4://thursday $MySite = "http://www.eurotropic.com/book/north.htm"; $MyTitle = "Something to read..."; break; case 5://friday $MySite = "http://www.alhambra-patronato.es/ingles/inforgenrl/informain.htm"; $MyTitle = "Take a trip to Granada and visit the Alhambra...."; break; case 6://saturday $MySite = "www.eurotropic.com"; $MyTitle = "Your holiday site..."; break; default: echo "Time has run out !"; } $MyMessage = "It is" . $MyDay . "<br> Lets go to .... <a href="http://"; $MyMessage = $MyMessage .$MySite ."">" . $MyTitle ." </a>"; echo $MyMessage; ?> It works!!! |
|
Beauchy
|
|
|
madhatter
|
|