Browser MMO video #8

Location of the Videos
Tatti1234
Posts: 10
Joined: Sun Dec 27, 2009 6:30 pm

Re: video#8

Post by Tatti1234 »

OH YEES!!! Sorry :D But now it is working, thanks valhalla ;D
zolacat999
Posts: 62
Joined: Tue Nov 24, 2009 11:09 pm

Re: video#8

Post by zolacat999 »

where do we get the images from or if we cannot use those one and we create our own where do we place them
brasilboy109
Posts: 7
Joined: Wed Jan 13, 2010 1:36 am

Re: video#8

Post by brasilboy109 »

yea im still confused on divs but they seem realy helpful and like i wished i knew about them sooner. im gonna check out some other resources though
User avatar
Zerk
Posts: 58
Joined: Wed Jan 20, 2010 2:59 am

Re: video#8

Post by Zerk »

I have a question: Where does the "Include/Include_once" go in a HTML thing...

Example:

Code: Select all

<html>
<head>
include_once here?
</head>
<body>
or here?
</body>
</html>
I've been trying to use normal HTML stuff and putting the PHP in the HTML...

I learned my current PHP knowledge from you and w3schools.com and neither specify where I should put this.

:oops:
Coding - Unity3d JS, PHP, and small amount of C#.
Art stuff - GIMP, Blender
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: video#8

Post by Jackolantern »

As long as it is in the <?php ?> tags, it really doesn't matter (include_once is a PHP function). However, you have to keep in mind that the location of the include_once directive is where the code is added. If you are trying to use the value of a variable, or a function, you need to keep in mind that the include_once function call needs to come in an order that makes sense. Just imagine that you are writing the included file directly into your code.

As far as head vs. body, PHP typically goes in the body. That is because quite often you want the PHP to dynamically create HTML for your page, and the body is the location in an HTML document that contains HTML that will be rendered in the viewer's browser. You can add PHP to the heading, but the reasons for doing so are typically limited.
The indelible lord of tl;dr
User avatar
Zerk
Posts: 58
Joined: Wed Jan 20, 2010 2:59 am

Re: video#8

Post by Zerk »

Jackolantern wrote:As long as it is in the <?php ?> tags, it really doesn't matter (include_once is a PHP function). However, you have to keep in mind that the location of the include_once directive is where the code is added. If you are trying to use the value of a variable, or a function, you need to keep in mind that the include_once function call needs to come in an order that makes sense. Just imagine that you are writing the included file directly into your code.

As far as head vs. body, PHP typically goes in the body. That is because quite often you want the PHP to dynamically create HTML for your page, and the body is the location in an HTML document that contains HTML that will be rendered in the viewer's browser. You can add PHP to the heading, but the reasons for doing so are typically limited.
Thanks ^^ That helps a lot.

So, from what I gather, you recommend putting ALL PHP in the body section, right?


Even stuff like the connect php thing from the videos?

Code: Select all

<?php
include_once 'connect.php';
 session_start();

if(isset($_SESSION['player']))
{
  $player=$_SESSION['player'];
}

?>
Coding - Unity3d JS, PHP, and small amount of C#.
Art stuff - GIMP, Blender
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: video#8

Post by Jackolantern »

I have not gone through the video tutorial series yet, so I would just put it where Halls suggests to.
The indelible lord of tl;dr
User avatar
Zerk
Posts: 58
Joined: Wed Jan 20, 2010 2:59 am

Re: video#8

Post by Zerk »

Jackolantern wrote:I have not gone through the video tutorial series yet, so I would just put it where Halls suggests to.
He isn't using HTML, just putting everything in <?php ?> right now.
Coding - Unity3d JS, PHP, and small amount of C#.
Art stuff - GIMP, Blender
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: video#8

Post by Jackolantern »

Zerk wrote:
Jackolantern wrote:I have not gone through the video tutorial series yet, so I would just put it where Halls suggests to.
He isn't using HTML, just putting everything in <?php ?> right now.
Probably is a file begins and ends with <?php ?>, it is meant to be a stand-alone file to be included. Almost all of your scripts will be in the body because they have to do with rendering HTML to the screen. Even if the commands themselves don't, they will likely be used by a function that does. Just assume to put it in the body unless the video states otherwise.
The indelible lord of tl;dr
ZeroComp
Posts: 648
Joined: Thu Oct 29, 2009 8:48 pm

Re: video#8

Post by ZeroComp »

All of them are done in php with some HTML or XHTML tags (I forgot is <center> an XHTML>)
Coding-PHP, Javascript, C++, HTML, mySQL
Modeling/Art-Blender, GIMP
Games-Unity, Game Maker 8
Post Reply

Return to “Older Browser MMO Videos”