Looking to learn PHP

Discussion in 'General Discussion' started by DarkUnderlord, Sep 26, 2002.

Remove all ads!
Support Terra-Arcanum:

GOG.com

PayPal - The safer, easier way to pay online!
  1. DarkUnderlord

    DarkUnderlord Administrator Staff Member

    Messages:
    4,315
    Likes Received:
    5
    Joined:
    Nov 10, 2001
    I'm looking to learn PHP, any suggestions?

    Any good sites? Also, how do you set the thing up on an offline comp (if possible).
     
  2. Hel Khat

    Hel Khat New Member

    Messages:
    899
    Likes Received:
    0
    Joined:
    Aug 27, 2002
    Is that what they used to create the Ninjai animation? if so I don't blame you that stuff is beautiful 3:)
     
  3. Rat Keeng

    Rat Keeng New Member

    Messages:
    267
    Likes Received:
    0
    Joined:
    Mar 20, 2002
  4. Quethim

    Quethim New Member

    Messages:
    1,671
    Likes Received:
    0
    Joined:
    Sep 18, 2001
    You could go to a libray, I'm sure there is a book called "PHP for dummies."
     
  5. xento

    xento New Member

    Messages:
    3,116
    Likes Received:
    0
    Joined:
    Jun 18, 2002
    There is! I was suggested that. The person said it is a great book for learning PHP. You have to set up an offline server to run PHP, but it is a pain most of the time. It nearly never works. Your best option would be to upload the files to a PHP-working server, and test it there.
     
  6. Milo

    Milo New Member

    Messages:
    2,517
    Likes Received:
    0
    Joined:
    Sep 12, 2001
    Get in touch with me via e-mail, DU. I have some tutorials and stuff that I can send you.

    To test scrits on your computer offline, you'll have to install Apache and PHP (probably a database too) on your computer, make sure they're set up and running correctly, and call the script through your browser.
     
  7. DarkUnderlord

    DarkUnderlord Administrator Staff Member

    Messages:
    4,315
    Likes Received:
    5
    Joined:
    Nov 10, 2001
    Done.

    This is the trouble I've been having. Getting it setup offline so that I can test it.
     
  8. xento

    xento New Member

    Messages:
    3,116
    Likes Received:
    0
    Joined:
    Jun 18, 2002
    Hey, Milo! Haven't seen you around much! Could you send me a copy of that PHP stuff?
     
  9. Quethim

    Quethim New Member

    Messages:
    1,671
    Likes Received:
    0
    Joined:
    Sep 18, 2001
    Think you could mabye send me some info about PHP as well, I really want to know how to make cool web sites, not just plain old boring geocities. I want to know PHP, and I also want to know some HTML or whatever it is called, I think PHP is better...


    I wonder how much "for dummies" books there are.
     
  10. Etalis Craftlord

    Etalis Craftlord New Member

    Messages:
    1,784
    Likes Received:
    0
    Joined:
    Sep 4, 2001
    1. Who says you can't have a cool site on Geocities? They use HTML...
    2. How can you have an opinion on something you don't know anything about?
    3. MANY books. MANY. Not MUCH. MANY.
     
  11. Jarinor

    Jarinor New Member

    Messages:
    6,350
    Likes Received:
    1
    Joined:
    Aug 5, 2001
    DU, if you have Linux on your computer, can set up Linux on your computer, or can get access to a computer with Linux, setting up Apache is pretty easy. From there, you just have to edit the config files to allow PHP...but unless you knew what you were doing, I wouldn't be making it a public server, because if you didn't secure it properly, someone could write a script, or several scripts, to do very nasty things to your computer.

    You could also get Apache for Windows, but it's probably easier to set up under Linux. Or Unix even.
     
  12. Quethim

    Quethim New Member

    Messages:
    1,671
    Likes Received:
    0
    Joined:
    Sep 18, 2001
    1. If you read my second sentence right, then you would see that I put "I would also like to know some HTML." And if I don't know HTML then geocities is boring, plus, I want to beable to make a .com site without have adds and a host site next to it (Yeah, I know it costs money for sites like that).

    2. What are you talking about? If you are talking about me saying PHP is better, I said "I think it's better."
     
  13. xento

    xento New Member

    Messages:
    3,116
    Likes Received:
    0
    Joined:
    Jun 18, 2002
    PHP often works hand-in-hand with HTML. HTML is almost a required language for any website programming. HTML for dummies is about 15-30 dollars or so.

    The basic stuff to know about HTML is this:
    <html> - starts the HTML programming
    <head> - hosts the area that puts the title on the page (the title is the words on the bar at the way top
    <title>HTML preview</title> - this would be the title
    </head> -this ends the head area
    </html> - this ends the HTML area

    All tags have <*tag*> to open it, and </*tag*> to close it. I will post more later.
     
  14. xento

    xento New Member

    Messages:
    3,116
    Likes Received:
    0
    Joined:
    Jun 18, 2002
    Oh, ya, a tag is a coded statement/command in HTML. Now, observe the following code:

    <html>
    <head>
    <title>HTML code</title>
    </head>
    <body>
    <h1>HTML</h1>
    This is HTML code.
    <a href="http://www.yahoo.com">This is a link to Yahoo.com</a>
    <img src="http://nbrosz.tripod.ca/mark.gif">
    </body>
    </html>

    Now, you may have noticed quite a few new things:

    <body> *** </body>
    This opens the area where you can put pictures, text, and links.

    <a href="***">***</a>
    This tag opens a link. The area in the ""s will determine where the link goes to, while the area between the <a href="">***</a> will determine what text/picture will have to be clicked on to open the link.

    <img src="***">
    This puts a picture on the page. The area between the ""s is the directory of the image file. An image can be put as a link in this way:
    <a href="http://nbrosz.triopd.ca"><img src="http://nbrosz.tripod.ca/mark.gif"></a>

    The area between the <h1> and </h1> tags mean header. There are 6 different headers: <h1><h2><h3><h4><h5> and <h6>. The largest being <h1>, and the smallest being <h6>.

    The text in there (the "This is HTML code." thing) will show up as normal sized text. There is no required tag for normal text.

    Observe the following code: <a href="http://nbrosz.tripod.ca"><h1>My image-hosting website.<h1></a>
    Notice how I opened the <a href> first and the <h1> second, but I closed the <h1> tag (</h1>) first. You must always close the tags in the order you opened them: The firstly opened ones will be closed last, and the last ones first. This is only like this if you stuff two or more tags together like I did above.

    Now, the <body> tag has some attributes:
    <body bgcolor="" text="" alink="" vlink="" link="" background="">
    The bgcolor is the color of the background of the page. You can put in a few names (like black, red, blue, etc.), but the main way is to put bgcolor="#FF0000", the #FF0000 being the color code. the first two didgets, in this case, the FF, is red, the second two blue, and the last two green. The text is the text of the page, the alink the color of the active links, the vlink the color of the visited links, and the link the color of links before you visit them (link & text color works the same way as bgcolor). background is the directory of a background image, if you want one. If you have one, then the bgcolor won't show.


    Help any? I will post more later.
     
  15. xento

    xento New Member

    Messages:
    3,116
    Likes Received:
    0
    Joined:
    Jun 18, 2002
    With the colors, F=full, C=half, 0,1,2,3,4,5,6,7,8,9 = brightness of color. So, FFFFFF would be white, wile 000000 would be black. FFFF00 would probably be a bright purple. This can only support 256 colors.

    If you want to make a web site, open a simple text editor, I suggest notepad, and type the following code:
    <html>
    <head>
    <title>My First Page</title>
    </head>
    <body bgcolor="black" text="yellow" alink="green" vlink="red" link="orange">
    <h1>This is my first web page!</h1>
    I am so proud of myself!<br>
    <hr><br>
    I can even make lines!
    </body>
    </html>

    Note: I mentioned <br> and <hr>. <br> makes the plain text go down/skip a line. If one isn't added, the text will get scrunched togehter into one big paragraph. It can also be used for spacing images and other objects. <hr> makes a horizontal line accross the page.

    Once you have typed that, save the file to your desktop as "myfirst.htm". Go to your desktop and open it (It will have the same symbol as your default browser.). Now, change the color, or add a picture or a link or two. Play around with it.

    The best image formats are .gif and .jpg, because these are compressed formats and will take less time to load on your site. There are many other useful HTML tags/code, including image maps, frames, music, and videos, but I will get into those later.

    JavaScript is a though, but useful programming language. You can get free JavaScript code snippets on the internet. www.google.com and search for "free javascript code".

    For music and videos in HTML, make a tag called <embed src="***" loop="false" autostart="true">
    The src="***" is the directory of the music/video. The loop can be either true or false, and describes if the movie/music will replay itself. Autostart can be true or false, aslo, and will tell if the music/video will start playing immediatly when the page loads. Another two attributes are height="" and width="", which are mainly for re-sizing movies. Another way to play music is <body bgsound="***">, where *** is the directory of the music.

    IF you wanted to link between two pages, write the following code & save it to the desktop as one.htm:
    <html>
    <head>
    <title>ONE</title>
    </head>
    <body>
    <a href="two.htm">Two</a>
    </body>
    </html>
    Now, save the following code as two.htm to your desktop, open one.htm, and click on the link called "Two":
    <html>
    <head>
    <title>TWO</title>
    </head>
    <body>
    <a href="one.htm">One</a>
    </body>
    </html>

    That is how you make links between web site pages. Any questions?
     
  16. Milo

    Milo New Member

    Messages:
    2,517
    Likes Received:
    0
    Joined:
    Sep 12, 2001
    Sorry for the late reply folks. I'm back now after having dropped the family off at the airport.

    1st off, something's gone wrong with my webmail. That's all out of commission.

    2nd, I really have a lot of PHP stuff. I'll make a list and PM it to the people who asked (so far DU, Queth, and nbrosz).

    3rd, depending on what you wanted, these are going to be pretty big filesize-wise. Probably too big to e-mail. If anyone who requested this stuff could be so kind as to set up an FTP for the others to download from, I'll be happy to upload everything I have (2 CDs worth of stuff on various programming languages). Or you can try to catch up with me on IRC so I can DCC the stuff.

    EDIT - Don't stress about the FTP. If anyone is willing to set one up, then cool. If not, it's nothing to worry about. It turns out I had less material than I thought - about 15MBs worth. It shouldn't be a problem upping that to some webspace.
     
Our Host!