get method

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Malder
Forum Newbie
Posts: 13
Joined: Wed Mar 19, 2003 11:09 pm

get method

Post by Malder »

1) When i run script with parameters ("localhost://script.php?www.server.com=main&php=cool") and in script look at him(param) using variable $_GET, i get "www_server_com...". Why? & what can be done? I found the way out in $_ENV variable, but that's not comfortable cause there can be several parameters and $_ENV[$QUERY_STRING] is string.

2) How to open link in new window?

Thanks guys for your help!
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

you can't have a period in a variable name.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

and for your second question:
<a href="url" target="windowname" >
Malder
Forum Newbie
Posts: 13
Joined: Wed Mar 19, 2003 11:09 pm

Post by Malder »

i meant how to open url in new window in PHP and not in broyzer
Malder
Forum Newbie
Posts: 13
Joined: Wed Mar 19, 2003 11:09 pm

Post by Malder »

hob_goblin wrote:you can't have a period in a variable name.
then how to send url_name via "get"?
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Malder wrote:
hob_goblin wrote:you can't have a period in a variable name.
then how to send url_name via "get"?
Don't make it a variable name, make it a variable. E.g.:

Code: Select all

localhost://script.php?url=www.server.com&page=main&php=cool
instead of

Code: Select all

localhost://script.php?www.server.com=main&php=cool
then you can access the url through $_GET['url'].

Mac
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Malder wrote:i meant how to open url in new window in PHP and not in broyzer
Do you mean redirecting to another page?
header()

Code: Select all

header('Location: http://www.somesite.com/');
Mac
Malder
Forum Newbie
Posts: 13
Joined: Wed Mar 19, 2003 11:09 pm

Post by Malder »

Do you mean redirecting to another page?
header()
And in new window?
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Malder wrote:
Do you mean redirecting to another page?
header()
And in new window?
Not possible using PHP - try looking for a JavaScript solution - opening new windows is a client-side function and PHP is server-side.

Mac
Post Reply