[PHP] Newsgroup status

2011-04-27 Thread Al

Is this group off the air or just no topics being posted?

I've not seen it so quiet in years.

Al.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Newsgroup status

2011-04-27 Thread Joshua Kehn
If this is the PHP list thinking of it's moderately active. I sometimes forget 
which ones I'm subscribed to.

Regards,

-Josh___
Joshua Kehn | josh.k...@gmail.com
http://joshuakehn.com

On Wednesday, April 27, 2011 at 11:52 AM, Al wrote:
Is this group off the air or just no topics being posted?
> 
> I've not seen it so quiet in years.
> 
> Al.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


Re: [PHP] Newsgroup status

2011-04-27 Thread Steve Staples
On Wed, 2011-04-27 at 11:54 -0400, Joshua Kehn wrote:
> If this is the PHP list thinking of it's moderately active. I sometimes 
> forget which ones I'm subscribed to.
> 
> Regards,
> 
> -Josh___
> Joshua Kehn | josh.k...@gmail.com
> http://joshuakehn.com
> 
> On Wednesday, April 27, 2011 at 11:52 AM, Al wrote:
> Is this group off the air or just no topics being posted?
> > 
> > I've not seen it so quiet in years.
> > 
> > Al.
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 

I guess we've all figured out how to deal with our problems... 

TO THE CLOUD!!


Steve.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Newsgroup status

2011-04-27 Thread Joshua Kehn
On Wednesday, April 27, 2011 at 12:20 PM, Steve Staples wrote:
On Wed, 2011-04-27 at 11:54 -0400, Joshua Kehn wrote:
> > If this is the PHP list thinking of it's moderately active. I sometimes 
> > forget which ones I'm subscribed to.
> > 
> > Regards,
> > 
> > -Josh___
> > Joshua Kehn | josh.k...@gmail.com
> > http://joshuakehn.com
> 
> I guess we've all figured out how to deal with our problems... 
> 
> TO THE CLOUD!!
> 
> 
> Steve.

As EC2 has shown, while clouds might look safe all white and fluffy, sometimes 
they can create drastic storms. 

Regards,

-Josh___
Joshua Kehn | josh.k...@gmail.com
http://joshuakehn.com




Re: [PHP] Newsgroup status

2011-04-27 Thread Jason Pruim
It used to be alot busier. But lately it has slowed down... It's up to us 
though to fix that!

It's time for the next generation to start picking up the slack and helping out 
and asking questions :)

Jason Pruim

On Apr 27, 2011, at 11:54 AM, Joshua Kehn  wrote:

> If this is the PHP list thinking of it's moderately active. I sometimes 
> forget which ones I'm subscribed to.
> 
> Regards,
> 
> -Josh___
> Joshua Kehn | josh.k...@gmail.com
> http://joshuakehn.com
> 
> On Wednesday, April 27, 2011 at 11:52 AM, Al wrote:
> Is this group off the air or just no topics being posted?
>> 
>> I've not seen it so quiet in years.
>> 
>> Al.
>> 
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] files outside of the web tree

2011-04-27 Thread Jim Giner
I have managed to build include files and store them above my public folder 
and the called pages manage to find them from the public folder and properly 
include them.  My problem is with the html src= attribute.  I have uploaded 
photos to  be included in my web pages and I didn't want them in the web 
tree so I moved them above it also. I use php to get the root folder's name 
and then I add "../photos/" to the filename's path, but now my tags can't 
find them.  Can I not do this? 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] files outside of the web tree

2011-04-27 Thread Joshua Kehn
On Wednesday, April 27, 2011 at 1:08 PM, Jim Giner wrote:
I have managed to build include files and store them above my public folder 
> and the called pages manage to find them from the public folder and properly 
> include them. My problem is with the html src= attribute. I have uploaded 
> photos to be included in my web pages and I didn't want them in the web 
> tree so I moved them above it also. I use php to get the root folder's name 
> and then I add "../photos/" to the filename's path, but now my tags can't 
> find them. Can I not do this? 
> 
Nope, static elements need to be stored in a web accessible directory. If you 
could access things by saying `../` then that would defeat the purpose of 
storing things where they aren't accessible.

Regards,

-Josh___
Joshua Kehn | josh.k...@gmail.com
http://joshuakehn.com




Re: [PHP] files outside of the web tree

2011-04-27 Thread Jason Pruim


Jason Pruim

On Apr 27, 2011, at 1:11 PM, Joshua Kehn  wrote:

> On Wednesday, April 27, 2011 at 1:08 PM, Jim Giner wrote:
> I have managed to build include files and store them above my public folder 
>> and the called pages manage to find them from the public folder and properly 
>> include them. My problem is with the html src= attribute. I have uploaded 
>> photos to be included in my web pages and I didn't want them in the web 
>> tree so I moved them above it also. I use php to get the root folder's name 
>> and then I add "../photos/" to the filename's path, but now my tags can't 
>> find them. Can I not do this? 
>> 
> Nope, static elements need to be stored in a web accessible directory. If you 
> could access things by saying `../` then that would defeat the purpose of 
> storing things where they aren't accessible.
> 

Actually it is possible but not the way he was doing it...  Look at dispatch 
model scripts I believe. 

Those (if my memory is correct) will allow you to serve files the way you are 
wanting to. 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Newsgroup status

2011-04-27 Thread Geoff Lane
On Wednesday, April 27, 2011, Jason Pruim wrote:

> It's time for the next generation to start picking up the slack and
> helping out and asking questions :)

To be honest, I've started three or four cries for help in the last
few days. However, on each occasion I've spotted the answer before
actually hitting 'Send' (and just as well because all were due to
typos!)

However, I do have one residual question. I suspect the short answer
to this is "No", but since the list is quiet I'll ask anyway:

Q: Is it possible to check whether Javascript is available on the
client without using client-side Javascript to create a form and hence
pass a variable that will only be set if Javascript is available on
the client? Is there something in $_SERVER etc. that can provide this
info?

TIA,

-- 
Geoff


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: files outside of the web tree

2011-04-27 Thread Shawn McKenzie
On 04/27/2011 12:08 PM, Jim Giner wrote:
> I have managed to build include files and store them above my public folder 
> and the called pages manage to find them from the public folder and properly 
> include them.  My problem is with the html src= attribute.  I have uploaded 
> photos to  be included in my web pages and I didn't want them in the web 
> tree so I moved them above it also. I use php to get the root folder's name 
> and then I add "../photos/" to the filename's path, but now my tags can't 
> find them.  Can I not do this? 
> 
> 

One way to do this is to have a PHP file as the image source.  The PHP
file would grab the image outside of the web root and echo it along with
the proper headers.  This is the same principle as storing the binary
image data in a database.




//photo.php
$file = '/path/to/photos/' . basename($_GET['name']);
$type = mime_content_type($file);
header('Content-type: $type');
readfile($file);

-- 
Thanks!
-Shawn
http://www.spidean.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Flattery will get you nowhere

2011-04-27 Thread Marc Guay
I just googled up "php tedd form validation" and can't find a single
reference.  What does this mean, that I respect tedd's skills or that
he needs better SEO?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Flattery will get you nowhere

2011-04-27 Thread Joshua Kehn
On Wednesday, April 27, 2011 at 3:54 PM, Marc Guay wrote:
I just googled up "php tedd form validation" and can't find a single
> reference. What does this mean, that I respect tedd's skills or that
> he needs better SEO?

I wasn't aware Tedd had a form validation lib written.

Regards,

-Josh___
Joshua Kehn | josh.k...@gmail.com
http://joshuakehn.com




Re: [PHP] Flattery will get you nowhere

2011-04-27 Thread Daniel Brown
On Wed, Apr 27, 2011 at 15:54, Marc Guay  wrote:
> I just googled up "php tedd form validation" and can't find a single
> reference.  What does this mean, that I respect tedd's skills or that
> he needs better SEO?

Your point is valid, Marc, but if you change 'php' to 'php1' in
that query, you'll get a whole new set of results.

-- 

Network Infrastructure Manager
http://www.php.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Flattery will get you nowhere

2011-04-27 Thread HallMarc Websites
> I just googled up "php tedd form validation" and can't find a single
reference.
> What does this mean, that I respect tedd's skills or that he needs better
SEO?
> 

OOH!! I KNOW! I KNOW! PICK ME! PICK ME! Um Both? No wait, maybe Tedd
doesn't want his stuff found?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Newsgroup status

2011-04-27 Thread Ashley Sheridan
On Wed, 2011-04-27 at 18:42 +0100, Geoff Lane wrote:

> On Wednesday, April 27, 2011, Jason Pruim wrote:
> 
> > It's time for the next generation to start picking up the slack and
> > helping out and asking questions :)
> 
> To be honest, I've started three or four cries for help in the last
> few days. However, on each occasion I've spotted the answer before
> actually hitting 'Send' (and just as well because all were due to
> typos!)
> 
> However, I do have one residual question. I suspect the short answer
> to this is "No", but since the list is quiet I'll ask anyway:
> 
> Q: Is it possible to check whether Javascript is available on the
> client without using client-side Javascript to create a form and hence
> pass a variable that will only be set if Javascript is available on
> the client? Is there something in $_SERVER etc. that can provide this
> info?
> 
> TIA,
> 
> -- 
> Geoff
> 
> 


Firstly, please do not hijack a thread, if you have a question, start
your own. We won't bite if you create new threads, whereas we might a
little if you hijack ;)

There are ways to detect the general capabilities of the client machine,
however they are generalisations, and may not be accurate. Try and grab
an up-to-date browscap.ini file, and use this in conjunction with the
user agent string found in the $_SERVER array. This should tell you
whether the user agent is capable of running Javascript.

Bear in mind that this has several problems:


  * A browser might be Javascript capable but may have it turned off
or disabled by a plugin
  * The Javascript may have been filtered out by a a firewall (which
is rare but possible)
  * A browser could be masking as another one by giving the wrong
user agent string
  * A browser may not even give up the user agent string, or it may
have been filtered out somewhere along the line


A better approach is to only use the Javascript to enhance the site
progressively, and not rely on it for functionality. However, if you
really must rely on Javascript and you don't care about going to hell
for it, then why not use Javascript to pull in the content via Ajax and
leave some sort of apology notice in the cases where the content can't
be displayed. It's not often though that you really can't do something
without Javascript, unless you're doing something incredibly complex
like creating the next Google Docs. Even Facebook works on mobile
devices without Javascript.

-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] Flattery will get you nowhere

2011-04-27 Thread Robert Cummings

On 11-04-27 04:47 PM, HallMarc Websites wrote:

I just googled up "php tedd form validation" and can't find a single

reference.

What does this mean, that I respect tedd's skills or that he needs better

SEO?




OOH!! I KNOW! I KNOW! PICK ME! PICK ME! Um Both? No wait, maybe Tedd
doesn't want his stuff found?


Tedd who?

;)

Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Newsgroup status

2011-04-27 Thread Yico Gaga
 well, no question ,may be a big question!
2011/4/28 Geoff Lane 

> On Wednesday, April 27, 2011, Jason Pruim wrote:
>
> > It's time for the next generation to start picking up the slack and
> > helping out and asking questions :)
>
> To be honest, I've started three or four cries for help in the last
> few days. However, on each occasion I've spotted the answer before
> actually hitting 'Send' (and just as well because all were due to
> typos!)
>
> However, I do have one residual question. I suspect the short answer
> to this is "No", but since the list is quiet I'll ask anyway:
>
> Q: Is it possible to check whether Javascript is available on the
> client without using client-side Javascript to create a form and hence
> pass a variable that will only be set if Javascript is available on
> the client? Is there something in $_SERVER etc. that can provide this
> info?
>
> TIA,
>
> --
> Geoff
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


[PHP] Detecting Javascript (was Re: Newsgroup status)

2011-04-27 Thread Geoff Lane
 On Wednesday, April 27, 2011, Ashley Sheridan wrote:

> Firstly, please do not hijack a thread, if you have a question, start
> your own. We won't bite if you create new threads, whereas we might a
> little if you hijack ;)

Ouch! My apologies - Hijacking was not intended and I've changed the
subject to reflect that this is a distinct 'branch'.

> There are ways to detect the general capabilities of the client machine,
> however they are generalisations, and may not be accurate. Try and grab
> an up-to-date browscap.ini file, and use this in conjunction with the
> user agent string found in the $_SERVER array. This should tell you
> whether the user agent is capable of running Javascript.

Thanks for your reply. As you wrote, identifying the 'alleged' user
agent in that way is not accurate. For example, I run Opera with JS
disabled to check what my work looks like without JS and I know some
who run without JS for security reasons.

My immediate concern is a large form where two data entry fields are
implemented as image maps. The easiest way of presenting this to the
user is as a DHTML tabbed page with AJAX to store x/y locations of the
image map clicks in hidden fields.

However, the page still has to work without JS. So my thought was that
if I could detect whether JS is available at the client, I could serve
different content dependent on JS status. AFAICT, there's nothing that
lets me know 'at first hit' although for pages that aren't directly
accessed (e.g. stuff for which you need to log in each session), it's
possible to use Javascript to write a hidden field. When the user logs
in, this is used to detect that JS is available and to set a session
cookie that you can use on subsequent pages to determine that JS is
there.

That said, I've done some sideways thinking. If JS is not available
then client-side scripts don't run. Clicking image maps or submit
buttons produce the default behaviour and onClick, onChange etc.
events aren't triggered. So I've laid out the page for no JS and then
used an onLoad function to hide the appropriate content. I've also
coded the form handling PHP script to refresh the form with the
appropriate values if one of the image maps is clicked. That way, the
onClick etc. events can be used to trigger AJAX if JS is available and
make an 'interim form submission' if it's not.

However, it would be so much simpler if I could tell straight off and
for sure whether JS was available; but if this isn't possible I guess
it'll be a limitation of HTTP rather than PHP.

Thanks again,

Geoff


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Flattery will get you nowhere

2011-04-27 Thread Jason Pruim

On Apr 27, 2011, at 4:58 PM, Robert Cummings wrote:

> On 11-04-27 04:47 PM, HallMarc Websites wrote:
>>> I just googled up "php tedd form validation" and can't find a single
>> reference.
>>> What does this mean, that I respect tedd's skills or that he needs better
>> SEO?
>>> 
>> 
>> OOH!! I KNOW! I KNOW! PICK ME! PICK ME! Um Both? No wait, maybe Tedd
>> doesn't want his stuff found?
> 
> Tedd who?
> 
> ;)

This tedd right? http://www.tednugent.com/
 
;)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Destroying cookies... not working

2011-04-27 Thread Rick Dwyer

Hello all.

I have a logout page that should be destroying cookies when loaded...  
but it is not.


setcookie("mycookie", "False", time() - 3600, "/");

However, I can still pull values stored in the cookie and I can still  
see the cookie in my browser's "Show Cookies" window.


So I tried the following:

setcookie('mycookie','',time()-3600);
unset($_COOKIE['mycookie']);

Still no luck.

Any help with this is appreciated.



 --Rick

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Destroying cookies... not working

2011-04-27 Thread Andre Polykanine
Hello Rick,

Pay attention how you did set the cookie.
When I tried to unset the cookie using only three parameters, I got no
luck because I had set it using five:
setCookie ("mycookie", "", time()-32557600, '/', '.oire.org');

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
My blog: http://oire.org/menelion (mostly in Russian)
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion

 Original message 
From: Rick Dwyer 
To: php-general@lists.php.net
Date created: , 2:16:43 AM
Subject: [PHP] Destroying cookies... not working


  Hello all.

I have a logout page that should be destroying cookies when loaded...  
but it is not.

setcookie("mycookie", "False", time() - 3600, "/");

However, I can still pull values stored in the cookie and I can still  
see the cookie in my browser's "Show Cookies" window.

So I tried the following:

setcookie('mycookie','',time()-3600);
unset($_COOKIE['mycookie']);

Still no luck.

Any help with this is appreciated.



  --Rick

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: files outside of the web tree

2011-04-27 Thread Jim Giner
I think I see what you mean but I guess if that's the way it's meant to be 
there must not be a great risk to my uploaded files.
Thanks! 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] refreshing pages in the cache

2011-04-27 Thread Jim Giner
I"m trying to make my webpages display random photos on a border.  Got it 
all working now but have a question about the IE cache.  Seems that once the 
page has been displayed, no amount of "refresh" will make the page "rebuild" 
and thus show 'different' pics the second time around.

Can php do something about a page in the cache?  I know that the cache is 
there to speed up performance and all, but I thought this random image thing 
would work if they just hit F5 to see a new array of images.

Can php detect a user-requested 'refresh'? 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] refreshing pages in the cache

2011-04-27 Thread Sean Greenslade
On Wed, Apr 27, 2011 at 4:42 PM, Jim Giner wrote:

> I"m trying to make my webpages display random photos on a border.  Got it
> all working now but have a question about the IE cache.  Seems that once
> the
> page has been displayed, no amount of "refresh" will make the page
> "rebuild"
> and thus show 'different' pics the second time around.
>
> Can php do something about a page in the cache?  I know that the cache is
> there to speed up performance and all, but I thought this random image
> thing
> would work if they just hit F5 to see a new array of images.
>
> Can php detect a user-requested 'refresh'?
>
>
>
Though you can't control everything, headers can help.

https://secure.wikimedia.org/wikipedia/en/wiki/List_of_HTTP_header_fields<%20https://secure.wikimedia.org/wikipedia/en/wiki/List_of_HTTP_header_fields>

http://us3.php.net/manual/en/function.header.php

Cache-Control is a nice one. =)

-- 
--Zootboy

Sent from my PC.


Re: [PHP] refreshing pages in the cache

2011-04-27 Thread Jim Giner
thanks for the input but your first link is invalid and the second I don't 
understand why you sent me.
Perhaps you could explain? 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Destroying cookies... not working

2011-04-27 Thread Rick Dwyer

The following did the trick... is there any reason I should not use it?

$name="mysession";
setcookie($name);

 --Rick


On Apr 27, 2011, at 7:16 PM, Rick Dwyer wrote:


Hello all.

I have a logout page that should be destroying cookies when  
loaded... but it is not.


setcookie("mycookie", "False", time() - 3600, "/");

However, I can still pull values stored in the cookie and I can  
still see the cookie in my browser's "Show Cookies" window.


So I tried the following:

setcookie('mycookie','',time()-3600);
unset($_COOKIE['mycookie']);

Still no luck.

Any help with this is appreciated.



--Rick

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Destroying cookies... not working

2011-04-27 Thread Sean Greenslade
On Wed, Apr 27, 2011 at 8:52 PM, Rick Dwyer  wrote:

> The following did the trick... is there any reason I should not use it?
>
> $name="mysession";
> setcookie($name);
>
>  --Rick


Only if you're OCD, since the cookie is still technically there, just empty.
Without setting the expire arg, the browser will keep it until closed.
-- 
--Zootboy

Sent from my PC.


Re: [PHP] refreshing pages in the cache

2011-04-27 Thread Sean Greenslade
On Wed, Apr 27, 2011 at 8:50 PM, Jim Giner wrote:

> thanks for the input but your first link is invalid and the second I don't
> understand why you sent me.
> Perhaps you could explain?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Sure. In order to "tell" the browser to not cache a page, you need to set
the header "Cache-Control: no-cache". This can be done by the PHP command

header("Cache-Control: no-cache");



-- 
--Zootboy

Sent from my PC.


Re: [PHP] refreshing pages in the cache

2011-04-27 Thread Jim Giner
ok - I'm lost.  What do I do with this knowledge?

- Original Message - 
From: "Sean Greenslade" 

>>
> Sure. In order to "tell" the browser to not cache a page, you need to set
> the header "Cache-Control: no-cache". This can be done by the PHP command
>
> header("Cache-Control: no-cache");
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] refreshing pages in the cache

2011-04-27 Thread Ross Hansen

You need to still put in the standard PHP tags as you would normally and it is 
just another line of code.

e.g



> To: php-general@lists.php.net
> From: jim.gi...@albanyhandball.com
> Date: Wed, 27 Apr 2011 21:33:16 -0400
> Subject: Re: [PHP] refreshing pages in the cache
> 
> ok - I'm lost.  What do I do with this knowledge?
> 
> - Original Message - 
> From: "Sean Greenslade" 
> 
> >>
> > Sure. In order to "tell" the browser to not cache a page, you need to set
> > the header "Cache-Control: no-cache". This can be done by the PHP command
> >
> > header("Cache-Control: no-cache");
> >
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
  

Re: [PHP] refreshing pages in the cache

2011-04-27 Thread Jim Giner
So - it's not an html attribute - it's a PHP command that precedes ALL my 
html headers?

"Ross Hansen"  wroteYou need to still put in the 
standard PHP tags as you would normally and it is just another line of code.

e.g





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] refreshing pages in the cache

2011-04-27 Thread Ross Hansen

I am not 100% with this so i might not have the full picture however, it
 is just a command that would have the server tell the client not to 
cache the page. from something i just read you would want to execute 
this from the server, as by the time it gets to the client it would be 
too late as it would have already been cached.


Have a look at this page also


http://php.net/manual/en/function.header.php


There is a quick section on this, it doesn't explain much detail but it does 
give an idea.

> To: php-general@lists.php.net
> From: jim.gi...@albanyhandball.com
> Date: Wed, 27 Apr 2011 21:52:57 -0400
> Subject: Re: [PHP] refreshing pages in the cache
> 
> So - it's not an html attribute - it's a PHP command that precedes ALL my 
> html headers?
> 
> "Ross Hansen"  wroteYou need to still put in the 
> standard PHP tags as you would normally and it is just another line of code.
> 
> e.g
> 
>   header("Cache-Control: no-cache");
> ?>
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
  

Re: [PHP] refreshing pages in the cache

2011-04-27 Thread Jim Giner
Must be doing something wrong.  Besides not helping my pages to re-build, it 
actually ruins the presentation of a couple of my pages, even tho they are 
all using the exact same includes with only some dummy content in one div 
different than all the other pages.

I added this line to my existing "starter" page code:



the above lines were added just ahead of the following - which was the 
absolute first line of output generated by my "built page" - line 1 of my 
first included file:

http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] refreshing pages in the cache

2011-04-27 Thread Ross Hansen

You don't want to echo it as it isn't something that is going to HTML. it is 
native PHP. the correct command should be


See how this goes.



> To: php-general@lists.php.net
> From: jim.gi...@albanyhandball.com
> Date: Wed, 27 Apr 2011 22:12:23 -0400
> Subject: Re: [PHP] refreshing pages in the cache
> 
> Must be doing something wrong.  Besides not helping my pages to re-build, it 
> actually ruins the presentation of a couple of my pages, even tho they are 
> all using the exact same includes with only some dummy content in one div 
> different than all the other pages.
> 
> I added this line to my existing "starter" page code:
> 
> 
> 
> the above lines were added just ahead of the following - which was the 
> absolute first line of output generated by my "built page" - line 1 of my 
> first included file:
> 
>  
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
  

Re: [PHP] Flattery will get you nowhere

2011-04-27 Thread tedd

At 3:54 PM -0400 4/27/11, Marc Guay wrote:

I just googled up "php tedd form validation" and can't find a single
reference.  What does this mean, that I respect tedd's skills or that
he needs better SEO?



What are you are looking for?

Cheers,

tedd


--
---
http://sperling.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Javascript detection

2011-04-27 Thread tedd

At 6:42 PM +0100 4/27/11, Geoff Lane wrote:

However, I do have one residual question. I suspect the short answer
to this is "No", but since the list is quiet I'll ask anyway:

Q: Is it possible to check whether Javascript is available on the
client without using client-side Javascript to create a form and hence
pass a variable that will only be set if Javascript is available on
the client? Is there something in $_SERVER etc. that can provide this
info?


Geoff:

To answer your question in a new thread.

No, the $_SERVER super-global isn't going to give you anything nor is 
anything else like it.


You see, PHP has a difficult time detecting IF Javascript is turned 
ON in the client's browser because PHP is history by the time the 
browser does anything, including running Javascript.


As Yogi Berra once said; "It's always hard to predict things 
especially when it deals with the future."


However, there are two ways to "kind-of" doing it:

Way 1 --  I place an element in html that is hidden from the user's 
view via css (display:none) and if Javascript is ON then Javascript 
changes the css so that the element is shown to the user 
(display:block). Here's an example:


http://php1.net/b/show-hide/

Try clicking "MORE"

That way Javascript routines are shown to the user only if the user's 
browser is capable of running Javascript. If Javascript is OFF then 
nothing happens.


Way 3 -- another way is to use unobtrusive Javascript -- here's an 
example I did for my students:


http://www.webbytedd.com/aa/add-onclick-button/index.php

If Javascript is OFF, then the "Add Another Record" button is not 
seen by the user -- because it's not in the html.


However, if JavaScript is turned on, then the "Add Another Record" 
button is shown and becomes available as another option via DOM 
scripting. That's called unobtrusive Javascript.


Try it!

Now that doesn't mean that JavaScript can't call PHP, because it can 
-- look here:


http://webbytedd.com/b/timed-php/

and here:

http://webbytedd.com/a/ajax-site/

Those are examples of JavaScript running PHP scripts.

So, the world of mixing JavaScript and PHP is quite vast, but you 
have to know what run's what and when.


HTH,

tedd


--
---
http://sperling.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Flattery will get you nowhere

2011-04-27 Thread tedd

At 4:58 PM -0400 4/27/11, Robert Cummings wrote:

On 11-04-27 04:47 PM, HallMarc Websites wrote:

I just googled up "php tedd form validation" and can't find a single

reference.

What does this mean, that I respect tedd's skills or that he needs better

SEO?




OOH!! I KNOW! I KNOW! PICK ME! PICK ME! Um Both? No wait, maybe Tedd
doesn't want his stuff found?


Tedd who?

;)

Cheers,
Rob.


Rob what?

;-)

Cheers,

tedd

--
---
http://sperling.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php