2017-11-22 19:37



I have 3 files, one index.php, one instapic.php and one 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.

div {
font family: Ubuntu;
background-color: #F2F2F2;
<h1> <center> Instagram Full Size Profile Picture </center> </h1>
<form action="" method="get">
Enter Instagram Username: <input type="text" name="input">
<input type="submit" value="View">

$name = $_REQUEST['input'];
echo $name;
echo "<br>";
$output = shell_exec("/var/www/html/ $name");
echo "<img src=$output>";


#curl -s$NAME/ | grep image | grep fbma | sed 's,s150x150/,,g' | cut -f 4 -f '"'
curl -s$NAME/ | grep "og:image" | sed 's,s150x150/,,g' | cut -f 4 -f '"'
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答


  • dsmvovm27249 dsmvovm27249 4年前

    To achieve this you need to can add some PHP code on your index and just send your form to the same page. If you don't want to reload the page every time you have to send an ajax call. It could be a solution (not the best at all):

    Include this at the beginning of you index.php file :

      if(isset($_REQUEST['input'])) {
        $name = $_REQUEST['input'];
        $output = shell_exec("/var/www/html/ $name");

    And Include this where you want to display the images :

      if(isset($output)) {
        echo "<img src=$output>";

    Also don't forget to add "index.php' on the action attribute of the form

    点赞 评论 复制链接分享