School Map:  Home / Enroll $ Student Records; Class  
$ News @ LIVE Tech Radio * Support/FAQ | Store | FORUMS

 

 (#605 2004-05-29 13:38:45) Post Reply
Page 0 1 2 3 4 5

ice52us
Need To Set


Enrolled: Feb 2004
Posts: 9
AP: 1



<html>
<head>
<title>Untitled</title>
</head>

<body>
<?
$day
= date("w");
$comment = "$day 's site is";
$google = "<a href=\"www.google.com\">www.google.com</a>";
$googled = "Search engine";
$yahoo = "<a href=\"www.yahoo.com\">www.yahoo.com</a>";
$yahood = "Email";
$stickdeath = "<a href=\"www.stickdeath.com\">www.stickdeath.com</a>";
$stickdeathd = "Stick figure fights";
$ebay = "<a href=\"www.ebay.com\">www.ebay.com</a>";
$ebayd = "Auction site";
$textfiles = "<a href=\"www.textfiles.com\">www.textfiles.com</a>";
$textfilesd = "Contains textfiles";
$dhama = "<a href=\"www.dhama.us\">www.dhama.us</a>";
$dhamad = "Real estate";
$hotmail = "<a href=\"www.hotmail.com\">www.hotmail.com</a>";

switch (
$day)
{case
0: print ("$comment $google $googled");
break;
case
1: print ("$comment $yahoo $yahood");
break;
case
2: print ("$comment $stickdeath $stickdeathd");
break;
case
3: print ("$comment $ebay $ebayd");
break;
case
4: print ("$comment $textfiles $textfilesd");
break;
case
5: print ("$comment $dhama $dhamad");
break;
case
6: print ("$comment $hotmail $yahood");
break;
default: print (
"What's the weather like on your planet?"); }






?>


</body>
</html>


This is my first time programming, and taking what I learned from lesson 1 and 2, this is what i was able to accomplish. I have read some of the other examples, which dont use as many print() but I am pretty sure the lessons dont cover that.

 

 (#608 2004-05-30 11:10:07) Post Reply
Page 0 1 2 3 4 5

gr
Need To Set


Enrolled: May 2004
Posts: 2
AP: 1



<html>
<head>
<title>week2 php</title>
<meta name="generator" content="BBEdit 6.5">
</head>
<body>

<?php
$today
=date("w");

switch(
$today)
{
case
"0":
$url="Here is Sunday's link: <a href='http://www.lfcc.org' target=_blank>www.lfcc.org</a>";
$features = "the Living Faith Christian Center.";
break;

case
"1":
$url="Here is Monday's link: <a href='http://www.google.com'>www.google.com</a>";
$features = "maybe the world's best search engine.";
break;

case
"2":
$url="Here is Tuesday's link: <a href='http://www.nhl.com'>www.nhl.com</a>";
$features = "coverage of the Stanley Cup playoffs.";
break;

case
"3":
$url="Here is Wednesday's link: <a href='http://www.guyradcliffe.com'>www.guyradcliffe.com</a>";
$features = "the best in art and illustration";
break;

case
"4":
$url="Here is Thursday's link: <a href='http://www.scriptschool.com'>www.scriptschool.com</a>";
$features = "the best online scripting school!";
break;

case
"5":
$url="Here is Friday's link: <a href='http://www.incognito.org.uk'>www.incognito.org.uk/a>";
$features = "one of the best R & B bands ever.";
break;

case
"6":
$url="Here is Saturday's link: <a href='http://www.allafrica.com'>www.allafrica.com</a>";
$features = "the best in African news, information and photographs.";
break;

default:
print(
"Houston, we have a problem!");
}

print(
"$url representing $features");

?>

</body>
</html>


 

 (#611 2004-05-31 00:09:58) Post Reply
Page 0 1 2 3 4 5

Salluas
Need To Set


Enrolled: May 2004
Posts: 5
AP: 1

This one took a little while to get right..man those backslashers before the double quotes are KILLERS!



<?php //Week 2 Assignment
//Begin code
//Assign date string constants and uniform resource locator variables
$today = date("n/j/y");
$day = date("w");

//Begin switch/case
switch($day)
{
case
"0":
$url = "<a href=\"http://www.fark.com\">It's not news, it's Fark.com!</a>";
break;
case
"1":
$url = "<a href=\"http://www.microsoft.com\">Microsoft, how do you want to crash today?</a>";
break;
case
"2":
$url = "<a href=\"http://www.ebay.com\">eBay, Got junk?</a>";
break;
case
"3":
$url = "<a href=\"http://www.thinkgeek.com\">ThinkGeek, why not?</a>";
break;
case
"4":
$url = "<a href=\"http://www.bravenet.com\">Bravenet, free hosting, anyone?</a>";
break;
case
"5":
$url = "<a href=\"http://www.neowin.net\">Microsoft betas, news, and reviews</a>";
break;
case
"6":
$url = "<a href=\"http://www.wincustomize.com\">WinCustomize, just skin it!</a>";
break;
//Error handling
default:
print(
"No webpage for you!");
break;
}

print(
"Today's date is: $today and the site of the day is: $url");
?>




Enjoy!

 

 (#625 2004-06-08 16:05:47) Post Reply
Page 0 1 2 3 4 5

fishhead
Need To Set


Enrolled: Jun 2004
Posts: 6
AP: 1



<?
// assign urls and descriptions
$sun="<a href=http://www.yahoo.com>Yahoo</a> - Search Engine";
$mon="<a href=http://www.google.com>Google</a> - Search Engine";
$tues="<a href=http://www.godaddy.com>Go Daddy</a> - Domain Registry";
$wed="<a href=http://www.directnic.com>Directnic</a> - Domain Registry";
$thur="<a href=http://www.espn.com>ESPN</a> - Sports info";
$fri="<a href=http://www.abc.com>ABC</a> - Television info";
$sat="<a href=http://www.nbc.com>NBC</a> - Television info";
$today = date("w");
switch(
$today) // sets switch in motion
{
case
0:
print(
$sun);
break;
// if false proceed to next case
case 1:
print(
$mon);
break;
case
2:
print(
$tues);
break;
case
3:
print(
$wed);
break;
case
4:
print(
$thur);
break;
case
5:
print(
$fri);
break;
case
6:
print(
$sat);
break;
default:
// when nothing is true do this
}
?>



 

 (#631 2004-06-09 12:25:56) Post Reply
Page 0 1 2 3 4 5

Samspong
Need To Set


Enrolled: May 2004
Posts: 4
AP: 1



<?
$today
= date("w");

$slink = "<a href =\ "http://darkbasic.com">dark basic</a>";
$sdes = "Brilliant programming language";
$mlink = "<a href = \"http://bbc.co.uk"</a>";
$mdes = "
The official bbc website";
$tlink = "
<a href =

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /web/sites/tdavid/non_public_system/parsemsg.php on line 94

"http://thespark.com"</a>";
$tdes = "
Cool tests and stuff";
$wslink = "
<a href =

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /web/sites/tdavid/non_public_system/parsemsg.php on line 94

"http://cooltext.com"</a>";
$wdes = "
For all your banner making needs";
$thlink = "
<a href =

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /web/sites/tdavid/non_public_system/parsemsg.php on line 94

"http://hostultra.com"</a>";
$thdes = "
Unlimited space and bandwidth hosting, utterly spledid";
$flink = "
<a href =

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /web/sites/tdavid/non_public_system/parsemsg.php on line 94

"http://billbailey.co.uk"</a>";
$fdes = "
Bill Bailey's official site, most spectacular";
$salink = "<a href =\ "http://google.co.uk"</a>";
$sades = "The site of the amazing searching ability";
switch = $today {
case=0;
print("Todays magical link is: ".$sdes<br>. $slink);
break;
case=1;
print("Todays magical link is: ".$mdes<br>. $mlink);
break;
case=2;
print("Todays magical link is: ".$tdes<br>. $tlink);
break;
case=3;
print("Todays magical link is: ".$wdes<br>. $wlink);
break;
case=4;
print("Todays magical link is: ".$thdes<br>. $thlink);
break;
case=5;
print("Todays magical link is: ".$fdes<br>. $flink);
break;
case=6;
print("Todays magical link is: ".$sades<br>. $salink);
break;
default:
print("we appear to be linkless");
}
?>



 

 (#632 2004-06-09 12:30:14) Post Reply
Page 0 1 2 3 4 5

Samspong
Need To Set


Enrolled: May 2004
Posts: 4
AP: 1

hmmm there was something wrong with that, was it the spaces between the backslashes, let me see.


<?
$today
= date("w");

$slink = "<a href =\"http://darkbasic.com">dark basic</a>";
$sdes = "
Brilliant programming language";
$mlink = "
<a href =

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /web/sites/tdavid/non_public_system/parsemsg.php on line 94

"http://bbc.co.uk"</a>";
$mdes = "
The official bbc website";
$tlink = "
<a href =

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /web/sites/tdavid/non_public_system/parsemsg.php on line 94

"http://thespark.com"</a>";
$tdes = "
Cool tests and stuff";
$wslink = "
<a href =

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /web/sites/tdavid/non_public_system/parsemsg.php on line 94

"http://cooltext.com"</a>";
$wdes = "
For all your banner making needs";
$thlink = "
<a href =

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /web/sites/tdavid/non_public_system/parsemsg.php on line 94

"http://hostultra.com"</a>";
$thdes = "
Unlimited space and bandwidth hosting, utterly splendid";
$flink = "
<a href =

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /web/sites/tdavid/non_public_system/parsemsg.php on line 94

"http://billbailey.co.uk"</a>";
$fdes = "
Bill Bailey's official site, most spectacular";
$salink = "<a href =\"http://google.co.uk"</a>";
$sades = "The site of the amazing searching ability";
switch = $today {
case=0;
print("Todays magical link is: ".$sdes<br>. $slink);
break;
case=1;
print("Todays magical link is: ".$mdes<br>. $mlink);
break;
case=2;
print("Todays magical link is: ".$tdes<br>. $tlink);
break;
case=3;
print("Todays magical link is: ".$wdes<br>. $wlink);
break;
case=4;
print("Todays magical link is: ".$thdes<br>. $thlink);
break;
case=5;
print("Todays magical link is: ".$fdes<br>. $flink);
break;
case=6;
print("Todays magical link is: ".$sades<br>. $salink);
break;
default:
print("we appear to be linkless");
}
?>



 

 (#633 2004-06-09 12:34:00) Post Reply
Page 0 1 2 3 4 5

Samspong
Need To Set


Enrolled: May 2004
Posts: 4
AP: 1

what the dickens is going on? whats wrong with my code, or more to the point- whats right with it?

 

 (#639 2004-06-11 11:43:33) Post Reply
Page 0 1 2 3 4 5

lestat
Need To Set


Enrolled: Jan 2004
Posts: 44
AP: 1

Maybe replace the ";"'s in case...

case "0"; to case "0":

 

 (#640 2004-06-11 14:38:55) Post Reply
Page 0 1 2 3 4 5

lestat
Need To Set


Enrolled: Jan 2004
Posts: 44
AP: 1

OK - If I can do this, anybody can! This is <strong>exciting</strong>, because I made it go. I had a little difficulty missing quotes or semi colons here and there, but it only took me about 45min. With this tutorial I am starting to see the possibilities that can be done with this!



<?
// Assign date variable
$today=date("w");


// Set switch with variable static url possibilites

switch($today)
{
// Sun
case "0":
$url="A search Engine: <a href=\"http://www.google.com\" target=_blank>Google</a>";
break;

// Mon
case "1":
$url="A place to buy things: <a href=\"http://www.tigerdirect.com\">Tigerdirect</a>";
break;

// Tues
case "2":
$url="A place to buy paper: <a href=\"http://bradnersmith.com\">Bradner Smith</a>";
break;

// Wed
case "3":
$url="A place to buy business computer stuff: <a href=\"http://www.cdw.com\">CDW</a>";
break;

// Thurs
case "4";
$url="Whats going on in the world of scientists: <a href=\"http://www.fas.org/main/home.jsp\">FAFSA</a>";
break;

// Fri
case "5";
$url="Check your weather: <a href=\"http://www.weather.com\">Weather Channel</a>";
break;

//Sat
case "6";
$url="See how stuff works: <a href=\"http://entertainment.howstuffworks.com\">How Stuff Works</a>";
break;
default:
}

// Print Results
print("Todays site: $url" )
?>



 

 (#658 2004-07-16 21:10:36) Post Reply
Page 0 1 2 3 4 5

def
Need To Set


Enrolled: Jul 2004
Posts: 10
AP: 1


<?
$today
= date("w");
switch (
$today)
{
case
"0": // sunday
$site = "<a href='http://www.sunday.com'>http://www.sunday.com</a>";
$description = "sunday: ";
break;

case
"1": // monday
$site = "<a href='http://www.monday.com'>http://www.monday.com</a>";
$description = "monday: ";
break;

case
"2": // tuesday
$site = "<a href='http://www.tuesday.com'>http://www.tuesday.com</a>";
$description = "tuesday: ";
break;

case
"3": // wednesday
$site = "<a href='http://www.wednesday.com'>http://www.wednesday.com</a>";
$description = "wednesday: ";
break;

case
"4": // thursday
$site = "<a href='http://www.thursday.com'>http://www.thursday.com</a>";
$description = "thursday: ";
break;

case
"5": // friday
$site = "<a href='http://www.friday.com'>http://www.friday.com</a>";
$description = "friday: ";
break;

case
"6": // saturday
$site = "<a href='http://www.sunday.com'>http://www.sunday.com</a>";
$description = "sunday: ";
break;

default:
// impossible
// no default output
}

print (
"$description" "$site");
?>


 

 (#663 2004-07-17 15:03:37) Post Reply
Page 0 1 2 3 4 5

DS
Need To Set


Enrolled: Jul 2004
Posts: 13
AP: 1

Here is my second assignment
still debugging


<HTML>
<HEAD>
<TITLE>ScriptSchool Second Assignment</TITLE>
<BODY>
//Switch and case function used to display something different each day of the week
<?
$today date
=(“w”);
$sunlink="<A HREF="http://www.foxwar.com">Foxwar</A>";
$monlink="<A=HREF="http://www.ebay.com>Ebay</A>";
$tueslink="<A HREF="http://www.wizards.com/magic>MagicTheGathering.com</A>";
$wedlink="<A HREF="http://www.aatrade.springfield.net">Alien Assault Traders</A>";
$thurlink="<A HREF="http://www.blacknovaplus.net">Blacknova Traders</A>";
$frilink="<A HREF="http://www.google.com">Google</A>";
$satlink="<A HREF="http://www.thugbuilder.net">Thugbuilder</A>";
//begin of switch and case
switch ($today) {
cade 0:
print(
"Todays URL for the day is..." . $sunlink
break;
case
1:
print(
"Todays URL for the day is..." . $monlink)
break;
case
2:
print(
"Todays URL for the day is..." . $tueslink)
break;
case
3:
print(
"Todays URL for the day is..." . $wedlink)
break;
case
4("Todays URL for the day is..." . $thurlink)
break;
case
5
print("Todays URL for the day is..." . $frilink)
break;
case
6
print("Todays URL for the day is..." . $satlink
//end of switch and case
?>
</BODY>
</HTML>


 

 (#664 2004-07-17 15:05:31) Post Reply
Page 0 1 2 3 4 5

DS
Need To Set


Enrolled: Jul 2004
Posts: 13
AP: 1

I don't get my errors here
I think it is the quotes in my tag error.
I don't know why my string print has a problem though.

 

 (#665 2004-07-17 15:50:43) Post Reply
Page 0 1 2 3 4 5

DS
Need To Set


Enrolled: Jul 2004
Posts: 13
AP: 1

okay I got it


<HTML>
<HEAD>
<TITLE>ScriptSchool Second Assignment</TITLE>
<BODY>
//Switch and case function used to display something different each day of the week
<?
$today date
=(“w”);
$sunlink="<A HREF=\"http://www.foxwar.com\">Foxwar</A>";
$monlink="<A=HREF=\"http://www.ebay.com>Ebay</A>\";
$tueslink="
<A HREF=

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /web/sites/tdavid/non_public_system/parsemsg.php on line 94

"http://www.wizards.com/magic\">MagicTheGathering.com</A>";
$wedlink="<A HREF=\"http://www.aatrade.springfield.net\">Alien Assault Traders</A>";
$thurlink="<A HREF=\"http://www.blacknovaplus.net\">Blacknova Traders</A>";
$frilink="<A HREF=\"http://www.google.com\">Google</A>";
$satlink="<A HREF=\"http://www.thugbuilder.net\">Thugbuilder</A>";
//begin of switch and case
switch ($today) {
cade 0:
print(
"Todays URL for the day is..." . $sunlink
break;
case
1:
print(
"Todays URL for the day is..." . $monlink)
break;
case
2:
print(
"Todays URL for the day is..." . $tueslink)
break;
case
3:
print(
"Todays URL for the day is..." . $wedlink)
break;
case
4("Todays URL for the day is..." . $thurlink)
break;
case
5
print("Todays URL for the day is...\" . $frilink)
break;
case 6
print("
Todays URL for the day is...

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /web/sites/tdavid/non_public_system/parsemsg.php on line 94

" . $satlink
//end of switch and case
?>
</BODY>
</HTML>




 

 (#666 2004-07-17 15:59:47) Post Reply
Page 0 1 2 3 4 5

DS
Need To Set


Enrolled: Jul 2004
Posts: 13
AP: 1

maybe not third time's the charm


<HTML>
<HEAD>
<TITLE>ScriptSchool Second Assignment</TITLE>
<BODY>
//Switch and case function used to display something different each day of the week
<?
$today date
=(“w”);
$sunlink="<A HREF=\"http://www.foxwar.com\">Foxwar</A>";
$monlink="<A=HREF=\"http://www.ebay.com\">Ebay</A>\";
$tueslink="
<A HREF=

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /web/sites/tdavid/non_public_system/parsemsg.php on line 94

"http://www.wizards.com/magic\">MagicTheGathering.com</A>";
$wedlink="<A HREF=\"http://www.aatrade.springfield.net">Alien Assault Traders</A>";
$thurlink="
<A HREF=

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /web/sites/tdavid/non_public_system/parsemsg.php on line 94

"http://www.blacknovaplus.net\">Blacknova Traders</A>";
$frilink="<A HREF=\"http://www.google.com\">Google</A>";
$satlink="<A HREF=\"http://www.thugbuilder.net\">Thugbuilder</A>";
//begin of switch and case
switch ($today) {
case
0:
print(
"Todays URL for the day is..." . $sunlink
break;
case
1:
print(
"Todays URL for the day is..." . $monlink)
break;
case
2:
print(
"Todays URL for the day is..." . $tueslink)
break;
case
3:
print(
"Todays URL for the day is..." . $wedlink)
break;
case
4("Todays URL for the day is..." . $thurlink)
break;
case
5
print("Todays URL for the day is..." . $frilink)
break;
case
6
print("Todays URL for the day is..." . $satlink
//end of switch and case
?>
</BODY>
</HTML>




 

 (#667 2004-07-17 16:03:52) Post Reply
Page 0 1 2 3 4 5

DS
Need To Set


Enrolled: Jul 2004
Posts: 13
AP: 1

one more time
<HTML>
<HEAD>
<TITLE>ScriptSchool Second Assignment</TITLE>
<BODY>
//Switch and case function used to display something different each day of the week
<?
$today=date(“w”);
$sunlink="<A HREF=\"http://www.foxwar.com\">Foxwar</A>";
$monlink="<A=HREF=\"http://www.ebay.com\">Ebay</A>\";
$tueslink="<A HREF=\"http://www.wizards.com/magic\">MagicTheGathering.com</A>";
$wedlink="<A HREF=\"http://www.aatrade.springfield.net">Alien Assault Traders</A>";
$thurlink="<A HREF=\"http://www.blacknovaplus.net\">Blacknova Traders</A>";
$frilink="<A HREF=\"http://www.google.com\">Google</A>";
$satlink="<A HREF=\"http://www.thugbuilder.net\">Thugbuilder</A>";
//begin of switch and case
switch ($today) {
case 0:
print("Todays URL for the day is..." . $sunlink)
break;
case 1:
print("Todays URL for the day is..." . $monlink)
break;
case 2:
print("Todays URL for the day is..." . $tueslink)
break;
case 3:
print("Todays URL for the day is..." . $wedlink)
break;
case 4("Todays URL for the day is..." . $thurlink)
break;
case 5
print("Todays URL for the day is..." . $frilink)
break;
case 6
print("Todays URL for the day is..." . $satlink)
//end of switch and case
?>
</BODY>
</HTML>


 

 (#680 2004-07-30 03:06:35) Post Reply
Page 0 1 2 3 4 5

MI4C
Need To Set


Enrolled: Jul 2004
Posts: 6
AP: 1

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>URL a day</title>
</head>

<body>
<?
/* This is my second script ever and it was week 2 assigment*/
// day variable
$today = date("w");
switch($today)
{
case 0:
// it is true so do this
$url = "http://www.google.com";
$title = "google";
break; // escape the switch since we had a true result
case 1:
$url = "<http://www.altavista.com";
$title = "altavista";
break;
case 2:
$url = "http://www.microsoft.com";
$title = "microsoft";
break;
case 3:
$url = "http://www.msn.fi";
$title = "msn";
break;
case 4:
$url = "http://www.novalogic.com";
$title = "novalogic";
break;
case 5:
$url = "http://www.novaworld.com";
$title = "novaworld";
break;
case 6:
$url = "http://www.mirc.com";
$title = "mirc";
break;
default:
$url = "blank";
// when nothing is true do this
}
print (
"<a href = \"$url \" <br> $title </a><br>". "$title");

?>

</body>
</html>

 

 (#691 2004-09-15 21:03:11) Post Reply
Page 0 1 2 3 4 5

abectech
Need To Set


Enrolled: Sep 2004
Posts: 1
AP: 1

<?

/* This script selects the day of the week and dynamically creates the URL for that specific day by creating a
URL with that given day as a variable in the URL. Once you view the site click the link it will forward you to the URL for that
day. If you switch the number at the end betweenn 1-7 you will see you switch days of the week. Try it out! On to lesson 3 for me*/

// This variable is here to input the root URL of the site where the script is posted!
$root = "http://127.0.0.1/week2";

// This piece selects the numerical date 1-7 for the current day of the week.
$day = date("w");

// This section is for testing. It allows you to set the date to assure that each case is working use integers 1-7 for Monday - Sunday.
//$day = 6;

//The day_full variable selects the full name of the day to print in the description fot that given day.
$day_full = date("l");

//These two statements below are used to test if the day and day_full are correctly setting the date
//echo("$day");
//echo("$day_full");

//The switch statment below uses the numerical date for today

switch($day)
{
case"1":
$url = "<a href=\"$root/index.php?day=1\">$day_full's Link</a>";
$description = "This is a unique description for $day_full";
break;

case"2":
$url = "<a href=\"$root/index.php?day=2\">Tuesday's Link</a>";
$description = "This is a unique description for $day_full";
break;

case"3":
$url = "<a href=\"$root/index.php?day=3\">Wednesday's Link</a>";
$description = "This is a unique description for $day_full";
break;

case"4":
$url = "<a href=\"$root/index.php?day=4\">Thursday's Link</a>";
$description = "This is a unique description for $day_full";
break;

case"5":
$url = "<a href=\"$root/index.php?day=5\">Friday Link</a>";
$description = "This is a unique description for $day_full";
break;

case"6":
$url = "<a href=\"$root/index.php?day=6\">Saturday Link</a>";
$description = "This is a unique description for $day_full";
break;

case"7":
$url = "<a href=\"$root/index.php?day=7\">Sunday Link</a>";
$description = "This is a unique description for $day_full";
break;

// echo statment combines the URL and Description from the valid day and prints it in the browser.
}
echo("$url - " . "$description");
?>

 

 (#692 2004-09-22 12:49:45) Post Reply
Page 0 1 2 3 4 5

Umbra
Need To Set


Enrolled: Sep 2004
Posts: 3
AP: 1

Question: If I were to put this script on my web site to check it, they say path to script should be /home/users/web/####/umbra! Where do I put that?

<HTML>
<HEAD><TITLE> Script Lesson #1</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="Microsoft Word 73.1">
</HEAD>

<BODY>
<FONT FACE="Times">
<?php
//Object is to write script to store and print name and URL of my webste
//Assign variables
$firstname="Ted";
$lastname="Erikson";
$website="http://www.sdogv.com";
$MPPOAsite=http://www.madisonparkhydepark.com;
//Print the output
print("Hello there, my first name is $firstname and my last name is $lastname<BR>
My personal web site is at $website and <BR> I am a volunteer (new) webmaster at $MPPOAsite")
?>
</FONT></BODY>
</HTML>

 

 (#695 2004-09-26 16:46:58) Post Reply
Page 0 1 2 3 4 5

Umbra
Need To Set


Enrolled: Sep 2004
Posts: 3
AP: 1

Question: If I were to put this script on my web site to check it, they say path to script should be /home/users/web/####/umbra! Where do I put that?

<HTML>
<HEAD><TITLE> Script Lesson #1</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="Microsoft Word 73.1">
</HEAD>

<BODY>
<FONT FACE="Times">
<?php
//Object is to write script to store and print name and URL of my webste
//Assign variables
$firstname="Ted";
$lastname="Erikson";
$website="http://www.sdogv.com";
$MPPOAsite=http://www.madisonparkhydepark.com;
//Print the output
print("Hello there, my first name is $firstname and my last name is $lastname<BR>
My personal web site is at $website and <BR> I am a volunteer (new) webmaster at $MPPOAsite")
?>
</FONT></BODY>
</HTML>

 

 (#696 2004-09-29 10:21:09) Post Reply
Page 0 1 2 3 4 5

Umbra
Need To Set


Enrolled: Sep 2004
Posts: 3
AP: 1

In reviewing post, I found some errors; hopefully corrcted here.
Question: If I were to put this script on my web site to check it, they (my server) say path to script should be /home/users/web/####/umbra! Where do I put that?

<HTML>
<HEAD><TITLE> Script Lesson #1</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="Microsoft Word 73.1">
</HEAD>

<BODY>
<FONT FACE="Times">
<?php
//Object is to write script to store and print name and URL of my webste
//Assign variables
$firstname="Ted";
$lastname="Erikson";
$website="http://www.sdogv.com";
$MPPOAsite=http://www.madisonparkhydepark.com;
//Print the output
print("Hello there, my first name is $firstname and my last name is $lastname<BR>
My personal web site is at $website and <BR> I am a volunteer (new) webmaster at $MPPOAsite");
?>
</FONT></BODY>
</HTML>

 

 (#699 2004-09-29 16:46:04) Post Reply
Page 0 1 2 3 4 5

lestat
Need To Set


Enrolled: Jan 2004
Posts: 44
AP: 1

Umbra:
When posting your code use the "
" tags - then it's easier for us to see.
The path to your script is like any other web page. Such as path/to/your/script.php
This is the week #2 forum, and you have posted week #1 in it.
The line $MPPOAsite=http://www.madisonparkhydepark.com; will not work. you need to add a " before http and after the com.

Good Luck!



 

 (#700 2004-09-29 16:48:30) Post Reply
Page 0 1 2 3 4 5

lestat
Need To Set


Enrolled: Jan 2004
Posts: 44
AP: 1

the CODE tags

 

 (#706 2004-10-05 08:28:31) Post Reply
Page 0 1 2 3 4 5

Marcel
Need To Set


Enrolled: Oct 2004
Posts: 4
AP: 1

Ok, hope this is the way you meant it :P



<?php
$today
= date("w");
$day= date("l");
switch (
$today) {
case
"0" :
$url="<a href='http://www.sunday.com' target='_blank'>Sunday's website</a>";
break;

case
"1" :
$url="<a href='http://www.monday.com' target='_blank'>Monday's website</a>";
break;

case
"2" :
$url="<a href='http://www.tuesday.com' target='_blank'>Tuesday's website</a>";
break;

case
"3" :
$url="<a href='http://www.wednesday.com' target='_blank'>Wednesday's website</a>";
break;

case
"4" :
$url="<a href='http://www.thursday.com' target='_blank'>Thursday's website</a>";
break;

case
"5" :
$url="<a href='http://www.friday.com' target='_blank'>Friday's website</a>";
break;

default :
$url="<a href='http://www.saturday.com' target='_blank'>Saturday's website</a>";
}
print
"Welcome, today is $day! click this link to go to $url to find all the news you need today!";

?>




Any comments are welcome !

 

 (#716 2004-10-19 20:58:30) Post Reply
Page 0 1 2 3 4 5

schoon
Need To Set


Enrolled: Oct 2004
Posts: 1
AP: 1



<html>
<head>
<title>
Assignment 2
</title>
</head>
<body>
<center>



<?php


//assign date string

$today=date("w");

//assign urls to variables

$mondaylink='<a href="http://www.reaction-gaming.co.uk">Reaction Gaming</a>';
$mondaydesc=print("My clan's website");
$tuesdaylink='<a href="http://www.play.com">Play.com</a>';
$tuesdaydesc=print("DVD's & Games");
$wednesdaylink='<a href="http://www.amazon.co.uk">Amazon</a>';
$wednesdaydesc=print("Amazon");
$thufrisatsunlink='<a href="http://www.pwned.nl">Pwned.nl</a>';
$thufrisatsundesc=print("Funny video");


//using the switch

switch($today) {

case
0:
print(
"Today's url is:" .$mondaylink <br> .$mondaydesc);
break;

case
1:
print(
"Today's url is:" .$tuesdaylink <br> .$tuesdaydesc);
break;

case
2:
print(
"Today's url is:" .$wednesdaylink <br> .$wednesdaydesc);
break;

default:
print(
"It is not monday tuesday or wednesday, so the url is:" .$thufrisatsunlink <br> .$thufrisatsundesc);


}


?>

</center>
</body>
</html>



i get this error:

Parse error: parse error, unexpected '>' in /home/sites/reaction-gaming.co.uk/public_html/assignment2.php on line 36


Help plz!!
thx.





















 

 (#721 2004-10-31 14:10:41) Post Reply
Page 0 1 2 3 4 5

SexToyLady
Need To Set


Enrolled: Oct 2004
Posts: 6
AP: 1

<?
$today =date("w");
$text = "Todays Link is : ";


//switch address

switch($today)
{
case "0";
$address = "<a href=\"http://www.charliedaniels.com\">Charlie Daniels</a><br>";
break;
case "1";
$address = "<a href=\"http://www.lujack.com\">Lujack Northpark Auto Plaza</a><br>";
break;
case "2";
$address = "<a href=\"http://www.millercontainer.com\">Miller Container</a><br>";
break;
case "3";
$address = "<a href=\"http://www.kwqc.com\">KWQC TV 6</a><br>";
break;
case "4";
$address = "<a href=\"http://www.qcbankruptcy\">James C. Wherry</a><br>";
break;
case "5";
$address = "<a href=\"http://www.qconline.com\">QC Online</a><br>";
break;
case "6";
$address = "<a href=\"http://www.qctimes.com\">Quad City Times</a><br>";
break;
}
Print "$text $address";

?>

 

 (#723 2004-11-01 12:12:44) Post Reply
Page 0 1 2 3 4 5

JXWolF
Need To Set


Enrolled: Oct 2004
Posts: 2
AP: 1



<html>
<head>
<title>Lesson #2</title>
</head>
<body>
<?php
$today
=date("w");
$todays_date=date("F j, Y");
$time=date("g:i A");
switch(
$today)
{
case
"0":
$url="XERORIP - <a href=\"http://www.xerorip.com\" target=_blank>My Website</a>";
break;
case
"1":
$url="Ebay Online - <a href=\"http://www.ebay.com\" target=_blank>Ebay</a>";
break;
case
"2":
$url="Free Email - <a href=\"http://www.hotmail.com\" target=_blank>Hotmail</a>";
break;
case
"3":
$url="Do you Yahoo? - <a href=\"http://www.yahoo.com\" target=_blank>Yahoo</a>";
break;
case
"4":
$url="Cool DNS tools - <a href=\"http://www.dnsstuff.com\" target=_blank>DNSstuff</a>";
break;
case
"5":
$url="A Search - <a href=\"http://www.av.com\" target=_blank>Altavista</a>";
break;
case
"6":
$url="Ask Jeeves - <a href=\"http://www.ask.com\" target=_blank>Ask</a>";
break;
}
print(
"Todays date is: $todays_date <br> Todays URL is: $url <br> The Current time is: $time");
?>
</body>
</html>


 

 (#724 2004-11-01 17:30:02) Post Reply
Page 0 1 2 3 4 5

spanweb
Need To Set


Enrolled: Oct 2004
Posts: 3
AP: 1

<html>
<head>
<title>Script School Week 2</title>
</head>
<body>
<?php
$today = date("w"); //w - day of the week, numeric, i.e. "0" (Sunday) to "6" (Saturday)
$url_0 = "http://www.php.net/"; // it is Sunday
$url_1 = "http://www.w3schools.com/"; // it is Monday
$url_2 = "http://www.zend.com/"; // it is Tuesday
$url_3 = "http://www.devshed.com/"; // it is Wednesday
$url_4 = "http://www.thesitewizard.com/"; // it is Thursday
$url_5 = "http://www.htmlgoodies.com/"; // it is Friday
$url_6 = "http://www.hotscripts.com/"; // it is Saturday
?>
<b>Today is <u><?php print(date( "l" . ", " . "d" . " " . "F". " " . "Y")); ?></u><br/>Your website will be
<?php
switch($today)
{
case 0: // it is Sunday
print "<a href= " . $url_0 . " target=_blank " . ">". $url_0 . "</a>";
break; // escape the switch since we had a true result
case 1: // it is Monday
print "<a href= " . $url_1 . " target=_blank " . ">". $url_1 . "</a>";
break; // escape the switch since we had a true result
case 2: // it is Tuesday
print "<a href= " . $url_2 . " target=_blank " . ">". $url_2 . "</a>";
break; // escape the switch since we had a true result
case 3: // it is Wednesday
print "<a href= " . $url_3 . " target=_blank " . ">". $url_3 . "</a>";
break; // escape the switch since we had a true result
case 4: // it is Thursday
print "<a href= " . $url_4 . " target=_blank " . ">". $url_4 . "</a>";
break; // escape the switch since we had a true result
case 5: // it is Friday
print "<a href= " . $url_5 . " target=_blank " . ">". $url_5 . "</a>";
break; // escape the switch since we had a true result
default: // it is Saturday
print "<a href= " . $url_6 . " target=_blank " . ">". $url_6 . "</a>";
}
?>
</b>
</body>
</html>

 

 (#725 2004-11-01 17:30:25) Post Reply
Page 0 1 2 3 4 5

spanweb
Need To Set


Enrolled: Oct 2004
Posts: 3
AP: 1

<html>
<head>
<title>Script School Week 2</title>
</head>
<body>
<?php
$today = date("w"); //w - day of the week, numeric, i.e. "0" (Sunday) to "6" (Saturday)
$url_0 = "http://www.php.net/"; // it is Sunday
$url_1 = "http://www.w3schools.com/"; // it is Monday
$url_2 = "http://www.zend.com/"; // it is Tuesday
$url_3 = "http://www.devshed.com/"; // it is Wednesday
$url_4 = "http://www.thesitewizard.com/"; // it is Thursday
$url_5 = "http://www.htmlgoodies.com/"; // it is Friday
$url_6 = "http://www.hotscripts.com/"; // it is Saturday
?>
<b>Today is <u><?php print(date( "l" . ", " . "d" . " " . "F". " " . "Y")); ?></u><br/>Your website will be
<?php
switch($today)
{
case 0: // it is Sunday
print "<a href= " . $url_0 . " target=_blank " . ">". $url_0 . "</a>";
break; // escape the switch since we had a true result
case 1: // it is Monday
print "<a href= " . $url_1 . " target=_blank " . ">". $url_1 . "</a>";
break; // escape the switch since we had a true result
case 2: // it is Tuesday
print "<a href= " . $url_2 . " target=_blank " . ">". $url_2 . "</a>";
break; // escape the switch since we had a true result
case 3: // it is Wednesday
print "<a href= " . $url_3 . " target=_blank " . ">". $url_3 . "</a>";
break; // escape the switch since we had a true result
case 4: // it is Thursday
print "<a href= " . $url_4 . " target=_blank " . ">". $url_4 . "</a>";
break; // escape the switch since we had a true result
case 5: // it is Friday
print "<a href= " . $url_5 . " target=_blank " . ">". $url_5 . "</a>";
break; // escape the switch since we had a true result
default: // it is Saturday
print "<a href= " . $url_6 . " target=_blank " . ">". $url_6 . "</a>";
}
?>
</b>
</body>
</html>

 

 (#731 2004-11-11 00:50:19) Post Reply
Page 0 1 2 3 4 5

wakjoko
Need To Set


Enrolled: Jan 2003
Posts: 4
AP: 1

<html>
<head><title>Learn PHP with scriptschool.com ::: 2nd week assignment</title>
<body>
<?php //start php code
//declare an array to store 6 string
$url_arr=array("yahoo.com", "google.com", "aol.com", "lycos.com", "msn.com", "hotbot.com");

//start comparing and print
switch(date(w)){
case 0: print("Today's(".date(l).") url is <a href="http://".$url_arr[date(w)]."">".$url_arr[date(w)]."</a>"); break;
case 1: print("Today's(".date(l).") url is <a href="http://".$url_arr[date(w)]."">".$url_arr[date(w)]."</a>"); break;
case 2: print("Today's(".date(l).") url is <a href="http://".$url_arr[date(w)]."">".$url_arr[date(w)]."</a>"); break;
case 3: print("Today's(".date(l).") url is <a href="http://".$url_arr[date(w)]."">".$url_arr[date(w)]."</a>"); break;
case 4: print("Today's(".date(l).") url is <a href="http://".$url_arr[date(w)]."">".$url_arr[date(w)]."</a>"); break;
case 5: print("Today's(".date(l).") url is <a href="http://".$url_arr[date(w)]."">".$url_arr[date(w)]."</a>"); break;
default: print("Today's(".date(l).") url is <a href="http://".$url_arr[date(w)]."">".$url_arr[date(w)]."</a>");
}
?>
</body>
</html>

 

 (#740 2004-11-15 03:59:53) Post Reply
Page 0 1 2 3 4 5

FamYon
Need To Set


Enrolled: Nov 2004
Posts: 3
AP: 1

<HTML>
<HEAD>
<TITLE>Assignment 2</TITLE>
</HEAD>
<BODY>
<?
//Use conditional to get a url every day of the week
$today = date("W");
$link1 = "<A HREF = http://www.site1.com;</A>";
$link1desc = "Click here to visit site 1";
$link2 = "<A HREF = http://www.site2.com;</A>";
$link2desc = "Click here to visit site 2";
$link3 = "<A HREF = http://www.site3.com;</A>";
$link3desc = "Click here to visit site 3";
$link4 = "<A HREF = http://www.site4.com;</A>";
$link4desc = "Click here to visit site 4";
$link5 = "<A HREF = http://www.site5.com;</A>";
$link5desc = "Click here to visit site 5";
$link6 = "<A HREF = http://www.site6.com;</A>";
$link6desc = "Click here to visit site 6";
$link7 = "<A HREF = http://www.site7.com;</A>";
$link7desc = "Click here to visit site 7";
//Use switch case statement
switch ($today)
{
case1:
print($link1);
print($link1desc);
break;
case2:
print($link2);
print($link2desc);
break;
case3:
print($link3);
print($link3desc);
break;
case4:
print($link4);
print($link4desc);
break;
case5:
print($link5);
print($link5desc);
break;
case6:
print($link6);
print($link6desc);
break;
case7:
print($link7);
print($link7desc);
break;
//default item
default:
case1:
print($link1);
print($link1desc);
}
?>
</BODY>
</HTML>

 

  Page 0 1 2 3 4 5

View Previous Thread
Print this page Print This Page

View Next Thread

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