gfxgfxFSnC Forumgfxgfx
gfx gfx
gfx
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 23, 2012, 05:37:44 PM

Login with username, password and session length
[8:39:20 PM] Forte: yep
[8:39:21 PM] Forte: fuck this game
[8:39:25 PM] Forte: and its impossibility.
[8:39:31 PM] Jason "Rags" Gray: what are you playing
[8:39:35 PM] Forte: Gradius goddamn III
[8:39:48 PM] Forte: you win, Konami.
[8:39:52 PM] Forte: you made the most unbeatable game
[8:39:53 PM] c0mp1337: arcade mode?
[8:39:54 PM] Forte: that is still playable.
[8:40:10 PM] Forte: I don't understand how they did it
[8:40:14 PM] Forte: it's not glitchy as fuck or anything
[8:40:23 PM] Forte: it's just unfair to the maximum definition of unfair.
[8:40:43 PM] c0mp1337: a rape you in the ass unfair?
[8:40:51 PM] Forte: rape can't even describe it
[8:41:08 PM] Forte: I think it's more the promise of being raped
[8:41:14 PM] Forte: but it never happens
[8:41:20 PM] Forte: yet you're constantly being told that you will be raped
[8:41:32 PM] Forte: and they won't let you out of this little tiny room unti you are raped
[8:41:36 PM] Forte: but no one ever does it
[8:41:47 PM] Forte: so you just die
[8:41:51 PM] Forte: after waiting for forever
[8:42:06 PM] Jason "Rags" Gray: lol
[8:42:08 PM] Forte: and occasionally a big black dude will come in and flash you a menacing smile
[8:42:13 PM] Forte: and then he just leaves
[8:42:28 PM] Forte: This is what playing Gradius III is like.
gfx
gfx
*
gfxgfx
gfxgfx gfxgfx
Search:     Advanced search
gfxgfx Home Help Calendar DownloadsChessFlashChat Login Register   gfxgfx
gfx gfx
gfx
Forte's Sprites n' Comics
Pages: [1]   Go Down
Print
Author Topic: How do I shot Web?  (Read 353 times)
0 Members and 2 Guests are viewing this topic.
Death Dark
Abaddon
Pig Mask Commander
*

Hats: 3
Offline Offline

Awards:
<3 Pink HairElder Scrolls FanPhantasy Star Online FanChosen by C++ to get a badge
Xbox Live Gamertag: The Death Dark
Steam ID: Darksteel_Colossus
Posts: 5972


Master of the Unfinished.


« on: June 05, 2009, 02:16:50 PM »

The following posts in this topic will be abbreviated tutorials on web based languages such as HTML, CSS, JavaScript, and PHP.  They may assume some knowledge of different things (such as hexadecimal color codes), but are generally intended to give you a brief knowledge of the language so that you can read it, though you may not be able to use it to its full extent.

If you wish for more details into parts of the language not covered here, w3schools.com is a superior resource for all things web.



How do I shot HTML?

How do I shot CSS?

How do I shot PHP?
« Last Edit: June 07, 2009, 08:58:33 PM by Death Dark » Logged

"Leave it to you to troll a porn star." -- Sepuku
Death Dark
Abaddon
Pig Mask Commander
*

Hats: 3
Offline Offline

Awards:
<3 Pink HairElder Scrolls FanPhantasy Star Online FanChosen by C++ to get a badge
Xbox Live Gamertag: The Death Dark
Steam ID: Darksteel_Colossus
Posts: 5972


Master of the Unfinished.


« Reply #1 on: June 05, 2009, 03:36:20 PM »

Today we will be addressing the subject of HTML.  You will need a basic text editor such as Notepad for this and a web browser (you have one since you're looking at this).

HTML, or HyperText Markup Language, is a markup language based on HTM.  It's stored in .html files and is translated by a web browser into a visual display based on the parameters and guidelines given by the HTML.  HTML is not a scripting or programming language, and as such cannot process information.  Instead, it can only tell the browser how to display things.  The latest edition of HTML is 4.01 and the language is standardized by the W3C.  HTML is a basic browser language and is compatible with all browsers.



First thing you should decide upon is how you're going to write your code.  There are three different major styles of writing code when it comes to HTML.  The first is Computer Style coding.  Normally very few people write this way, but it's how the code will appear if it's been computer generated.

Code:
<html><head><title>Hello World</title></head><body>Hello World.</body></html>

It's an ugly style that gets hard to read when you get any sort of length to it.  I don't recommend using this style as it will make editing a pain.

The second major style is the left aligned style, which is most popular.

Code:
<html>

<head>
<title>
Hello World
</title>
</head>

<body>
Hello World.
</body>

</html>

Code is relatively easy to read this way.  It's perfectly fine to use, since HTML ignores all whitespace (spaces, line breaks, and indents) except in displayed text (in which all whitespace is displayed as a single space).

The third major style, the way I'll be writing, is the Programming style or the Visual Hierarchy style.

Code:
<html>
<head>
<title>
Hello World
</title>
</head>

<body>
Hello World.
</body>
</html>

The focus of this style is portraying all code that is contained within a tag as indented.  This allows easier viewing and reminds you how many tags you have yet to close.



Whatever style you decide upon, the important thing to know is the tags.  There are three kinds of tags:

Opening Tags - <tag> - All code afterwards is affected by the effects of this tag.
Closing Tags - </tag> - Ends the effects of an opening tag.
Single-Use Tags - <tag /> - Effect is immediate and cannot be applied over an area.

Every opening tag needs a closing tag.  You should close the current tag before closing any tags before it.  Single-Use tags can have the / omitted, but should be written with them in.



Some tags (most tags) have information/variables that you can set in order to change the way they're displayed.  These attributes go after the tag name but before the end of the tag (the > or />).  There can be no spaces before or after the = sign, and the information should be in quotation marks (' or "), though they don't have to be.  Note:  for an open and closing tag set, the variables only go in the open tag.

<tag color="blue" size="4">Stuff</tag>

<tag src="there.jpg" />




Important tags to know:



Code:
<html></html>

Indicates HTML code.  These should begin and end your code.

Attributes:
None



Code:
<head></head>

The first major section of HTML code.  This is not displayed, but contains information.  This is known as the header of the page.

Attributes:
None



Code:
<body></body>

The second major section of HTML code.  This is all of the code that will be displayed onscreen.  This is known as the body of the page.

Attributes:
text - Indicates the color of the text
link - Indicates the color of hyperlinks
alink - indicates the color of a link that is being clicked on
vlink - indicates the color of a link that has been visited
background - indicates the image to be used as the background (automatically repeats)
bgcolor - indicates the background color



Code:
<title></title>

Belongs in in the header.  Indicates what will be displayed as the page's title (in a tab or at the top of the browser window).

Attributes:
None



Code:
<font></font>

Belongs in the body.  Indicates an area of altered font.

Attributes:
face - indicates the font face or font type used
color - indicates the font color
size - indicates the font size



Code:
<b></b>
<u></u>
<i></i>
<s></s>

Indicates text that is bold, underlined, italic, or struck-through.

Attributes:
None



Code:
<center></center>
<left></left>
<right></right> (not available in all browsers)

Indicates text that is aligned left, right, or center.



Code:
<br />

Indicates a line break

Code:
<hr />

Indicates a horizontal rule (horizontal line).



Code:
<img />

Indicates an image.

Attributes:
src - indicates what image to display
alt - indicates the text to display if the image cannot be displayed
height - indicates the height the image should be decreased to
width - indicates the width the image should be decreased to



Code:
<table>
<tr>
<td>
</td>
</tr>
</table>

Indicates a table.  This can be used to completely structure your page as the size of each cell can be controlled to the pixel.

Attributes:
cellspacing - indicates the number of pixels between each cell
cellpadding - indicates the number of pixels between the edge of the cell and its content
height
width
border - indicates the size of the border
bordercolor - indicates the color of the border

Code:
<tr>
<td>
</td>
</tr>

Indicates a row in the table.

Attributes:
height
width

Code:
<td>
</td>

Indicates a cell in the table.  This is where your content goes.

Attributes:
height
width
colspan - the number of columns the cell takes up
align - the alignment (center, right, left, justified) of the content of the cell
valign - the vertical alignment (top, middle, bottom) of the content of the cell



Code:
<a></a>

Indicates an anchor.  This is how you make links.

Attributes:
href - the hyper-reference; indicates where the link takes you to
target - indicates where the link opens (put _blank to open in a new window)




Colors in attributes can be represented in two ways.  They can be indicated by hexadecimal color codes (#000000) or by the color name (black).  Not all colors are displayed the same way on all computers or browsers.

Hyper-references and image sources are given as URLs.  They can be full URLs (such as http://fortescomics.net/Comics/index.php) or abbreviated URLs (such as index.php).  Abbreviated URLs can only be used for files in the same folder as the page or in subfolders (such as "folder/image.jpg").

Heights and widths are given in pixels.

Sizes are given in a number of ways.  The first is the default HTML sizes of 1-7, 1 being the smallest.  The second is in pixel notation, which is written with px immediately after the value ("15px").  The third, that is for use with text, is in point notation, which is written with pt immediately after the value ("15pt").  The fourth is used with text as well, and is the relative sizes of x-small, small, medium, large, x-large, etc.

Font names are given as you would find them if you opened up Word or something.  The full name (such as "Comic Sans MS") is required.  You can list fonts separated by commas ("Arial, Verdana, Tahoma") and it will attempt to use the first font first, and keep going down the line as it can't find them.  You can also use the generic names "serif", "sans-serif", and "monospace" instead.  Monospace fonts are fonts that take up the same amount of space for any given character, such as Courier, Courier New, and Lucida Console.  Serif fonts are fonts that have little lines at the end of the characters, such as Times, Times New Roman, and Garamond.  Sans-serif fonts do not have the lines, such as Arial, Verdana, and Tahoma.



Writing a page in HTML is simple.  Start with an HTML tag.

Code:
<html>

Then start your header, and give your page a name.

Code:
<html>
<head>
<title>
Hey look, a webpage
</title>

There's nothing else you need the header for right now, so close it and start up the body.

Code:
<html>
<head>
<title>
Hey look, a webpage
</title>
</head>

<body text="green" bgcolor="black" link="white" vlink="white">

Now we should make a table to hold our page.

Code:
<html>
<head>
<title>
Hey look, a webpage
</title>
</head>

<body text="green" bgcolor="black" link="white" vlink="white">
<center>
<table width="1000" border="1px" bordercolor="red">
<tr>
<td>

Now let's put some large text in and give the page a visual header of some sort (note that usually you'd use an image here, but since I have no images readily available, I'm skipping that step).

Code:
<html>
<head>
<title>
Hey look, a webpage
</title>
</head>

<body text="green" bgcolor="black" link="white" vlink="white">
<center>
<table width="1000" border="1px" bordercolor="red">
<tr>
<td>
<font size="5" color="blue>
<b>
THIS IS CODIIIIIIIIIIIIING!!!
</b>
</font>

Alright.  Now we need another cell for the content.

Code:
<html>
<head>
<title>
Hey look, a webpage
</title>
</head>

<body text="green" bgcolor="black" link="white" vlink="white">
<center>
<table width="1000" border="1px" bordercolor="red">
<tr>
<td>
<font size="5" color="blue>
<b>
THIS IS CODIIIIIIIIIIIIING!!!
</b>
</font>
</td>
</tr>
<tr>
<td>
Hey, this is some body text.  Pretty nifty, right?

Swingin'.  Lastly, let's add a bit at the bottom.

Code:
<html>
<head>
<title>
Hey look, a webpage
</title>
</head>

<body text="green" bgcolor="black" link="white" vlink="white">
<center>
<table width="1000" border="1px" bordercolor="red">
<tr>
<td>
<font size="5" color="blue>
<b>
THIS IS CODIIIIIIIIIIIIING!!!
</b>
</font>
</td>
</tr>
<tr>
<td>
Hey, this is some body text.  Pretty nifty, right?
</td>
</tr>
<tr>
<td>
<font size="x-small" face="monospace">
Hey, this is MY page.  Leave it alone.

Okay, that should be good.  now we close everything up.

Code:
<html>
<head>
<title>
Hey look, a webpage
</title>
</head>

<body text="green" bgcolor="black" link="white" vlink="white">
<center>
<table width="1000" border="1px" bordercolor="red">
<tr>
<td>
<font size="5" color="blue>
<b>
THIS IS CODIIIIIIIIIIIIING!!!
</b>
</font>
</td>
</tr>
<tr>
<td>
Hey, this is some body text.  Pretty nifty, right?
</td>
</tr>
<tr>
<td>
<font size="x-small" face="monospace">
Hey, this is MY page.  Leave it alone.
</font>
</td>
</tr>
</table>
</center>
</body>
</html>

And there you have a webpage.  Save it as a .html file and open it in the web-browser of your choice, and view this masterpiece.  If you want to make changes, make changes, save, and refresh the page in your browser.  You can do this even if your computer isn't connected to the internet, so long as you have the images in the same directory (folder).




That should be everything.  If you want to know anything else, just ask or go to w3schools.com.  They have a full list of every HTML tag and all the attributes for them and stuff like that.  It's pretty cool.
« Last Edit: June 06, 2009, 08:26:54 PM by Death Dark » Logged

"Leave it to you to troll a porn star." -- Sepuku
Death Dark
Abaddon
Pig Mask Commander
*

Hats: 3
Offline Offline

Awards:
<3 Pink HairElder Scrolls FanPhantasy Star Online FanChosen by C++ to get a badge
Xbox Live Gamertag: The Death Dark
Steam ID: Darksteel_Colossus
Posts: 5972


Master of the Unfinished.


« Reply #2 on: June 06, 2009, 11:59:57 AM »

Today we will be addressing the subject of CSS.  You will need a basic text editor, a web browser with CSS enabled, and a knowledge of HTML.

CSS, or Cascading StyleSheets, is a formatting language developed to take away the responsibility of HTML to provide formatting.  It is stored in .css files or in .html files along with HTML code.  CSS is also not a scripting or programming language, so it also cannot process information.  Instead, CSS tells the browser how to display the information given by HTML code.  The latest version of CSS is 2.0 an is also standardized by the W3C.  Most browsers support CSS, though there is the slight chance that a browser may not support it, and CSS may also be disabled in some browsers.



There are three ways to write your CSS.  The first is in-line CSS, which you add the universal attribute style="" to the tag and insert your CSS directly into it.  However, this can get messy.  The second is CSS written in the header of the file.  This is nice since it can apply for the whole document and everything's in one nice little place.  However, it cannot be applied to other documents.  To solve this, you can use a .css file and link your page to the .css file and it will read from it instead (I'll tell you how to do this a bit).  This is the preferred method, but since it's impractical here, I'll use the second method instead.

In order to enact the second method, you need to do the following:

Code:
<html>
<head>
<title>
CSS Tutorial
</title>

<style type="text/css">
/*  CSS to go here  */
</style>

As it says, the CSS code will go in the style tags.  In there, the document switches to CSS standards instead of HTML standards and processes the CSS.

As for the third method, you will need to do something to the effect of the following:

Code:
<html>
<head>
<title>
CSS Tutorial
</title>

<link rel="stylesheet" type="text/css" href="style.css" />

The CSS file in the hyper-reference will be treated entirely as CSS (for obvious reasons) and will be applied to the document.  Note that most server settings will allow this to happen fine across multiple directories (meaning the CSS file can be somewhere completely different if you give the full URL).



The basics of CSS are very easy, and there is no real advanced section to CSS.  There are comments, styles for tags, sub-classes for tags, and pseudo-classes for tags.



Comment your CSS by placing text between /* and */ (like opening and closing tags).  Using the standard code comment of // will work as an end-of-line comment simply because your browser will say "What the hell is that?" and ignore it (this will also generate an error, but it won't show up in any bad way).  However, due to the straightforward nature of CSS, it's not necessary to comment.



The main focus of CSS is stylizing your HTML.  All details given in your HTML will override the CSS, but the CSS will apply to all instances of the HTML tag, so if you want a particular style everywhere except one spot, you can use the CSS to give the everywhere else style and the HTML to do the one spot (though you can use CSS to handle the one spot as well).

To start off with an easy example, here's some sample CSS:

Code:
<html>
<head>
<title>
CSS Tutorial
</title>

<style type="text/css">
a
{
color:  white;
}
body
{
color:  green;
background-color:  black;
}
table
{
border: 1px solid blue;
width:  1000;
}
</style>

If you don't recognize it, this code will do the same thing as the <body> tag in the HTML tutorial.  All I did was address each of the tags and set the details for each one.  Though the names are different, each one of the attributes the HTML tag has can be controlled with CSS, and you can even add more control than HTML will allow, making for interesting effects such as small-caps for text headers.

In order to set tag details, simply type the tag's name, then an open brace "{".  You then merely type the name of the attribute, a colon ":", the details (generally this is provided identically to how you would give it to HTML), and then a semicolon ";" (think of it as a period for a sentence).  Once you have all of your details for the tag, use a closing brace "}" and close the style tag if necessary.

The order in which you provide these details is unimportant.  The order in which you state the tags is unimportant.  However, the attributes, and what can be given into them, is a wide, yet set, range of details.  Since I'm lazy and someone else has done it already, I'm going to skip out on this part of it, and send you to here:  http://www.w3schools.com/css/css_reference.asp.  Yes, w3schools again.  This has all of the possible tag attributes.



You can use the universal class="" attribute with your CSS in order to provide a more detailed distribution of styles.  To start, you'll need to put the class tag into your HTML.

Code:
<html>
<head>
<title>
CSS Tutorial
</title>

<style type="text/css">
</style>

</head>

<body>
<span class="classA">
This is text.
</span>

<span class="classB">
THIS IS TEEEEEEEEEEEEXT!!!
</span>
</body>
</html>

Now, keep an eye on my hands; nothing up my sleeves and...

Code:
<html>
<head>
<title>
CSS Tutorial
</title>

<style type="text/css">
span.classA
{
color:  blue;
}
span.classB
{
color:  yellow;
}
</style>

</head>

<body>
<span class="classA">
This is text.
</span>

<span class="classB">
THIS IS TEEEEEEEEEEEEXT!!!
</span>
</body>
</html>

As you can see, it's merely tag.class when it comes to this.  Egads.  I think I'm done here.



If you go to the bottom of the page I sent you to for all of the attributes you'll find some pseudo-classes you can use to handle some parts of CSS.  You can use this for hover-overs and such like that.  However, these pseudo-classes use a colon ":" instead of a period "." (or dot-operator for those of us who know), and you can chain them off of classes (tag.class:pseudo-class).  If you need more details, see the link.  They're pretty cool.




CSS isn't very hard, as you can see.  It's rather straight-forward and simple in concept.  I'd dare to say it's simpler than HTML.  Anyways, it's helpful.
« Last Edit: June 08, 2009, 08:56:12 AM by Death Dark » Logged

"Leave it to you to troll a porn star." -- Sepuku
Death Dark
Abaddon
Pig Mask Commander
*

Hats: 3
Offline Offline

Awards:
<3 Pink HairElder Scrolls FanPhantasy Star Online FanChosen by C++ to get a badge
Xbox Live Gamertag: The Death Dark
Steam ID: Darksteel_Colossus
Posts: 5972


Master of the Unfinished.


« Reply #3 on: June 06, 2009, 09:47:06 PM »

Today we will be addressing the subject of PHP.  You will need a basic text editor, a web browser, a knowledge of HTML, and a PHP enabled server.  If you do not have a PHP enabled server, you can download PHP here:  http://www.php.net/downloads.php.  If installed onto your computer, a PHP enabled server is no longer required as your computer can process the PHP.

PHP, originally standing for Personal Home Page and later for P-Hypertext Preprocessor, is a server-side scripting language based on the C programming language.  It is stored in .php or .phtml files, though it will not be recognized in any other types of files.  PHP is a scripting language, and thereby can process information and output results based on that information.  The latest version of PHP is 5.1 and is standardized by The PHP Group (php.net).  PHP requires no browser support, but requires a server to be PHP ready.



First thing's first.  Get a place to practice PHP.  That's a task in and of itself.

Getting started with PHP is different for everyone.  Those familiar with C and/or C++ will find themselves right at home immediately, while those new to programming/scripting will be lost quickly.  Don't worry, though, PHP is an easy place to start.



To begin your PHP, you need to essentially make a PHP tag.  This is denoted as follows.

Code:
<?php ?>

Any PHP code must be placed within this tag.  Note that the tag may span several lines.  The standard comment notations of // and /* */ work in PHP.

Code:
<?php
//Hey, look, a comment!

/*
And another!
*/
?>


(If you haven't noticed yet, the SMF code tags like PHP best of all)

All PHP is executed on the server before the page is sent to the user to be viewed.  When this happens, the PHP tags are removed from the page, since HTML isn't PHP friendly (though PHP is HTML friendly)  (kind of).



Variables are the way that a scripting or programming language holds information.  They're known as variables since they can change (or vary).  If you're going to do anything that's processing information, you're going to have to do it with variables.

All variables start with the dollar sign "$".  To make a variable, just reference it in some way or another.

Code:
<?php
$var 0;
//A variable?  That's cool.
?>


Variables can store information that your code generates or that is given by the user.  Remember to end your lines with a semicolon ";".



The most important thing is displaying your information.  To do this, use the echo function for PHP.

Code:
<?php
$echo "echo";
echo "echo" 'echo' $echo;
?>


Echo writes everything it's given to the file.  This information won't be erased along with the PHP.  To use echo, simply type the keyword and what you wish to display.  String literals, or text that you want displayed as you type it, must be surrounded by single or double quotes ' or ".  Single quotes will display all information literally, while double quotes will display any variables inside of it as the values instead (however, I prefer to not exploit this capability as it can't be done in C/C++).  Variables by themselves are displayed as the value they contain, whatever it may be.  To link multiple string literals or variables together, use the concatenation operator ".".  This will strap everything together.  Note that . does not add a space in the display.  Also, to get a line break you must type in a line break, and to get ' or " or \ displayed, you must type in \" or \' or \\.  Though echo may span many lines, remember to end with your semicolon.

Echo writes before the page is sent.  As such, you can use it to write HTML, JavaScript, CSS, or any other non-server-side language.

Code:
<?php
echo 
"
<html>
<head>
<title>
DUDE, IT'S PHP!!!
</title>

<style type=\"text/css\">
body
{
background-color:  black;
color:  green;
}
</style>
</head>

<body>
LOOK, IT\'S PHP!!!
</body>
</html>"
;

?>


Using this you can process the information given and force your page to do different things such as change the CSS or JavaScript based on your user's preferences.  For example, you could make a single page layout and have your user choose the theme of that layout in terms of colors and such and therefore load up your pages differently.  It's not only possible with PHP, but it'd actually be extremely friggin' easy.



Variables have multiple operators that can act on them.  However, they share all of the mathematical, logical, and comparison operators with C++, so instead of listing them, I'll send you here:  http://fortescomics.net/forum/index.php/topic,594.msg20454.html#msg20454.  This topic is a C++ tutorial, but it has all the operators.  They're all the same.  The main thing to remember is = sets a variable equal to something and == determines if it's equal to something (one forces while the other checks).



An important part of PHP can be seen if you look at something like what you see in your address bar right about now.  What you see up there are GET variables.  They begin after a question mark "?" and are separated by ampersands "&".  To get them down, you merely need to use the preset variable $_GET.  For example, if I sent you to the page http://fortescomics.net/Comics/index.php?series=filler&comic=8, I can use the following code

Code:
<?php
$series $_GET["series"];
$comic $_GET["comic"];

echo "<img src=\"http://fortescomics.net/Comics/" $series "/" $comic ".PNG\" alt=\"COMIC\" />";

//don't insult me; this isn't all there is to it, so stop thinking it is
?>


The ["text"] should be changed depending on the information provided by the URL, but operates the same way.  It's a good idea to store the information in a variable before using it.

To get information in the URL, either use a link with the variables hard-coded, or use an HTML form in the "get" mode.  Similar exploits can be used with $_POST and $_COOKIE.  $_POST can only be set by a form in "post" mode, and the information doesn't appear in the URL, so it can be used for passwords and large blocks of information, since $_GET has a limit.  $_COOKIE can only be set by way of a language that can set cookies (such as PHP).  In order to do so, use the setcookie function.

Code:
<?php
setcookie("omnom""delicious");

echo $_COOKIE["omnom"];
?>


That code will output "delicious" to the file.  The first string is the name of the cookie.  The second is its value.  The third, not shown here, is when the cookie should expire.  The easiest way to set this is using the PHP time() function, which will give the current time in seconds since Midnight January 1st 1970 (this is a C/C++ classic).  So, if you want the cookie to expire in 5 seconds, do this:

Code:
<?php
setcookie("omnom""delicious"time() + 5);

echo $_COOKIE["omnom"];
?>


The expiration begins after the page is loaded, so you should be able to use it in your PHP and any page loaded in the next 5 seconds.  To delete a cookie, use the setcookie function to set the same cookie, but set the expiration time to something like time() - 3600 or so, which will cause it to expire immediately.  Using something like that, we can do the following:

Code:
<?php
setcookie("fsncUser""log-out"time() - 3600);
?>


The setcookie function must come before the <html> tag in a document, so either use PHP before your HTML or echo your HTML.



You can use PHP and variables to decide things.  Using an if/elseif/else statement, you can tell certain pieces of code to act.

Code:
<?php
$number $_GET["guess"];

if($number == 42)
{
echo $number " was the right guess!";
}
?>


The if statement sees if the expression in the () is true.  If it is, it will activate the code.  If it is not, then it will not.

Code:
<?php
$number $_GET["guess"];

if($number == 42)
{
echo $number " was the right guess!";
}
else
{
echo $number " is the wrong answer!  (loser)";
}
?>


The else statement needs no expression as it's what happens if the if statement doesn't (a default).

Code:
<?php
$number $_GET["guess"];

if($number == 42)
{
echo $number " was the right guess!";
}
elseif($number == 41 || $number == 43)
{
echo "So close...";
}
else
{
echo $number " is the wrong answer!  (loser)";
}
?>


The elseif statement activates if the previous if and elseif statements have not and the expression is true.  Think of it as a backup.  If the first thing isn't true, and the second thing is, then do this.  The else statement will still catch anything that isn't caught by if and elseif statements.  Note that an if must start off a group and an elseif cannot be added after an else.




As far as simple PHP is concerned, this is it.  There are, of course, other things PHP can do, but you'll either have to wait for "How to shot PHP? 2" or go to w3schools.com.
« Last Edit: December 24, 2009, 09:08:20 PM by Death Dark » Logged

"Leave it to you to troll a porn star." -- Sepuku
Hobro
Bro
Serenade
*****

Hats: 9042
Offline Offline

Awards:
Chess Beta TesterSearchMan\'s OpIke MainMaze Beta TesterYou\'d best watch out.Banner MagicIt\'s like Christmas or something.
Brawl Code: 1204-5409-5125
Xbox Live Gamertag: Lyrun Novum
Playstation Network ID: Lyrun
3DS Code: 2836-0088-7573
Steam ID: hoboreloaded
Posts: 3512


Henshin a go go, baby!


« Reply #4 on: July 13, 2009, 03:05:10 PM »

How do I shot web?

Logged

urusai
RockMan Killer
*

Hats: 4
Offline Offline

Posts: 433


« Reply #5 on: January 12, 2011, 12:59:37 AM »

:D
Logged

Pages: [1]   Go Up
Print
Jump to:  

MegaMan Topsites

Our affiliates

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines
Cerberus design by Bloc
Valid XHTML 1.0! Valid CSS!
gfx
gfxgfx gfxgfx