Jump to content

syntax help


justAnoob

Recommended Posts

Did it actually work?

 

...

 

What Daniel is trying to get at, is that you should describe what's wrong, post the relevant code and any errors. And if you don't know how to put a string into a variable, I would recommend you learn that and other similar basics before going any further.

Link to comment
https://forums.phpfreaks.com/topic/161295-syntax-help/#findComment-851178
Share on other sites

http://ww23.rr.com/index.php?origURL=http://http//www.mysite.com/mypage.php

That is what page I return with the following code below. I don't want all that,, just http//www.mysite.com/mypage.php    It is also leaving out the page number.. Any ideas??

 

$_SESSION['url'] = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'];

 

$url = $_SESSION['url'];

header("Location: http://$url");

Link to comment
https://forums.phpfreaks.com/topic/161295-syntax-help/#findComment-851183
Share on other sites

Ok,, here is my setup now... and yes,, i use session_start

Lets say this is what is in the url box

http://www.mysite.com/mypage.php?pageno=2

 

I use this to get what is in the url box

$_SESSION['getpage'] = $_SERVER['HTTP_REFERER'];

I even echoed out that out to see what I get,, and it is the entire address in the url box.

 

Then when I use this header,, it leaves out the page number and I get this...

http://www.mysite.com/mypage.php

 

$getpage = $_SESSION['getpage'];

header("Location: $getpage");

exit();

 

Any input would be appreciated. Thanks...

Link to comment
https://forums.phpfreaks.com/topic/161295-syntax-help/#findComment-851191
Share on other sites

What do you mean what do I mean? You can get the data you want with $_GET['var_name']. Of course, you change var_name to the argument you want to get. If you don't fully understand how to use $_GET, then Google it. It's not hard. php.net probably has many examples. Generally I would put up an example, but for something like this, which I consider things people should already know (PHP 101), I don't.

Link to comment
https://forums.phpfreaks.com/topic/161295-syntax-help/#findComment-851354
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.