[PHP] foreach and form submission.

2009-03-28 Thread Angus Mann
Hi all. I'm writing a script that accepts several different forms with different content. Depending on what data is sent with the form the script will do one or the other think. Before the form data is processed I'd like to scrub it of HTML tags. I can do this manually as below but the form

Re: [PHP] foreach and form submission.

2009-03-28 Thread Ashley Sheridan
On Sat, 2009-03-28 at 18:28 +1000, Angus Mann wrote: Hi all. I'm writing a script that accepts several different forms with different content. Depending on what data is sent with the form the script will do one or the other think. Before the form data is processed I'd like to scrub it

RE: [PHP] flushing AJAX scripts

2009-03-28 Thread Andrea Giammarchi
As I said if the client abort or close the connection, PHP does not finish its execution, it simply exits from the script. If you run this code and you close the browser before 10 seconds the file will never be created, for example. ?php function write($stuff){ echo$stuff, PHP_EOL.br

Re: [PHP] PHPizabi - Applying php in TPL (smarty template engine)

2009-03-28 Thread Virgilio Quilario
Well well I forgot to install Smarty, but show the message. Ididn't modify Smasrty.class.php. And index.tpl in libs directpory don't exist only the file in root. Anybody Can save me? I'm X confuss. All is new for me.  Warning: Smarty error: unable to read resource: index.tpl in

[PHP] Calling function on the same line?

2009-03-28 Thread דניאל דנון
Is there any way to do something like: ?php (str_replace)(a, b, aaa); ? ? One of the problems that I must keep str_replace on the same line...The only solution I see is call_user_func, but I would like to know if you guys might have a clue =] Tried looking on the manual, sadly didn't found

Re: [PHP] foreach and form submission.

2009-03-28 Thread Virgilio Quilario
Hi all. I'm writing a script that accepts several different forms with different content. Depending on what data is sent with the form the script will do one or the other think. Before the form data is processed I'd like to scrub it of HTML tags. I can do this manually as below but the

RE: [PHP] Calling function on the same line?

2009-03-28 Thread Andrea Giammarchi
I miss the utility to do stuff like that ... seriously ... but in any case: ?php echo ($f = 'str_replace') ? $f(a, b, aaa) : null; ? where echo is optional. Regards Date: Sat, 28 Mar 2009 15:26:18 +0300 From: danondan...@gmail.com To: php-general@lists.php.net Subject: [PHP] Calling

Re: [PHP] SESSION values show up days later!

2009-03-28 Thread tedd
At 2:39 PM -0700 3/27/09, Mary Anderson wrote: Hi all, I use session variables to store values from one page to another on my website. Alas, sometimes, but not always, the values persist from one invocation of the script to another! Just how, exactly, do I make them go away when a

Re: [PHP] Calling function on the same line?

2009-03-28 Thread Virgilio Quilario
I miss the utility to do stuff like that ... seriously ... but in any case: ?php echo ($f = 'str_replace') ? $f(a, b, aaa) : null; ? where echo is optional. Regards you mean this ?= ($f = 'str_replace') ? $f(a,b,aaa) : null; ? virgil http://www.jampmark.com -- PHP General Mailing

Re: [PHP] Sort a multi-dimensional array on a certain key followed by another key

2009-03-28 Thread Virgilio Quilario
Ok so, I have an array [0(index)][1st key][2nd key] Basically I don't care about the index. As a matter of fact I'd prefer it reset to still be in order afterwards. However, I need to sort the 1st key and keep correlation w the second key. Then sort on the second key. I have video

RE: [PHP] Calling function on the same line?

2009-03-28 Thread Andrea Giammarchi
I don't , I mean if the function is not str_replace you do not necesary need the echo (array_push, as example) This notation: ?= is deprecated since dunno how long ago ... strongly not suggested Date: Sun, 29 Mar 2009 01:06:16 +0800 Subject: Re: [PHP] Calling function on the same line? From:

RE: [PHP] Calling function on the same line?

2009-03-28 Thread Andrea Giammarchi
How do you pass that string? If you replace via other file, you do not need to use strings, just call the function. If you are parsing a variable, you do not need the inline ... $_GET['function'](a, b, aaa); if the query string is function=str_replace I do not get the problem at all specially

Re: [PHP] foreach and form submission.

2009-03-28 Thread Angus Mann
Thanks Ashley...that did the trick. After reading about the limitations of strip_tags I decided to just replace the bad bits as below... It still uses your foreach suggestion but replaces and with ( and ) instead of stripping tags. I think I will extend the good and bad arrays to deal with