problem passing variables with url

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
McGoff
-


Joined: 05 Aug 2004
Posts: 2
Location: Sydney

PostPosted: Thu Aug 05, 2004 11:54 am    Post subject: problem passing variables with url Reply with quote

I have been using Abyss as a home test server for 2 years and have just done a fresh windows install after an upgrade
I seem to have forgotten a setting somewhere

I have a "std.php" page that I use throughout one of my sites that sets up the pages top, left and bottom blocks and has only one variable to display the pages main content in the right block
Code:
<?php include ($content) ; ?>

and use internal links like this to navigate around the site
Code:
HREF="std.php?content=content/04-ski-inf.php"

it worked fine in the past both at home and on the web

now the whole page loads with top, bottom and left displayed properly (they are also called with include calls) but the content block dosen't show and I get a

"PHP Notice: Undefined variable: content " in the cgi.log file

so what have I missed in the Abyss / PHP configuration this time

PS. the "php-info.php" page shows up fine so I asume I have the basic PHP settings right

thanks
Keith
Back to top View user's profile Send private message
roganty
-


Joined: 08 Jun 2004
Posts: 357
Location: Bristol, UK

PostPosted: Thu Aug 05, 2004 2:36 pm    Post subject: Re: problem passing variables with url Reply with quote

what version of php are you using? 4?

for some some reason you can't just call $content any more, you have to call "$HTTP_GET_VARS['content']"

in all of my scripts i use the following format to get the vars from the url:
Code:
$content = ( isset($HTTP_GET_VARS['contect']) ) ? $HTTP_GET_VARS['content'] : "";

this is similar to the following:
Code:
if( isset($HTTP_GET_VARS['contect']) )
 $content = $HTTP_GET_VARS['content'];
else
 $content = "";


you can also use $_GET['content'] which does the same,
or $_POST['content'] which is used for post requests

hope this helps
_________________
Anthony R

Roganty
| Links-Links.co.uk
Back to top View user's profile Send private message Visit poster's website
McGoff
-


Joined: 05 Aug 2004
Posts: 2
Location: Sydney

PostPosted: Thu Aug 05, 2004 2:55 pm    Post subject: Reply with quote

Thanks roganty

that worked :)

I had upgraded from "PHP 4.3.1" to "PHP 4.3.8"

added this to the top of "std.php" and all is good
Code:
<?php $content = $_GET['content'] ; ?>


thanks Again

Keith
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group