Showing posts with tag: php
Posted February 15, 2011 by Nick Vogt in Programming
Many of the sites I build require an image thumbnailer, so that users can upload an image and it will automatically be thumbnailed. I decided to write a function that I could incorporate into these sites quickly and easily. This function takes a number of arguments, and will create any number of thumbnails in any sizes, and also has the option of moving the original, unedited file into a folder. It handles jpg, png, and gif, and creates jpg thumbnails.

Download it here, name it and put it somewhere. Use php "include" or "require" where it is needed, then call the createthumbs function, which takes four arguments:

The first argument is the $_FILES[] variable that points to the file that was uploaded.

The second argument is the filename of the image.

The third argument is an array that contains the different sizes and locations to save the images. It is formatted like so: array('imgdir/thumb' => array(360,240), 'imgdir/large' => array(800,600)). Each key in the main array is the image folder, and each value is an array that contains the width and height. You can have as many as you want.

The fourth argument is optional, and is a string that points to the directory you want the original image to be saved in, if you want it saved.


Continue reading...
Posted September 16, 2010 by Nick Vogt in Programming
Having a code block allows you to display code without it being interpreted as HTML. Code blocks are used extensively on programming-related forums and web sites so users can show other users the code they use. Here is a simple code block:

<html>
  <head>
    <title>H3XED!</title>
    <meta name="description" content="My Blog.">
    <meta name="keywords" content="gaming, stuff">
  </head>
  <body>
    Hello world!
  </body>
<html>


Continue reading...
Posted March 12, 2010 by Nick Vogt in Programming
See this post for a better search engine implementation.
-------

This guide / tutorial is a follow up to my previous PHP MySQL search engine guide. In this guide, we will be implementing a couple of useful search features into our search engine. The features we will be adding are a checkbox that will determine if we want to match case or not, and the ability to use an asterisk (*) to search for partial words

Continue reading...
Posted March 11, 2010 by Nick Vogt in Programming
See this post for a better search engine implementation.
-------

This guide / tutorial will show you how to write a PHP search engine that effectively searches through a MySQL database. Many sites have search engines that link to Google search results. This method is usually ok, as Google's search algorithms are good, but for sites with database-driven content, a custom-built search engine is often times better. They aren't difficult to create, it just involves a MySQL query and some array manipulation.

Continue reading...
Posted February 22, 2010 by Nick Vogt in Programming
See my updated beginner guide here.

AJAX (asynchronous JavaScript and XML) is a method for using JavaScript and server-side programming languages to access the server and update specific elements without having to reload the current page.

To learn AJAX we will use a very simple example that utilizes JavaScript, PHP, and MySQL to update a DIV element on a page with dynamic content from the MySQL database. We will use two PHP files for this example:

Continue reading...
Posted February 19, 2010 by Nick Vogt in Programming
If you've been developing in ASP 3.0 (classic ASP) you may be used to calling the response.redirect() function whenever you need to redirect a user to a different page. You could call this function anywhere in the page, which was convenient. Now that you're all grown up and using PHP, you may be a little confused about how to redirect in PHP. In PHP, you redirect using the header() function and it must be called before any HTML. Like so:

<?php
header('Location: index.php');
exit;
?>
<html>
<body>
Hello world!
</body>
</html>

The function is straightforward. Simply change index.php with the location you want. The exit function is also needed as it terminates the rest of the script from running.


Continue reading...
Posted February 9, 2010 by Nick Vogt in Programming
So you've mastered HTML, made a few websites -maybe one for your dog, and now you want to know what's next. Well, besides simply practicing and becoming better at design, which is always good, you can try your hand at server-side coding. Server-side coding is programming that is written into the document and is executed by the web server prior to sending out the HTML document to the user's browser. It allows websites to do things dynamically. For example, it is what drives H3XED and allows you to filter and search for posts, and it allows me to write and edit posts easily using a web interface (rather than editing the HTML directly).

Continue reading...
Features
Free Web MP3 PlayerComputer Build GuidePHP Beginner Tutorials
Post Series
ActionScript 3 TutorialsHard Drive Cost Charts
Popular Tags
actionscriptajaxcall of dutycrysisebayfacebookgooglejavascriptminecraftneweggphprageskyrimtutorialyoutube


H3XED © 2012 Nick Vogt | Web Design
Saturday, May 19, 2012 | Privacy Policy | Disclosure Policy | Contact