Skip to content
This repository has been archived by the owner on Jul 17, 2021. It is now read-only.

Commit

Permalink
Error Handling changes
Browse files Browse the repository at this point in the history
  • Loading branch information
succkarz committed Aug 6, 2018
1 parent cfd3690 commit 3a76e59
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions data.php
Expand Up @@ -13,7 +13,7 @@ function myfputcsv($handle, $array, $delimiter = ',', $enclosure = '"', $eol = "
$name = $_REQUEST['uname'];
$doc = new DOMDocument();
//using codeofninja instagram id finder and fetching the id
$doc->loadHTML(file_get_contents("https://codeofaninja.com/tools/find-instagram-id-answer.php?instagram_username=".$name));
if($doc->loadHTML(file_get_contents("https://codeofaninja.com/tools/find-instagram-id-answer.php?instagram_username=".$name))){
$xpath = new DOMXPath($doc);
$userid = $xpath->query('/html/body/div[1]/div[2]/div[1]/b')->item(0)->nodeValue;
//using the user id to get the json with the image url
Expand All @@ -31,7 +31,10 @@ function myfputcsv($handle, $array, $delimiter = ',', $enclosure = '"', $eol = "
echo '<br/>Followers:<b> '.$followers.'</b>';
echo '<br/><a style="text-decoration: none !important; color:#323232 !important;" href="'.$hdimage.'" download><small>Download</small></a><hr style="padding:0;margin:10px 0px;">';
}else{
echo "Username does not exist or server busy <br/>.";
echo "Username does not exist.<br/>.";
}
}else{
echo "Server Busy.<br/>";
}
/* Calling logging function and storing Username searched and data/time
if(isset($_POST['uname'])) {
Expand Down

0 comments on commit 3a76e59

Please sign in to comment.