php-general Digest 19 Nov 2009 11:39:36 -0000 Issue 6450
Topics (messages 299919 through 299926):
Re: dynamic meta tag and title app?
299919 by: Ashley Sheridan
299920 by: Shawn McKenzie
299921 by: Daevid Vincent
299922 by: Ashley Sheridan
299923 by: Daevid Vincent
299926 by: Ashley Sheridan
Re: tracking forwarded emails using PHP
299924 by: Manuel Lemos
Re: Lightweight web server for Windows?
299925 by: Peter Ford
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
Rather than use Javascript, which would limit your site to only those
browsers that support Javascript, have it enabled and aren't using any
plugins (like Noscript).
You could just use an array with the details in, set the type of page as
one of the first things in your script, and then output what you need
from that.
Thanks,
Ash
http://www.ashleysheridan.co.uk
On Wed, 2009-11-18 at 14:18 -0800, Daevid Vincent wrote:
> I usually just use some JS in the footer.php of the page to go back and
> change the title based upon other stuff, say the user's name or whatever:
>
> <script language="JavaScript" type="text/javascript">
> parent.document.title = "<?= PRODUCT_NAME ?> :: <?= $PAGE_TITLE ?>";
> </script>
>
> > -----Original Message-----
> > From: Jack S [mailto:jacklistm...@gmail.com]
> > Sent: Wednesday, November 18, 2009 8:30 AM
> > To: php-gene...@lists.php.net
> > Subject: [PHP] dynamic meta tag and title app?
> >
> > Hello All,
> >
> > Does anyone have a reference to a program that may be out there to
> > help with using a single header.php for a site, but then dynamically
> > loads different keywords , titles etc based on what page is including
> > the header file?
> >
> > Sample:
> > If home page include it knows the title and other variables would be
> > home, about us would be about etc.
> >
> > --
> > Thanks!
> > Jack
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
--- End Message ---
--- Begin Message ---
Jack S wrote:
> Hello All,
>
> Does anyone have a reference to a program that may be out there to
> help with using a single header.php for a site, but then dynamically
> loads different keywords , titles etc based on what page is including
> the header file?
>
> Sample:
> If home page include it knows the title and other variables would be
> home, about us would be about etc.
>
So if you have an index.php that is controlling your site and you use
get params like page=home, then something like this in the header:
switch ($_GET['page']) {
case 'home':
$title = 'Home';
$description = 'Some description';
$keywords = "some, key, words";
break;
case 'about':
$title = 'about';
$description = 'Some description';
$keywords = "some, key, words";
break;
default
$title = 'whatever';
$description = 'Some description';
$keywords = "some, key, words";
break;
}
include('header.php');
include('whatever_file.php');
If you have separate pages like home.php, then something like this:
// home.php
$title = 'Home';
$description = 'Some description';
$keywords = "some, key, words";
include('header.php');
//header.php
// use the vars from the including file
--
Thanks!
-Shawn
http://www.spidean.com
--- End Message ---
--- Begin Message ---
...right, because people can really use a site today without JS enabled...
please. welcome to the 90's. I challenge you to turn off JS on pretty much
any site with any amount of complexity. bah.
But yes, you could shove it in your <title> tags, but that's not always
convenient. it depends on how you construct your page and the order of
things, and how dynamic you need the title to be.
_____
From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk]
Sent: Wednesday, November 18, 2009 2:24 PM
To: Daevid Vincent
Cc: 'Jack S'; php-gene...@lists.php.net
Subject: RE: [PHP] dynamic meta tag and title app?
Rather than use Javascript, which would limit your site to only those
browsers that support Javascript, have it enabled and aren't using any
plugins (like Noscript).
You could just use an array with the details in, set the type of page as one
of the first things in your script, and then output what you need from that.
Thanks,
Ash
http://www.ashleysheridan.co.uk
On Wed, 2009-11-18 at 14:18 -0800, Daevid Vincent wrote:
I usually just use some JS in the footer.php of the page to go back and
change the title based upon other stuff, say the user's name or whatever:
<script language="JavaScript" type="text/javascript">
parent.document.title = "<?= PRODUCT_NAME ?> :: <?= $PAGE_TITLE ?>";
</script>
> -----Original Message-----
> From: Jack S [mailto:jacklistm...@gmail.com]
> Sent: Wednesday, November 18, 2009 8:30 AM
> To: php-gene...@lists.php.net
> Subject: [PHP] dynamic meta tag and title app?
>
> Hello All,
>
> Does anyone have a reference to a program that may be out there to
> help with using a single header.php for a site, but then dynamically
> loads different keywords , titles etc based on what page is including
> the header file?
>
> Sample:
> If home page include it knows the title and other variables would be
> home, about us would be about etc.
>
> --
> Thanks!
> Jack
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
On Wed, 2009-11-18 at 17:40 -0800, Daevid Vincent wrote:
> ...right, because people can really use a site today without JS enabled...
> please. welcome to the 90's. I challenge you to turn off JS on pretty much
> any site with any amount of complexity. bah.
>
> But yes, you could shove it in your <title> tags, but that's not always
> convenient. it depends on how you construct your page and the order of
> things, and how dynamic you need the title to be.
>
>
> _____
>
> From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk]
> Sent: Wednesday, November 18, 2009 2:24 PM
> To: Daevid Vincent
> Cc: 'Jack S'; php-gene...@lists.php.net
> Subject: RE: [PHP] dynamic meta tag and title app?
>
>
> Rather than use Javascript, which would limit your site to only those
> browsers that support Javascript, have it enabled and aren't using any
> plugins (like Noscript).
>
> You could just use an array with the details in, set the type of page as one
> of the first things in your script, and then output what you need from that.
>
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>
>
> On Wed, 2009-11-18 at 14:18 -0800, Daevid Vincent wrote:
>
> I usually just use some JS in the footer.php of the page to go back and
>
> change the title based upon other stuff, say the user's name or whatever:
>
>
>
> <script language="JavaScript" type="text/javascript">
>
> parent.document.title = "<?= PRODUCT_NAME ?> :: <?= $PAGE_TITLE ?>";
>
> </script>
>
>
>
> > -----Original Message-----
>
> > From: Jack S [mailto:jacklistm...@gmail.com]
>
> > Sent: Wednesday, November 18, 2009 8:30 AM
>
> > To: php-gene...@lists.php.net
>
> > Subject: [PHP] dynamic meta tag and title app?
>
> >
>
> > Hello All,
>
> >
>
> > Does anyone have a reference to a program that may be out there to
>
> > help with using a single header.php for a site, but then dynamically
>
> > loads different keywords , titles etc based on what page is including
>
> > the header file?
>
> >
>
> > Sample:
>
> > If home page include it knows the title and other variables would be
>
> > home, about us would be about etc.
>
> >
>
> > --
>
> > Thanks!
>
> > Jack
>
> >
>
> > --
>
> > PHP General Mailing List (http://www.php.net/)
>
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> >
>
>
>
>
>
>
Actually, you can make a site today that uses JAvascript to enhance
functionality. Something as simple as a title for a page shouldn't be
relying on Javascript to function! It's worth pointing out that in the
UK there is something called the Disability Discrimination Act, in which
it is an offense to unfairly penalise someone based on a disability.
Now, call me stupid, but how many speech or Braille browsers do you know
with Javascript support, and if there are any, do they support all the
Javascript that some people rely on to make their site accomplish basic
functionality
There is an aside to this as well. Javascript is not indexed by search
engines. The closest that even Google comes is to index URL's it find in
the Javascript, but it is not a full Javascript parser itself. How could
any search engine achieve this; the permutations of user interaction are
infinite. So, relying on Javascript to populate basic content means that
it will never be indexed. I mention this last part because most people
don't seem to give a damn about accessibility, but when threatened with
low search rankings they wail like harpies until their site is 'fixed'.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
> Actually, you can make a site today that uses JAvascript to enhance
> functionality.
I'd say a <title> fits that category. You can live without it.
> Something as simple as a title for a page shouldn't be
> relying on Javascript to function!
Shouldn't = I agree.
Sometimes the way a page is coded, it does have to be that way.
I'm working on one now, where the way the UX guy made the DIV's (so that
when using
A mobile phone, the menu is at the bottom) it makes it very difficult to
populate
The title with my gui_header.php and gui_footer.php and gui_nav.php
components.
Also, I render in a top down fashion, so I output:
1. the header,
2. then the navigation,
3. body content
4. footer
I can't populate the title when I've already output it and don't know what
page in the navigation the user is currently on. Sure I could jump through
hoops and pre-process the nav and use output buffering or something, but
whatev.
Hence, I use JS to populate at the end of the PHP rendering.
Just sayin'. ;-)
> It's worth pointing out that in the
> UK there is something called the Disability Discrimination
> Act, in which
> it is an offense to unfairly penalise someone based on a disability.
> Now, call me stupid, but how many speech or Braille browsers
> do you know
> with Javascript support, and if there are any, do they support all the
> Javascript that some people rely on to make their site
> accomplish basic
> functionality
Not to sound like a jerk or diminish the plight of disabled people,
but how many Braille browsers can parse Flash? Or use AJAX then?
Or Silverlight? Or umpteen other technologies.
Your point, while good in theory is far from practical or realistic.
> There is an aside to this as well. Javascript is not indexed by search
> engines. The closest that even Google comes is to index URL's
> it find in
> the Javascript, but it is not a full Javascript parser
> itself. How could
> any search engine achieve this; the permutations of user
> interaction are
> infinite. So, relying on Javascript to populate basic content
> means that
> it will never be indexed. I mention this last part because most people
> don't seem to give a damn about accessibility, but when
> threatened with
> low search rankings they wail like harpies until their site
> is 'fixed'.
Having said that, you are correct and if SEO is your goal, then certainly
<title> ranks up there.
http://www.seomoz.org/article/search-ranking-factors
http://www.seobook.com/video-google-seo-friendly-page-titles
For my needs, SEO is NOT a factor as this is a SaaS site and our customers
subscribe to it as an ancillary service to a multi-million dollar product we
sell them. The site is used for reports/statistics the hardware generates.
In fact, we don't even want Google or other engines to know about it -- that
just invites crackers and script kiddies ;-)
Daevid.
http://daevid.com
--- End Message ---
--- Begin Message ---
On Wed, 2009-11-18 at 21:42 -0800, Daevid Vincent wrote:
> > Actually, you can make a site today that uses JAvascript to enhance
> > functionality.
>
> I'd say a <title> fits that category. You can live without it.
>
> > Something as simple as a title for a page shouldn't be
> > relying on Javascript to function!
>
> Shouldn't = I agree.
>
> Sometimes the way a page is coded, it does have to be that way.
That just means that the code is poorly thought out. Consider:
$body = "html and content here";
Look, now we have the body content, and it's not printed. Do this at the
top of the page before any output and you know what to expect.
Frameworks do it like this, it's not something new and magic I've just
thought up.
> I'm working on one now, where the way the UX guy made the DIV's (so that
> when using
> A mobile phone, the menu is at the bottom) it makes it very difficult to
> populate
> The title with my gui_header.php and gui_footer.php and gui_nav.php
> components.
>
> Also, I render in a top down fashion, so I output:
>
> 1. the header,
> 2. then the navigation,
> 3. body content
> 4. footer
>
> I can't populate the title when I've already output it and don't know what
> page in the navigation the user is currently on. Sure I could jump through
> hoops and pre-process the nav and use output buffering or something, but
> whatev.
That just shows that the code hasn't been thought out as well as it
could be then
>
> Hence, I use JS to populate at the end of the PHP rendering.
>
> Just sayin'. ;-)
>
> > It's worth pointing out that in the
> > UK there is something called the Disability Discrimination
> > Act, in which
> > it is an offense to unfairly penalise someone based on a disability.
> > Now, call me stupid, but how many speech or Braille browsers
> > do you know
> > with Javascript support, and if there are any, do they support all the
> > Javascript that some people rely on to make their site
> > accomplish basic
> > functionality
>
> Not to sound like a jerk or diminish the plight of disabled people,
> but how many Braille browsers can parse Flash? Or use AJAX then?
> Or Silverlight? Or umpteen other technologies.
Exactly, and a site should not be relying solely on them either. The WAI
guidelines clearly show that alternative content should be offered in
the case of plugins such as Flash and Silverlight where possible, like
text transcripts of audio dialogue, and scene descriptions for video.
Sometimes it isn't possible, as in the case of some online games (spot
the difference perhaps) built in Flash, but these are fringe cases and
not the majority.
> Your point, while good in theory is far from practical or realistic.
>
It's not about practicality, but consideration. A blind user can no
longer rely on your javascript-only menus and Ajax-driven content.
Someone with severe arthritis might navigate with their keyboard and not
the mouse, what happens to all those Javascript onmouseover event
handlers now?
I've been arguing this whole point for a few years now to many people.
It's not an issue that will go away with the argument that it's just not
feasible or realistic or practical. There are 1.6million registered
blind in the UK, which is not a small number no matter how you try and
twist the statistics. 3.4 millions people have a disability that
prevents them using a standard keyboard and mouse. Are you really
willing to shun so many people because your work would become more
difficult otherwise?
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
Hello,
on 11/18/2009 06:32 AM Angelo Zanetti said the following:
> 1. When an email is opened. I think this can be done with an img tag where
> the src is a php script. We can then track when that script is called and
> from whom.
>
> 2. Track if the email was forwarded, not sure how this is done but it should
> be possible any ideas?
>
> I basically need advice on the second point and to know that the first point
> I am heading in the correct direction.
I think iy would be more objective if you would tell why you need those
things because there may be different solution than what you think is
the way to go.
In this slide presentation there are solutions for things that what you
ask may be used but there are other solutions.
For instance slide 18 talks about solutions to know when a message was
received. Slide 17 talks about handling received messages.
http://www.phpclasses.org/browse/video/3/package/9.html
Other slides talk about solutions to other common problems. What exactly
do you want to solve?
--
Regards,
Manuel Lemos
Find and post PHP jobs
http://www.phpclasses.org/jobs/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--- End Message ---
--- Begin Message ---
O. Lavell wrote:
>
> Also, it is not for daily use. I have two desktop computers and a server
> for that. This is for when I have to go by train or something.
>
> Essentially it is just an extra plaything.
>
Does the battery still hold enough charge for a train journey - that always
seems to be the first thing that goes on old laptops.
They make really good low-power servers for stuff like DNS or even firewalling
(as long as you can plug in enough network cards), but only when on mains power
:(
--
Peter Ford phone: 01580 893333
Developer fax: 01580 893399
Justcroft International Ltd., Staplehurst, Kent
--- End Message ---