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.

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

报告相同问题?

悬赏问题

  • ¥15 chaquopy python 安卓
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 有没有帮写代码做实验仿真的
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题