School Map:
Home / Enroll
$ Student Records; Class
$ News @ LIVE
Tech Radio * Support/FAQ
| Store | FORUMS
(#259 2003-09-21 15:31:57) Post Reply |
|
Coop
|
<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 |
|
mathgeek
|
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 |
|
mathgeek
|
??? 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 |
|
maddy
|
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 |
|
TDavid
|
quote: 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 |
|
zxrod
|
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 |
|
Mark87
|
[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 |
|
Mark87
|
[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 |
|
jlk242
|
|
(#310 2003-10-11 08:16:27) Post Reply |
|
flor
|
<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 |
|
Quicksaver
|
flor, i think you need to close the last print section no? :) |
(#316 2003-10-13 13:01:24) Post Reply |
|
Ahkorahil
|
<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 |
|
jennyjlo
|
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 |
|
Ahkorahil
|
//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 |
|
Quicksaver
|
the print() is to be done like this:
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 |
|
Quicksaver
|
sorry, make it
|
(#324 2003-10-15 18:42:18) Post Reply |
|
Dom
|
<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 |
|
Dom
|
<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 |
|
spacekydet
|
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
|
(#335 2003-10-27 15:22:03) Post Reply |
|
Tala
|
<html>
<head> <title>Tala's Assignment</title> </head> <body> <center>
</center> </body> </html> |
(#336 2003-10-27 15:27:18) Post Reply |
|
Tala
|
Now where did my spaces go?! Let me try that again. *frown*
<html> <head> <title>Tala's Assignment</title> </head> <body> <center>
</center> </body> </html> |
(#340 2003-10-29 15:02:09) Post Reply |
|
Merlyn
|
<?
// $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 |
|
Quicksaver
|
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 |
|
Dest
|
<?
//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 |
|
TDavid
|
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 |
|
Dest
|
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 |
|
TDavid
|
quote: 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 |
|
Dest
|
Ok here's final result i get. added some html tags and date and time from 2 week :) :
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 |
|
Quicksaver
|
do like this:
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 |
|
Gibson
|
<?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); ?> |
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