Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7981215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:18:10+00:00 2026-06-04T10:18:10+00:00

Basically what I want to do is since I offer my users the ability

  • 0

Basically what I want to do is since I offer my users the ability to share links within there comments and posts on my site is have my site when a user clicks on an external link have it open the page within my page in a matter of speaking. Kinda like how facebook does. You will see the site in its entirety yet facebooks little navigation bar will remain at the top of the site you just opened.

I want to copy this behavior so I can moderate links shared by users flagging them if they are invalid or malicious. So I can turn them off. Right now I am already catching the links and storing them on a per user per link basis so I can moderate as needed. But in order for my users to flag a site currently they would have to go back to mine, and follow a process which is tedious. What I want to do is offer a mini navigation that will essentially have the option to flag on it if and when a user so desires. Also a means to offer them a direct link back to my site.

So I am trying to figure out whats the best way. Should I pull the entire contents of a page via something like cURL or should I have it in a frame like setting. Or whats the best way to do it thats in a manor of speaking cross platform and cross browser friendly to both desktop browsers and mobile browsers. I can foresee someone mucking me up maliously if I do something like cURL as all they have to do is dump some vile code in somewhere and since my sites picking it up and pulling it through a script maybe it will some how break my site I dunno, I dont use cURL often enough to know if theres any major risk.

So what say you stack? cURL method of some sort, frames, other? does anyone have a good example they can point me at?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T10:18:11+00:00Added an answer on June 4, 2026 at 10:18 am

    If you use frames then some websites can jump out of them. If you use CURL you need to parse all urls (links, images, scripts, css) and change them to your own if you want to keep user within your site. So CURL seems more reliable but it requires you to do a lot of work and it generated more bandwidth to your site. If you want CURL based solution you can try to look on net for web proxy examples.

    Here’s a basic working code to get you started:

    $url = isset($_GET['url']) ? $_GET['url'] : 'http://amazon.co.uk/'; 
    $html = file_get_contents2($url);
    
    
    $doc = new DOMDocument();
    @$doc->loadHTML($html);
    $xml = simplexml_import_dom($doc);
    
    $host = 'http://' .parse_url($url, PHP_URL_HOST);
    $proxy = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME'] . '?url=';
    
    $items['a']         = 'href';
    $items['img']       = 'src';
    $items['link']      = 'href';
    $items['script']    = 'src';
    
    foreach ($items AS $tag=>$attr)
    {
        $elems = $xml->xpath('//' . $tag);
        foreach ($elems AS &$e)
        {
            if (substr($e[$attr], 0, 1) == '/')
            {
                $e[$attr] = $host . $e[$attr];
            } 
            if ($tag == 'a')
            {
                $e[$attr] = $proxy . urlencode($e[$attr]);
            }   
        }
    }
    
    $xmls = $xml->asXml();
    $doc->loadXML($xmls);
    $html = $doc->saveHTML();
    echo $html;
    
    
    function file_get_contents2($address)
    {   
        $useragent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1"; 
    
        $c = curl_init(); 
        curl_setopt($c, CURLOPT_URL, $address);
        curl_setopt($c, CURLOPT_USERAGENT, $useragent);     
        curl_setopt($c, CURLOPT_HEADER, 0);
        curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($c, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($c, CURLOPT_FRESH_CONNECT, 1);
        if (!$data = curl_exec($c)) 
        {
            return false; 
        } 
    
        return $data;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large multidimensional array and I basically want to drop the first
I have an SPListItemCollection. I basically want to get one of the items (randomly)
i'm experimenting with django and the builtin admin interface. I basically want to have
Basically I want to use the Twitter Users Lookup (REST API) method, this: http://apiwiki.twitter.com/w/page/24142947/Twitter-REST-API-Method:-users-lookup
Say I have the following interface that I want to share between my server
If I have classes A and B, I basically want to do something like
I basically want to do this in code: PersonList myPersonList; //populate myPersonList here, not
I basically want to be able to deploy multiple versions of the same EAR
I basically want to make things easier by just looping LinkButtons instead of making
I basically want to open a browser window from Word using VBA that does

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.