Need help.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hustle247
Forum Newbie
Posts: 2
Joined: Sun Oct 18, 2009 4:56 pm

Need help.

Post by hustle247 »

I am trying to have users enter a url for there social networks, then depending on the social network url entered, I am posting the stored image for that site on the user page. For example if they enter "Http://www.twitter.com/sample" it would post the twitter icon stored on my server image dir and post to the user profile next to the actual twitter url entered. I want the code to work so that it recognizes the url, posts the correct image, no matter what username is in the string of the url. Thanks in advance.
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: Need help.

Post by Eric! »

Well you could use parse_url and then match the host to your icons. http://php.net/manual/en/function.parse-url.php
plezops
Forum Newbie
Posts: 11
Joined: Mon May 28, 2007 5:22 pm
Location: Austin, Texas

Re: Need help.

Post by plezops »

Another way would be to search the provided URL for a list of certain words, for example: 'facebook', 'twitter', etc. If you have a match use that image.
hustle247
Forum Newbie
Posts: 2
Joined: Sun Oct 18, 2009 4:56 pm

Re: Need help.

Post by hustle247 »

thanks, I'll try your suggestions in the AM, i appreciate it.
Post Reply