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

 

 (#259 2003-09-21 15:31:57) Post Reply
Page 0 1 2 3 4 5 6 7 8

Coop
Need To Set


Enrolled: Sep 2003
Posts: 4
AP: 1

<code>
<html>
<head>
<title>My first Assignment</title>
</head>
<body>
My name, nick and site.


<? $name='Jeremiah';//first name $lname='Cooper';//last name
$nick='Coop';//nickname $site='www.bulldogproductions.rom.cd;//site
print(Name $name $lname <br>;)
print(Nick $nick <br>;)
print(Site $site;)
</body>
</html>
</code>

 

 (#268 2003-09-23 00:31:56) Post Reply
Page 0 1 2 3 4 5 6 7 8

mathgeek
Need To Set


Enrolled: Sep 2003
Posts: 2
AP: 1

I used Dreamweaver's text editor. What doesn't seem obvious is why HTML code is included inside the quotes. Is this because php prints directly into the browser that then interprets the HTML as normal?

<html>
<head>
<title>First PHP Try</title>
</head>

<body>

<script language="JavaScript">
<!--

function SymError()
{
return true;
}

window.onerror = SymError;

var SymRealWinOpen = window.open;

function SymWinOpen(url, name, attributes)
{
return (new Object());
}

window.open = SymWinOpen;

//-->
</script>

<script language="php">
$name = "MathGeek";
$realname = "Jeffrey Tull";
$fav_url = "www.motherboards.org";
print("My Name is $name <br>");
print("My Real Name is $realname <br>");
print("My Favorite Site is $fav_url <br>");
</script><br>
How's this for PHP?!?
</body>

<script language="JavaScript">
<!--

window.open = SymRealWinOpen;

//-->
</script>

</html>

 

 (#269 2003-09-23 00:33:52) Post Reply
Page 0 1 2 3 4 5 6 7 8

mathgeek
Need To Set


Enrolled: Sep 2003
Posts: 2
AP: 1

??? I didn't type all of what is there! What happened?!? Did I do something wrong?

 

 (#273 2003-09-26 00:22:59) Post Reply
Page 0 1 2 3 4 5 6 7 8

maddy
Need To Set


Enrolled: Sep 2003
Posts: 14
AP: 1



<?
//this is my nickname
$nick = "maddy";
//this is my favourite site ;)
$url = "http://www.scriptschool.com";
//print it all out in the browser baby
print("my nickname is $nick and my favourite site is $url");
?>




Seems to work fine. Not sure why I need to use the (), and it prints out just fine if I only have the quotes.The PHP manual seems to indicate that you don't need to use (), whereas the lesson suggests the other way around? No matter, it works! :D

 

 (#291 2003-09-27 04:52:55) Post Reply
Page 0 1 2 3 4 5 6 7 8

TDavid
php mySQL Perl C/C++
Principal


Enrolled: Mar 2000
Posts: 193
AP: 1

quote:
Seems to work fine. Not sure why I need to use the (), and it prints out just fine if I only have the quotes.The PHP manual seems to indicate that you don't need to use (), whereas the lesson suggests the other way around? No matter, it works! :D


It is true that the parenthesis are optional, but I suggest staying with them because it will help you think in terms of functions, which when you get into that later, that will make more sense. Also when concatenating it can provide a logical, visual ending to the statement.

 

 (#296 2003-10-02 16:24:49) Post Reply
Page 0 1 2 3 4 5 6 7 8

zxrod
Need To Set


Enrolled: Oct 2003
Posts: 7
AP: 1

New to the course, but thanks a lot for offering these lessons in php. Here's my assignment.. any suggestions?
<html>
<title>Week 1 Assignment</title>
<body>
<code>
<?
// This script is to print my name and my url
// Assign the variables
$firstname = 'Matt';
$lastname = 'Woodman';
$url = 'http://www.zxrod.com';
// Print the
print("Hi, my name is $firstname $lastname <br>My website is $url");
?>
</code>
</body>
</html>

 

 (#297 2003-10-03 22:25:03) Post Reply
Page 0 1 2 3 4 5 6 7 8

Mark87
Need To Set


Enrolled: Oct 2003
Posts: 2
AP: 1

[CODE]

<html>
<head>
<title>Mark's First php</title>
</head>
<body>

<?php

//first name
$fname="Mark";

//last name
$lname="Striemer";

//website
$website="http://www.webmonkey.com";

//print my text
print("My name is $fname $lname , and one of my favorite sites is $website");

php?>

</body>
</html>

[/CODE]

 

 (#298 2003-10-03 22:28:00) Post Reply
Page 0 1 2 3 4 5 6 7 8

Mark87
Need To Set


Enrolled: Oct 2003
Posts: 2
AP: 1

[CODE]

<html>
<head>
<title>Mark's First php</title>
</head>
<body>

<?php

//first name
$fname="Mark";

//last name
$lname="Striemer";

//website
$website="http://www.webmonkey.com";

//print my text
print("My name is $fname $lname , and one of my favorite sites is $website");

php?>

</body>
</html>

[/CODE]

 

 (#301 2003-10-08 12:17:03) Post Reply
Page 0 1 2 3 4 5 6 7 8

jlk242
Need To Set


Enrolled: Oct 2003
Posts: 8
AP: 1


<?
//This will Print the PHP Version to the Browser
printf(" This host is running PHP Version %s ", phpversion());
//I like <br> and i like <blockquote> so don't ask
printf("<br><br><blockquote>");
printf("Hell Yeah! My Server is rockin with PHP %s", phpversion());
//Begin snobb code
printf(" Which is way better than your version!");
//EOSC = End Of Snobb Code
printf("</blockquote>");

//This is a simple Hello world type script
//sets $myname to "Jason"
$myname = "Jason";
//sets $my_fav_url to "http://www.scriptschool.com/"
$my_fav_url = "http://www.scriptschool.com";
//Prints a literal string to the browser
printf("My Name Is : ");
//Prints the Variable $myname to the browser
printf($myname);
//Prints another literal string to the browser
printf(". And my favortie link is : ");
//Prints the variable $my_fav_url to the Browser
printf($my_fav_url);
/* This is the end of the 1st TO-DO assignment.
I have attempted to use as much as was taught
in the lesson, to incorporate into this simple script
Even the layout is intentional, I was trying to repeat
as much as possible for the purposes of assimilation.
*/
?>



 

 (#310 2003-10-11 08:16:27) Post Reply
Page 0 1 2 3 4 5 6 7 8

flor
Need To Set


Enrolled: Oct 2003
Posts: 1
AP: 1

<HTML>
<HEAD>
<TITLE>School Script.com Assingment 1</TITLE>
</HEAD>
<BODY>
<?php
//This program use php to display my name and my favourite website using variables
//Assign the variables
$firstname = "Flor";
$lastname = "Bermudez";
//$website = "http://www.google.com";
$site='<a href="http://www.realstate.com" target="_blank">www.realstate.com</a>';
//Display informaton in browser
print("Hello, my name is $firstname $lastname. <br>My favourite website is $site. ");
//print current date
print("<br> The current date is: " .date("m/j/y"))
?>
</BODY>
</HTML>

 

 (#311 2003-10-11 09:13:24) Post Reply
Page 0 1 2 3 4 5 6 7 8

Quicksaver
Need To Set


Enrolled: Sep 2003
Posts: 90
AP: 1

flor, i think you need to close the last print section no? :)

 

 (#316 2003-10-13 13:01:24) Post Reply
Page 0 1 2 3 4 5 6 7 8

Ahkorahil
Need To Set


Enrolled: Oct 2003
Posts: 20
AP: 1

<HTML>
<HEAD>
<TITLE>ScriptSchool.com Assaignment 1</TITLE>
</HEAD>
<BODY>
<?php
// This is how I print may nick and two my favorite URL
$nick=Ahkorahil
$oneurl=www.zone.ee/kincclan
$secondurl=www.lammas.com
print($nick);
print($oneurl);
print($secondurl);
//sentences about me
print("Hello, my nickname is $nick.<br> My favorite websites are here: $oneurl,<br> $secondurl")
print("<br> The current date is: ". date("m/k/a"));
?>
</BODY>
</HEAD>

 

 (#319 2003-10-14 09:14:52) Post Reply
Page 0 1 2 3 4 5 6 7 8

jennyjlo
Need To Set


Enrolled: Oct 2003
Posts: 2
AP: 1

I admit - I had to look at the other assignemtns before I could get mine to work.....

<?

// seting variables for my nick and my favorite url

$my_nick="jennyjlo"; // nickname
$fav_url="http://www.jeneration-designs.com/"; // favorite url

print("My Nick is $my_nick and my URL is $fav_url.");

?>

 

 (#321 2003-10-14 13:18:20) Post Reply
Page 0 1 2 3 4 5 6 7 8

Ahkorahil
Need To Set


Enrolled: Oct 2003
Posts: 20
AP: 1

//Something is wrong with that code my host doesnt show anything on my screen.Can You tell me where is mistake?
<HTML>
<HEAD>
<TITLE>ScriptSchool.com Assaignment1</TITLE>
</HEAD>
<BODY>
<?php
// This is how I print may nick and two my favorite URL
$nick="lammas";
$oneurl="http://www.zone.ee/kincclan";
$secondurl="http://www.lammas.com";
print($nick);
print($oneurl);
print($secondurl);
//sentences about me
print("Hello,mynicknameis$nick.<br>Myfavoritewebsitesarehere: $oneurl,<br>$secondurl")
print("<br>The current date is: ".date("m/j/y"))
?>
</BODY>
</HEAD>

 

 (#322 2003-10-15 16:23:33) Post Reply
Page 0 1 2 3 4 5 6 7 8

Quicksaver
Need To Set


Enrolled: Sep 2003
Posts: 90
AP: 1

the print() is to be done like this:


<?
print("Something"");
?>



you have mistakes in all of them, first you forgot the "" on the ones to print the strings individually, then you forgot to close the last two print() commands with an ";"

 

 (#323 2003-10-15 16:24:14) Post Reply
Page 0 1 2 3 4 5 6 7 8

Quicksaver
Need To Set


Enrolled: Sep 2003
Posts: 90
AP: 1

sorry, make it


<?
print("Something");
?>



 

 (#324 2003-10-15 18:42:18) Post Reply
Page 0 1 2 3 4 5 6 7 8

Dom
Need To Set


Enrolled: Oct 2003
Posts: 2
AP: 1

<html>
<head>
<title>My php assignment 1</title>
<body>
<?

//this is for my php assignment
//list my name
$myfirstname='Dominick';
$mylastname='Evans';
//list my url
$url='http://www.crimson-twilight.com';
print("My name is $myfirstname $mylastname. <br> My website is $url");



?>
</body>
</html>

 

 (#325 2003-10-15 19:00:49) Post Reply
Page 0 1 2 3 4 5 6 7 8

Dom
Need To Set


Enrolled: Oct 2003
Posts: 2
AP: 1

<html>
<head>
<title>My php assignment 1</title>
<body>
<?

//this is for my php assignment
//list my name
$myfirstname='Dominick';
$mylastname='Evans';
//list my url
$url='http://www.crimson-twilight.com';
print("My name is $myfirstname $mylastname. <br> My website is $url");



?>
</body>
</html>

 

 (#326 2003-10-17 00:07:02) Post Reply
Page 0 1 2 3 4 5 6 7 8

spacekydet
Need To Set


Enrolled: Oct 2003
Posts: 1
AP: 1

Here's mine. Now I know the html tags are missing but I've found they are unneccessary and really do annoy me. So no I did not forget them. Sounds funny, btu I have my own unique coding style. 8D



<head>
<Title>PHP School :: Assignment 1</title>
</head>

<?php
// Enter variables for print here
$name=Amber;
$email=<a href='mailto:amber@crushed-innocence.org'>amber@c-i.org</a>;
$url=<a href='http://www.crushed-innocence.org' target='_blank'>Crushed Innocence</a>;

// Variables print here
Print (My name is $name and I run $url.
<
br>
You may contact me at $email for further information.);
php?>



 

 (#335 2003-10-27 15:22:03) Post Reply
Page 0 1 2 3 4 5 6 7 8

Tala
Need To Set


Enrolled: Oct 2003
Posts: 3
AP: 1

<html>
<head>
<title>Tala's Assignment</title>
</head>
<body>
<center>
<?php
//Here's the assignment. This script is made to store variables such as a name and URL.
$firstname='Tala';
$surname='Cather';
$nick='Tala';
$email='<a href="mailto:talawolf@earthlink.net">talawolf@earthlink.net</a>';
$site='<a href="http://www.freakmanor.com" target="_blank">www.freakmanor.com</a>';
//Print My Details
print("Hellomynameis$firstname$surname.<br/>Mynicknameis$nick.
<br/>Mye-mailis$email.<br/>Mywebsiteis$site."
);
?>


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

 

 (#336 2003-10-27 15:27:18) Post Reply
Page 0 1 2 3 4 5 6 7 8

Tala
Need To Set


Enrolled: Oct 2003
Posts: 3
AP: 1

Now where did my spaces go?! Let me try that again. *frown*



<html>
<head>
<title>Tala's Assignment</title>
</head>
<body>
<center>

<?php
//Here's the assignment. This script is made to store variables such as a name and URL.
$firstname='Tala';
$surname='Cather';
$nick='Tala';
$email='<a href="mailto:talawolf@earthlink.net">talawolf@earthlink.net</a>';
$site='<a href="http://www.freakmanor.com" target="_blank">www.freakmanor.com</a>';
//Print My Details
print("Hello my name is $firstname $surname.<br/>My nickname is $nick.
<br/>My e-mail is $email.<br/>My website is $site."
);
?>


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

 

 (#340 2003-10-29 15:02:09) Post Reply
Page 0 1 2 3 4 5 6 7 8

Merlyn
Need To Set


Enrolled: Aug 2003
Posts: 1
AP: 1

<?
// $name is a string variable to hold my name
$name = "Marty";
// $url is a string variable to hold my fav. url
$url = "www.google.com";
print($name " uses " $url " a great deal!");
?>

 

 (#341 2003-10-29 15:35:18) Post Reply
Page 0 1 2 3 4 5 6 7 8

Quicksaver
Need To Set


Enrolled: Sep 2003
Posts: 90
AP: 1

Merlyn, the print() command you used is bugged

print($name " uses " $url " a great deal!");

you must insert some "." (dots) in the middle, a dot works as an "and" so it print $name(and)"use"(and)... like so:

print($name." uses ".$url." a great deal!");

or fuse them all together :)

print("$name uses $url a great deal!");

 

 (#344 2003-10-31 04:54:02) Post Reply
Page 0 1 2 3 4 5 6 7 8

Dest
Need To Set


Enrolled: Oct 2003
Posts: 18
AP: 1

<?
//All the strings in this script:
$name="Simas";
$nick="Dest";
$url="http://www.delfi.lt";
$hobbies="Basketball, online games, PHP (from now ;))";

//Intro
print("Hello, people. I'm trying to write my first PHP script.<br> Here are some facts about me:");


//Facts:
print("<br> <br> My Name: $name <br> My Nick: $nick <br> Hobbies: $hobbies <br> Favorite url: $url");

?>

 

 (#345 2003-10-31 05:00:42) Post Reply
Page 0 1 2 3 4 5 6 7 8

TDavid
php mySQL Perl C/C++
Principal


Enrolled: Mar 2000
Posts: 193
AP: 1

Thanks for stopping by and saying hi in the Script School chatroom, Dest. I encourage other students to stop by and say hello. If I'm not there, go ahead and park your nick and I'll come along sooner or later.

As for your assignment, it looks like a great start to me.

 

 (#346 2003-10-31 05:05:27) Post Reply
Page 0 1 2 3 4 5 6 7 8

Dest
Need To Set


Enrolled: Oct 2003
Posts: 18
AP: 1

i have couple of questions. So, there they go:

1. What and why should i use and what's the diffirende ? I copied from Tala's post:

print("Hello my name is $firstname $surname.<br/>My nickname is $nick.
<br/>My e-mail is $email.<br/>My website is $site.");

In my script i use <br> command. What diffirence between <br> and </br> ? and what commands from HTML can i use in my scripts ? i know i can <a href> <br> but i cant <b> etc.etc. how can i know can i or not use this or another command ? is there list of commands or something ? :) thanx. if i'll have other questions (and im sure i will) ill post in another reply. Cheers

 

 (#347 2003-10-31 05:14:40) Post Reply
Page 0 1 2 3 4 5 6 7 8

TDavid
php mySQL Perl C/C++
Principal


Enrolled: Mar 2000
Posts: 193
AP: 1

quote:
how can i know can i or not use this or another command ? is there list of commands or something ? :)


You can use any HTML code to print inside PHP, but you must make sure to backslash any presence of the doublequotes (or single quote) if you use that in the print statement or you'll get parser errors.

 

 (#348 2003-10-31 07:12:12) Post Reply
Page 0 1 2 3 4 5 6 7 8

Dest
Need To Set


Enrolled: Oct 2003
Posts: 18
AP: 1

Ok here's final result i get. added some html tags and date and time from 2 week :) :



<?php

//Variables in this script:
$name="Simas";
$nick="Dest";
$url="<a href=http://www.delfi.lt>http://www.delfi.lt</a>";
$hobbies="Basketball, online games, PHP (from now ;))";
$time=date("G:i");
$date=date("Y-m-d");
$mail="<a href=mailto:sir@tts.lt?subject=Hello!>sir@tts.lt</a>";

//Some fun with colors
print("<b><font color=blue>H</font>
<font color=red>e</font>
<font color=blue>l</font>
<font color=red>l</font>
<font color=blue>o</font>
, World! </b>"
);

print(
"<br> He He, just kidding. Here are some facts about me:");

//Facts:
print("<br> <br> My Name: $name <br> My Nick: $nick <br> Hobbies: $hobbies <br> Favorite url: $url <br> Contact me - $mail");

//Date and time (a little from week 2 :) )
print("<br><br> Today's date is: $date <br> Now it's $time o'clock");


php?>




Last question before i go to 2week - how to make my mail subject not hello, but Hello, Dest.

if i make like this:
$mail="<a href=mailto:sir@tts.lt?subject=Hello!, Dest>sir@tts.lt</a>";

then subject is only Hello, .... If i make this:

$mail="<a href=mailto:sir@tts.lt?subject=Hello%Dest>sir@tts.lt</a>";

i get subject: Hello?st

is it possible to make subject Hello, Dest?
if a gref would be in " " i think that would be ok. but if i try to do this:

$mail="<"a href=mailto:sir@tts.lt?subject=Hello%Dest>sir@tts.lt"</a>";

i get error. I know, its small problem, but it would be interesting to know :)


 

 (#350 2003-11-01 09:40:10) Post Reply
Page 0 1 2 3 4 5 6 7 8

Quicksaver
Need To Set


Enrolled: Sep 2003
Posts: 90
AP: 1

do like this:


$subject = "Hello, Dest!";
$mail="<a href=mailto:sir@tts.lt?subject=$subject>sir@tts.lt</a>";

or

$mail="<a href=mailto:sir@tts.lt?subject=Hello,%20Dest!>sir@tts.lt</a>";



that second code works with my browser (IE) but if it doesnt with you then im pretty sure the first one does the trick :)

 

 (#372 2003-11-09 18:31:57) Post Reply
Page 0 1 2 3 4 5 6 7 8

Gibson
Need To Set


Enrolled: Nov 2003
Posts: 2
AP: 1

<?php
// store variables
$name1='Corey Gibson';
$url1='<a href=www.fedhead,com>Fedhead</a>';
// HTML and variable assignment result
print (My name is $name1 and my Fav site is $url1);
?>

 

  Page 0 1 2 3 4 5 6 7 8

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