Jump to content

Please need help in URL navigator from URL txt file


RAPIDGRAB

Recommended Posts

Hello,

 

I'm new in PHP and i want to make a PHP navigator that help me to view URL from a text or PHP file saved on the server and i want to add variable to URLS to hide them in my page and call them from the text file  ???

 

And i want these links to be displayed randomly every time when refreshing the page by user request "not auto refresh" and target them to an inline iframe in my page so that i want links to be hidden by variables like [ /index.php?link=2 ,  /index.php?link=3 and so on].

 

If this should done by MySQL data base, so please any one help me and post the code that explain how to connect to the data base as I'm very weak in PHP :(

 

Thanks!

Link to comment
Share on other sites

You can't really obfuscate the source of an iframe, as the browser needs to be able to read it.

 

However, you could use cURL to open pages.

So, for example:

//in your iframe page
<iframe src="curl.php?id=1"></iframe>
//and then in curl.php
$id = $_GET['id'];
$sql = mysql_query("SELECT * FROM table WHERE ID='$id'");
$fetch = $mysql_fetch_array($sql);
$link = $fetch['link'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$return = curl_exec($ch);
curl_close($ch);
echo $return;

Something like that anyway.

Link to comment
Share on other sites

You can't really obfuscate the source of an iframe, as the browser needs to be able to read it.

 

However, you could use cURL to open pages.

So, for example:

//in your iframe page
<iframe src="curl.php?id=1"></iframe>
//and then in curl.php
$id = $_GET['id'];
$sql = mysql_query("SELECT * FROM table WHERE ID='$id'");
$fetch = $mysql_fetch_array($sql);
$link = $fetch['link'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$return = curl_exec($ch);
curl_close($ch);
echo $return;

Something like that anyway.

 

Thank you sir  ;D

 

Please see this pic

 

how10.gif

 

As you see at the top there is dynamic navigation bar that show random URL in the iframe "You are using server [ 1 ]"

 

I believe this need MySQL connection to perform this function!

 

The codes you post, could you explain more how many files i should create to execute them  ???

 

Thanks.

Link to comment
Share on other sites

Well, if you create a table with ID and link, and a page that calls them values from the database, that's all you need. Just point the iframe to that file.

 

Well I'm trying now and i succeeded to create and insert into tables :)

 

But how i hide urls in my page and view them with variables like "index.php?link=1" then on click this url open in the iframe ;)

 

I hope you answer me if i have more questions  ;D

 

Thanks.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.