by Frost

Introduction
Recently I had an inquiry about how I would go about creating a directory in a PHP script using a FORM with POST / GET data. Creating a Directory from a PHP script using PHP is not all that easy and should be done with caution, as you want to make sure that you validate the input and prevent un-wanted characters from being used to create a directory. Use this script with caution and I would even go so far as to hiding it behind a User Login script and require a valid user.

The Form
For simplicity we will use a very basic input form to submit POST data to the PHP script (I opted to use POST because it is my preference for a php script like this). You can use GET, just be sure to reflect that in the form and on the PHP script. The components of the PHP script will simply be the <form> tags and 2 input tags (one for directory name and one for submit). Here it is:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
/**********************
File: createDir.php
Author: Frost
Website: http://www.slunked.com
***********************/
?>
<html>
<head><title>Make Directory</title></head>
<body>
	<h2>Make Directory on Server</h2>
	<form name="phpMkDIRForm" method="POST" action="createDir.php">
	Enter a Directory Name (Alpha-Numeric only): <input type="text" value="" name="dirName" /><br />
	<input type="submit" name="create" value="Create Directory" />
	</form>
</body>
</html>

The form is really straight forward, we will add more to this form onto our next step which is creating the actual PHP script.

by Frost

Introduction
Often I see many posts about how to do a simple SQL search. Well I finally caved in and decided to write a tutorial just for that. I will try and explain everything in as much detail as I can without being over wordy. This is a basic search, nothing more. If you want a more advanced search I would suggest using Google or hiring someone to code it for you.The aim of this tutorial is to provide users with a basic layout and the logic behind creating a multiple field search in MySQL. As often time users tend to over do the search and add a lot of unnecessary code. By following and understanding this tutorial you should be able to implement this search into your own site and provide a nice and simple SQL Search of your own database. So roll up your sleeves and be prepared to get dirty.

© 2012 Help Source for Coders - Get Slunked! Suffusion theme by Sayontan Sinha
Stop SOPA