【问题标题】:Can I pass URL parameter values into webpage code to make the page display differently based on the URL Parameters? I.E. Embeded Google Drive Iframes?我可以将 URL 参数值传递到网页代码中,以根据 URL 参数使页面显示不同吗? IE。嵌入 Google Drive iframe?
【发布时间】:2022-11-03 16:28:37
【问题描述】:

我只是一个人,我想将 URL 参数传递到页面的 iFrame 代码中,以获取不同的 Google Drive iFrame 以显示给不同的客户。这个想法是我们将只有一页,但与查看它们的人不同。那可能吗?

就像在代码中一样: <iframe src="https://drive.google.com/embeddedfolderview?(THIS BECOMES A DRIVE ID CUSTOM FIELD)#grid" style="width:100%; height:600px; border:0;"></iframe>

我们希望通过电子邮件传递此链接,因此当用户单击按钮时,它会将他们带到页面并加载 iframe,其中包含他们在谷歌驱动器上的文件夹。

电子邮件上的链接如下:

https://customcreations.com/dashboard?driveID=(GOOGLE DRIVE ID TO POPULATE THE CUSTOM FIELD)

我很抱歉,如果不清楚,请告诉我,以便我澄清。

我尝试让 id 像一个自动填充 iframe 的表单一样在里面,但它正在破坏。我真的希望这是可能的。

感谢任何可以帮助这个凡人的人。

【问题讨论】:

    标签: wordpress iframe url-parameters custom-field-type


    【解决方案1】:

    一些php怎么样:

    <?php
        $drive_id = htmlspecialchars($_GET["driveID"]);
        if (isset($drive_id)) {
            // echo start <iframe> code here...
            echo 'https://customcreations.com/dashboard?driveID=' , $drive_id;
            // echo rest of <iframe> code here...
        } else {
            echo 'Invalid ID';
        }
    ?>
    

    【讨论】:

      猜你喜欢
      • 2017-03-26
      • 1970-01-01
      • 2018-06-07
      • 1970-01-01
      • 1970-01-01
      • 2015-12-04
      • 2020-04-05
      • 1970-01-01
      • 2016-02-27
      相关资源
      最近更新 更多