Jump to content

$_GET?


Graxeon

Recommended Posts

I think has to do with http headers. How can I request http header information with PHP?

 

 

 

@coupe:

 

but that's only if the request was sent on the current page.

 

My page is "mysite.com/display.php". And what "display.php" is supposed to do is what I described in my first post. So that wouldn't necessarily work.

Link to comment
Share on other sites

where do you want to echo this at?

 

Do you want to just take the user to

 

site.com/123.php?hp=1

 

only and not the full URL (site.com/user.php?level=site.com/123.php?hp=1)?

 

header('Location: site.com/123.php?hp=1');

 

I guess I'm not sure what you are trying to do or where you want to send them.

Link to comment
Share on other sites

I have "mysite.com/display.php"

 

That file goes to this URL: site.com/user/redirect

Since that URL redirects to "site.com/user.php?level=site.com/123.php?hp=1"...I want "display.php" to only redirect to "site.com/123.php?=1"

 

**Note that display.php and the redirecting URL are on different hosts/servers (hence why $_GET doesn't seem the way to go for me)

 

 

edit:

 

if I'm not explaining it too well, can you at least tell me how I can request HTTP Header information from any website like this page does: http://www.softswot.com/http-header.php?#viewer

(type in any URL that redirects in the box first then click Send Request). I'd like the "Location" info echoed.

 

That, or how can I parse the URL so that it gives me the URL once it has redirected me?

Link to comment
Share on other sites

Ok, but would you know anything about this?:

 

Go to: http://www.softswot.com/http-header.php?#viewer

Type in this URL and click Send Request: http://tiny.cc/7n0i9lvimd (this redirects you to Google.com)

 

The "http-header.php" will display this info:

 

Received Response
HTTP/1.1 301 Moved Permanently
Server: nginx/0.7.65
Date: Mon, 04 Oct 2010 02:54:43 GMT
Content-Type: text/html
Connection: close
X-Powered-By: PHP/5.3.2
Set-Cookie: session= (alphanumerical data here); expires=Mon, 04-Oct-2010 05:54:43 GMT; path=/; domain=.tiny.cc
Set-Cookie: tycc7n0i9lvimd=1286160883; expires=Thu, 04-Oct-2012 02:54:43 GMT
Location: http://www.google.com

 

How can I do the same thing on my "display.php" file?

 

(or at least just show the "Location" information)

Link to comment
Share on other sites

Before: mysite.com/user.php?level=site.com/123.php?hp=1

 

$url = ('' . htmlspecialchars($_GET["level"]) . '');
$urlInfo = parse_url($url);
$output = array();
parse_str($urlInfo['query'], $output);

 

echo this;

" . ($output['level']) . "

 

After: site.com/123.php?hp=1

 

Hope this helps?

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.