<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7715740931190954265</id><updated>2011-04-21T17:38:03.394-04:00</updated><title type='text'>ToddHisted.com</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://toddhisted.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7715740931190954265/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://toddhisted.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Todd</name><uri>http://www.blogger.com/profile/11660259449034719772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7715740931190954265.post-904455258979187897</id><published>2009-05-26T20:20:00.002-04:00</published><updated>2009-05-26T21:27:51.808-04:00</updated><title type='text'>It's been a while....</title><content type='html'>So I haven't updated lately, and there's been quite a few things that have happened in my life. &lt;br /&gt;&lt;br /&gt;First of all back in November Julie and I went to Vegas, me for work, her for pleasure.  We had a great time, saw Hover Damn and spent lots of money gambling.  We got back just in time for start of deer season, and I actually managed to get a deer.  First time in 4 or 5 years, so that was pretty cool.&lt;br /&gt;&lt;br /&gt;Christmas was exciting, doing all of the shopping for Mackenzie was a treat.  She just had to have Biscuit, a robotic Dog that responds to voice commands and petting.  He was pretty cool for the 45 minutes or so that she's played with him.  All I can say is I'm glad we didn't spend the $30+ on rechargeable batteries for him. His first pair seem to be holding up just fine.  Got to love kids......&lt;br /&gt;&lt;br /&gt;Speaking of kids....  Julie and I found out in late February that she is pregnant.  The baby is due November 7th, but I'm convinced the bundle of joy will wait until November 15th.  Julie's been going through the phases of pregnancy pretty well.  First she was extremely tired, just making it through the day at work was a challenge but she persevered.  While she hasn't been extremely sick she never feels very well and her tastes for food has definitely changed.  Lucky for me it's been in my favor as she's been craving carbohydrates and I love me some potatoes and bread. &lt;br /&gt;&lt;br /&gt;As of today we're 15 weeks along and everything has been going fairly well, but I guess that's easy for me to say.  We have our 3rd appointment this Thursday, at the last one I got to hear the heartbeat which was really cool for me.  It's amazing to think there's a little life growing in that belly.  Julie's cousin Michael and his Fiancee Sarah had their baby girl, Katelyn on Saturday morning and it was amazing to think in less than 5 short months that's going to be Julie and I.&lt;br /&gt;&lt;br /&gt;In other news I proposed to Julie on March 14th, 1 year and 1 day after we officially started dating.  She said yes and we're planning to be married in August of 2010.  I can't say enough about that girl.  She's taught me so much about myself and love that I can't imagine life without her.  Mackenzie is a joy to be around and I feel myself getting wound tighter and tighter around her little finger every day.&lt;br /&gt;&lt;br /&gt;Julie and I have also been doing a lot of work to try to sell my house.  We've done a bunch of landscaping, painting and recently tore the whole bathroom apart, replaced the shower, tub and window so far.  I've been learning how to mud dry wall....not fun and I'm finally ready to prime and paint.&lt;br /&gt;&lt;br /&gt;All in all it's been quite a busy and exciting few months and I can't wait to see what the next few brings us.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7715740931190954265-904455258979187897?l=toddhisted.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://toddhisted.blogspot.com/feeds/904455258979187897/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7715740931190954265&amp;postID=904455258979187897' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7715740931190954265/posts/default/904455258979187897'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7715740931190954265/posts/default/904455258979187897'/><link rel='alternate' type='text/html' href='http://toddhisted.blogspot.com/2009/05/its-been-while.html' title='It&apos;s been a while....'/><author><name>Todd</name><uri>http://www.blogger.com/profile/11660259449034719772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7715740931190954265.post-5892085939338919174</id><published>2008-10-27T15:33:00.004-04:00</published><updated>2008-10-27T16:08:45.658-04:00</updated><title type='text'>Dinner Dance, Fantasy Sports and Deer Season</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Dinner Dance&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Yes, I finally did it.  I finally went to the dinner dance.  Julie bought a new dress and I bought a new suit and on October 25th, 2008 I finally went to my first dinner dance.&lt;br /&gt;&lt;br /&gt;This was also the first time I'd ever been to New Horizons Center and I was pretty impressed.  Very nice place, big, ample bars and great food.  I only wish I would have put a little more on my plate...and I would have been quicker to the dessert line.  (I missed out on the chocolate cheese cake) &lt;br /&gt;&lt;br /&gt;We got our pictures taken....twice, well...three times really.  The first two (two pics each) were of just Julie and I.  The photographer was a little strange...he REALLY like posing Julie.  Then after dinner we came back and got a group photo.  Hopefully they'll turn out good.  Julie looked amazing so I'm sure they will ;)&lt;br /&gt;&lt;br /&gt;Other memorable moments of the night:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Julie and Tasha dancing on the stage, and turning Lon and I down when we came out to dance with them.&lt;/li&gt;&lt;li&gt;Lon playing "Quarters"&lt;/li&gt;&lt;li&gt;Jon's crutches being hidden in the womens bathroom&lt;/li&gt;&lt;li&gt;Kirk drinking a "sex on the beach with a man"&lt;/li&gt;&lt;li&gt;Crackers and bread at the Timbers&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Fantasy Sports&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;First of all I have to say go Julie!  Two weeks into the fantasy hockey season and she's holding on to the lead.  I actually won this week so I'm closing in.  Look out babe!&lt;br /&gt;&lt;br /&gt;I'm now 8-0 in the PFL.  Mike and I also managed to pull out a win in the F3L even without a kicker...  Unfortunately I think we're out of the running in that league so we may go into our "Rebuilding for next year" phase soon.  In the PFL I'm starting to get worried that I'm going to have a perfect regular season and then lose in the first week of the playoffs.  That would be my luck.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Deer Season&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Hopefully I'll be able to make my final preperations for deer season this weekend.  I need to trim another shooting lane or two and do some more scouting.  I'm going to basically be booked from now until opening day with going to Vegas for for a SQL conference so this is really my last opportunity.  November 15 will be here soon, and I can't wait!&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7715740931190954265-5892085939338919174?l=toddhisted.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://toddhisted.blogspot.com/feeds/5892085939338919174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7715740931190954265&amp;postID=5892085939338919174' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7715740931190954265/posts/default/5892085939338919174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7715740931190954265/posts/default/5892085939338919174'/><link rel='alternate' type='text/html' href='http://toddhisted.blogspot.com/2008/10/dinner-dance-fantasy-sports-and-deer.html' title='Dinner Dance, Fantasy Sports and Deer Season'/><author><name>Todd</name><uri>http://www.blogger.com/profile/11660259449034719772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7715740931190954265.post-2331317542711649602</id><published>2008-09-02T15:07:00.004-04:00</published><updated>2008-09-02T15:50:06.149-04:00</updated><title type='text'>Labor Day Weekend at Traverse City</title><content type='html'>For Labor Day Weekend Julie and I decided to go to Traverse City to do some wine tasting and shopping.  We stayed at the Grand Traverse Bay Resort and Spa, a 4 star resort with 3 golf courses designed by famous professional golfers...or at least that's what they said.  I only recognized Jack Nicklaus' name.  Sadly we didn't bring our clubs but I don't know when we would have had time to golf anyways.&lt;br /&gt;&lt;br /&gt;Sunday we got to Traverse City around 12:30, and the sight coming into town was magnificent.  The color of the waters in the bay made me think of the tropics with the many shades of blues outlined by green.  It was beautiful.  We stopped at the visitors bureau and picked up a bunch of fliers on where the many wineries were located in the area and took a short trip down to front street, the downtown of Traverse City.  We checked out a few shops and got some ice cream from Coldstone creamery and then decided it was time to find some wine.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_7dHgLIU6wNU/SL2X_PBivkI/AAAAAAAAAH4/FNhLPvGt4Ho/s1600-h/P1010633.JPG"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://2.bp.blogspot.com/_7dHgLIU6wNU/SL2X_PBivkI/AAAAAAAAAH4/FNhLPvGt4Ho/s200/P1010633.JPG" alt="" id="BLOGGER_PHOTO_ID_5241512653949681218" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;We headed up Old Mission Peninsula and stopped at 5 or 6 different wineries there.  I'll be the first to admit that I'm not a huge wine drinker but there were a few that I genuinely enjoyed.  The general rule seemed to be 6 free samples per winery and that worked out pretty well. We ended up buying 3 different bottles total and tasted well over 25 different wines.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_7dHgLIU6wNU/SL2X-1zQt5I/AAAAAAAAAHw/36Tw924s5Pc/s1600-h/P1010630.JPG"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://3.bp.blogspot.com/_7dHgLIU6wNU/SL2X-1zQt5I/AAAAAAAAAHw/36Tw924s5Pc/s200/P1010630.JPG" alt="" id="BLOGGER_PHOTO_ID_5241512647178893202" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;At this point we decided to go check into the hotel. When we were looking through some of the travel guides for the area they mentioned the Arie Restaurant and Lounge located in the 16th floor of the tower in the resort.  The pictures made it look beautiful so we made reservations.  Sadly 8:15 was the earliest we could get in but we thought we should still catch the end of the sunset.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_7dHgLIU6wNU/SL2YmI6AcMI/AAAAAAAAAII/Y0hQC18zkYc/s1600-h/DSCF0398_2.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://4.bp.blogspot.com/_7dHgLIU6wNU/SL2YmI6AcMI/AAAAAAAAAII/Y0hQC18zkYc/s200/DSCF0398_2.jpg" alt="" id="BLOGGER_PHOTO_ID_5241513322322358466" border="0" /&gt;&lt;/a&gt;Also included with the resort was access to their own private beach on the bay so Julie and I decided to head down there before dinner.  The water was a bit chilly and we drew in the sand and got some pretty cool pictures of the bay with the sun starting to set.  It was a very peaceful and relaxing atmosphere and it was great to share that with Julie.&lt;br /&gt;&lt;br /&gt;The Arie Restaurant was very cool, but unfortunately we were too late to see the sun set.  We did still get to see the sky with all sorts of color.  The main dish (we both ordered the chicken) was very good however the salads weren't exactly what we had envisioned.  For anyone who likes caeser salad be aware that their dressing is authentic. Yup...sardines. *yuck*  I will say the beer prices up there were pretty reasonable though.  All in all in was an enjoyable and private dinner with a beautiful view.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_7dHgLIU6wNU/SL2YmTttZ-I/AAAAAAAAAIQ/K1HvcJOM3oo/s1600-h/DSCF0409.JPG"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://2.bp.blogspot.com/_7dHgLIU6wNU/SL2YmTttZ-I/AAAAAAAAAIQ/K1HvcJOM3oo/s200/DSCF0409.JPG" alt="" id="BLOGGER_PHOTO_ID_5241513325223569378" border="0" /&gt;&lt;/a&gt;Monday we had lunch at the North Peak brewery and sampled some of their beers.  It was a nice place to eat and I'd recommend it to anyone.  We did a little more shopping and then headed home.&lt;br /&gt;&lt;br /&gt;There's so much to do in Traverse City and the surrounding area I wish we would have spent the entire weekend up there.  If nothing else it definitely leaves us with a reason to come back.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7715740931190954265-2331317542711649602?l=toddhisted.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://toddhisted.blogspot.com/feeds/2331317542711649602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7715740931190954265&amp;postID=2331317542711649602' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7715740931190954265/posts/default/2331317542711649602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7715740931190954265/posts/default/2331317542711649602'/><link rel='alternate' type='text/html' href='http://toddhisted.blogspot.com/2008/09/labor-day-weekend-at-traverse-city.html' title='Labor Day Weekend at Traverse City'/><author><name>Todd</name><uri>http://www.blogger.com/profile/11660259449034719772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_7dHgLIU6wNU/SL2X_PBivkI/AAAAAAAAAH4/FNhLPvGt4Ho/s72-c/P1010633.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7715740931190954265.post-8872701456100477698</id><published>2008-08-18T21:10:00.005-04:00</published><updated>2008-08-18T21:50:13.670-04:00</updated><title type='text'>Drews Bachelor Party Weekend</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://farm4.static.flickr.com/3129/2776703182_9a17a2718c_b.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px;" src="http://farm4.static.flickr.com/3129/2776703182_9a17a2718c_b.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://farm4.static.flickr.com/3218/2775849617_2a3caf70cd_b.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px;" src="http://farm4.static.flickr.com/3218/2775849617_2a3caf70cd_b.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://farm4.static.flickr.com/3162/2775852871_b01c41f007_b.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px;" src="http://farm4.static.flickr.com/3162/2775852871_b01c41f007_b.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://farm4.static.flickr.com/3212/2775851723_0661bdaa2f_b.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px;" src="http://farm4.static.flickr.com/3212/2775851723_0661bdaa2f_b.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://farm4.static.flickr.com/3174/2776709590_3ea98c0190_b.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px;" src="http://farm4.static.flickr.com/3174/2776709590_3ea98c0190_b.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This past weekend was Drews bachelor party. We headed up to the Leroy Hunt Club nestled on the east side of the fletcher flood waters in North Eastern Michigan. We golfed at the beautiful Elk Ridge golf course in Atlanta Michigan. I shot a 69 and a 73 which would be pretty darn good except those were for the front and back 9 respectively.&lt;br /&gt;&lt;br /&gt;Here are some pictures of some of the mounts in the Leroy club.  This club has nearly 1,900 beautiful acres with an amazing variety of wildlife.  While we were there, aside from drinking a ridiculous amount of alcohol we saw some incredible sites.  Just riding the trails we saw 4 different bucks in velvet.  One of them looked to have an amazing rack.  All in all it was a fun weekend with some beautiful sites.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7715740931190954265-8872701456100477698?l=toddhisted.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://toddhisted.blogspot.com/feeds/8872701456100477698/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7715740931190954265&amp;postID=8872701456100477698' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7715740931190954265/posts/default/8872701456100477698'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7715740931190954265/posts/default/8872701456100477698'/><link rel='alternate' type='text/html' href='http://toddhisted.blogspot.com/2008/08/drews-bachelor-party-weekend.html' title='Drews Bachelor Party Weekend'/><author><name>Todd</name><uri>http://www.blogger.com/profile/11660259449034719772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm4.static.flickr.com/3129/2776703182_9a17a2718c_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7715740931190954265.post-4964960045135875971</id><published>2008-08-12T15:31:00.000-04:00</published><updated>2008-08-12T15:35:16.701-04:00</updated><title type='text'>Random Image Rotation</title><content type='html'>If you find my scripts useful sign my guestbook with a link to where you're using it.&lt;br&gt;&lt;br&gt;&lt;br /&gt;    I wanted a script that would grab all the images in a directory and then randomly rotate them on my homepage.  This is what I came up with.&lt;br&gt;&lt;br /&gt;    &lt;hr&gt;&lt;br /&gt;&lt;br /&gt;  &lt;div style="margin-bottom:2px"&gt;PHP Code:&lt;/div&gt;&lt;br /&gt;  &lt;div style="margin:0px; padding:3px; border:1px inset; width:400px; height:375px; overflow:auto; background-color: white;"&gt;&lt;br /&gt;  &lt;code style="white-space:nowrap"&gt;&lt;br /&gt;  &lt;div dir="ltr" style="text-align:left;"&gt;&lt;br /&gt;   &lt;!-- php buffer start --&gt;&lt;br /&gt;   &lt;code&gt;&lt;font color="#000000"&gt;&lt;br /&gt;&lt;font color="#0000BB"&gt;&amp;lt;?&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="#007700"&gt;function &lt;/font&gt;&lt;font color="#0000BB"&gt;directoryToArray&lt;/font&gt;&lt;font color="#007700"&gt;(&lt;/font&gt;&lt;font color="#0000BB"&gt;$directory&lt;/font&gt;&lt;font color="#007700"&gt;, &lt;/font&gt;&lt;font color="#0000BB"&gt;$recursive&lt;/font&gt;&lt;font color="#007700"&gt;) {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000BB"&gt;$array_items &lt;/font&gt;&lt;font color="#007700"&gt;= array();&lt;br /&gt;&lt;br /&gt;if (&lt;/font&gt;&lt;font color="#0000BB"&gt;$handle &lt;/font&gt;&lt;font color="#007700"&gt;= &lt;/font&gt;&lt;font color="#0000BB"&gt;opendir&lt;/font&gt;&lt;font color="#007700"&gt;(&lt;/font&gt;&lt;font color="#0000BB"&gt;$directory&lt;/font&gt;&lt;font color="#007700"&gt;)) {&lt;br /&gt;&lt;br /&gt;while (&lt;/font&gt;&lt;font color="#0000BB"&gt;false &lt;/font&gt;&lt;font color="#007700"&gt;!== (&lt;/font&gt;&lt;font color="#0000BB"&gt;$file &lt;/font&gt;&lt;font color="#007700"&gt;= &lt;/font&gt;&lt;font color="#0000BB"&gt;readdir&lt;/font&gt;&lt;font color="#007700"&gt;(&lt;/font&gt;&lt;font color="#0000BB"&gt;$handle&lt;/font&gt;&lt;font color="#007700"&gt;))) {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if (&lt;/font&gt;&lt;font color="#0000BB"&gt;$file &lt;/font&gt;&lt;font color="#007700"&gt;!= &lt;/font&gt;&lt;font color="#DD0000"&gt;"." &lt;/font&gt;&lt;font color="#007700"&gt;&amp;amp;&amp;amp; &lt;/font&gt;&lt;font color="#0000BB"&gt;$file &lt;/font&gt;&lt;font color="#007700"&gt;!= &lt;/font&gt;&lt;font color="#DD0000"&gt;".."&lt;/font&gt;&lt;font color="#007700"&gt;) {&lt;br /&gt;&lt;br /&gt;if (&lt;/font&gt;&lt;font color="#0000BB"&gt;is_dir&lt;/font&gt;&lt;font color="#007700"&gt;(&lt;/font&gt;&lt;font color="#0000BB"&gt;$directory&lt;/font&gt;&lt;font color="#007700"&gt;. &lt;/font&gt;&lt;font color="#DD0000"&gt;"/" &lt;/font&gt;&lt;font color="#007700"&gt;. &lt;/font&gt;&lt;font color="#0000BB"&gt;$file&lt;/font&gt;&lt;font color="#007700"&gt;)) {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if(&lt;/font&gt;&lt;font color="#0000BB"&gt;$recursive&lt;/font&gt;&lt;font color="#007700"&gt;) {&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000BB"&gt;$array_items &lt;/font&gt;&lt;font color="#007700"&gt;= &lt;/font&gt;&lt;font color="#0000BB"&gt;array_merge&lt;/font&gt;&lt;font color="#007700"&gt;(&lt;/font&gt;&lt;font color="#0000BB"&gt;$array_items&lt;/font&gt;&lt;font color="#007700"&gt;, &lt;/font&gt;&lt;font color="#0000BB"&gt;directoryToArray&lt;/font&gt;&lt;font color="#007700"&gt;(&lt;/font&gt;&lt;font color="#0000BB"&gt;$directory&lt;/font&gt;&lt;font color="#007700"&gt;. &lt;/font&gt;&lt;font color="#DD0000"&gt;"/" &lt;/font&gt;&lt;font color="#007700"&gt;. &lt;/font&gt;&lt;font color="#0000BB"&gt;$file&lt;/font&gt;&lt;font color="#007700"&gt;, &lt;/font&gt;&lt;font color="#0000BB"&gt;$recursive&lt;/font&gt;&lt;font color="#007700"&gt;));&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000BB"&gt;$file &lt;/font&gt;&lt;font color="#007700"&gt;= &lt;/font&gt;&lt;font color="#0000BB"&gt;$directory &lt;/font&gt;&lt;font color="#007700"&gt;. &lt;/font&gt;&lt;font color="#DD0000"&gt;"/" &lt;/font&gt;&lt;font color="#007700"&gt;. &lt;/font&gt;&lt;font color="#0000BB"&gt;$file&lt;/font&gt;&lt;font color="#007700"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000BB"&gt;$array_items&lt;/font&gt;&lt;font color="#007700"&gt;&amp;#91;] = &lt;/font&gt;&lt;font color="#0000BB"&gt;preg_replace&lt;/font&gt;&lt;font color="#007700"&gt;(&lt;/font&gt;&lt;font color="#DD0000"&gt;"/\/\//si"&lt;/font&gt;&lt;font color="#007700"&gt;, &lt;/font&gt;&lt;font color="#DD0000"&gt;"/"&lt;/font&gt;&lt;font color="#007700"&gt;, &lt;/font&gt;&lt;font color="#0000BB"&gt;$file&lt;/font&gt;&lt;font color="#007700"&gt;);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;} else {&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000BB"&gt;$file &lt;/font&gt;&lt;font color="#007700"&gt;= &lt;/font&gt;&lt;font color="#0000BB"&gt;$directory &lt;/font&gt;&lt;font color="#007700"&gt;. &lt;/font&gt;&lt;font color="#DD0000"&gt;"/" &lt;/font&gt;&lt;font color="#007700"&gt;. &lt;/font&gt;&lt;font color="#0000BB"&gt;$file&lt;/font&gt;&lt;font color="#007700"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000BB"&gt;$array_items&lt;/font&gt;&lt;font color="#007700"&gt;&amp;#91;] = &lt;/font&gt;&lt;font color="#0000BB"&gt;preg_replace&lt;/font&gt;&lt;font color="#007700"&gt;(&lt;/font&gt;&lt;font color="#DD0000"&gt;"/\/\//si"&lt;/font&gt;&lt;font color="#007700"&gt;, &lt;/font&gt;&lt;font color="#DD0000"&gt;"/"&lt;/font&gt;&lt;font color="#007700"&gt;, &lt;/font&gt;&lt;font color="#0000BB"&gt;$file&lt;/font&gt;&lt;font color="#007700"&gt;);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000BB"&gt;closedir&lt;/font&gt;&lt;font color="#007700"&gt;(&lt;/font&gt;&lt;font color="#0000BB"&gt;$handle&lt;/font&gt;&lt;font color="#007700"&gt;);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;return &lt;/font&gt;&lt;font color="#0000BB"&gt;$array_items&lt;/font&gt;&lt;font color="#007700"&gt;;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000BB"&gt;$files &lt;/font&gt;&lt;font color="#007700"&gt;= &lt;/font&gt;&lt;font color="#0000BB"&gt;directoryToArray&lt;/font&gt;&lt;font color="#007700"&gt;(&lt;/font&gt;&lt;font color="#DD0000"&gt;"randomimages/"&lt;/font&gt;&lt;font color="#007700"&gt;, &lt;/font&gt;&lt;font color="#0000BB"&gt;false&lt;/font&gt;&lt;font color="#007700"&gt;); &lt;/font&gt;&lt;font color="#FF8000"&gt;//The Directory to grab the images from&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000BB"&gt;shuffle&lt;/font&gt;&lt;font color="#007700"&gt;(&lt;/font&gt;&lt;font color="#0000BB"&gt;$files&lt;/font&gt;&lt;font color="#007700"&gt;);&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000BB"&gt;$count&lt;/font&gt;&lt;font color="#007700"&gt;=&lt;/font&gt;&lt;font color="#0000BB"&gt;count&lt;/font&gt;&lt;font color="#007700"&gt;(&lt;/font&gt;&lt;font color="#0000BB"&gt;$files&lt;/font&gt;&lt;font color="#007700"&gt;);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;echo &lt;/font&gt;&lt;font color="#DD0000"&gt;"&amp;lt;script&amp;gt;\n"&lt;/font&gt;&lt;font color="#007700"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;echo &lt;/font&gt;&lt;font color="#DD0000"&gt;"var curImage=0;\n"&lt;/font&gt;&lt;font color="#007700"&gt;;&lt;br /&gt;&lt;br /&gt;echo &lt;/font&gt;&lt;font color="#DD0000"&gt;"var numImages=$count;\n"&lt;/font&gt;&lt;font color="#007700"&gt;;&lt;br /&gt;&lt;br /&gt;echo &lt;/font&gt;&lt;font color="#DD0000"&gt;"var img = new Array();\n"&lt;/font&gt;&lt;font color="#007700"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;for (&lt;/font&gt;&lt;font color="#0000BB"&gt;$i&lt;/font&gt;&lt;font color="#007700"&gt;=&lt;/font&gt;&lt;font color="#0000BB"&gt;0&lt;/font&gt;&lt;font color="#007700"&gt;; &lt;/font&gt;&lt;font color="#0000BB"&gt;$i&lt;/font&gt;&lt;font color="#007700"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#0000BB"&gt;$count&lt;/font&gt;&lt;font color="#007700"&gt;; &lt;/font&gt;&lt;font color="#0000BB"&gt;$i&lt;/font&gt;&lt;font color="#007700"&gt;++){&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; echo &lt;/font&gt;&lt;font color="#DD0000"&gt;"img&amp;#91;$i]='$files&amp;#91;$i]'; \n"&lt;/font&gt;&lt;font color="#007700"&gt;;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000BB"&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;function rotate()&lt;br /&gt;&lt;br /&gt; {&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt; &lt;font color="#0000BB"&gt;&amp;lt;? &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#007700"&gt;if (&lt;/font&gt;&lt;font color="#0000BB"&gt;preg_match&lt;/font&gt;&lt;font color="#007700"&gt;(&lt;/font&gt;&lt;font color="#DD0000"&gt;"/msie.&amp;#91;4|5|6]/i"&lt;/font&gt;&lt;font color="#007700"&gt;,&lt;/font&gt;&lt;font color="#0000BB"&gt;$_SERVER&lt;/font&gt;&lt;font color="#007700"&gt;&amp;#91;&lt;/font&gt;&lt;font color="#DD0000"&gt;"HTTP_USER_AGENT"&lt;/font&gt;&lt;font color="#007700"&gt;])) &lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo &lt;/font&gt;&lt;font color="#DD0000"&gt;"document.images.myimg.style.filter='blendTrans(duration=2)';\n"&lt;/font&gt;&lt;font color="#007700"&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#FF8000"&gt;//the time of duration if browser is IE&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#007700"&gt;echo &lt;/font&gt;&lt;font color="#DD0000"&gt;"document.images.myimg.filters.blendTrans(duration=5).Apply();\n"&lt;/font&gt;&lt;font color="#007700"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo &lt;/font&gt;&lt;font color="#DD0000"&gt;"document.images.myimg.filters.blendTrans.Play();\n"&lt;/font&gt;&lt;font color="#007700"&gt;;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt; &lt;/font&gt;&lt;font color="#0000BB"&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;document.images.myimg.src=img&amp;#91;curImage];&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;curImage++;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (curImage &amp;gt;= numImages){&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curImage=0;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;setTimeout("rotate()",3000);&amp;nbsp;&amp;nbsp;//The time to display the image&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&amp;lt;body onload="rotate()"&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&amp;lt;img border="0" id="myimg" name="myimg" width="290" height="218" align="right"&amp;gt;&lt;/font&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;   &lt;br /&gt;   &lt;!-- php buffer end --&gt;&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;  &lt;/code&gt;&lt;br /&gt;&lt;br /&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7715740931190954265-4964960045135875971?l=toddhisted.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://toddhisted.blogspot.com/feeds/4964960045135875971/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7715740931190954265&amp;postID=4964960045135875971' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7715740931190954265/posts/default/4964960045135875971'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7715740931190954265/posts/default/4964960045135875971'/><link rel='alternate' type='text/html' href='http://toddhisted.blogspot.com/2008/08/random-image-rotation.html' title='Random Image Rotation'/><author><name>Todd</name><uri>http://www.blogger.com/profile/11660259449034719772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7715740931190954265.post-1230110120146279630</id><published>2008-08-12T15:15:00.002-04:00</published><updated>2008-08-12T15:24:06.981-04:00</updated><title type='text'>PHP Ping Alternative</title><content type='html'>&lt;div style="margin-bottom: 2px;"&gt;&lt;pre id="line209"&gt;I wanted a php script that would ping a server on any port I choose but couldn't find any so I wrote this.  Hopefully some people will find it useful.&lt;span class="start-tag"&gt;&lt;/span&gt;&lt;span class="start-tag"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;PHP Code:&lt;/div&gt;&lt;br /&gt;&lt;div style="border: 1px inset ; margin: 0px; padding: 3px; overflow: auto; width: 400px; height: 243px; background-color: white"&gt;&lt;br /&gt;&lt;br /&gt; &lt;code style="white-space: nowrap;"&gt;&lt;br /&gt; &lt;/code&gt;&lt;div dir="ltr" style="text-align: left;"&gt;&lt;br /&gt;  &lt;!-- php buffer start --&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;&amp;lt;?&lt;br /&gt;&lt;br /&gt;$info&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"name"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;]=&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"Google"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$info&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"address"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;]=&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"216.239.39.99"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$info&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"port"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;]=&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"80"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$info&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"name"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;]=&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"FTP Microsoft.com"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$info&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"address"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;]=&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"207.46.133.140"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$info&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"port"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;]=&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"21"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$infocount &lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$timeout &lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;2&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;echo &lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;'&amp;lt;table width="300" border="0"&amp;gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;;&lt;br /&gt;&lt;br /&gt;for (&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$i&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$i&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;&amp;lt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$infocount&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$i&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;++){&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$fp &lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;= @&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;fsockopen &lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$info&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$i&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"address"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;], &lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$info&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$i&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"port"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;], &lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$errno&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$errstr&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$timeout&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if (&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$fp&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;) {&lt;br /&gt;&lt;br /&gt;echo &lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;img src='images/up.gif' alt='Connected'&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;a href='http://" &lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;. &lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$info&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$i&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"address"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;] . &lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"'&amp;gt;" &lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;. &lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$info&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$i&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"name"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;] . &lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;" &lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;. &lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$info&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$i&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"address"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;] . &lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;" &lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;. &lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$info&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$i&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"port"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;] . &lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}else{&lt;br /&gt;&lt;br /&gt;echo &lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;img src='images/down.gif' alt='Down!'&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;" &lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;. &lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$info&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$i&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"name"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;] . &lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;" &lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;. &lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$info&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$i&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"address"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;] . &lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;" &lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;. &lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$info&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;$i&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"port"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;] . &lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;echo &lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;"&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 204);"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;!-- php buffer end --&gt;&lt;br /&gt; &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7715740931190954265-1230110120146279630?l=toddhisted.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://toddhisted.blogspot.com/feeds/1230110120146279630/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7715740931190954265&amp;postID=1230110120146279630' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7715740931190954265/posts/default/1230110120146279630'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7715740931190954265/posts/default/1230110120146279630'/><link rel='alternate' type='text/html' href='http://toddhisted.blogspot.com/2008/08/php-ping-alternative.html' title='PHP Ping Alternative'/><author><name>Todd</name><uri>http://www.blogger.com/profile/11660259449034719772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7715740931190954265.post-1663468661255096972</id><published>2008-08-12T15:04:00.005-04:00</published><updated>2008-08-12T15:12:38.299-04:00</updated><title type='text'>PHP, LDAP &amp; Active Directory</title><content type='html'>Integrating Active Directory with PHP using LDAP opens a plethora of options for customizing web sites, using Active Directory for web authentication, AD administration through a web page, or a web based directory of everything in the directory. Below you will find an example of what my code prints, and the code itself.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    This is what it prints&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;table width="100%" align="center" bgcolor="white" border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Name: Todd Histed&lt;br /&gt;Description: Network Technician&lt;br /&gt;Phone: 894-9738&lt;br /&gt;Building: Cramer&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;Here is the code&lt;hr /&gt;&lt;br /&gt;&lt;div style="border: 1px inset ; margin: 0px; padding: 3px; overflow: auto; width: 400px; height: 260px; background-color: white"&gt;&lt;br /&gt;  &lt;code style="white-space: nowrap;"&gt;&lt;br /&gt;  &lt;/code&gt;&lt;div dir="ltr" style="text-align: left;"&gt;&lt;br /&gt;   &lt;!-- php buffer start --&gt;&lt;code&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;&lt;span style="color:#0000cc;"&gt;&amp;lt;?&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#ff9900;"&gt;///////////////variables//////////////////////////////////&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$dn &lt;/span&gt;&lt;span style="color:#006600;"&gt;= &lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"dn=e-hps,dn=local"&lt;/span&gt;&lt;span style="color:#006600;"&gt;;                    &lt;/span&gt;&lt;span style="color:#ff9900;"&gt;//This is the distinguished name of your domain, mine is e-hps.local&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$filter &lt;/span&gt;&lt;span style="color:#006600;"&gt;= &lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"cn=*"&lt;/span&gt;&lt;span style="color:#006600;"&gt;;                                &lt;/span&gt;&lt;span style="color:#ff9900;"&gt;//This is your search filter, in my example I am searching for everyone with a CN&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$user&lt;/span&gt;&lt;span style="color:#006600;"&gt;=&lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"student@e-hps.local"&lt;/span&gt;&lt;span style="color:#006600;"&gt;;                   &lt;/span&gt;&lt;span style="color:#ff9900;"&gt;//I was never able to make it work anonymously, So I use an account without permissions to search&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$pass&lt;/span&gt;&lt;span style="color:#006600;"&gt;=&lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"password"&lt;/span&gt;&lt;span style="color:#006600;"&gt;;                                  &lt;/span&gt;&lt;span style="color:#ff9900;"&gt;//The password&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;////////////connect and bind//////////////////////////////&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$ad &lt;/span&gt;&lt;span style="color:#006600;"&gt;= &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;ldap_connect&lt;/span&gt;&lt;span style="color:#006600;"&gt;(&lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"localhost"&lt;/span&gt;&lt;span style="color:#006600;"&gt;)             &lt;/span&gt;&lt;span style="color:#ff9900;"&gt;//I am running AD on my webserver so it is localhost, you may need to enter your servers IP address&lt;br /&gt;&lt;br /&gt;          &lt;/span&gt;&lt;span style="color:#006600;"&gt;or die(&lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"Couldn't connect to AD!"&lt;/span&gt;&lt;span style="color:#006600;"&gt;);    &lt;/span&gt;&lt;span style="color:#ff9900;"&gt;//This always returns true, so it's not really a good test&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;ldap_set_option&lt;/span&gt;&lt;span style="color:#006600;"&gt;(&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$ad&lt;/span&gt;&lt;span style="color:#006600;"&gt;, &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;LDAP_OPT_PROTOCOL_VERSION&lt;/span&gt;&lt;span style="color:#006600;"&gt;, &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;3&lt;/span&gt;&lt;span style="color:#006600;"&gt;); &lt;/span&gt;&lt;span style="color:#ff9900;"&gt;//To work with LDAP in AD you need to set the version to version 3&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$bd &lt;/span&gt;&lt;span style="color:#006600;"&gt;= &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;ldap_bind&lt;/span&gt;&lt;span style="color:#006600;"&gt;(&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$ad&lt;/span&gt;&lt;span style="color:#006600;"&gt;, &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$user&lt;/span&gt;&lt;span style="color:#006600;"&gt;, &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$pass&lt;/span&gt;&lt;span style="color:#006600;"&gt;)            &lt;/span&gt;&lt;span style="color:#ff9900;"&gt;//This is where you actually connect and where your connection will usually fail. &lt;br /&gt;&lt;br /&gt;          &lt;/span&gt;&lt;span style="color:#006600;"&gt;or die(&lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"Couldn't bind to AD!"&lt;/span&gt;&lt;span style="color:#006600;"&gt;);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#ff9900;"&gt;////////////search and print//////////////////////////////&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$result &lt;/span&gt;&lt;span style="color:#006600;"&gt;= &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;ldap_search&lt;/span&gt;&lt;span style="color:#006600;"&gt;(&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$ad&lt;/span&gt;&lt;span style="color:#006600;"&gt;, &lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"CN=users,DC=e-hps,DC=local"&lt;/span&gt;&lt;span style="color:#006600;"&gt;, &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$filter&lt;/span&gt;&lt;span style="color:#006600;"&gt;); &lt;/span&gt;&lt;span style="color:#ff9900;"&gt;//I'm searching my $ad connection in the users portion of my AD for all CN's&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$entries &lt;/span&gt;&lt;span style="color:#006600;"&gt;= &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;ldap_get_entries&lt;/span&gt;&lt;span style="color:#006600;"&gt;(&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$ad&lt;/span&gt;&lt;span style="color:#006600;"&gt;, &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$result&lt;/span&gt;&lt;span style="color:#006600;"&gt;);  &lt;/span&gt;&lt;span style="color:#ff9900;"&gt;//An array of the results of my search&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#006600;"&gt;for (&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$i&lt;/span&gt;&lt;span style="color:#006600;"&gt;=&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;0&lt;/span&gt;&lt;span style="color:#006600;"&gt;; &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$i&lt;/span&gt;&lt;span style="color:#006600;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$entries&lt;/span&gt;&lt;span style="color:#006600;"&gt;[&lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"count"&lt;/span&gt;&lt;span style="color:#006600;"&gt;]; &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$i&lt;/span&gt;&lt;span style="color:#006600;"&gt;++)  &lt;/span&gt;&lt;span style="color:#ff9900;"&gt;//loop through all the results and print them to a page&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#006600;"&gt;{&lt;br /&gt;&lt;br /&gt;     echo &lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"&amp;lt;br&amp;gt;&amp;lt;table width='100%' align='center' border='1' bgcolor='#E9E9E9'&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;"&lt;/span&gt;&lt;span style="color:#006600;"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;     echo &lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"Name: "&lt;/span&gt;&lt;span style="color:#006600;"&gt;;&lt;br /&gt;&lt;br /&gt;      if (isset(&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$entries&lt;/span&gt;&lt;span style="color:#006600;"&gt;[&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$i&lt;/span&gt;&lt;span style="color:#006600;"&gt;][&lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"givenname"&lt;/span&gt;&lt;span style="color:#006600;"&gt;][&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;0&lt;/span&gt;&lt;span style="color:#006600;"&gt;])){&lt;br /&gt;&lt;br /&gt;           echo &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$entries&lt;/span&gt;&lt;span style="color:#006600;"&gt;[&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$i&lt;/span&gt;&lt;span style="color:#006600;"&gt;][&lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"givenname"&lt;/span&gt;&lt;span style="color:#006600;"&gt;][&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;0&lt;/span&gt;&lt;span style="color:#006600;"&gt;] . &lt;/span&gt;&lt;span style="color:#cc0000;"&gt;" "&lt;/span&gt;&lt;span style="color:#006600;"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      } else {&lt;br /&gt;&lt;br /&gt;           echo &lt;/span&gt;&lt;span style="color:#cc0000;"&gt;" "&lt;/span&gt;&lt;span style="color:#006600;"&gt;;&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      if (isset(&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$entries&lt;/span&gt;&lt;span style="color:#006600;"&gt;[&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$i&lt;/span&gt;&lt;span style="color:#006600;"&gt;][&lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"sn"&lt;/span&gt;&lt;span style="color:#006600;"&gt;][&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;0&lt;/span&gt;&lt;span style="color:#006600;"&gt;])){&lt;br /&gt;&lt;br /&gt;          echo &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$entries&lt;/span&gt;&lt;span style="color:#006600;"&gt;[&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$i&lt;/span&gt;&lt;span style="color:#006600;"&gt;][&lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"sn"&lt;/span&gt;&lt;span style="color:#006600;"&gt;][&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;0&lt;/span&gt;&lt;span style="color:#006600;"&gt;] . &lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"&amp;lt;br&amp;gt;"&lt;/span&gt;&lt;span style="color:#006600;"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      } else {&lt;br /&gt;&lt;br /&gt;            echo &lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"&amp;lt;br&amp;gt;"&lt;/span&gt;&lt;span style="color:#006600;"&gt;;&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;       if (isset(&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$entries&lt;/span&gt;&lt;span style="color:#006600;"&gt;[&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$i&lt;/span&gt;&lt;span style="color:#006600;"&gt;][&lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"description"&lt;/span&gt;&lt;span style="color:#006600;"&gt;][&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;0&lt;/span&gt;&lt;span style="color:#006600;"&gt;]))&lt;br /&gt;&lt;br /&gt;         echo &lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"Description: " &lt;/span&gt;&lt;span style="color:#006600;"&gt;. &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$entries&lt;/span&gt;&lt;span style="color:#006600;"&gt;[&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$i&lt;/span&gt;&lt;span style="color:#006600;"&gt;][&lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"description"&lt;/span&gt;&lt;span style="color:#006600;"&gt;][&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;0&lt;/span&gt;&lt;span style="color:#006600;"&gt;] . &lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"&amp;lt;br&amp;gt;"&lt;/span&gt;&lt;span style="color:#006600;"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      if (isset(&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$entries&lt;/span&gt;&lt;span style="color:#006600;"&gt;[&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$i&lt;/span&gt;&lt;span style="color:#006600;"&gt;][&lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"telephonenumber"&lt;/span&gt;&lt;span style="color:#006600;"&gt;][&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;0&lt;/span&gt;&lt;span style="color:#006600;"&gt;]))&lt;br /&gt;&lt;br /&gt;         echo &lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"Phone: " &lt;/span&gt;&lt;span style="color:#006600;"&gt;. &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$entries&lt;/span&gt;&lt;span style="color:#006600;"&gt;[&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$i&lt;/span&gt;&lt;span style="color:#006600;"&gt;][&lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"telephonenumber"&lt;/span&gt;&lt;span style="color:#006600;"&gt;][&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;0&lt;/span&gt;&lt;span style="color:#006600;"&gt;] . &lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"&amp;lt;br&amp;gt;"&lt;/span&gt;&lt;span style="color:#006600;"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      if (isset(&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$entries&lt;/span&gt;&lt;span style="color:#006600;"&gt;[&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$i&lt;/span&gt;&lt;span style="color:#006600;"&gt;][&lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"physicaldeliveryofficename"&lt;/span&gt;&lt;span style="color:#006600;"&gt;][&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;0&lt;/span&gt;&lt;span style="color:#006600;"&gt;]))&lt;br /&gt;&lt;br /&gt;         echo &lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"Building: " &lt;/span&gt;&lt;span style="color:#006600;"&gt;. &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$entries&lt;/span&gt;&lt;span style="color:#006600;"&gt;[&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$i&lt;/span&gt;&lt;span style="color:#006600;"&gt;][&lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"physicaldeliveryofficename"&lt;/span&gt;&lt;span style="color:#006600;"&gt;][&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;0&lt;/span&gt;&lt;span style="color:#006600;"&gt;] . &lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"&amp;lt;br&amp;gt;"&lt;/span&gt;&lt;span style="color:#006600;"&gt;;   &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      echo &lt;/span&gt;&lt;span style="color:#cc0000;"&gt;"&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;"&lt;/span&gt;&lt;span style="color:#006600;"&gt;;&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;   &lt;/span&gt;&lt;span style="color:#0000cc;"&gt;ldap_unbind&lt;/span&gt;&lt;span style="color:#006600;"&gt;(&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;$ad&lt;/span&gt;&lt;span style="color:#006600;"&gt;) &lt;/span&gt;&lt;span style="color:#ff9900;"&gt;//unbind, not doing this can use up all the available ldap connections.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#0000cc;"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7715740931190954265-1663468661255096972?l=toddhisted.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://toddhisted.blogspot.com/feeds/1663468661255096972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7715740931190954265&amp;postID=1663468661255096972' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7715740931190954265/posts/default/1663468661255096972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7715740931190954265/posts/default/1663468661255096972'/><link rel='alternate' type='text/html' href='http://toddhisted.blogspot.com/2008/08/php-ldap-active-directory.html' title='PHP, LDAP &amp; Active Directory'/><author><name>Todd</name><uri>http://www.blogger.com/profile/11660259449034719772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7715740931190954265.post-901437906011342384</id><published>2008-08-07T13:08:00.002-04:00</published><updated>2008-08-07T13:11:16.063-04:00</updated><title type='text'>Initial Post</title><content type='html'>This is my initial post in order to determine how I want to format my Blog.  There's really nothing exciting here, just some text to fill up some space on the screen.  I think I'm going to paste a large section of text just to fill it up some more now.  Thanks for reading.&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt; Lorem ipsum dolor sit amet, dolor quam a odio vitae dictumst fringilla. Non neque, in purus est varius vel aenean, ac taciti arcu semper, tristique pulvinar varius ante purus massa ultricies. Turpis blandit donec, tellus maecenas, aenean integer aliquam, ut dictumst varius sit feugiat phasellus, tellus mollis non adipiscing pretium. Facilisis varius elit mauris, a integer sapien, tempor posuere in faucibus. Dictum ante, eget ut vestibulum mauris. Mi arcu at amet hac, mattis a laoreet facilisis turpis dapibus pede, aenean massa orci vel rutrum, quis risus, vestibulum orci aenean rhoncus in.&lt;/p&gt; &lt;p align="justify"&gt; Risus sed, nonummy pretium sit ut, convallis massa vestibulum pharetra varius magna, vel eget ultricies scelerisque lacinia commodo. Amet lacinia, montes orci, massa donec ut nam mi sit neque, vestibulum aliquam nulla in amet ac. Velit amet suspendisse vitae sit. Est amet nunc placerat at, etiam et nullam a sem fringilla, tincidunt iaculis non tellus sed, dolor velit lacus orci leo est maecenas, at suscipit tortor. Mauris magna venenatis dolor ad tempor arcu, orci duis potenti ullamcorper pretium. Est nec lorem ac interdum fermentum, id fringilla eros at in quis vestibulum, cras arcu tempus dolor amet hendrerit tristique, nisl ut sed. Bibendum praesent mollis lacinia, pede ante vestibulum, suspendisse ut sapien vestibulum, praesent vel gravida fermentum imperdiet.&lt;/p&gt; &lt;p align="justify"&gt; Magna nunc pede a, et quas pretium eget et suspendisse posuere, duis urna gravida, nec dignissim vehicula at mauris. Eu vel sem eu erat pellentesque, enim tincidunt malesuada pellentesque arcu. Non lectus dolor consequat neque dictumst. Ut elit ligula sed blandit integer, erat placerat metus posuere fermentum bibendum, tortor libero erat tempus. Porta lacus arcu, massa interdum, ultricies scelerisque mollis magna diam nunc. Eros vitae quis, felis velit commodo euismod leo nec nibh. Ligula ipsum mattis lorem a pellentesque, tempus vestibulum sed lacus quis morbi duis, curabitur sed elit vel nulla aliquam, leo scelerisque euismod dis ante eu nec. Ultrices est augue non sagittis ut, dui diam vulputate, sed magna morbi porttitor nulla donec, urna proin mi cras est. Massa viverra, tellus hymenaeos vivamus sit viverra, dignissim massa erat curabitur nam etiam quod, erat sit. Elementum mi egestas, a in nibh volutpat volutpat tellus tellus, eros mollis mauris neque diam dictum, sed fermentum, consectetuer sodales erat. Ut cras porttitor.&lt;/p&gt; &lt;p align="justify"&gt; Sed nisl pretium sit pulvinar fusce conubia. Orci suscipit, eros fames, feugiat neque arcu est, quis lectus. Nec turpis at ante vestibulum ligula vehicula, eros elit eleifend, erat purus nostra vitae, aliquet vel, vel reprehenderit augue suscipit. Rutrum wisi, non placerat. Lorem in nunc arcu tellus a tellus, et elit mi odio mauris, at tincidunt ligula cursus, integer nam facilisis expedita egestas, conubia aptent tellus vestibulum aliquam. Eu laboris primis feugiat, est nec et aptent ipsum, nec ut. Velit morbi ut, augue magna accumsan aliquam vulputate, ac vehicula, sit rhoncus in massa. Morbi sed amet quisque ultricies, porttitor justo. Nulla eu integer. Convallis et sem.&lt;/p&gt; &lt;p align="justify"&gt; &lt;/p&gt;&lt;img src="http://lorem-ipsum.perbang.dk/cms_perbang/images/space.gif" alt="+" width="1" height="0" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7715740931190954265-901437906011342384?l=toddhisted.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://toddhisted.blogspot.com/feeds/901437906011342384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7715740931190954265&amp;postID=901437906011342384' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7715740931190954265/posts/default/901437906011342384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7715740931190954265/posts/default/901437906011342384'/><link rel='alternate' type='text/html' href='http://toddhisted.blogspot.com/2008/08/initial-post.html' title='Initial Post'/><author><name>Todd</name><uri>http://www.blogger.com/profile/11660259449034719772</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
