This is the code for gmail dot trick. I had added this to TC but people abuse it and it eats server resources. So for those who were looking for it..
Credit to A.Gamer ..
Of course this is pretty basic and would need edited for something pretty. Actually, I found the exact post in googleCode:<?php function add_dot($str){ if ((strlen($str) > 1) && (strlen($str) < 31)) { $ca = preg_split("//",$str); array_shift($ca); array_pop($ca); $head = array_shift($ca); $res = add_dot(join('',$ca)); $result = array(); foreach($res as $val){ $result[] = $head . $val; $result[] = $head . '.' .$val; } return $result; } return array($str); } $res = add_dot("yourname"); foreach($res as $val) echo $val,"@gmail.com, "; ?>And yes it was A Gamer
C & P
Assuming you have access to a server that supports PHP... <)
Simply cut-past the code above into a file ending with a php extension. Example:
c:\gmailtrick.php
Without making any changes to the code above, you will get all possible iterations for yourname@gmail.com, which is probably not what you want. So, change the "yourname" (line 19) to the part of your email that is in front of the @ sign and upload the file to your server (or place in the correct directory if you are running an HTTPd on your computer).
Then access the page via your browser for the results. Example:
If you wanted to make it dynamic, then you could create a form and replace the "yourname" with the appropriate $_POST (or $_REQUEST) variable.Code:http://yourserver.tld/userpath/gmailtrick.php
Or a quick way to make a dynamic page without a form would be to replace "yourname" with $_REQUEST['name'] and then access your file with the 'name' parameter. Example:
(see attached file for working example code)
This is by no means 'complete' code... It is the minimum required for the desired results. The output is not going to be HTTP compliant (i.e. no <html><body> tags, etc).
But it should be enough for most beginners to be able to build a proper web page around it if they wanted to. Just put all your HTML stuff before and after the <?PHP and ?> tags.
Note: I can never simply copy-n-paste code from sites like this because it inserts 'gremlins' (i.e. non-breaking spaces) in order to get the code to align in the browser. If you are getting PHP errors in the first or second line when you try to access your page, then download the attached text/php file and go from there.


1Likes
LinkBack URL
About LinkBacks
And yes it was A Gamer
Reply With Quote