When using the php mail() function to send mail on my websites, I dont want the “mailed by:” header being sent. I just recently discovered an option to add to the mail function that masks the originating server. Simply add “-firstname.lastname@example.org” as the last option in the function call.
mail ($to, $subject, $message, $headers,"-email@example.com");
and your “from” address from the headers will be all that shows up.
Voila! The ads are gone!
If you have ever searched Google for almost anything script or programming related, you probably have found results from the “help” site www.experts-exchange.com. This site contains a huge number of tech-related threads and is very well indexed in Google. Unfortunately, this storehouse (not necessarily the best source, but usually fairly good info) is locked behind a $13/mo subscription fee.
Never fear, however, because you have just found the solution!
Step 1: Bypass Logon
Step 2: Negate the Scrolling
Now that the solutions are visible, lets bring them to the top of the page so we can see them without scrolling down a hundred feet of links. To do this, you can either use this link (bookmark it) to fix the experts-exchange page once its loaded or you can download the script directly and implement it yourself (with something like greasemonkey).
The script works with Safari 3.2 and FireFox 3.1. If you are using IE you probably wont ever be on experts-exchange. If you are, you need to use a different browser. I also noticed that the solutions only appear the first time you visit the page from google. Apparently refreshing the page removes the solutions.
Thats about all there is to it. Let me know what you think.
Working with databases and php often makes tables an important part of the construction and often final result of the project. I decided to simplify this process by creating a function that would generate a table based on the data in a single string of input.
The syntax is pretty simple.
|Head Row 1||Head Row 2||Head Row 3||Head Row 4|
|Item 1||Item 2||Item 3||Item 4|
You do not need to close <tr> or <td> tags in your string, just start a new row with %tr; and each new <td> with %td; (you do not need to use the %td; on the first cell of a row, so you will never have %tr;%td;)
The options are printed un-modified in the table tab ie <table $options> so use the standard attributes syntax. The default options are " border='1' align=''center' cellpadding='5' ".
|First Name||Last Name|
So far I haven't found anything that breaks the function, but let me know if you do I usually iterate through the data using a single variable and the ".=" to build the table data string.
I added the option to put options in each td tag. Before each td string, simply put your options (like valign='top') and then the %op; tag. So your string would look like:
Apache's mod_rewrite is one of the most confusing things to learn but it is an extremely powerful tool. One of the best resources I found was http://www.webforgers.net/mod-rewrite/. Recently I needed to rename a folder on one of the sites I built. The traffic needed to be automatically routed to the new folder to keep all the links to the content valid. To accomplish this, i used a mod rewrite to grab the string after the old folder and move it to the new folder. Below is the content of my .htaccess (located in the root directory with my new folder) file:
RewriteEngine On RewriteBase /subdir/ RewriteRule ^olddir/?(.*)$ newdir/$1 [R=301,L]
So lets look at it line by line
The RewriteEngine has to be on (obviously).
the RewriteBase is the path to the folder containing your .htaccess and the new folder (in this case, "subdir/" would contain ".htaccess and newdir/"). This is relative to the domain. So if you were working with yourdomain.com/newdir/ the RewriteBase would just be "/".
RewriteRule ^olddir/?(.*)$ newdir/$1 [R=301,L]
The RewriteRule takes anything after the request for your old folder (like index.html) and changes the URL to the new folder. "olddir" is the name of your old folder and "newdir" is the name of your new folder. So a request like:
it doesnt matter what comes after the request for the oldir it will get moved to the newdir. It's pretty obvious that mod_rewrite is a powerful tool but mastering it is a significant challenge. Here's one down though, and plenty more to go.
Inspired by Lee's PR checking script (www.refreshinglyblue.com), I modified it to be slightly less obtrusive version that adds the PageRank to the browser title bar (in Safari and Firefox) and in an alert (all browsers).
Simply drag the link below to your favorites bar and then click it whenever you want to get the PageRank for the page you are on.
I have noticed that it sometimes takes as long as 30 seconds for it to work, I assume its because the script is scrubbing an external site so it can take longer on occasion, due to server load. If you would like the script or have any optimization/improvements please let me know!