|
 |
|
|
Submitted: December 23, 2008
Views: 1947
A simple example on how to submit POST variables to a page using the cURL library and handle the server response by accepting temporary cookies.
|
|
|
 |
|
|
Submitted: August 5, 2008
Views: 1403
This snippet will parse your DIC blog for use on your website. I currently have it set up to only pull the title of each blog post, as well as the first 10 words of each post. You could then link from the blurb to the actual post on DIC.
I'm sure this could be adapted to whatever rss feed you are using.
|
|
|
 |
|
|
Submitted: June 13, 2008
Views: 1229
never overwrite a file when uploading again
|
|
|
 |
|
|
Submitted: January 29, 2009
Views: 887
This will count number of page views in a session.
|
|
|
 |
|
|
Submitted: September 27, 2009
Views: 267
Checks if a string is a palindrome
|
|
|
 |
|
|
Submitted: May 7, 2008
Views: 2681
Keep your Sessions on lockdown and prevent Fixation, and Hijacking with this snippet.
|
|
|
 |
|
|
Submitted: October 5, 2008
Views: 1038
A simple class for using stacks in PHP. It includes simple stack functions like push and pop, but also new functions like pad_extra and peek
|
|
|
 |
|
|
Submitted: August 23, 2007
Views: 3782
I know that there are many ways to convert date in PHP, but I use those to two convert from/to MySQL DB.
|
|
|
 |
|
|
Submitted: October 5, 2009
Views: 90
|
|
|
 |
|
|
Submitted: October 20, 2007
Views: 1498
Function to write in top, write on bottom, overwrite o delete file.
|
|
|
 |
|
|
Submitted: November 15, 2006
Views: 4090
A 3D engine written in PHP which highlights you can do anything if you set your mind to it.
|
|
|
 |
|
|
Submitted: March 25, 2008
Views: 2073
This code reads all the lines in a text file then alphabetizes it and overwrites the file with the alphabetized version
|
|
|
 |
|
|
Submitted: October 18, 2007
Views: 1496
This function will parse BBCode Tags.
|
|
|
 |
|
|
Submitted: May 14, 2008
Views: 1664
This is a snippet for calculating the distance between 2 points. Each "point" is represented by the longitude & latitude for that location
|
|
|
 |
|
|
Submitted: November 15, 2006
Views: 2210
This uses php's highlight_string() function to highlight your php code.
|
|
|
 |
|
|
Submitted: June 4, 2006
Views: 3026
A demonstration of using Bash or Cmd.exe (Windows Shell) and PHP to make a clock...straight from the command line, no files are used except for those already on your system.
|
|
|
 |
|
|
Submitted: March 9, 2008
Views: 9131
This is a function to convert a 64 bit number since base_convert will choke on a number that size
|
|
|
 |
|
|
Submitted: March 9, 2008
Views: 1349
Snippet for converting a value from base 256 to integer
|
|
|
 |
|
|
Submitted: January 15, 2009
Views: 1213
Takes a decimal (base 10) number and converts it to binary (base 2).
|
|
|
 |
|
|
Submitted: January 16, 2006
Views: 5989
A simple PHP email form.
|
|
|
 |
|
|
Submitted: November 15, 2006
Views: 8416
This script can find a file in a directory, with different extensions!
|
|
|
 |
|
|
Submitted: February 25, 2009
Views: 1557
Reads the <title> tag of a web page.
|
|
|
 |
|
|
Submitted: August 18, 2007
Views: 6668
This is some code for "securing" your pages using Sessions in PHP. By securing I mean pages that can only viewed by a logged in user
This "snippet" actually consists of 3 snippets, first is what to put in login_check.php, second is what to put in login.php, third is what to put in each page in your site that must be secured (only a logged in user can view)
|
|
|
 |
|
|
Submitted: February 16, 2005
Views: 11675
This simple code will get the microtime (The server's time) and round it to 3 digits. This can obviously be changed, but both values need to be the same. It will then subtract the two times, leaving you with the time it took to generate the page! Remember to place the first part at the start of your document (Preferably before anything but the opening PHP tag) and the final part just above the closing PHP tag ;)
|
|
|
 |
|
|
Submitted: May 17, 2009
Views: 868
Some people would probably call this over secure, others might call it not secure enough. Either way, this will hash your password pretty well. (Based on SHA512, but a little more secure.) Adds salt to the beginning, middle and end of the password, as well as hashing with SHA512 and changing the first half of the SHA512 with str_rot13.
|
|