background preloader

PHP 101: PHP For the Absolute Beginner

PHP 101: PHP For the Absolute Beginner

Beginning Game Development: Part I – Introduction | Coding4Fun Articles Part I – Introduction Welcome to the first article of an introductory series on game programming using the Microsoft .NET Framework and managed DirectX 9.0. This series as aimed at beginning programmers who are interested in developing a game for their own use with the .NET Framework and DirectX. The goal of this series is to have fun creating a game and learn game development and DirectX along the way. Game programming and DirectX have their own terms and definitions that can be difficult to understand, but after awhile, you’ll crack the code and be able to explore a new world of possibilities. I will keep things as straightforward as possible and decode terms as they appear. In this series, we are going to build a simple game to illustrate the various components of a commercial game. Tools: Before we start writing our first game we need to talk about the tools we will use. The most important tool for any developer is the Integrated Development Environment (IDE). Our Game idea: Visual C#

PHP for Beginners: Building Your First Simple CMS The Magic of PHP + MySQL It’s safe to say that nearly every website that’s up-to-date these days is using some form of content management system (CMS). While there are a ton of great free options that provide us with a CMS to power a website (WordPress, Drupal, etc.), it doesn’t hurt to peek under the hood and get a feel for how these systems work. To get our feet wet as back-end developers, we’ll be creating a simple PHP class that will: Create a databaseConnect to a databaseDisplay a form with two fieldsSave the form data in the databaseDisplay the saved data from the database Download Files This class is intended to give you a feel for how PHP and MySQL interact together, and to show the basics of a CMS. Building the Class Our first step is to simply lay out the class in a file named ‘simpleCMS.php’ so we have a road map to work with. As you can see, we’re creating one class with four variables and five methods. The Variables Build the Database Connect to the Database Build the Form <! <?

CSS tutorial: Create a dynamic horizontal navigation bar These days it's almost a standard to use an unordered list element for your page navigation. While a vertical list in some sidebar is some easy peace of work, is the horizontal navigation a little bit more complicated. Preview and example navigation We need to float the list elements to get them in the horizontal order. There are many great examples on this CSS resource site and also our example here is based on one of the tutorials listed on the suggested site. Generating the html snippet The next snippet has for the first list item the attribute id "current". First we create an array for the links and link labels we want to use in our navigation. While the navigation is very simple (just using one level) we need only some style sheet for the unordered list elements. Don't forget that we are working with a block type element and all those elements are having a 100% width by default. At last but not least we need some extra style for the current state in our navigation bar:

Easy PHP Blackhole Trap with WHOIS Lookup for Bad Bots One of my favorite security measures here at Perishable Press is the site’s virtual Blackhole trap for bad bots. The concept is simple: include a hidden link to a robots.txt-forbidden directory somewhere on your pages. Bots that ignore or disobey your robots rules will crawl the link and fall into the trap, which then performs a WHOIS Lookup and records the event in the blackhole data file. Once added to the blacklist data file, bad bots immediately are denied access to your site. I call it the “one-strike” rule: bots have one chance to follow the robots.txt protocol, check the site’s robots.txt file, and obey its directives. In five easy steps, you can set up your own Blackhole to trap bad bots and protect your site from evil scripts, bandwidth thieves, content scrapers, spammers, and other malicious behavior. The Blackhole is built with PHP, and uses a bit of .htaccess to protect the blackhole directory. These four files are all contained in a single directory named “blackhole”.

How to Create Login Page in PHP and MySQL with Session « Frozenade’s Zone ##########################NEW UPDATE!!! PHPMySimpleLogin 0.3 Download full source code: ########################## The production of login page using PHP and MySQL is actually very simple. I assume that you use local web server connection (Apache and PHP) and your MySQL database configuration use ‘localhost’ as hostname and ‘root’ as username with blank password. Run XAMPP Control Panel on desktop. Start Apache and PHP modules. Let’s create a database with PHPMyAdmin. Create database ‘phpmysimplelogin’. Click ‘Create’. Now, let’s create a table, name it ‘user’ with ‘2’ (two) number of fields. Click ‘Go’. First field, name it ‘username’, type ‘varchar’, lenght/values ’25’. Click ‘Save’. After that, we will fill the table. It means, you fill ‘username’ field with string ‘admin’ and ‘username’ field with an encryption string of ‘admin’. Okay, now let’s prepare the web pages. <? // Inialize session session_start(); ?

PHPBuilder.com, the best resource for PHP tutorials, templates, PHP manuals, content management systems, scripts, classes and more. I wish I had known these 10 tips the day I started working with PHP. Instead of learning them through painstaking process, I could have been on my way to becoming a PHP programmer even sooner! This article is presented in two parts and is intended for folks who are new to PHP. Tip 1: MySQL Connection Class The majority of web applications I've worked with over the past year have used some variation of this connection class: class DB { function DB() { $this->host = "localhost"; // your host $this->db = "myDatabase"; // your database $this->user = "root"; // your username $this->pass = "mysql"; // your password $this->link = mysql_connect($this->host, $this->user, $this->pass); mysql_select_db($this->db); } } // calls it to action $db = new $DB; Simply edit the variables and include this in your files. $result = mysql_query("SELECT * FROM table ORDER BY id ASC LIMIT 0,10"); More information can be found in the manual--be sure you read the comments:

Sphider - a php spider and search engine OBJECT ORIENTED PHP TUTORIAL FOR BEGINNERS Preamble The hardest thing to learn (and teach btw,) in object oriented PHP is the basics. But once you understand them, the rest will come much, much easier. But don’t be discouraged! … Or so I’ve been told. About This Tutorial This tutorial is designed to teach total beginners object oriented PHP. This is not a long-winded theoretical blathering that you see all too often; instead, we actually start writing OO code very quickly. So before you begin, get out your favorite PHP code editor and be ready to write and run some object oriented PHP code. PS: scroll to the bottom of the page for the supporting videos. Thanks for reading, Stefan Mischook Introduction With the release of php5 in 2004, php programmers finally had the power to code with the ‘big boys’. In this tutorial, you will be guided (step-by-step) through the process of building and working with objects using php’s built-in OOP capabilities. OOP Videos

CMU Sphinx - Speech Recognition Toolkit Improve website load time by 500% with 3 lines of code | Aciddrop.com Major New Update - PHP SPEEDY: latest version available here There are 4 relatively easy ways by which you can speed up the time it takes a browser to download a page: Make fewer HTTP requestsAdd a far-future expires headerGzip your page's componentsMinify your JavaScript, CSS and HTML Following on from my post on joining CSS and JavaScript files, I have written a PHP script which will automatically do all of the above. All you have to do is call the following at the top of your page: The code require_once('class.compressor.php'); //Include the class. And the following at the bottom of the page: The Demo That's it! The class can be downloaded here: site speed boost class download Requirements A server running at least PHP4. Setting basic options Options can be set with a comma separated string as follows: $compressor = new compressor('css,javascript,page'); The string can contain 'css', 'javascript' and 'page' depending on which elements you would like to be compressed. Setting advanced options

Good PHP Tutorials - Beginner To Advanced PHP Programming Tutorials

Related: