Jump to content

redirection and parse_url


ginocote

Recommended Posts

Hi,

I have this scripts and i want to take the result to redirect to a webpage.

[code]<?php
$url = trim($_GET["url"]);

$a = str_replace('www.', '', parse_url($url));
echo 'Lien vers <a href=http://www.toolurl.com/search-domains.php?url=www.' . $a['host'] .'>'. $a['host'] . '</a>';

?>[/code]

this is my test page:
http://scripts.toolurl.com/parseurl/parse_url.php?url=http://www.phpfreaks.com/forums/index.php

many test on this page: the last two result are the good one.
i want to take a full url and redirect it to the www.toolurl.com search: for this example it will redirect to this page: http://www.toolurl.com/search-domains.php?url=www.phpfreaks.com

resume:
when someone will go to: http://scripts.toolurl.com/parseurl/parse_url.php?url=http://www.phpfreaks.com/forums/index.php
he will be automaticly redirect to: http://www.toolurl.com/search-domains.php?url=www.phpfreaks.com

Thank you to help
Link to comment
Share on other sites

Why don't you make an INDEX.PHP on your
[url=http://scripts.toolurl.com/parseurl/parse_url.php?url=http://www.phpfreaks.com/forums/]http://scripts.toolurl.com/parseurl/parse_url.php?url=http://www.phpfreaks.com/forums/[/url]
site and put the following code in:

[code]<?php
header("Location: http://www.toolurl.com/search-domains.php?url=www.phpfreaks.com");
?>[/code]

Or do I misunderstand the question?
When you want to break down the url, you can use the parse_url command, see [url=http://nl3.php.net/manual/en/function.parse-url.php]http://nl3.php.net/manual/en/function.parse-url.php[/url]

Ronald  8)
Link to comment
Share on other sites

[quote author=ronverdonk link=topic=106289.msg425044#msg425044 date=1156976318]
Why don't you make an INDEX.PHP on your
[url=http://scripts.toolurl.com/parseurl/parse_url.php?url=http://www.phpfreaks.com/forums/]http://scripts.toolurl.com/parseurl/parse_url.php?url=http://www.phpfreaks.com/forums/[/url]
site and put the following code in:

[code]<?php
header("Location: http://www.toolurl.com/search-domains.php?url=www.phpfreaks.com");
?>[/code]

Or do I misunderstand the question?
When you want to break down the url, you can use the parse_url command, see [url=http://nl3.php.net/manual/en/function.parse-url.php]http://nl3.php.net/manual/en/function.parse-url.php[/url]

Ronald  8)
[/quote]

I need a php scripts in this redirection to parse the url for this example:
http://www.phpfreaks.com/forums/index.php
and transforme it to
www.phpfreaks.com

witch scripts i should use to take my result www.phpfreaks.com and send it to the redirect script?

And the redirect scripts to work should be the first line of a web page, we can send the result www.phpfreaks.com at the beginning of the page.
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.