Welcome To Snipplr
You searched for: http
Everyone's Recent PHP Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
The following are instructions to "re-post" files that have been already been POSTed to your php script. This can help if you want to have a form (with file upload) that POSTs its data to your own script where the text elements can be handled and the...
2
2007
posted 16 years ago by benjaminpearson
This is a simple search function for the [User Groups](http://www.dabbledoo.com/design/docs/User-Groups-Module/) module for ExpressionEngine. It searches groups (names and descriptions) as well as topics and topic replies. It respects group types as...
0
1767
posted 16 years ago by lukemcr
Via: [http://www.touchdesk.nl/2009/04/full-menu-tree-with-active-trail-in-drupal-6/](http://www.touchdesk.nl/2009/04/full-menu-tree-with-active-trail-in-drupal-6/)
0
1387
posted 16 years ago by Ateneatech
I rewrote [this snippet](http://snipplr.com/view/15402/php-password-generator/).
Usage:
$password1 = new Password;
$password2 = new Password;
echo '<p>' . $password1->generate() . '</p>';
echo '<p>' . $password2->generate(array('leng...
1
1773
posted 16 years ago by AzizLight
This code allows you to track each step of Magento's One Page Checkout in Google Analytics. I installed it at the bottom of my `checkout/onepage.phtml` template file. Once installed, you can set up a funnel for the following:
* `/checkout/onepage/...
0
1471
posted 16 years ago by jdbartlett
Sometimes, the first or last block in a region needs to be styled different than the rest. This solution do this in simple way for Drupal 6.
(originaly code from [email protected]: http://drupal.org/node/293188#comment-1282186)
2
1570
posted 16 years ago by Fake
Some valid UTF-8 characters are illegal in XML:
http://www.w3.org/TR/REC-xml/#charsets
This statement strips them from your strings.
0
3481
posted 16 years ago by jdbartlett
Some times you need to accept some url as input but users seldom add http:// to it, this code will add http:// to the URL if it’s not there.
1
1830
posted 16 years ago by paulgrenwood
This snippet is just an upgrade to the "http://snipplr.com/view/7396/php-file-extension-case-changer/" code. This particular code works on image files... although you can just change this line [if (preg_match("/(jpg|gif|png|bmp)/",$ext)) ] to target...
0
2178
posted 16 years ago by el-artiste
Sometimes you just need to mask a script or reject a user from a page this can be done effortlessly using a single line of code. Header location will allow you to redirect a user quickly and without them having any control over the action.
A good...
1
1427
posted 16 years ago by scopefragger
Easy check (:
**UPD**
You can just use [version_compare()](http://ca.php.net/manual/en/function.version-compare.php) function.
1
1483
posted 16 years ago by kirik
http://code.google.com/p/jquery-jtwitter/ for examples.
2
1844
posted 16 years ago by jonniespratley
gibt die url plus storeview aus, also bspw:
http://yourdomain.com/de/
0
1319
posted 16 years ago by nico65
this function formats a web address for use in a link.<br>
echo formatWebAddress("google.com");<br>
http://www.google.com/
1
1613
posted 16 years ago by jlvallelonga
Include file that contains the array of areacodes and states. **This file is needed for the Areacode Script to work. Script here: http://snipplr.com/view/17339/area-code-lookup-script/
2
1298
posted 16 years ago by arnoldb
This simple script will return what state an areacode belongs to. Be sure to get the include file that contains the array here: http://snipplr.com/view/17340/area-code-lookup-script--include-file/
1
1450
posted 16 years ago by arnoldb
Split a string containing HTTP response into a array with HTTP headers and a string with HTTP content
1
2040
posted 16 years ago by touv
this function processes a URL that 'should' be a full url (i.e. http://something.com/dfsdfs/)
and makes sure it contains http:// for easy inclusion as a link into a href attribute
0
1236
posted 16 years ago by iloveitaly
[Google's "AJAX Libraries API"](http://code.google.com/apis/ajaxlibs/) is great and all, but can slow things down if you're doing a lot of refreshing/cache clearing while debugging. Here's a neat trick: stuff something like this in the `<head>` of yo...
1
1902
posted 16 years ago by jdbartlett
When you have a URL like this
http://mysite/newsletters/index/2007
The find('first') method adds the 2007 value as ID parameter
WTF!?
0
1278
posted 16 years ago by sveggiani
this is how to automatically get short urls for your blog posts in wordpress,
What you need
is to decide which tinyurl service you will be using and get its api URL,
for example rinyurl.com , bit,ly, tr.im,
here are the api URLS for the mo...
0
1837
posted 16 years ago by nerdsane
You can get hostname from script environment - getenv("HTTP_HOST")
(?!'.$host.') matches URLs always except local links
0
1447
posted 17 years ago by kossmoss
Affects <A> tags for links starting with $link
Example: LinkReplacer ($text, 'http://www.snipplr.com') affects to
<a href="http://www.snipplr.com">Snipplr</a>
and <a href="http://www.snipplr.com/blog">Snipplr Blog</a>
0
1559
posted 17 years ago by kossmoss
PHP
Rewrite Drupal's File system paths to remove redundant sites/example.com (alternate settings.php method)
Alternate to <a href="http://snipplr.com/view/133530">this method</a>. Have not yet tested.
In settings.php, put this code:
0
1375
posted 17 years ago by zachharkey
include this snippet in your sites to force InternetExplorer 8 to display your site like InternetExplorer 7
In summary, IE7 compatibility support looks as follows:
IE=7
Display in IE7 Standards mode; Already supported in the IE8 Beta 1 relea...
3
3117
posted 17 years ago by tobaco