SOPA and PIPA
January 18, 2012
Right now Not much can be done but visit google.
A soon to be blog with tutorials
Right now Not much can be done but visit google.
At the moment everything has slowed down. The site has been slowly updated, which isn’t good for us or the viewers. Please be patient. Trust me it will get better.
~Tyler.
Starting Tags
You can generally use either one depending on the php.ini file but to start you php you can do.
<?php
?>
Or you could do (which is the short-hand code)
<?
?>
Echoing
This is probably the easiest function there is in PHP. You can echo html and other PHP as well.
to echo you first need to start with your PHP tags so lets begin
<?php
echo("hello world");
?>
That code will echo out the words “hello world”. Now you can also echo html:
<?php
echo("<i><b>Hello World</b></i>");
?>
This code will display “Hello World” just like that. Other things to note are that if you are echoing things such as links it is highly recommended to use single quotes, or you will end up with a parse error. To counter the parse error do something like this.
<?php
echo '<a href=\'http://nukewarz.com\'>Nukewarz</a>';
?>
Including
This is also very simple. Basically you put the requested file onto that page such as a php, html, text, or even a flash file. To do this simply enter the following code
<?php
include("/directory/file.html");
?>
What this code will do is put a html on the which ever page you insert this code. Now things to note are, if a file is farther up a directory you must add ../ so it will include a file in the previous directory. Example:
<?php
include("../etc/members.php");
?>
Say you were in the directory called “tutorials” this would request the file members.php even though it is located in a different directory all together.
If’s and Else’s
This is also quite simple. Say you had a decent member system with basic cookies. the following would work for example:
<?php
if ($_COOKIE[username]) {
echo("<h2>Login</h2>"); //displays the title
include("../login/welcome.php"); //includes the shouts
}
?>;
This code is basically stating that if the user is logged in (assuming your using cookies) then it will show the shout box. Everything between the {} tags is what happens if there logged in. Here is another example:
<?php
if (!$_COOKIE[username]) {
echo("You are not logged in!"); //tells the user he isn't logged in
die(); //kills the script. Anything ran below or after this page will not be ran.
}
?>
By adding the exclamation mark this is telling the script basically that he is NOT logged in then tells the user he isn’t.
At the moment we are doing some site optimization to both the main site and the blog.
This is the PHP intro. Let me start by saying that Google is your best friend. If you cannot code it, google can at least help with a basis for idea’s. Just do not steal code.
1. Notepad++ ( This tool is great for more then PHP coding. It is great for almost everything. With a few plugins it could be used for anything text related. Check it out because this tool is free and definitely a must have.)
2. Pastebin ( A web based tool such as Pastebin is great for providing code to other people. You will notice it colors text just like Notepad++. There is many other tools like Pastebin out there to use. Again Google can help you find that.)
What is PHP?
Most people who are new to the web designing field ask this question because most skilled designers love this language. PHP stands for PHP: Hypertext Preprocessor.
You still can use all your HTML skills in PHP. Most PHP is written within HTML to give a website a style. PHP can also be written alone as a script. PHP is server side scripting at its best.
Basically PHP has little to do with layout, events, or really anything about what a website looks like. PHP is mostly lurking within the site and doing things that the user isn’t aware of. Server side means that when you view the source of the page you won’t see any PHP code. Only HTML is available. This is because when a user goes to a page the page is called from the server where the files are hosted. From there the server reads any PHP and keeps that PHP code and only returns the HTML and what ever the PHP code was supposed to display for the user. Most things displayed from the database.
Basically what it says. Its a place where data is kept to read from. Users on a website are all part of a database. This way each page on a website can be the same and the info within it can change easily sing some PHP and database information.
Want more info on php? Go visit www.PHP.net
The new blog is up.
We are using html5 and wordpress.
There will be some tweaks to the theme and plugins. Right now this is the only post however expect more to come.