Help and I'll send $$ your way...

Discussion in 'PHP' started by CLMMafia, Jan 3, 2012.

  1. #1
    Hello,

    I'm making a URL shorterner and if someone can make a function
    that can validate a URL and if its missing something it will add it.

    If you can make what I need then I will send $5, to your PayPal.

    Thanks
     
    CLMMafia, Jan 3, 2012 IP
  2. AlexanderZ

    AlexanderZ Member

    Messages:
    28
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    48
    #2
    AlexanderZ, Jan 4, 2012 IP
  3. CLMMafia

    CLMMafia Member

    Messages:
    93
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    28
    #3
    I'm only offering money because I want some fancy code if a url is missing something (eg: 'http://', '/', ect...)the code will add it.
     
    CLMMafia, Jan 4, 2012 IP
  4. startdream

    startdream Member

    Messages:
    76
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    28
    #4
    Can you tell clearly requirement more than?
     
    startdream, Jan 6, 2012 IP
  5. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #5
    If you haven't found someone, contact me with all details and i'll see what i can do for you! :)
     
    EricBruggema, Jan 7, 2012 IP
  6. t3od0r

    t3od0r Well-Known Member

    Messages:
    334
    Likes Received:
    3
    Best Answers:
    3
    Trophy Points:
    155
    #6
    you can use this function to test if the link is ok
    
    function link_is_live($url){
    	$h = get_headers($url);
    	$ok=false;
        if(preg_match('~HTTP/1\.\d\s+200\s+OK~', $h[0])) $ok=true;
    	return $ok;
    } 
    
    $url = 'http://wscripts.net/';
    if(link_is_live($url)) echo 'yes'; else echo 'no'; //will return yes
    $url = 'http://wscripts.net/asdasd';
    if(link_is_live($url)) echo 'yes'; else echo 'no'; //will return no
    
    PHP:
     
    t3od0r, Jan 7, 2012 IP