RE: [PHP] Re: include help please

2003-08-01 Thread Ford, Mike [LSS]
> -Original Message- > From: Jennifer Goodie [mailto:[EMAIL PROTECTED] > Sent: 31 July 2003 22:42 > > > if (isset($page)) { > > include $$_GET['page']; > > } else { > > $page = $home; > > include $page; > > } > > > > would that be right? > > or should i use > > > > if (isset($page)) { > >

Re: [PHP] Re: include help please

2003-08-01 Thread LoonySalmon
nope, it doesn't work. it'll only call up the variables that were specified in my files.inc.php...well so far at least "Curt Zirzow" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > * Thus wrote LoonySalmon ([EMAIL PROTECTED]): > > > > i want to call up my contact page, but how

Re: [PHP] Re: include help please

2003-07-31 Thread Curt Zirzow
* Thus wrote LoonySalmon ([EMAIL PROTECTED]): > > i want to call up my contact page, but how do i do it? > > http://localhost/index.php?page=$contact I hope you cant use something like: http://localhost/index.php?page=%2Fetc%2Fpasswd Curt -- "I used to think I was indecisive, but now I'm no

Re: [PHP] Re: include help please

2003-07-31 Thread LoonySalmon
thanks jeff harris, that is exactly what my problem was, now it works good night all thank a million "Jeff Harris" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Aug 1, 2003, "LoonySalmon" claimed that: > > |and btw, this is my code now: > | > | |require 'files.inc.php'; > | >

Re: [PHP] Re: include help please

2003-07-31 Thread Jeff Harris
On Aug 1, 2003, "LoonySalmon" claimed that: |and btw, this is my code now: | | -- Is $main being set inside a function? http://www.php.net/language.variables.scope Also, for future compatability, you should probably change the 3rd line to "if (isset($_GET['page'])) {" That will also help incase

Re: [PHP] Re: include help please

2003-07-31 Thread LoonySalmon
and btw, this is my code now: "Loonysalmon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > well crap, it turns out that i'm back to step 1, but with more code > it won't load up the other files now when defined through the url. i guess > that there is something wrong, but w

Re: [PHP] Re: include help please

2003-07-31 Thread LoonySalmon
well crap, it turns out that i'm back to step 1, but with more code it won't load up the other files now when defined through the url. i guess that there is something wrong, but what could it be? "Loonysalmon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > if (isset($page)) { > i

Re: [PHP] Re: include help please

2003-07-31 Thread Brad Pauly
Jennifer Goodie wrote: I don't think I'd let someone pass any page they wanted via a get and just include that page. If you have URL fopen wrappers on I can create a page on my server and include it to your page and pretty much execute any code I want on your server. example: http://www.yourdomai

RE: [PHP] Re: include help please

2003-07-31 Thread Jennifer Goodie
> if (isset($page)) { > include $$_GET['page']; > } else { > $page = $home; > include $page; > } > > would that be right? > or should i use > > if (isset($page)) { > include $$_GET['page']; > } else { > include $home; > } > > hopefully that's right. if so, pretty good for a n00b > I don't think I

Re: [PHP] Re: include help please

2003-07-31 Thread LoonySalmon
for some odd reason, $home wasn't working, so i changed home to main and now it works thanks for all the good support guys/gals? L00NY54LM0N - 16 year old coder in the makin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: include help please

2003-07-31 Thread Matt Matijevich
is there anyway where i can check if page is defined in the url? not sure I know exactly what you mean but I think you could use something like this $foo = @include("index.php"); if ($foo) { //index.php was valid } else { //index.php was not valid } there also might be a better way to do th

Re: [PHP] Re: include help please

2003-07-31 Thread LoonySalmon
if (isset($page)) { include $$_GET['page']; } else { $page = $home; include $page; } would that be right? or should i use if (isset($page)) { include $$_GET['page']; } else { include $home; } hopefully that's right. if so, pretty good for a n00b -- PHP General Mailing List (http://www.php.n

Re: [PHP] Re: include help please

2003-07-31 Thread Brad Pauly
LoonySalmon wrote: if page is defined in url, include page defined else include home You are on the right track. Take a look at the manual. http://us4.php.net/manual/en/index.php http://us4.php.net/isset - Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://ww

Re: [PHP] Re: include help please

2003-07-31 Thread LoonySalmon
ok i have that done, but now i can't just have index.php because i get an error is there anyway where i can check if page is defined in the url? if so, could somebody make me a simple script? this is my first time with php i'm guessing that it would be something like this, but summed up if pa

Re: [PHP] Re: include help please

2003-07-31 Thread Brad Pauly
LoonySalmon wrote: that isn't really what i want i want to have a seperate file where i declare the variables. what i'm getting at here is this, well, take a look at this page: http://l33trus.servebeer.com/site/index.php i just want to include a page into the table where it says that it's included

Re: [PHP] Re: include help please

2003-07-31 Thread LoonySalmon
that isn't really what i want i want to have a seperate file where i declare the variables. what i'm getting at here is this, well, take a look at this page: http://l33trus.servebeer.com/site/index.php i just want to include a page into the table where it says that it's included what i'm going fo

Re: [PHP] Re: include help please

2003-07-31 Thread Chris Shiflett
> http://localhost/index.php?page=contact.html > > And get rid of your hard-coded set for $contact, and use > $_GET['contact'] instead. My apologies. I meant $_GET['page']. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mai

Re: [PHP] Re: include help please

2003-07-31 Thread Chris Shiflett
--- LoonySalmon <[EMAIL PROTECTED]> wrote: > INDEX.PHP > > require 'files.inc.php'; > $page = $home; > include $page; > ?> > > FILES.INC.PHP > > $home = 'home.html'; > $forum = 'forum/index.php'; > $contact = 'contact.html'; > ?> > > http://localhost/index.php?page=$contact http://localhost/in