douruyun8153 2015-07-29 13:22
浏览 8
已采纳

Php shadow登录论坛并将数据返回给iframe

I have a page whit login forums

<a href="https://www.Forum1.com/en/login" target="myiframe">Forum1</a> &nbsp;
<a href="http://Forum2.be/Login.aspx" target="myiframe">Forum2</a> &nbsp;
<a href="https://Forum3.forum.com/desktop/" target="myiframe">Forum3</a>
</br>
<iframe width="100%" height="100%" name="myiframe"></iframe>
<p><a href="?action=logOut">LogOut</a></p>

I have registration credentials in each of them, I have 5 people who want read this forums with my credentials, I do not want to show them credentials but I want to let whem read thoose forums with my credentials. So in my page on href pressed in iframe must be loaded content of each forum already with my credentials (which must be not shown to user) (so i dont warry what they can change any info or something else in my profiles). Also i need to track what whey do on forums to control who what can do ( such thing which link is pressed).

It is possible to do with PHP? Please show me i right direction to solve this problem.

  • 写回答

1条回答 默认 最新

  • dplht39359 2015-07-29 13:53
    关注

    I guess it's way easier to let those users register a own account.

    In case you still want to use a PHP code to let those users view the forum without knowing your credentials, you could create a PHP class like this:

    <?php
        class Forum
        {
            var $url = '';
    
            public function getContent()
            {
                $content = @file_get_contents($this->url);
                return $content;
            }
        }
    ?>
    

    and create objects for each forum u want to show.

    <?php
        require_once('Forum.php');
        $getForum = new Forum();
        $getForum->url = 'http://www.google.de';
        echo $getForum->getContent();
    ?>
    

    That's just a example though, you would have to add your credentials and might use http://php.net/manual/en/book.curl.php to sign in to the forum.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗
  • ¥15 ikuai客户端l2tp协议链接报终止15信号和无法将p.p.p6转换为我的l2tp线路