php-general Digest 11 Apr 2009 23:25:13 -0000 Issue 6062
Topics (messages 291361 through 291371):
Re: Caching
291361 by: Richard Heyes
Random php
291362 by: Gary
291363 by: Phpster
291364 by: Gary
291368 by: Gary
291369 by: 9el
Re: Escape Data In/Out of db [solved]
291365 by: Shawn McKenzie
Sobre Login PHP
291366 by: Alejandro Esteban Galvez
291367 by: Daniel Brown
extract varying data from array with different formatting
291370 by: PJ
Additional support for your family!
291371 by: Forest Bennett
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
> Hey! About " Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT" "
> The problem is the files might change, lets say - every week. How can I use
> " Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"" to something like
>
> Header set Expires "today plus week"
>
> (or X seconds / y minutes / etc...)
In that case you will want to use Cache-Control instead:
Header set Cache-Control "private,public,max-age=604800"
The max-age is the number of seconds (1 week in this case) that the
page is cached for. The private and public determine which kinds of
cache should cache it. IIRC (which isn't likely).
--
Richard Heyes
HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
http://www.rgraph.net (Updated April 11th)
--- End Message ---
--- Begin Message ---
Is there a way to have a php include called ramdomly? For example, I have
an area that I am using to show various quotes and I would like the quotes
to be ramdom.
Thanks for your help
Gary
--- End Message ---
--- Begin Message ---
On Apr 11, 2009, at 10:12, "Gary" <[email protected]> wrote:
Is there a way to have a php include called ramdomly? For example,
I have
an area that I am using to show various quotes and I would like the
quotes
to be ramdom.
Thanks for your help
Gary
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Best is to use a storage system ( either file with a quote in each
line or a database ) and then randomly select a record from the
database or an item from the file. If you do a quick search on www.hotscripts.com
or just goodle 'php random quote' you'll see lots of samples or
complete code.
Bastien
--- End Message ---
--- Begin Message ---
Thanks much for your quick reply, I'll take a look (and maybe even find one
that spell checks my posts first!).
Gary
"Phpster" <[email protected]> wrote in message
news:[email protected]...
>
>
> On Apr 11, 2009, at 10:12, "Gary" <[email protected]> wrote:
>
>> Is there a way to have a php include called ramdomly? For example, I
>> have
>> an area that I am using to show various quotes and I would like the
>> quotes
>> to be ramdom.
>>
>> Thanks for your help
>>
>> Gary
>>
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
> Best is to use a storage system ( either file with a quote in each line
> or a database ) and then randomly select a record from the database or
> an item from the file. If you do a quick search on www.hotscripts.com or
> just goodle 'php random quote' you'll see lots of samples or complete
> code.
>
> Bastien
--- End Message ---
--- Begin Message ---
I had been on that site before, but seems like it is a breeding ground for
spam and links to "free" commercial sites. Ran into a few bad or broken
links, several listings as different scripts only to take you to the same
"best price hosting" company with no scripts at all. Is this common, is
that site on its way out?
Would you have another suggestion?
Thanks for your help.
Gary
"Phpster" <[email protected]> wrote in message
news:[email protected]...
>
>
> On Apr 11, 2009, at 10:12, "Gary" <[email protected]> wrote:
>
>> Is there a way to have a php include called ramdomly? For example, I
>> have
>> an area that I am using to show various quotes and I would like the
>> quotes
>> to be ramdom.
>>
>> Thanks for your help
>>
>> Gary
>>
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
> Best is to use a storage system ( either file with a quote in each line
> or a database ) and then randomly select a record from the database or
> an item from the file. If you do a quick search on www.hotscripts.com or
> just goodle 'php random quote' you'll see lots of samples or complete
> code.
>
> Bastien
--- End Message ---
--- Begin Message ---
On Sun, Apr 12, 2009 at 1:32 AM, Gary <[email protected]> wrote:
> I had been on that site before, but seems like it is a breeding ground for
> spam and links to "free" commercial sites. Ran into a few bad or broken
> links, several listings as different scripts only to take you to the same
> "best price hosting" company with no scripts at all. Is this common, is
> that site on its way out?
>
> Would you have another suggestion?
>
>
Well, I also browsed through that site.. yes what you claimed is true.
Facility/Opportunity comes with a price. So, you can go through the
ads/sponsors but there are working examples/free code snippets as well.
Just googling with that "random quote php" could yield you a lots of
practical results.
Regards
Lenin
www.twitter.com/nine_L
--- End Message ---
--- Begin Message ---
tedd wrote:
> At 9:12 PM -0700 4/9/09, Jim Lucas wrote:
>> tedd wrote:
>>> At 5:03 PM +0200 4/9/09, Jan G.B. wrote:
>>>>
>>>> You might want to use htmlspecialchars($str, ENT_QUOTES)
>>>
>>> OUT from db to html
>>>
>>> and
>>>
>>>> mysql_real_escape_string(stripslashes($_POST['yourself']));
>>>
>>
>> The above tells me that you probably need to look at your magic quotes
>> setting.
>
> The php info says:
>
> magic_quotes_runtime Off Off
> magic_quotes_sybase Off Off
>
> I'm assuming that means OFF, right?
>
> Cheers,
>
> tedd
I think you want to look for magic_quotes_gpc
--
Thanks!
-Shawn
http://www.spidean.com
--- End Message ---
--- Begin Message ---
Saludos colegas, los otros dias, estuve escribiendo acerca de esto, y bueno ya
tengo una parte ahora necesito que cuando se cierre el navegador, se cierre la
sesion de login tambien. Saludos
-----------------------------------------------------------
Alejandro Esteban Galvez
Administrador de Red IPICHMC Rimed,
Radio-Aficionado CL2AEG
Linux User #472120 - http://i18n.counter.li.org/
Correo: [email protected]
Correo y Jabber: [email protected]
www.ipichmc.rimed.cu
-----------------------------------------------------------
---------------------------------------
Red Telematica de Salud - Cuba
CNICM - Infomed
--- End Message ---
--- Begin Message ---
2009/4/11 Alejandro Esteban Galvez <[email protected]>:
>
> Saludos colegas, los otros dias, estuve escribiendo acerca de esto, y bueno
> ya tengo una parte ahora necesito que cuando se cierre el navegador, se
> cierre la sesion de login tambien. Saludos
Saludos, Alejandro;
Envíe por favor este mensaje a la lista española del PHP en
[email protected]. Usted puede suscribir a la lista en
http://php.net/mailinglists. Solo inglés a este lista.
¡Gracias, y Pascua feliz!
--
</Daniel P. Brown>
[email protected] || [email protected]
http://www.parasane.net/ || http://www.pilotpig.net/
50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW10000
--- End Message ---
--- Begin Message ---
foreach does a nice job if you want the results identical each time.
What can you use to change the formatting of the results dependent on
the number of results.
Here's an example:
foreach ( $authors[$bookID] AS $authorID => $authorData ) {
# Display the
echo "{$authorData['first_name']}
{$authorData['last_name']}\n";
}
will echo - Joe Boe John Blue Andy Candy etc depending on how many rows
we have.
What I want is: Joe Boe, John Blue, Andy Candy & Hans Stick ( separated
by commas, except for the last one which is separated with & .
I thought of passing a variable to the foreach and then using if
elseif... but that can't work because the variable is reset to 0 after
each pass.
Can't get switch to do it (maybe I don't understand it right.
Help ?
--
unheralded genius: "A clean desk is the sign of a dull mind. "
-------------------------------------------------------------
Phil Jourdan --- [email protected]
http://www.ptahhotep.com
http://www.chiccantine.com/andypantry.php
--- End Message ---
--- Begin Message ---
Good day, Dear Mr. or Ms!
Are you in need for money but you don't have the time and nerve for a secondary
job? Here is your chance to be part of a program that is taking traditional
marketing research in a brand new direction, with the ease of the Internet
technologies!
Our participants are always rewarded for their precious opinion.
Here is what amounts you can earn:
- From $5 to $100 per online survey
- From $50 to $200 for an online focus group discussion
- From $30 to $120 per product and service evaluation
Please excuse us if this letter is unwanted for you or we have disturbed you in
some way, but this inquiry is serious and sincere!
Please reply to [email protected] for further information. Join us now
because the places are limited!
Best regards,
Consumer Opinion Administration
------------------------------------------------------------------
This email has been written and proved to be in compliance with the recently
established can-spam act law in US. We are not provoking or forcing any person
in any way to participate in our programs. To participate is your own decision
and you carry the responsibility of taking further part in this promotion.
Anyway, if you don't want to receive more good offers from us, you can simply
Unsubscribe by sending us a notification email to [email protected]
with a mail-subject and text "Unsubscribe me", and we will get your email out
of our list within 10 days.
This message is STRICTLY CONFIDENTIAL and is solely for the individual or
organisation to whom it is addressed. It may contain PRIVILEGED and
CONFIDENTIAL information. If you are not the intended recipient, you are hereby
notified that any dissemination, distribution or copying of this communication
and its contents is strictly prohibited. If you are not the intended recipient
you should not read, copy, distribute, disclose or otherwise use the
information in this email. Email may be susceptible to data corruption,
interception and unauthorised amendment, and we do not accept liability for any
such corruption, interception or amendment or the consequences thereof or your
reliance on any information contained therein if you are not the intended
recipient. If you are not interested in the offered promotions, please just
don't answer. If you think you have received this message and its contents in
error, please delete it from your computer, or follow the unsubscribing
procedure shown above.
------------------------------------------------------------------
--- End Message ---