首页 > 解决方案 > 一次获得多个结果

问题描述

我的代码通过在 .htm 之前获取 ID 来工作,我希望它与一行中的多个链接而不是 1 x 1

如果有人想看看它是如何工作的:https ://cleberrafael.com.br/freepik/fp.php

<?PHP
  if (isset($_POST['execute']))
  {
    if ($_SESSION['token'] == $token) {
      $url = $_POST['url'];
      $stepOne = explode("_", $url);
      
     if(!empty($stepOne[1])){
      $stepTwo = explode(".htm", $stepOne[1]);
        if(!empty($stepTwo[0])){
            $id = $stepTwo[0];
            $status = "success";
            $msg = "https://www.freepik.com/download-file/".$id; 
        }
        else {
           $status = "warning";
           $msg = "Cannot Parse URL";
        }
      }
     else {
        $status = "warning";
        $msg = "Link Errado Amigo";
      }
          
      if ($status == "success") {
            echo '<div class="alert alert-'.$status.'">
                  <strong>Pronto LIND!</strong> '.$msg.'
                </div>';
      } else if($status == "warning") {
            echo '<div class="alert alert-'.$status.'">
                  <strong>Failed!</strong> '.$msg.'
                </div>';
      } else {
        echo '<div class="alert alert-danger">
                  <strong>Error!</strong> UNKNOWN
                </div>';
      }
          
    } else {
            echo '<div class="alert alert-danger">
                  <strong>Invalid Token!</strong> ^_^.
                </div>';
    }
  }

?>

标签: phphtml

解决方案


推荐阅读