Webmaster Cookbook
            Webmaster Cookbook

10/29/2005

Show #54: Stringing together PHP

Filed under: Radio — Jowl @ 5:56 am

First we booted up the windows explorer browser, then we went to the course reading material. Then the browser crashed on Spawn’s machine, ChefTD thought that the MSN toolbar might of been causing Internet Explorer to crash. ChefTD stepped in and tried to fix Spawn’s browser issues, and spawn and I began to read at the top of the course material for this week. ChefTD then fixed the browser and Spawn and I kept on reading. We learned how to comment our code using the type C method, the type C method is used in commenting your code. If you use the type C method, then you can see the stuff you learned while writing the code because if you write a code you will probably forget how you wrote it. Then ChefTD said that for every PHP document we start we use this:

PHP:

1 <?php

and then we end our script with

PHP:

1 ?>

and thats how we start and end every script. Then ChefTD told us to make a string and told us that it would look like this:

$myname = ‘Jowl’;

Then we saved the document that we made as 1b1.php, and FTP’d that to our weekly folder.

Links Discussed:
PSPad - Windows-based free text editor with lots of code syntax options. WMcookbook recommended!
Firefox - an alternative browser to Internet Explorer. (ChefTD note: For those looking for the bleeding edge of browsers, try another Mozilla variation: Flock)

Original live airdate: Friday October 7, 2005 at 3:30pm PST / 6:30 pm EST
Webmaster cookBook AUDIO:

Streaming:
20k listen archive stream (dialup users)
64k listen archive stream (broadband)

download 15.0 MB (64k version)

10/14/2005

Trying to write code and getting errors

Filed under: Jowl's Journal — Jowl @ 10:31 am

Alright so im writing code and I go to upload it and I get a parse error that says

Parse error: parse error, unexpected T_VARIABLE in /web/sites/tdavid/webmastercookbook.com/courses/php101/jowl/1b1.php on line 7.

I’m unsure of what a T variable is so can anyone help me, I looked at my line 7 and don’t see any errors, here is line 7:

PHP:

1 
2 $my_favorite_website= ‘<a href="http://www.orting.com/">Orting</a>’;
3 

Both spawn and I have run into the same problem and we have also had many errors but have worked through them, I will ask ChefTD about a T variable later on in the show today.

I fixed it by changing my code to this, i figured out i was missing a closing tag.

PHP:

1 
2 print$my_favorite_website= ‘<a href="http://www.orting.com/">Orting</a>’;
3 

Update 1:15pm PST: I just learned that I was not suppose to put a print out in front of the dollar sign and that the code up there is still wrong. (from ChefTD: Yes, you can put print in front of the $string, but you were trying to print and then assign at the same time, which is not what you wanted to do.)

Update 1:20pm PST: (from ChefTD) Jowl, here is what you want to do:

PHP:

1 
2 $my_favorite_website= ‘<a href="http://www.orting.com/">Orting</a>’;
3 echo($my_favorite_website);
4 

10/13/2005

Show #53: PHP course begins - Week 1 - Lesson #1a

Filed under: Radio, Courses, PHP101 — Jowl @ 4:51 pm

First we opened up a new document in Pspad then we went to week #1 course reading material and started to read the information on that page. We then wrote down our first PHP script in the Pspad and the code for that script was:

PHP:

1 
2 <?php
3 // Does my host have PHP, and if so, what version?
4 printf(“Your host is running PHP version %s”,phpversion());
5 ?>
6 

Then once we finished writing that code we uploaded it into our server via FTP and I found that my code was wrong and had to redo my code several times before I finally got it right.

Links Discussed:
Week #1 course text (Lesson #1a)

Original live airdate: Friday September 23, 2005 at 3:30pm PST / 6:30 pm EST
Webmaster cookBook AUDIO:

Streaming:
20k listen archive stream (dialup users)
64k listen archive stream (broadband)

download 13.4 MB (64k version)

Powered by WordPress