Ask a Question related to PHP Development, Design and Development.
-
Logical #1
Query Strings, extract() and including pages
I wanted to do:
include('page.htm?id=12&foo=bar');
But since I can't (and don't want to make another seperate HTTP request
with include('http://...')); I was wondering if there's a function
similar to extract(); that can handle a query string as input, so that I
could:
$id = 12;
$foo = 'bar';
include('page.htm');
I am using this on a 'processor' style page to interperet URLs as
[url]http://foo.com/bla[/url]. It consults a database to manage a large number of
URLs to their pages.
Logical Guest
-
Isolate and extract pages from large doc....
Hey all, sorry to ask for help in first post but I am stuck with a big problem that could be made way easier if only... 1. I have a 136 page pdf.... -
Extract Pages help......
I have a 80 page InDesign CS Document that I have exported to a PDF. I need to extract this to separate PDF files in order to process through our... -
Extract separate pages of a pdf file
Is there any way that I can "automatically" separate a 60 page pdf file into 60 separate pdf files? This is a function that I will use a lot. If... -
extract strings between alternating text
hi there, i want to extract the numbers from this example input: bla trigger3 trigger4 trigger1 blabla trigger1 5000.00 trigger3 trigger1... -
Query apache and URL query strings
Our website uses the standard query string arrangement: something.php?this=1&that=2 We're in the process of moving over to an alternate... -
Pieter Nobels #2
Re: Query Strings, extract() and including pages
Logical wrote:
In your included file, you can use:> I wanted to do:
> include('page.htm?id=12&foo=bar');
>
> But since I can't (and don't want to make another seperate HTTP request
> with include('http://...')); I was wondering if there's a function
> similar to extract(); that can handle a query string as input, so that I
> could:
> $id = 12;
> $foo = 'bar';
> include('page.htm');
global $id, $foo;
And you'll be able to use those variables just like any other variable.
--
Pieter Nobels
Pieter Nobels Guest
-
Chung Leong #3
Re: Query Strings, extract() and including pages
"Logical" <me@privacy.net> wrote in message
news:4119f186$0$31716$61c65585@un-2park-reader-01.sydney.pipenetworks.com.au...Don't quite understand what you're trying to do, but I think parse_str() is> I wanted to do:
> include('page.htm?id=12&foo=bar');
>
> But since I can't (and don't want to make another seperate HTTP request
> with include('http://...')); I was wondering if there's a function
> similar to extract(); that can handle a query string as input, so that I
> could:
> $id = 12;
> $foo = 'bar';
> include('page.htm');
>
> I am using this on a 'processor' style page to interperet URLs as
> [url]http://foo.com/bla[/url]. It consults a database to manage a large number of
> URLs to their pages.
>
what you're looking for.
--
Obey the Clown - [url]http://www.conradish.net/bobo/[/url]
Chung Leong Guest
-
Logical #4
Re: Query Strings, extract() and including pages
Pieter Nobels wrote:
Isn't global-ing variables like that not required?> Logical wrote:
>>>> I wanted to do:
>> include('page.htm?id=12&foo=bar');
>>
>> But since I can't (and don't want to make another seperate HTTP
>> request with include('http://...')); I was wondering if there's a
>> function similar to extract(); that can handle a query string as
>> input, so that I could:
>> $id = 12;
>> $foo = 'bar';
>> include('page.htm');
> In your included file, you can use:
>
> global $id, $foo;
>
> And you'll be able to use those variables just like any other variable.
<http://www.php.net/manual/en/language.variables.scope.php>
I'm actually more concerned about how to get $id and $foo 'out of' the
query string attached to the URL (this part: page.htm?id=12&foo=bar).
Logical Guest
-
Logical #5
Re: Query Strings, extract() and including pages
Chung Leong wrote:
parse_str(), that's it!> "Logical" <me@privacy.net> wrote in message
> news:4119f186$0$31716$61c65585@un-2park-reader-01.sydney.pipenetworks.com.au...
>>>>I wanted to do:
>>include('page.htm?id=12&foo=bar');
>>
>>But since I can't (and don't want to make another seperate HTTP request
>>with include('http://...')); I was wondering if there's a function
>>similar to extract(); that can handle a query string as input, so that I
>>could:
>>$id = 12;
>>$foo = 'bar';
>>include('page.htm');
>>
>>I am using this on a 'processor' style page to interperet URLs as
>>[url]http://foo.com/bla[/url]. It consults a database to manage a large number of
>>URLs to their pages.
>>
>
> Don't quite understand what you're trying to do, but I think parse_str() is
> what you're looking for.
>
>
Thanks.
Logical Guest
-
steve #6
Re: Re: Query Strings, extract() and including pages
"Logical" wrote:
When you include a file, it inherits the scope of variables at the> Pieter Nobels wrote:> seperate HTTP> > Logical wrote:
> >> >> I wanted to do:
> >> include(’page.htm?id=12&foo=bar’);
> >>
> >> But since I can’t (and don’t want to make another> wondering if there’s a> >> request with include(’[url]http://...’));[/url] I was> as> >> function similar to extract(); that can handle a query string> other variable.> >> >> input, so that I could:
> >> $id = 12;
> >> $foo = ’bar’;
> >> include(’page.htm’);
> > In your included file, you can use:
> >
> > global $id, $foo;
> >
> > And you’ll be able to use those variables just like any
>
> Isn’t global-ing variables like that not required?
> <http://www.php.net/manual/en/language.variables.scope.php>
>
> I’m actually more concerned about how to get $id and $foo
> ’out of’ the
> query string attached to the URL (this part:
> page.htm?id=12&foo=bar).
point of inclusion. It means that $id and $foo are available to the
included script already. You would need to declare them as global
only if your include is a function.
steve
--
[url]http://www.dbForumz.com/[/url] This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: [url]http://www.dbForumz.com/PHP-Query-Strings-extract-including-pages-ftopict138606.html[/url]
Visit Topic URL to contact author (reg. req'd). Report abuse: [url]http://www.dbForumz.com/eform.php?p=466974[/url]
steve Guest



Reply With Quote

