Re: getting a variable from a file

From: Date: Sat, 24 Mar 2007 00:10:38 +0000
Subject: Re: getting a variable from a file
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-251236@lists.php.net to get a copy of this message
On Fri, March 23, 2007 5:47 am, Ross wrote: > I am using a script to generate a sitemap. It displays the page names > (mypage.php) but I want it to display the titles. The page heads and > <title> > are generated dynamically so the line below does not work > > if(preg_match("'<title>(.+)</title>'i", $f, $matches)){ > > However all the paged titles are stored in a variable $pageTitle. On > every > page like this > > $pageTitle="Who We Are"; > > how can I retrieve this variable? I tried > > echo $pageTitle and $_GET['pageTitle'] I'm confused... In your sitemap script, are you scraping your own site? The preg_match should work. but you could punt and use strpos since you know exactly what case/attributes are on your own TITLE tags. Or are you trying to have the page output update the sitemap on every page view? Or...??? -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.general (#251236) next »