PHP forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.
March 2024
SunMonTueWedThuFriSat
     12
3456789
10111213141516
17181920212223
24252627282930
31      

Calendar Calendar

Latest topics
» Kabaddi, Kabaddi, Kabaddi, Kabaddi......PHP?
Check if a file exists on a remote FTP server with PHP EmptyFri Jul 22, 2011 1:37 pm by shyamsunder

» Thousands of Free PHP Scripts Recommended
Check if a file exists on a remote FTP server with PHP EmptyWed May 18, 2011 10:33 am by bizboy12

» PHP form validation problem?
Check if a file exists on a remote FTP server with PHP EmptyWed Jan 12, 2011 1:25 pm by simy202

» string wrap
Check if a file exists on a remote FTP server with PHP EmptySat Aug 02, 2008 2:06 pm by scvinodkumar

» retrieving current date rows
Check if a file exists on a remote FTP server with PHP EmptyTue Jul 15, 2008 3:25 am by scvinodkumar

» number in words
Check if a file exists on a remote FTP server with PHP EmptyTue Apr 29, 2008 3:10 pm by scvinodkumar

» Simple PHP Form Field Generator
Check if a file exists on a remote FTP server with PHP EmptyFri Apr 25, 2008 12:28 pm by scvinodkumar

» PHP password generator
Check if a file exists on a remote FTP server with PHP EmptyFri Apr 18, 2008 7:24 pm by scvinodkumar

» PHP Script to Extract Email Address from any text
Check if a file exists on a remote FTP server with PHP EmptyFri Apr 18, 2008 7:18 pm by scvinodkumar

Search
 
 

Display results as :
 


Rechercher Advanced Search

Affiliates
free forum
 


Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Check if a file exists on a remote FTP server with PHP

Go down

Check if a file exists on a remote FTP server with PHP Empty Check if a file exists on a remote FTP server with PHP

Post  scvinodkumar Thu Apr 17, 2008 11:51 am

<?php
/**********************************************************************

Name :- checklink.php

Description :- This code check that the File is On the FTP or Not..

Example :- Change the $url variable as per your requrement u can
Post that variable from any other Page From Pages

***********************************************************************/


function get_h1($file){

$h1tags = preg_match_all("/(<h1.*>)(\w.*)(<\/h1>)/isxmU",$file,$patterns);
$res = array();
array_push($res,$patterns[2]);
array_push($res,count($patterns[2]));
return $res;
}

$url ="http://www.hardikbhavsar.com/index.php";
$ch = curl_init() or die(curl_error());
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$data1=curl_exec($ch) or die(curl_error());

$result = get_h1($data1);

if($result[0][0]=='Not Found')
{
echo "<b>OOps..Link is Not found on this Url...!";
}
else
{
echo "Link is Found on this Url";
}
curl_error($ch);
curl_close($ch);
?>

scvinodkumar
Admin

Posts : 40
Join date : 2008-01-30

https://solutions.aforumfree.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum