Re: [PHP] date time problem

2013-10-06 Thread Jonathan Sundquist
This should help you out http://stackoverflow.com/questions/365191/how-to-get-time-difference-in-minutes-in-php On Oct 6, 2013 6:07 PM, "Farzan Dalaee" wrote: > Its so freaky > > Best Regards > Farzan Dalaee > > > On Oct 7, 2013, at 2:29, Jim Giner wrote: > > > >> On 10/6/2013 6:49 PM, Farzan Da

Re: [PHP] mongo usage

2013-07-06 Thread Jonathan Sundquist
You commented out the setting of yhe addresses variable On Jul 6, 2013 1:42 PM, "Tim Dunphy" wrote: > Hey all, > > I'm trying to pick up some basic use of MongoDB using PHP. > > I seem to have hit an early obstacle that I'd like your opinion on. I try > to pass an array to the mongo insert func

Re: [PHP] timezone

2013-04-15 Thread Jonathan Sundquist
On Mon, Apr 15, 2013 at 12:14 PM, Larry Martell wrote: > I have a client that has an app the runs with PHP 5.1.6. They want to > upgrade to 5.3.3. First issue I ran into, they have a line of code > that is: > > $deftz = date("T"); > > I'm getting this for that line: > > [Mon Apr 15 10:44:16 2013]

Re: [PHP] UNLESS Statement Equivalent

2013-03-11 Thread Jonathan Sundquist
Angela, the variable $current_page does not exist. so $curent_page does not equal $saved_page. Also the ! in front of the entire statement means that all of this is false. Since one items is true and not true = false "Don't save" is echoed out. If you are looking to save the results based on th

Re: [PHP] UNLESS Statement Equivalent

2013-03-11 Thread Jonathan Sundquist
y = "UPDATE `table` SET `hits` = '$count', `agent` = '$agent', `ts` = '$date_time' WHERE `page` = '$page'"; $result = mysql_query($query) or die ('Error! -- ' . mysql_error()); On Mon, Mar 11, 2013 at 5:48 PM, Angela Barone wrote: &

Re: [PHP] UNLESS Statement Equivalent

2013-03-11 Thread Jonathan Sundquist
Since you already have the return statement with the if statement the else isn't required. If those three statements are true you would exit the call any ways On Mar 11, 2013 4:33 PM, "Angela Barone" wrote: > I'm looking for an 'unless' statement, but as far as I can tell, > PHP doesn't h

Re: [PHP] Is header() malfunction due to PHP5.3.3 -> 5.4.11 transition?

2013-02-09 Thread Jonathan Eagle
ng through that I see what seems to be a bunch of error log files. I will look through those and see what I can find. Thanks again, Jonathan , On 2/9/2013 4:14 PM, Matijn Woudt wrote: > On Sat, Feb 9, 2013 at 10:08 PM, Jonathan Eagle wrote: > >> My 'display_errors' is &qu

Re: [PHP] Is header() malfunction due to PHP5.3.3 -> 5.4.11 transition?

2013-02-09 Thread Jonathan Eagle
My 'display_errors' is "ON" and my 'error_reporting' is "22517". I'm not sure what that means but it looks as if I should be getting error messages somewhere. Jonathan On 2/9/2013 4:02 PM, Stuart Dallas wrote: > On 9 Feb 2013, at 21:00, Jonat

Re: [PHP] Is header() malfunction due to PHP5.3.3 -> 5.4.11 transition?

2013-02-09 Thread Jonathan Eagle
Matijn, Thanks for the suggestion. Your suspicions were correct. I am now tracking down the culprit. Jonathan On 2/9/2013 2:34 PM, Matijn Woudt wrote: > On Sat, Feb 9, 2013 at 8:00 PM, Jonathan Eagle wrote: > >> >> >> I'm having a problem with a very straightfo

Re: [PHP] Is header() malfunction due to PHP5.3.3 -> 5.4.11 transition?

2013-02-09 Thread Jonathan Eagle
d routines and classes/objects in the initialize script are the culprit. I greatly appreciate the assistance, Jonathan On 2/9/2013 2:34 PM, Stuart Dallas wrote: > On 9 Feb 2013, at 19:00, Jonathan Eagle wrote: > >> I'm having a problem with a very straightforward routine; o

[PHP] Is header() malfunction due to PHP5.3.3 -> 5.4.11 transition?

2013-02-09 Thread Jonathan Eagle
ted that I should come here for help, so here I am. Can anyone shed some light as to what is (or might be) going on? Any help or guidance that can be offered will be greatly appreciated. Jonathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Web User Management

2013-01-30 Thread Jonathan Sundquist
For Zend Framework 2, take a look at https://github.com/ZF-Commons/ZfcUser On Wed, Jan 30, 2013 at 10:19 AM, Adolfo Olivera wrote: > >You can take a look at the classes from the Zend Framework (they can be > used > >stand alone as well) > > Thanks Marco, which classes specifically are you talkin

Re: [PHP] Strip emails from a document

2013-01-26 Thread Jonathan Sundquist
If you are expecting the email address to always be the same but the first part being different you can create a regular expression to match it that way. Using a regular expression over all is going to be your best bet as shiplu suggested. On Sat, Jan 26, 2013 at 10:54 AM, shiplu wrote: > I thi

Re: [PHP] date problem

2013-01-03 Thread Jonathan Sundquist
Marc, When you take a date and do a strtotime you are converting it to an int which you can compare to each other much easier. So for your above example you would be best doing. define('WSOFFBEGIN','09/16/2012'); $jes = 01/03/2012; if ( strtotime($jes) < strtotime(WSOFFBEGIN) ) { $error

Re: [PHP] date problem

2013-01-03 Thread Jonathan Sundquist
1/3/2012 is in fact less then 9/16/2012. On Thu, Jan 3, 2013 at 3:57 PM, Marc Fromm wrote: > I am comparing to dates. > > define('WSOFFBEGIN','09/16/2012'); > $jes = 01/03/2012; > > if ( date("m/d/Y", strtotime($jes)) < date("m/d/Y", strtotime(WSOFFBEGIN)) > ) > { > $error = " M

Re: [PHP] Re: form validation

2012-12-20 Thread Jonathan Sundquist
On Thu, Dec 20, 2012 at 9:34 AM, Jim Giner wrote: > If you are using mysql for a db, then you should already be using > mysql_real_escape_string in place of addslashes. You should not be using mysql_real_escape_string going forward as it will be deprecated in php 5.5.0. http://php.net/manual/en/

Re: [PHP] how to read emails with php

2012-12-04 Thread Jonathan Sundquist
ke ssl setting or > somthing like that > Or this host im using block imap or pop3 access > > Best Regard > Farzan Dalaee > On Dec 4, 2012 10:03 PM, "Jonathan Sundquist" > wrote: > >> Try removing the call to the inbox and try getting a list of a

Re: [PHP] how to read emails with php

2012-12-04 Thread Jonathan Sundquist
wn on line 0 > > > this is my code > > $host = 'mail.mydomain.net:143/pop3'; > $user = 'x...@mydomain.net'; > $password = 'myPassword'; > $mailbox = "{$host}INBOX"; > $mbx = imap_open($mailbox , $user , $password); > > $check = imap_check(

Re: [PHP] how to read emails with php

2012-12-04 Thread Jonathan Sundquist
What does it say when you call imap_errors or imap_last_error? On Tue, Dec 4, 2012 at 10:02 AM, Farzan Dalaee wrote: > i dont have access to log files on server > > On Azar 14, 1391, at 5:51 PM, Daniel Brown wrote: > > > On Tue, Dec 4, 2012 at 8:10 AM, Farzan Dalaee > wrote: > >> hi guys > >> i

[PHP] Creating an Advanced Form

2012-11-02 Thread Jonathan Davies
quot;window.open(this.href,'_blank');return false;">http://www.w3.org/Icons/valid-xhtml10"; alt="Valid XHTML 1.0 Strict" height="31" width="88" /> http://jigsaw.w3.org/css-validator/check/referer"; onclick="window.open(this.href,'_blank');return false;">http://jigsaw.w3.org/css-validator/images/vcss"; alt="Valid CSS!" /> [/code] Thanks for looking, Jonathan

Re: [PHP] SNMP via PHP

2012-10-15 Thread Jonathan Sundquist
There appears to be quite a few examples, https://www.google.com/search?q=php+snmp+example, and tutorials, https://www.google.com/search?q=php+snmp+example

Re: [PHP] SNMP via PHP

2012-10-15 Thread Jonathan Sundquist
There appears to be quite a few examples, https://www.google.com/search?q=php+snmp+example, and tutorials, https://www.google.com/search?q=php+snmp+example

Re: [PHP] Friday - Return of Brain Teasers

2012-10-05 Thread Jonathan Sundquist
It means we require more cowbell. On Fri, Oct 5, 2012 at 3:34 PM, Steven Staples wrote: > > Subject: [PHP] Friday - Return of Brain Teasers > > > > About five-and-a-half years ago, we had a brainteasers thread going > > on[1]. Last year it was briefly resurrected[2], and both times got some

Re: [PHP] install PHP 5.4 by RPM

2012-09-25 Thread Jonathan Sundquist
What version of centso are you running? - "The cold winds are rising" On Sep 24, 2012 10:28 PM, "lx" wrote: > Hello: >I have installed the PHP and Apache by RPM, and the version of rpm > packets is: > > httpd-2.2.3-63.el5.centos.1.x86_64.rpm > apr-1.2.7-11.el5_3.1.x86_64.rpm > apr-util-1

Re: [PHP] Cost of redirect and site domain switch? Good Practice / Bad Practice / Terrible Practice

2012-08-17 Thread Jonathan Sundquist
Depending on how long you have why not just do an alias? No redirect required. On Fri, Aug 17, 2012 at 2:35 PM, Tristan wrote: > So, I need to change from somedomain.com to somenewdomain.com > > I was thinking of doing this > > 1) create an alias to the site somenewdomain.com to point to current

Re: [PHP] File concurrent file access

2011-07-22 Thread Jonathan Tapicer
> Best regards. > Florian > With file_put_contents you send a flag to lock the file and avoid concurrency problems, eg: file_put_contents('/some/file', 'data', FILE_APPEND | LOCK_EX); Regards, Jonathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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: > Hell

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 f

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] Re: Possible foreach bug; seeking advice to isolate the problem

2010-10-23 Thread Jonathan Sachs
On Sat, 23 Oct 2010 16:56:52 +0200, peter.e.l...@gmail.com (Peter Lind) wrote: >More information (and a complete breakdown of your problem) is >available here: >http://schlueters.de/blog/archives/141-References-and-foreach.html Thank you! The situation is obscure and confusing, but that explanati

Re: [PHP] Re: Possible foreach bug; seeking advice to isolate the problem

2010-10-23 Thread Jonathan Sachs
On Sat, 23 Oct 2010 08:34:27 +0200, peter.e.l...@gmail.com (Peter Lind) wrote: >It is not a bug - somewhere before the foreach loop you've got, a >variable is being referenced, and that's throwing things off. >Otherwise, unsetting the variable would have no effect on the problem >you're seeing. C

[PHP] Re: Possible foreach bug; seeking advice to isolate the problem

2010-10-22 Thread Jonathan Sachs
Gary wrote: >Better. I can tell you how to solve it: >$a = array('a', 'b','c'); >foreach($a as &$row){ >//you don't have to do anything here >} >unset($row); // <<<< THIS IS KEY! >print_r($a); >foreach($a as $row){ >echo "".$row; >} >print_r($a);

[PHP] Re: Possible foreach bug; seeking advice to isolate the problem

2010-10-20 Thread Jonathan Sachs
On Wed, 20 Oct 2010 08:37:55 +0200, php-gene...@garydjones.name (Gary) wrote: >Better. I can tell you how to solve it: >$a = array('a', 'b','c'); >foreach($a as &$row){ >//you don't have to do anything here >} >unset($row); // <<<< THIS IS KEY! >print_r($a); >fo

[PHP] Possible foreach bug; seeking advice to isolate the problem

2010-10-19 Thread Jonathan Sachs
I've got a script which originally contained the following piece of code: foreach ( $objs as $obj ) { do_some_stuff($obj); } When I tested it, I found that on every iteration of the loop the last element of $objs was assigned the value of the current element. I was able to step through the loo

Re: [PHP] ZipArchive, but without files

2010-09-23 Thread Jonathan Mills
> and what if you serialize your String? You can save Objects in it... True, but the defined format for the item in the database is a zip file (it gets exported later to another, external, application which eats zip files) :-( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, vi

Re: [PHP] ZipArchive, but without files

2010-09-22 Thread Jonathan Mills
string" - is what I'm looking for. Kind Regards Jonathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] ZipArchive, but without files

2010-09-22 Thread Jonathan Mills
7;t found any way of creating the data other than in a file yet. Jonathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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

2010-08-16 Thread Jonathan Tapicer
you modify a PHP file, since APC won't detect that it was modified. Regards, Jonathan On Mon, Aug 16, 2010 at 10:21 AM, Mark Hunting wrote: > I am struggling with the performance of some websites that use a lot of > includes (using include_once). The files are on a NFS mount (NFSv

RE: [PHP] Script to add domain users to local groups on remote machines

2010-06-04 Thread Mayer, Jonathan
-Original Message- From: tedd [mailto:tedd.sperl...@gmail.com] Sent: 04 June 2010 15:34 To: Mayer, Jonathan; php-general@lists.php.net Subject: Re: [PHP] Script to add domain users to local groups on remote machines At 11:16 AM +0100 6/4/10, Mayer, Jonathan wrote: >Hello, > >H

[PHP] Script to add domain users to local groups on remote machines

2010-06-04 Thread Mayer, Jonathan
Hello, Has anyone got any ideas how I might add a user to a local group on a remote networked Windows machine via a PHP script? The idea is to make an automated tool where users can request access to a shared folder via our intranet, and after suitable approval the system add them to a group wh

[PHP] COM/DCOM

2010-05-25 Thread Mayer, Jonathan
Hello, I'm trying to write a few scripts to help automate some Windows administration tasks. One of these is to add people to groups on different networked machines. I've written something like the following: TestComputer' , 'Username' => 'TestUser' , 'Password' => 'TestPass'); // lis

Re: [PHP] Who uses Mantis, please help!

2010-04-08 Thread Jonathan Vivero
Review your mantis mail settings. If I remember well, there are two possibilities, direct (pop3) mail or phpmailer. In www.mantisbt.org you can find all information you need. I've been in the same situation, and found out how to resolve it with success. 2010/4/7 Paul M Foster > On Wed, Apr 07,

[PHP] Re: Report generators: experience, recommendations?

2010-02-14 Thread Jonathan Sachs
On Sat, 13 Feb 2010 20:01:35 -0500, n...@ridersite.org (Al) wrote: >> I'm looking for a report generator which will be used to create >> management reports for my client from a MySQL database >> >> Has anyone had experience with report generators that meet these >> criteria? What would you rec

[PHP] Report generators: experience, recommendations?

2010-02-13 Thread Jonathan Sachs
I'm looking for a report generator which will be used to create management reports for my client from a MySQL database. The web site is implemented in PHP. Some characteristics that would be nice to have, roughly in order of importance: * It is moderately priced (a few hundred dollars at most) or

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] 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 >

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, > &g

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

2010-01-11 Thread Jonathan Tapicer
t;  1 > > Is there a simple code that I use to find this out? > > Thanks for your help. > > Alice > > _ > Hotmail: Trusted email with powerful SPAM protection. > http://clk.atdmt.com/GBL/go/196390707/direct/01/ Hi, Try the function array_count_values. Regards, Jonathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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] 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 ex

Re: [PHP] Re: SQL Queries

2009-12-20 Thread Jonathan Tapicer
it and run faster. Hope that helps, regards, Jonathan On Sun, Dec 20, 2009 at 6:41 PM, דניאל דנון wrote: > Sorry for the double-post, forgot to add up the way I thought about using: > > Simple sql query: > > SELECT * FROM `users` as u  WHERE (SELECT COUNT(id) FROM notes WHERE 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] 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: >

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, 200

Re: [PHP] Wiki recommendation?

2009-11-25 Thread Jonathan Tapicer
the Raid controller, > you'll be fine performance and DR wise. > > If its Linux, then MD based (software raids) works pretty well. > > - aurf > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > I also recommend dokuwiki (with a k, not c :) ): http://www.dokuwiki.org/ Regards, Jonathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Lightweight web server for Windows?

2009-11-15 Thread Jonathan Tapicer
webserver. Both of them are lighter than Apache. Good luck, Jonathan On Sun, Nov 15, 2009 at 6:00 PM, O. Lavell wrote: > What do people on this list use as an ultra-lightweight web server (with > PHP capability of course) on Windows? I have an old but still well > functioning laptop that I

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] 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

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

2009-10-12 Thread Jonathan Tapicer
it work fine, seems like a bug to me. Regards, Jonathan On Mon, Oct 12, 2009 at 1:10 PM, Soner Tari wrote: > When shell command returns a specially crafted string, I get an empty > array as $output of exec(), instead of the string. I can very easily > reproduce this issue as follows

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:  C

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 Vinc

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 > t

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 every

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] 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] 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, 2

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

Re: [PHP] how i assign a js variable to a php variable

2009-09-18 Thread Jonathan Vivero
And of course, sorry for my english!!! I correct!! Imagine you have an assoc. array that you encode with json and save into the > js var. Ok. > > This way is perfect. But you can do less with this values than using my > solution. Important: Each case is different, and may be studied in > particul

Re: [PHP] how i assign a js variable to a php variable

2009-09-18 Thread Jonathan Vivero
imagine you have an assoc. array that you encode with json and save in the js var. Ok. This way is perfect. But you can do less with this values than using my solution. Important: Each case is different, and may be studied in particular. You can not pass this myPHPvar javascript var as an input i

Re: [PHP] how i assign a js variable to a php variable

2009-09-18 Thread Jonathan Vivero
Or you can also do this way: on loading "; [...] echo " functino recalculateValue(){ var myText = document.getElementById("myphpvar"); var myValue = myText.value; /* operations with myText */ myText.value = myRecalcValue; } once changed, you choose how to proceed, maybe executing any other

RE: [PHP] Problem with date

2009-09-15 Thread Mayer, Jonathan
strtotime would be a neater way of solving the problem... ie (untested): $n = 0; while ($n <= 9) { $date = "d".$n; $$date = date("Y-m-d", strtotime("+ $n days") $n++; } If you are just enquiring about the maths though, I'm not sure! -Original Message- From: Korga

Re: [PHP] Problem with date

2009-09-15 Thread Jonathan Tapicer
row to format it. (Taken from example #3 here: http://www.php.net/manual/en/function.date.php, see the Note below the example in that page). Hope that helps. Regards, Jonathan 2009/9/15 Korgan : > Hi, > >  I have a problem with date function. > > $gen_pos = mktime(0,0,

Re: [PHP] File download question

2009-09-06 Thread Jonathan Tapicer
\"$file\""); Considering that $filename already has the 7z extension. Jonathan On Sun, Sep 6, 2009 at 3:19 PM, Chris Payne wrote: > Hi Everyone, > > I've setup a filedownload which works but i'm having an issue, i've > left out but when it downloads it, while it

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] 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 p

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

2009-08-22 Thread Jonathan Tapicer
[2]=> string(3) "cat" [3]=> string(7) " and a " [4]=> string(3) "dog" } Then you just have to go through the result array of preg_split and concatenate every "cat" and "dog". Regards, Jonathan On Sat, Aug 22, 2009 at 12:32 PM

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

Re: [PHP] Embedding foreach loops

2009-08-10 Thread Jonathan Tapicer
 />'; >  print '      yes/no'; >  print ''; > } > ?> > > [/code] > > In case you were wondering why I embedded the foreach statement, I need each > array (eg. $show_22) to display in a row, and I need PHP to build as many > rows are there are shows. > > Is this something I need to have in a database to work? > > Thanks! > Embedded loops are OK, actually I don't know a language where you can't do it :) I think that your problem is the $shows array creation, you do this: > $shows = array(); > > $shows['show_01'] = $show_01; > $show_01 = array(); Note that you are assigning $show_01 to a key in $shows before creating $show_01, you should first create and fill $show_01 and then assign it to a key in $shows. Hope that helps. Jonathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Array

2009-08-10 Thread Jonathan Tapicer
ber_services" ) AND ( $page > <> "member_services_login" ) AND ( $page <> "member_services_logoff" ) AND ( > $page <> "resource_center" ) AND ( $page <> "network" ) ) { Something like: } elseif (!in_array($page, ar

Re: [PHP] Notification system

2009-08-07 Thread Jonathan Tapicer
flush function to send data a continue processing/polling. Regards, Jonathan 2009/8/7 Phpster : > > > > > On Aug 2, 2009, at 7:59 AM, Dušan Novaković wrote: > >> Hi, >> >> Does anyone has any idea how to create notification system with >> combination

Re: [PHP] Trying to create a comment function

2009-08-06 Thread Jonathan Tapicer
o that it will display > anything you type within the quotes in comment(" "). > If you want the string to be rendered as it is without variable replacements you can use single quotes, like this: comment('test of $newComment'); That will render exactly this: test of

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

2009-08-02 Thread Jonathan Tapicer
nt constructor without knowing the number of parameters. Let me know if that helps. Jonathan On Sun, Aug 2, 2009 at 10:40 PM, Ralph Deffke wrote: > problem: > > __ construct( $something ... variable argument list ){ >    parent::__construct( ??? ); > } > > I tried with func_g

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

2009-07-30 Thread Jonathan Tapicer
h visited node, if you have to mark a node already marked then you have a cycle. Tarjan's algorithm does that and a little more, see here: http://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm Hope that helps. Jonathan On Thu, Jul 30, 2009 at 8:38 PM, Matt Neimeye

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] 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

Re: [PHP] Getting rid of extra lines

2009-07-29 Thread Jonathan Tapicer
ether..seems like there has to be an easier way... > > This is what I tried: > >     $tags = array('\n', '');    $sNotes = str_replace($tags,"", $notes); > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.ne

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: >

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

2009-07-21 Thread Jonathan Tapicer
-- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > That is javascript thing, not PHP. The Yahoo UI has a nice one, here you have an example: http://developer.yahoo.com/yui/examples/calendar/calcontainer_clean.html, and here

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] 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] why is this shell_exec() failing to execute my shell to create a symlink?

2009-06-27 Thread Jonathan Tapicer
path for ls and ln, it depends on your OS, but probably they are: /bin/ls and /bin/ln If that doesn't help, can you show us the output? Jonathan On Sat, Jun 27, 2009 at 5:46 PM, Govinda wrote: > this code: > > >        $testOutput = shell_exec("ls"); >

Re: [PHP] CSV file

2009-06-25 Thread Jonathan Tapicer
n of Alain, but this could always be useful for someone. Jonathan On Thu, Jun 25, 2009 at 5:37 AM, Richard Heyes wrote: > Hi, > >> 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 >>

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-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
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
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, Ju

Re: [PHP] Pointers for NuSOAP

2009-06-22 Thread Jonathan Tapicer
http://www.scottnichol.com/nusoapprogwsdl.htm It's nice, and it has lots of working examples. Jonathan On Mon, Jun 22, 2009 at 11:02 AM, Anton Heuschen wrote: > Does anyone have any good links to basic and more advanced (and some > examples) of NuSOAP and using this ? > > Would be a

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, becau

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

[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

  1   2   3   4   5   6   7   >