Re: [PHP] Problems with apc extension on wamp server.

2009-06-16 Thread Jonathan Tapicer
Hi, Does the extension appear on a phpinfo()? Seems like the extension isn't loaded. Jonathan On Tue, Jun 16, 2009 at 5:20 PM, Valentinas Bakaitis wrote: > Hello! > > I am trying to track file upload progress using APC extension. > However, when trying to use, it gives > > Fatal error: Call to

[PHP] Re: Issue with filter_var and FILTER_VALIDATE_EMAIL

2009-06-19 Thread Jonathan Tapicer
Did you execute the code I sent? Does it give you a false? Jonathan On Fri, Jun 19, 2009 at 12:17 PM, Bastien Koert wrote: > Correct, I send the @ > > > Bastien > > On Friday, June 19, 2009, Jonathan Tapicer wrote: >> Works for me: >> >>          var_dump

Re: [PHP] Issue with filter_var and FILTER_VALIDATE_EMAIL

2009-06-19 Thread Jonathan Tapicer
Works for me: var_dump(filter_var('bastien_k(a)hotmail.com', FILTER_VALIDATE_EMAIL) !== false); //replace (a) with @ Gives: bool(true) You are sending an @ instead of " at ", right? Jonathan On Fri, Jun 19, 2009 at 11:49 AM, Bastien Koert wrote: > Hey guys, > > Running the

Re: [PHP] Re: Issue with filter_var and FILTER_VALIDATE_EMAIL

2009-06-19 Thread Jonathan Tapicer
Can you check if the code is using true or false branch of the first if? On Fri, Jun 19, 2009 at 12:56 PM, Bastien Koert wrote: > On Fri, Jun 19, 2009 at 11:46 AM, Shawn McKenzie wrote: >> Bastien Koert wrote: >>> On Fri, Jun 19, 2009 at 11:20 AM, Jonathan Tapicer wrote: >&g

Re: [PHP] Problems with APC, possible cache-corruption?

2009-06-21 Thread Jonathan Tapicer
Can you do a phpinfo(); and tell us the value of the setting apc.filters (or every apc.* if you can)? Just curious, but I've seen apps set that setting to avoid APC opcode caching. Jonathan On Sun, Jun 21, 2009 at 8:56 PM, James McLean wrote: > (Resend from around 1 week ago, because of no respon

Re: [PHP] Pointers for NuSOAP

2009-06-22 Thread Jonathan Tapicer
I've used this one, split in 4 parts: Introduction to NuSOAP: http://www.scottnichol.com/nusoapintro.htm Programming with NuSOAP: http://www.scottnichol.com/nusoapprog.htm Programming with NuSOAP Part 2: http://www.scottnichol.com/nusoapprog2.htm Programming with NuSOAP Using WSDL: http://www.scot

Re: [PHP] CSV file

2009-06-24 Thread Jonathan Tapicer
You can read the whole file (file_get_contents) and count the number of "\n" in it, or read it line by line with fgets and store the lines in an array, and then the number of lines is the count() of the array, and you can use that array to store it in the database. Jonathan On Wed, Jun 24, 2009 a

Re: [PHP] CSV file

2009-06-24 Thread Jonathan Tapicer
If you want to know how many lines there are *before* inserting to the database, you can't count "as you go", you have to either read the file twice or read it once, store it memory in a variable and then insert in the database. On Wed, Jun 24, 2009 at 11:12 AM, Richard Heyes wrote: > Hi, > >> You

Re: [PHP] CSV file

2009-06-24 Thread Jonathan Tapicer
To do the line count first, you have to read the whole file, how would you do it? On Wed, Jun 24, 2009 at 3:00 PM, Richard Heyes wrote: > Hi, > >> If you want to know how many lines there are *before* inserting to the >> database, you can't count "as you go", you have to either read the >> file tw

Re: [PHP] CSV file

2009-06-24 Thread Jonathan Tapicer
Well, you are reading the whole file there (and throwing the data you read not assigning the fgets result to anything), and then to store it in the database you need to read it again, so you read the file twice. It will probably better to store the data you read the first time in an array and then

Re: [PHP] CSV file

2009-06-25 Thread Jonathan Tapicer
Hi, I don't say that reading the whole file into memory is the best option, I just say that your approach goes to the disk twice, if you have a 100MB file, you are reading 200MB from disk (unless there are some pages cached in physical memory, but you never can know, in the best case all the pages

Re: [PHP] why is this shell_exec() failing to execute my shell to create a symlink?

2009-06-27 Thread Jonathan Tapicer
Make sure that: - The user executing the script (apache I presume) has execute permissions on ls and ln binaries. - The user executing the script has write persmissions on the directory you are trying to write, and read permissions where you do ls. - This will probably help: put the full binary pa

Re: [PHP] Apache module PHP 5.3 on Windows

2009-07-01 Thread Jonathan Tapicer
What version, VC6 or VC9, TS or NTS? I use VC6 TS and the dll is there... On Wed, Jul 1, 2009 at 7:31 PM, Pablo Viquez wrote: > Hi, > > I just downloaded the new stable version of PHP 5.3 and I couldnt find the > php5apache2_2.dll file. > > Is the apache module on windows no longer supported? > >

Re: [PHP] PHP not running properly

2009-07-13 Thread Jonathan Tapicer
2. Try On Mon, Jul 13, 2009 at 3:47 PM, Togrul Mamedbekov wrote: > We are running, Windows Server 2003. > > 1. Changed that > 2. > > Togrul Mamedbekov > Marketing & Publishing Assistant > (Tel: +1-(713)-292-1945 / Fax: +1-(713)-292-1946 > http://www.iadc.org > > >  _ >

Re: [PHP] newbie - Is there a calendar module for date entry?

2009-07-21 Thread Jonathan Tapicer
On Tue, Jul 21, 2009 at 10:06 PM, c...@hosting4days.com wrote: > newbie ... > > - is there a calendar module for date fields? > > - so that a small calendar pops up - then you can click on a date,  to add > to a field - like google or yahoo calendars has...? > > BTW: I saw this - but it doesn't see

Re: [PHP] Re: Question on code profiling

2009-07-23 Thread Jonathan Tapicer
Just an idea: try using the (microtime(true) - $start) approach in portions of code to try isolate the portion that is taking more time. Sometimes that helps me to find "the" function that is slowing everything down. Jonathan On Thu, Jul 23, 2009 at 6:18 PM, Andrew Ballard wrote: > On Thu, Jul 23

Re: [PHP] Getting rid of extra lines

2009-07-29 Thread Jonathan Tapicer
On Wed, Jul 29, 2009 at 4:20 PM, Miller, Terion wrote: > > > > On 7/29/09 1:45 PM, "Ashley Sheridan" wrote: > > [snip/] > > Have you thought of just using a regular str_replace() on your code? You > can ask it to replace newlines and carriage returns with nothing and see > if that fixes you proble

Re: [PHP] Expand Variables in String

2009-07-29 Thread Jonathan Tapicer
Use eval, like this: eval('$str_expanded = "' . str_replace('"', '\\"', $str) . '";'); The str_replace is used because you could have a " inside $str and it would break the string, if you are sure the $str has no " inside you can omit it. Jonathan On Wed, Jul 29, 2009 at 5:43 PM, Daniel Kolbo w

Re: [PHP] Expand Variables in String

2009-07-29 Thread Jonathan Tapicer
On Wed, Jul 29, 2009 at 6:47 PM, Daniel Kolbo wrote: > Jonathan Tapicer wrote: >> Use eval, like this: >> >> eval('$str_expanded = "' . str_replace('"', '\\"', $str) . '";'); >> >> The str_replace is used

Re: [PHP] This isn't infinitely recursive is it?

2009-07-30 Thread Jonathan Tapicer
Hi, Well, you will have an infinite recursion there if the mapping has cycles, something like A->B, B->C, C->A would generate an invite recursion. Checking if the mapping has cycles is pretty simple: you have to create a directed graph and then go through the graph in DFS marking each visited nod

Re: [PHP] how to pass variable argument list in a childconstructor to parent constructor, ideas wanted

2009-08-02 Thread Jonathan Tapicer
I don't understand completely your problem, but think that something like this may help you: This will output: array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } As expected. The key is using call_user_func_array in combination with func_get_args to call the parent constructor wi

Re: [PHP] Trying to create a comment function

2009-08-06 Thread Jonathan Tapicer
> > [code] > > comment("test of $newComment"); > > [/code] > > This rendered a comment that said "test of ". > > So I added a \ before the $ to make it display properly, but I was wondering > if there was a way that the function could work so that it will display > anything you type within the quot

Re: [PHP] Notification system

2009-08-07 Thread Jonathan Tapicer
Also, take a look at Comet Server: http://en.wikipedia.org/wiki/Comet_(programming) I think that Facebook uses that and also Gmail, it tends to consume less resources than periodical ajax calls, the hidden iframe method is simple and works fine. To implement it in PHP you will need to use the flus

Re: [PHP] Array

2009-08-10 Thread Jonathan Tapicer
On Mon, Aug 10, 2009 at 9:28 AM, Ron Piggott wrote: > How do I change this ELSEIF into an array? > > } elseif ( ( $page <> "" ) AND ( $page <> "home_page" ) AND ( $page <> > "verse_of_the_day_activate" ) AND ( $page <> "member_services" ) AND ( $page > <> "member_services_login" ) AND ( $page <>

Re: [PHP] Embedding foreach loops

2009-08-10 Thread Jonathan Tapicer
On Mon, Aug 10, 2009 at 6:44 PM, Allen McCabe wrote: > Gmail automatically sent my last email, apologies. > > I am creating an order form for tickets for a list of performances at a > performing arts center. > > Currently, the form is on paper, and is set up as follows: > -Title     - date  - time

Re: [PHP] Displaying 2 digit minutes/seconds

2009-08-20 Thread Jonathan Tapicer
You can use sprintf or str_pad to fill in with zeros, with sprintf you can do this: echo sprintf('%02d', 5); That will print the string "05". Jonathan On Thu, Aug 20, 2009 at 6:27 PM, wrote: > Hi all, > >        I'm using this code to display the current time for our location on > our website:

Re: [PHP] preg_replace anything that isn't WORD

2009-08-22 Thread Jonathan Tapicer
Negating specific words with regexes isn't a good practice (see a deep discussion here: http://www.perlmonks.org/?node_id=588315), in your case I would resolve it like this: That will output: array(5) { [0]=> string(3) "cat" [1]=> string(10) "s i saw a " [2]=> string(3) "cat" [3]=

Re: [PHP] preg_replace anything that isn't WORD

2009-08-24 Thread Jonathan Tapicer
For the record Shawn: I received your previous post from Aug 22 and I think that it is the best solution. Jonathan On Tue, Aug 25, 2009 at 12:41 AM, Shawn McKenzie wrote: > hack988 hack988 wrote: >>  Use preg_replace_callback instead! >> preg_replace_callback is better performance than preg_repla

Re: [PHP] Who kown this memcache_get_stats function ?

2009-09-05 Thread Jonathan Tapicer
I think that the documentation for memcache_get_stats should be exactly the same as the one given for the method Memcache::getStats except that memcache_get_stats should receive as the first parameter a reference to the Memcache connection. Hope that helps. Jonathan On Sun, Sep 6, 2009 at 1:16

Re: [PHP] File download question

2009-09-06 Thread Jonathan Tapicer
I think that your problem in this line: header("Content-Disposition: filename=$file" . "%20"); I don't know what that %20 is for and you should quote the filename, that line should be something like this: header("Content-Disposition: attachment; filename=\"$file\""); Considering that $filenam

Re: [PHP] Problem with date

2009-09-15 Thread Jonathan Tapicer
Adding the number of seconds in a day could fall in the same day due to daylight saving time, a more reliable way of adding one day (or a given number of days) is this: $tomorrow = mktime(0, 0, 0, date("m") , date("d")+1, date("Y")); Then use date() with $tomorrow to format it. (Taken from exa

Re: [PHP] Stricter Error Checking?

2009-09-23 Thread Jonathan Tapicer
Hi, There is, see here (or it can also be set through php.ini): http://www.php.net/manual/en/function.error-reporting.php You are looking for E_STRICT. Regards, Jonathan On Wed, Sep 23, 2009 at 3:11 PM, Tim Legg wrote: > Hello, > > I just spent way, way to much time trying to debug code due

Re: [PHP] Stricter Error Checking?

2009-09-23 Thread Jonathan Tapicer
I think he meant that he is using 'Number' instead of 'Part_Number' when accessing the array and not in the SQL, his SQL was correct, this was wrong: > echo $row['Number']; E_STRICT catches that kind of error. Jonathan On Wed, Sep 23, 2009 at 3:28 PM, Tommy Pham wrote: > > > - Original

Re: [PHP] html email showing instead of line breaks

2009-09-24 Thread Jonathan Tapicer
\r\n should be between double quotes: "\r\n" On Thu, Sep 24, 2009 at 3:52 PM, Adam Williams wrote: > I have users enter support tickets into a a form and then it > emails it to me, I'm trying to get the emails to display when they hit enter > correctly, so i'm changing the \r\n to , but in the e

Re: [PHP] html email showing instead of line breaks

2009-09-24 Thread Jonathan Tapicer
ought they were interchangeable. > > Jonathan Tapicer wrote: >> >> \r\n should be between double quotes: "\r\n" >> >> > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

Re: [PHP] Converting print_r() output to an array

2009-09-30 Thread Jonathan Tapicer
Hi, May be you want to take a look at serialize and unserialize functions, serialize generates a string from a variable and then unserialize can give you the value of the variable back from the string. Regards, Jonathan On Thu, Oct 1, 2009 at 12:07 AM, James Colannino wrote: > Hey everyone, I

Re: [PHP] XML RSS - Unexpected End of File error

2009-10-08 Thread Jonathan Tapicer
Can you show the generated XML? Jonathan On Thu, Oct 8, 2009 at 3:45 PM, Ashley Sheridan wrote: > Hi guys, > > I've knocked up a quick RSS feed on my site. It works fine in Fx 2 & 3, > in Opera it throws an error "unexpected end of file" but allows the feed > to be added anyway, and Chrome just

Re: [PHP] Newb question about getting keys/values from a single array element

2009-10-08 Thread Jonathan Tapicer
One possible solution: 'peach'); list($id, $name) = array_merge(array_keys($a), array_values($a)); echo "The ID is $id and the name is $name"; ?> Prints: "The ID is 8575 and the name is peach". Regards, Jonathan On Thu, Oct 8, 2009 at 10:08 PM, Daevid Vincent wrote: > I feel like a total new

Re: [PHP] Fatal error on functions valid for PHP 4, 5

2009-10-09 Thread Jonathan Tapicer
What platform? If you compiled PHP yourself you need to compile with --enable-calendar. Jonathan On Fri, Oct 9, 2009 at 10:01 AM, wrote: > Hi, > > Would someone be kind enough to test whether these following functions work? > > I'm getting: "PHP Fatal error:  Call to undefined function easter_d

Re: [PHP] exec() confused by a specially crafted string

2009-10-12 Thread Jonathan Tapicer
Confirmed, it also happens to me on Linux, PHP version: PHP 5.2.4-2ubuntu5.7 with Suhosin-Patch 0.9.6.2 (cli) (built: Aug 21 2009 19:52:39) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies And adding a single character to the echoed string makes

Re: [PHP] Spam opinions please

2009-10-20 Thread Jonathan Tapicer
That will work just for one IP, but they could spam you from another IP. I suggest you add a good captcha to the form and that way you can avoid spam forever. Regards, Jonathan On Tue, Oct 20, 2009 at 3:31 PM, Gary wrote: > I have several sites that are getting hit with form spam.  I have the s

Re: [PHP] Spam opinions please

2009-10-20 Thread Jonathan Tapicer
On Tue, Oct 20, 2009 at 3:39 PM, Ashley Sheridan wrote: > > On Tue, 2009-10-20 at 15:36 -0300, Jonathan Tapicer wrote: > > That will work just for one IP, but they could spam you from another > IP. I suggest you add a good captcha to the form and that way you can > avoid spam fo

Re: [PHP] Lightweight web server for Windows?

2009-11-15 Thread Jonathan Tapicer
Try nginx (http://nginx.net/), very light, has a Windows binary distribution and can be configured easily for PHP. You can also find some version of Lighttpd compiled for Windows and skip the compilation troubles, and you can use this: http://sites.google.com/site/lightytray/ to control the webser

Re: [PHP] Wiki recommendation?

2009-11-25 Thread Jonathan Tapicer
On Wed, Nov 25, 2009 at 8:37 PM, wrote: > On Nov 25, 2009, at 2:42 PM, Skip Evans wrote: > >> Hey all, >> >> I'm looking for a good Wiki to maintain documentation on a large >> commercial web site that is always growing. >> >> DokuWiki is the only one I've installed and used at any length, so bef

Re: [PHP] PHP APACHE SAVE AS

2009-11-27 Thread Jonathan Tapicer
You are probably missing something like this in the apache httpd.conf: LoadModule php5_module "c:/PHP/php5apache2_2.dll" PHPIniDir "c:/PHP/php.ini" AddType application/x-httpd-php .php DirectoryIndex index.php index.html index.html.var Regards, Jonathan On Fri, Nov 27, 2009 at 6:24 AM, Julian M

Re: [PHP] Problem with XPath query

2009-12-14 Thread Jonathan Tapicer
Hi, You are missing a quote after widgetType: [...@alias="widgetType and @value="system"] should be [...@alias="widgetType" and @value="system"] Regards, Jonathan On Mon, Dec 14, 2009 at 1:52 PM, Christoph Boget wrote: > Given the following XML: > > >   >     >       >     >   > > > I'm u

Re: [PHP] Logic of conditionals and the ( ) operators

2009-12-18 Thread Jonathan Tapicer
Hi, Yes, what Ashley said is correct. Also, if you want to avoid writing $perm several times in the if, or if you have a lot of permissions you can do: if (in_array($perm, array(11, 22))) And you can put in that array all the permissions you need to. Regards, Jonathan On Fri, Dec 18, 2009 at

Re: [PHP] Re: SQL Queries

2009-12-20 Thread Jonathan Tapicer
Hello, That kind of queries usually run faster using a LEFT JOIN, like this: select u.id from users u left join notes n on u.id = n.user_id where n.id is null; That query will give you the ids of the users without notes. Make sure to have an index on notes.user_id to let the LEFT JOIN use i

Re: [PHP] OOP: __construct() and "extend"

2009-12-22 Thread Jonathan Tapicer
Hey, Constructors behave the same way as regular methods with inheritance, you have to manually call the parent constructor, ie: parent::__construct(). Regards, Jonathan On Tue, Dec 22, 2009 at 7:45 PM, APseudoUtopia wrote: > Hey list, > > I'm writing my own class which extends upon the Memcac

Re: [PHP] cannot access SimpleXML object property

2010-01-07 Thread Jonathan Tapicer
On Thu, Jan 7, 2010 at 6:56 PM, Mari Masuda wrote: > Hi, > > I am working with an XML document and have a SimpleXML object whose var_dump > looks like this: > > --- > object(SimpleXMLElement)#2 (10) { >  ["@attributes"]=> >  array(1) { >    ["id"]=> >    string(7) "3854857" >  } >  ["type"]=> >  

Re: [PHP] Count the Number of Certain Elements in An Array

2010-01-11 Thread Jonathan Tapicer
On Mon, Jan 11, 2010 at 6:21 PM, Alice Wei wrote: > > Hi, > >  This seems like a pretty simple problem, but I can't seem to be able to > figure it out. I have a lot of elements in an array, and some of them are > duplicates, but I don't want to delete them because I have other purposes for > it

Re: [PHP] array_count_values Problem

2010-01-12 Thread Jonathan Tapicer
Hi, The function array_count_values returns an array (http://php.net/array_count_values). So you are using it the wrong way, you should assign the return value to a variable and then access some index. Regards, Jonathan On Tue, Jan 12, 2010 at 11:09 AM, Alice Wei wrote: > > Hi, > >  I have a c

Re: [PHP] http vs https

2010-01-23 Thread Jonathan Tapicer
Hi, isset($_SERVER['HTTPS']) should do it. Regards, Jonathan On Sat, Jan 23, 2010 at 2:11 PM, Ben Miller wrote: > Is there a PHP function that will return whether the request was http or > https?  I have functions that need to cURL other servers - sometimes over > SSL, sometimes not, depending

Re: [PHP] Storing time in mysql prior to 1970

2010-01-27 Thread Jonathan Tapicer
On Wed, Jan 27, 2010 at 7:58 PM, Haig Davis wrote: > Hi Everyone, > > I'm sure I'm missing something simple. I'm trying to store dates of birth > prior to 1970 in mysql. I've tried mysql's date_format but am hitting a > wall. I'm chasing my tail and was hoping for the best practice. > > Many Thank

Re: [PHP] Including files on NFS mount slow with APC enabled

2010-08-16 Thread Jonathan Tapicer
Hi, APC checks by default if every included file was modified doing a stat call. You can disable it, setting apc.stat to 0 (http://www.php.net/manual/en/apc.configuration.php#ini.apc.stat). Try if that improves the performance. Of course, you should manually delete the APC opcode cache every time

Re: [PHP] Check for existence of mail address

2010-10-25 Thread Jonathan Tapicer
You can use this class: http://www.webdigi.co.uk/blog/wp-content/uploads/2009/01/smtpvalidateclassphp.txt It may not work for some SMTPs. It uses the concepts explained here: http://www.webdigi.co.uk/blog/2009/how-to-check-if-an-email-address-exists-without-sending-an-email/ On Mon, Oct 25, 2010

Re: [PHP] Open Source PHP/ mySQL Project Management

2010-11-11 Thread Jonathan Tapicer
Hi, I don't know if it meets all of the features you enumerated but Mantis (http://www.mantisbt.org/) is very good, and it is PHP+MySQL (or Postgres, or MSSQL). Jonathan On Thu, Nov 11, 2010 at 7:23 PM, Don Wieland wrote: > Hi gang, > > I am looking into Project Management apps for my projects.

Re: [PHP] Common session for all subdomains?

2010-12-20 Thread Jonathan Tapicer
Hi! You should use the function session_set_cookie_params to set the session cookie domain to ".oire.org" like this comment explains: php.net/manual/en/function.session-set-cookie-params.php#94961 Regards, Jonathan On Mon, Dec 20, 2010 at 7:18 PM, Andre Polykanine wrote: > Hello php-general, >

Re: [PHP] File concurrent file access

2011-07-22 Thread Jonathan Tapicer
On Fri, Jul 22, 2011 at 10:44 AM, Florian Lemaitre wrote: > Hi ! > > I'm developing my new website and I'm worried about concurrent file access. > In fact, I want to suppress a maximum database interactions so I keep > information in files with faster I/O than databases. > But I'm worried by the f