Jump to content

URL-related query


ankurkhanna

Recommended Posts

Hey guys,

 

I'm Ankur and a new member here. I just started off with php recently, still grabbing the basics and I'd like to ask about 1 thing for now -

 

I want to create a script in a way where... let's assume that there is a webpage with an external link pointing to .. say.. google.com

 

Now, as soon as someone clicks on this link, I want the link to become something like

 

www.abc.com?redirect=google.com?utm_source=abc

 

As you can see, even though there is a simple link posted - google.com, it gets engulfed by some other domain, followed by UTM parameters.

 

I'd love to create a script like this. How do I get started?

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/280823-url-related-query/
Share on other sites

As in, you want to obtain these HTTP parameters? These are accessible via POST or GET in the $_POST or $_GET superglobals. For example,

 

http://mysite.php?myval=adrian

 

Then access via $_GET['myval'].

 

See http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol and http://php.net/manual/en/reserved.variables.get.php

Link to comment
https://forums.phpfreaks.com/topic/280823-url-related-query/#findComment-1443464
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.