Re: [PHP] Regex

2009-03-26 Thread Jochem Maas
jesse.ha...@arvatousa.com schreef: > Hi, > > > > Brand new to regex. So I have a cli which runs a regex on users input, > to make sure that only 0-9 and A-Z are accepted. It should strip > everything else. My problem is that when you press control-Z (on > Windows; I have not yet tested this on

Re: [PHP] PHP and making a ZIP file

2009-03-26 Thread Chris
Ron Piggott wrote: Does anyone know how to make a ZIP file using PHP? This is for an application where the files the user selected will be put into a ZIP file and then the ZIP file made available for download. Ron http://www.php.net/zip would be a good place to start. Or http://pear.php.net/

[PHP] PHP and making a ZIP file

2009-03-26 Thread Ron Piggott
Does anyone know how to make a ZIP file using PHP? This is for an application where the files the user selected will be put into a ZIP file and then the ZIP file made available for download. Ron

Re: [PHP] Limit Local Search to Content

2009-03-26 Thread George Langley
Hi Ashley. That's what I'm doing, but want to limit what gets stored to just the content. Every page has a drop-down menu of, for instance, various cities, so I want to exclude that part of the page in my search terms. I don't want every page to think it has content on Calgary, Hamburg, Ph

[PHP] Re: Multiple cookies on the same computer

2009-03-26 Thread Shawn McKenzie
Shawn McKenzie wrote: > Ken Watkins wrote: >> Hi all. >> >> Newbie here. >> >> I have set up a blog site where my family creates posts and they get emailed >> to members of the family. To keep up with their identities, I created a >> script for each family member to run (dad.php, mom.php, etc.),

[PHP] Re: Multiple cookies on the same computer

2009-03-26 Thread Shawn McKenzie
Ken Watkins wrote: > Hi all. > > Newbie here. > > I have set up a blog site where my family creates posts and they get emailed > to members of the family. To keep up with their identities, I created a > script for each family member to run (dad.php, mom.php, etc.), and it sets a > cookie on ea

Re: [PHP] Regex

2009-03-26 Thread Shawn McKenzie
jesse.ha...@arvatousa.com wrote: > Nistan, > > Just got home, tested on linux. No problem on linux, the control-z just > exits. I may just go ahead and post my issue to the PHP windows list to see > if anything comes up, and not worry if it doesnt. I appreciate the help very > much > > > > T

Re: [PHP] flushing AJAX scripts

2009-03-26 Thread Raymond Irving
Hello Jim, You will need to do some low level ajax coding from the client side with the onreadychange event. If you're using jquery 1.3 then you can create your own XHR object with the xhr callback handler. To learn more about the ready state check out this link: http://www.quirksmode.org/blog

Re: [PHP] Multiple cookies on the same computer

2009-03-26 Thread dg
On Mar 26, 2009, at 7:14 PM, Ken Watkins wrote: To keep up with their identities, I created a script for each family member to run (dad.php, mom.php, etc.), and it sets a cookie on each computer and uses sessions so I know who is connecting. Each family member only uses her/his own page?

[PHP] Multiple cookies on the same computer

2009-03-26 Thread Ken Watkins
Hi all. Newbie here. I have set up a blog site where my family creates posts and they get emailed to members of the family. To keep up with their identities, I created a script for each family member to run (dad.php, mom.php, etc.), and it sets a cookie on each computer and uses sessions so I

RE: [PHP] Regex

2009-03-26 Thread bruce
hi... if you haven't solved your issue... can you tell me in detail what you're trying to accomplish? what are the steps to running the script? thanks -Original Message- From: jesse.ha...@arvatousa.com [mailto:jesse.ha...@arvatousa.com] Sent: Thursday, March 26, 2009 1:23 PM To: php-gen

Re: [PHP] Limit Local Search to Content

2009-03-26 Thread Ashley Sheridan
What about storing all of the page content in the database to start with, then searching with a mysql statement is a breeze! On Thu, 2009-03-26 at 16:29 -0600, George Langley wrote: > - Original Message - > > From: Stuart > > > You can't have any extra info in a closing HTML tag. This >

RE: [PHP] Regex

2009-03-26 Thread Jesse.Hazen
Nistan, Just got home, tested on linux. No problem on linux, the control-z just exits. I may just go ahead and post my issue to the PHP windows list to see if anything comes up, and not worry if it doesnt. I appreciate the help very much Thanks, Jesse -Original Message- From: jesse.

[PHP] Re: similar page replication

2009-03-26 Thread tedd
PJ wrote: I have a series of pages to display that are all exactly the same, except for a couple of small changes like 1 number that needs to be changed for a mysql_query, the title of the page, and the page_name.php. I am wondering how these changes could be implemented when clicking on an

Re: [PHP] Limit Local Search to Content

2009-03-26 Thread George Langley
- Original Message - > From: Stuart > > You can't have any extra info in a closing HTML tag. This > > problem is > > usually handled using comments. Something like the following... > > > > > > > > sofihsod hiosdh sdh gus us u sg > > > > > > > > You then just start with you see the b

Re: [PHP] flushing AJAX scripts

2009-03-26 Thread Chris
jim white wrote: I am using jQuery AJAX request to run a script that can take several minutes to create a report. I want to start the script and immediately echo a response to close the connection and then let the script complete a report which I can get later. I have tried several thing such a

RE: [PHP] Regex

2009-03-26 Thread Jesse.Hazen
Nitsan, Not a problem, thanks for the help. So, it is printed as ^Z. However, I created a little test.php script to accept input and print it back to me. So, I used control z as my test, and it simply printed a line, and that's all. So, then I input control z, and then had it print a letter rig

Re: [PHP] Regex

2009-03-26 Thread Nitsan Bin-Nun
If you can point me on the character which control-z creates it would make it easier, I have no idea of it ;) I'm sorry mate. On Thu, Mar 26, 2009 at 11:06 PM, wrote: > Nitsan, > > > > Thanks again. Sad to say, same result. > > > > The second option looped an error: Warning: preg_replace(): Co

RE: [PHP] Regex

2009-03-26 Thread Jesse.Hazen
Nitsan, Thanks again. Sad to say, same result. The second option looped an error: Warning: preg_replace(): Compilation failed: nothing to repeat at offset 17 Thanks, Jesse Hazen From: nit...@binnun.co.il [mailto:nit...@binnun.co.il] On Be

Re: [PHP] Regex

2009-03-26 Thread Nitsan Bin-Nun
I have no idea about this control-Z thing, you might want to try it with UTF (just add the 'u' modificator): $str = preg_replace("#[^a-zA-Z0-9]+#uis", "", $str); Or try this: $str = preg_replace("#(\b[^a-zA-Z0-9]\b?)+#uis", "", $str); I may be wrong about the second one but it might work... On T

RE: [PHP] Regex

2009-03-26 Thread Jesse.Hazen
Nitsan, Thank you very much for the input. However, I just gave this a try and it still did not strip the control-Z. Therefore, it is still hitting my loop later and looping infinitely. I am sure I could mend that by working something into that loop, but there are several loops I would need to

Re: [PHP] Regex

2009-03-26 Thread Nitsan Bin-Nun
To filter out everything which is not A-Z, a-z and 0-9 try this regex: $str = preg_replace("#[^a-zA-Z0-9]+#is", "", $str); On Thu, Mar 26, 2009 at 10:23 PM, wrote: > Hi, > > > > Brand new to regex. So I have a cli which runs a regex on users input, > to make sure that only 0-9 and A-Z are accep

[PHP] Regex

2009-03-26 Thread Jesse.Hazen
Hi, Brand new to regex. So I have a cli which runs a regex on users input, to make sure that only 0-9 and A-Z are accepted. It should strip everything else. My problem is that when you press control-Z (on Windows; I have not yet tested this on linux, and I will, but I would like this to be comp

[PHP] Re: similar page replication

2009-03-26 Thread Shawn McKenzie
PJ wrote: > I have a series of pages to display that are all exactly the same, > except for a couple of small changes like 1 number that needs to be > changed for a mysql_query, the title of the page, and the page_name.php. > I am wondering how these changes could be implemented when clicking on >

[PHP] flushing AJAX scripts

2009-03-26 Thread jim white
I am using jQuery AJAX request to run a script that can take several minutes to create a report. I want to start the script and immediately echo a response to close the connection and then let the script complete a report which I can get later. I have tried several thing such as ob_start(); ec

Re: [PHP] Limit Local Search to Content

2009-03-26 Thread George Langley
> 2009/3/26 George Langley : > > How do I STOP it? Is it permissible to add the id again in the > closing div tag ie . > From: Stuart > You can't have any extra info in a closing HTML tag. This > problem is > usually handled using comments. Something like the following... > > > > sofihsod hi

[PHP] similar page replication

2009-03-26 Thread PJ
I have a series of pages to display that are all exactly the same, except for a couple of small changes like 1 number that needs to be changed for a mysql_query, the title of the page, and the page_name.php. I am wondering how these changes could be implemented when clicking on an href link? Is the

Re: [PHP] Limit Local Search to Content

2009-03-26 Thread Stuart
2009/3/26 George Langley : >        Hi all! Am building a Search feature following the excellent tutorial > at: > > > > It loops through a page and stores the words found in a mySQL database. >        I have about 60 pages, a

[PHP] Limit Local Search to Content

2009-03-26 Thread George Langley
Hi all! Am building a Search feature following the excellent tutorial at: It loops through a page and stores the words found in a mySQL database. I have about 60 pages, and all of them share a number of comm

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

2009-03-26 Thread Virgilio Quilario
> Hi there! > Any know how Can I use PHP code into Smarty Temple Engine (TPL files) ? > I usued {php} include("text.php"); {/php} but the code don't run simply > output the code. > What's the problem? Wht don't run? > > Thankx, > Luciano Felli it may be the file path. try echoing something before

Re: [PHP] Re: Rusu Ionut, PHP Question

2009-03-26 Thread Jan G.B.
Erm, aren't "extends" what you're looking for? To accomplish the auto-loading of needed subclasses? example: greeting = parent::$x; } } $test = new BAR(); echo $test->greeting; ?> Prints out "Hello World". Sure - the if you put class FOO in a separate file, than you need to require_once(it)

[PHP] Re: Rusu Ionut, PHP Question

2009-03-26 Thread Ionut Rusu
sry to boder you again but i didnt quite understood youre answer, i got the part where to add the include files on the top of the file or with require_once statment, but i still dont understant how is it posiible to add classes to the constructor with the include statment and not trigger a nested c

Re: [PHP] utf-8-safe replacement for strtr()?

2009-03-26 Thread Nisse Engström
On Wed, 25 Mar 2009 11:32:42 +0100, Nisse Engström wrote: > On Tue, 24 Mar 2009 08:15:35 -0400, Tom Worster wrote: > >> strtr() with three parameters is certainly unsafe. but my tests are showing >> that it may be ok with two parameters if the strings in the second parameter >> are well formed ut

RE: [PHP] Rusu Ionut, PHP Question

2009-03-26 Thread kyle.smith
Have you bolded sections of the email or are there really asterisk characters in those strings? Assuming it's bolding being converted to text, why shouldn't this work? It's definitely not the best approach, for example if you instanciate the "index" class twice, you'll re-include the code *again*.

RE: [PHP] Problems with implode

2009-03-26 Thread Andrea Giammarchi
The "mail" problem came out later or I missed some post about it. So yes, I would pass that implode via wordwrap then wordwrap(implode(', ', $list), 100, "\n", false); please note the space after the coma, to avoid truncated id. @Tom Worster I hope on daily basis you do NOT create arrays with s

[PHP] Rusu Ionut, PHP Question

2009-03-26 Thread Ionut Rusu
Hello my name is Rusu Ionut, i'm from Romania and i was wondering if you have the time to to explain to mea little situation that i encountered. So i have a class: *index *and inside this class i have declared a public array containing some classes, inside the constructor of the class i extract t

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

2009-03-26 Thread Jacques Manukyan
You have to change the $php_handling variable in Smarty first before you can use {php}{/php} tags inside your template. The default behavior of Smarty is to ignore or echo your code inside {php}{/php} tags in the template. Take a look at http://www.smarty.net/manual/en/variable.php.handling.ph

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

2009-03-26 Thread Luciano Felli
Hi there! Any know how Can I use PHP code into Smarty Temple Engine (TPL files) ? I usued {php} include("text.php"); {/php} but the code don't run simply output the code. What's the problem? Wht don't run? Thankx, Luciano Felli

Re: [PHP] Problems with implode

2009-03-26 Thread Virgilio Quilario
>>> Dunno why you guys started talk about utf-8 problems, he has a list of >>> ids >>> which should contain only unsigned integers, otherwise I do not get how >>> that >>> query could work with an implode(',', $whatever) rather than 'id in >>> ("'.implode('","', array_map('mysql_real_escape_string'

Re: [PHP] Problems with implode

2009-03-26 Thread Toke Herkild
Tom Worster skrev: On 3/24/09 9:25 AM, "Andrea Giammarchi" wrote: Dunno why you guys started talk about utf-8 problems, he has a list of ids which should contain only unsigned integers, otherwise I do not get how that query could work with an implode(',', $whatever) rather than 'id in ("'.impl