PATH://adammoro.net/code/php/

Dynamic Bookmark Links

I use the AddThis button because it works and looks pretty good in my opinion but for projects where I need to have a little more control of the bookmarking functionality, I use the following script to get things rolling.

				<?php
					$domain = $_SERVER['HTTP_HOST'];
					$path = $_SERVER['SCRIPT_NAME'];
					$queryString = $_SERVER['QUERY_STRING'];
					$url = "http://" . $domain . $path . "?" . $queryString;
				?>
				
				<a href="http://del.icio.us/post?url=<?php echo $url ?>">del.icio.us</a>
				<a href="http://digg.com/submit?phase=2&url=<?php echo $url ?>">Digg it</a>
				<a href="http://www.google.com/bookmarks/mark?op=edit&bkmk=<?php echo $url ?>">Google</a>
				<a href="http://www.squidoo.com/lensmaster/bookmark?<?php echo $url ?>">Squidoo</a>
				<a href="http://www.stumbleupon.com/submit?url=<?php echo $url ?>">StumbleUpon</a>