Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Shah Hastimal  >  Link And Domain Extractor  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: Link And Domain Extractor
Retrieve links and e-mail from a remote Web page
Author: By
Last change:
Date: 2008-04-19 21:29
Size: 2,381 bytes
 

Contents

Class file image Download
<?php
        
require("LinkExtractor.class.php");
        
$obj_linkextractor = new LinkExtractor();
        
//$url="https://www.google.co.in";
        
if(isset($_POST['submit']))
        {
            
$geturl=$_POST['url'];          
            
$findlink=$_POST['search_url'];   
            
$finddomain=$_POST['search_domain'];   
            
$url=$obj_linkextractor->FetchUrl($geturl);
         
            echo 
"<HR><br/>Result<br/><br/>";
            echo 
"<h3>All Links</h3><hr><br/>";
            
$arrayLinks=$obj_linkextractor->GetAllLinks();
            for( 
$a 0$b count$arrayLinks );$a<$b$a++ )
            {
                echo 
$arrayLinks[$a]."<br />";
            }
            
$chkurl=$obj_linkextractor->FindExistLink($findlink);
            echo 
"<h3>URL Finding</h3><hr><br/>";
            if(
$chkurl)
            {
                echo 
"<strong>Given URL Exists.<strong> <br/>";
            }else
            {
                echo 
$obj_linkextractor->GetError();
            }
           
$arrayLinks=$obj_linkextractor->GetDomainNames();
         
            
$arrayLinks=(array_values($arrayLinks));

            echo 
"<h3>All Domain Names</h3><hr><br/>";
            for( 
$a 0$a<count($arrayLinks); $a++ )
            {
                echo 
$arrayLinks[$a];
                echo 
"<br/>";
            }
           
  

            
$chkdomain=$obj_linkextractor->FindDomainName($finddomain);
            echo 
"<h3>Domain Name Finding</h3><hr><br/>";
            if(
$chkdomain)
            {
                echo 
"<strong>Give Domain Name Exists.<br/></strong>";
            }else
            {
              echo 
$obj_linkextractor->GetError();
            }
           

           
           
        }       
?>

<form action="<?= $PHP_SELF ?>" method="POST">
<Strong>Url Should begin with http://(for example http://www.google.com)</strong>
<TABLE>
<TR>
    <TD>URL: </TD>
    <TD><input type="text" name="url" value=""/></TD>
</TR>
<TR>
    <TD>Search For URL : </TD>
    <TD><INPUT TYPE="text" NAME="search_url"></TD>
</TR>
<TR>
    <TD>Search For Domain : </TD>
    <TD><INPUT TYPE="text" NAME="search_domain"></TD>
</TR>
<TR>
    <TD><INPUT TYPE="submit" name="submit"></TD>
    <TD><INPUT TYPE="reset"></TD>
</TR>
</TABLE>
<br/><br/>
<br/><br/>


</form>