homepage Welcome to WebmasterWorld Guest from 54.204.94.228
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
problems getting get to work on desktop machine.
It works on the server. config problem?
neiljones




msg:1293411
 12:47 pm on Jan 12, 2005 (gmt 0)

I am working with two installations of PHP.
One is on a server on which I rent space. The second is on my linux machine on my desk.
I am writing a program on my desktop machine because the facility to access remote webpages as files is not available on the server.

The php on my desktop is as it comes out of the box with Suse linux. All I have to do is start up apache and it works(mostly).

To explain the problem I have two cutdown programs.
Program1

<?php
?>
<a href="two.php?pass=http:"> link <a><br>

Program 2

<?php

$url=$_GET['pass'];
print "two.".$pass."end\n";
?>

When I run them on the server the value of $pass is populated when I run it on the desk top it isn't

What do I need to change on my desktop machine?

 

dreamcatcher




msg:1293412
 12:56 pm on Jan 12, 2005 (gmt 0)

Shouldn`t $url be the variable and not $pass?

$url=$_GET['pass'];
print "two.".$url."end\n";

Birdman




msg:1293413
 12:59 pm on Jan 12, 2005 (gmt 0)

What's happening is the server is allowing you to access global variables with just the index name(pass).

On your local machine, register_globals in off, which means you must access globals with their full array name($_GET['pass']).

Actually, you are close to what you need because you already set the variable, $url, properly and it will contain the value you need. You just need to change the next line to use $url, rather than $pass.

$url=$_GET['pass'];
print "two.".$url."end\n";

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved