I have 3 files, one index.php, one instapic.php and one instapic.sh The php is supposed to execute sh to show an image but it wont work when it is on the "index" site, it worked earlier when it was directed to /instapic.php but i want it to display on main index page.
<html>
<head>
<style>
div {
font family: Ubuntu;
background-color: #F2F2F2;
}
</style>
</head>
<body>
<div>
<h1> <center> Instagram Full Size Profile Picture </center> </h1>
</div>
<center>
<form action="" method="get">
Enter Instagram Username: <input type="text" name="input">
<input type="submit" value="View">
</form>
</center>
</body>
<?php
$name = $_REQUEST['input'];
echo $name;
echo "<br>";
$output = shell_exec("/var/www/html/instapic.sh $name");
echo "<img src=$output>";
?>
-
#!/bin/bash
NAME=$1
#curl -s https://www.instagram.com/$NAME/ | grep image | grep fbma | sed 's,s150x150/,,g' | cut -f 4 -f '"'
curl -s https://www.instagram.com/$NAME/ | grep "og:image" | sed 's,s150x150/,,g' | cut -f 4 -f '"'