Re: [PHP] Question about a security function

2010-05-21 Thread David Otton
On 21 May 2010 14:21, Ashley Sheridan wrote: > I still think you might be better off using BBCode, which is used on > websites just for this very purpose. When any input comes back, you can > remove all the HTML completely and replace the BBCode tags that you > allow. This should guarantee that t

Re: [PHP] Question about a security function

2010-05-21 Thread David Otton
On 20 May 2010 16:51, Al wrote: > I'm not being clear. First pass is thru the blacklist, which effectually > tells hacker to not bother and totally deletes the entry. > > If the raw entry gets past the blacklist, it must then only contain my > whitelist tags. e.g., the two examples you cited were

Re: [PHP] Question about a security function

2010-05-20 Thread David Otton
On 20 May 2010 15:52, Al wrote: > I agree blacklisting is a flawed approach in general. My approach is to > strictly confine entry text to a whitelist of benign, acceptable tags. The But that's not what you've done. You've blacklisted the following patterns: "\ would sail straight through tha

Re: [PHP] Question about a security function

2010-05-20 Thread David Otton
On 20 May 2010 13:53, Al wrote: > > I have a password-protected, user, on-line editor that I'm hardening against > hackers just in case a user's pw is stolen or local PC is infected. > > The user can enter html tags; but, I restrict the acceptable tags to benign > ones. e.g., , , , etc.  e.g., no

Re: [PHP] Converting floats to ints with intval

2010-05-06 Thread David Otton
On 6 May 2010 11:52, Paul Waring wrote: > If I was designing the system from scratch, that's what I'd do. > Unfortunately this is an add-on to a legacy system where currency values are > already stored as strings in the database (yes, not ideal I know, but you > have to work with what you've got)

Re: [PHP] In need of CVS/SVN checkout script for Production servers [solved]

2010-05-06 Thread David Otton
On 6 May 2010 04:14, Adam Richardson wrote: > Daevid asked the list for a an app that facilitated SVN/CVS, and when nobody > provided options, he crafted a solution of his own and then offered it back > to the list. Er... I suggested Phing. Phing/Ant/Gradle/Maven/Capistrano... a build tool is th

Re: [PHP] In need of CVS/SVN checkout script for Production servers

2010-04-30 Thread David Otton
On 29 April 2010 20:32, Daevid Vincent wrote: > I'm looking for a script (bash or php) that I would run on my production > web server that would do this or close to it: > >        1. do a CVS/SVN checkout to a new timestamped directory >        2. change the symlink from the old directory >      

Re: [PHP] Little php code - error

2010-04-08 Thread David Otton
On 8 April 2010 15:21, Juan wrote: > The structure is pretty easy to understand, however I'm not able to > solve this. Could you tell me why I'm not able to run this code. Your else has a condition on it } else (empty($b) and empty($c)) { Should be } else { BTW, the "and" is fine. -- PHP G

Re: [PHP] How to redefine a function if it doesn't exist?

2010-03-30 Thread David Otton
On 30 March 2010 14:16, Andre Polykanine wrote: > I need a quoted_printable_encode function but it's available only > since PHP 5.3. How do I redefine that function only if PHP version is > lower than 5.3? function_exists(). if (!function_exists('myfunc')) { function myfunc() { ;

Re: [PHP] Re: Memory investigation

2010-03-03 Thread David Otton
On 3 March 2010 15:49, la...@garfieldtech.com wrote: > Yep, I'm familiar with XDebug and KCacheGrind.  As you say, though, it > doens't (as far as I am aware) offer the particular data that I'm after. >  We've already got cachegrind gurus working on the code who know how to use > it better than I

Re: [PHP] How to write specification

2010-01-08 Thread David Otton
2010/1/8 Dušan Novaković : > I've been programing for some time, but I never tried to write code > for two different application in same way. How when I work with more > programmers it's even worse. Everyone is forcing it's way of writing > functions inside classes or writing variables, etc. My id

Re: [PHP] amount of overlaping dates

2009-12-03 Thread David Otton
2009/12/3 Merlin Morgenstern : > That is what I thought first, too! But this does not work correct as there > might be a booking starting for example tomorrow. There needs to be free > place for the entire booking period. Ah, of course. I see the problem now. It's an odd situation, because you do

Re: [PHP] amount of overlaping dates

2009-12-03 Thread David Otton
2009/12/3 Merlin Morgenstern : > I am searching for a way to identify the amount of simultanious date ranges. > > Example: > > array start=('1.12', '5.12', '9.12'); > array end =('8.12', '12.12', '16.12'); > > Looks like this in a table: > start   end > 1.12    8.12 > 5.12    12.12 > 9.12    16.12

Re: [PHP] Metadata - mysqli

2009-11-24 Thread David Otton
2009/11/24 keyser soze : > mysqli_fetch_field provide result metadata > like 'column name', 'max length', 'datatype' etc > but i need the "comment" of each column > > is this possible? The table that stores data about columns is information_schema.COLUMNS. You're looking for the COLUMN_COMMENT co

Re: [PHP] Convert deprecated POSIX functions into wrappers for equivalent PCRE functions

2009-11-09 Thread David Otton
2009/11/9 Tony Marston : > Because I can't do that until I install PHP 6, but as I never play with beta > software waiting for it to go live will be too late. Not sure why not. If it's just the name collision, call them alt_ereg*() until ereg*() goes away. In fact, it's much easier to write unit

Re: [PHP] Convert deprecated POSIX functions into wrappers for equivalent PCRE functions

2009-11-09 Thread David Otton
2009/11/9 Tony Marston : > So you wouldn't trust the PHP developers to write simple code which takes > each POSIX function and redirects it to a PCRE function? I have more faith > in their ability than I do yours. If it's as simple as you claim, why don't you mock-up your solution in PHP, rather

Re: [PHP] How is this possible?

2009-10-28 Thread David Otton
2009/10/28 tedd : > > Hi gang: > http://php.net/manual/en/security.globals.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How to Get the Sub Classes of a Parent Class

2009-10-28 Thread David Otton
2009/10/28 David Otton : > 2009/10/28 Raymond Irving : > >>  I'm try to do something like what Martin Scotta did but I'm looking for a >> solution that did not require me to loop through get_declared classes() to >> find a sub class. > > Place all your chil

Re: [PHP] How to Get the Sub Classes of a Parent Class

2009-10-28 Thread David Otton
2009/10/28 Raymond Irving : >  I'm try to do something like what Martin Scotta did but I'm looking for a > solution that did not require me to loop through get_declared classes() to > find a sub class. Place all your child classes in the same namespace, and use ReflectionNamespace::getClasses().

Re: [PHP] What is the best practice for adding persistence to an MVC model?

2009-10-27 Thread David Otton
2009/10/27 David Otton : > If you go with the first approach, you're writing code that you and > anyone who comes after you can write useful tests for. The others, and > you're denying maintenance programmers a useful tool. I should have lead with this: the wikipedia ar

Re: [PHP] What is the best practice for adding persistence to an MVC model?

2009-10-27 Thread David Otton
2009/10/27 Paul M Foster : > On Tue, Oct 27, 2009 at 05:27:07PM +1100, Eric Bauman wrote: >> I'm in the process of implementing an ultra-light MVC framework in PHP. >> It seems to be a common opinion that the loading of data from a >> database, file etc. should be independent of the Model, and I

Re: [PHP] How to Get the Sub Classes of a Parent Class

2009-10-26 Thread David Otton
2009/10/27 Raymond Irving : >>> I want to automatically initialize a specific sub class when the php page >>> is loaded. >> You may be able solve this with a simple class_exists() (pseudo-code ahead): >> >> if(class_exists($var)) { >> $class = new $var; >> } else { >> $class = new FourOhF

Re: [PHP] how to replace many spaces with one space?

2009-10-25 Thread David Otton
2009/10/25 Jeffry Lunggot : > Hi, > > how to replace many spaces in any string of character with  one space? $str = preg_replace('/\s\s+/', ' ', $str); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How to Get the Sub Classes of a Parent Class

2009-10-25 Thread David Otton
2009/10/25 Raymond Irving : > I want to automatically initialize a specific sub class when the php page is > loaded. > > I'm looking for a solution for php 5.1+ or anything that's optimized for 5.3 You may be able solve this with a simple class_exists() (pseudo-code ahead): if(class_exists($var

Re: [PHP] How to Get the Sub Classes of a Parent Class

2009-10-25 Thread David Otton
2009/10/25 Raymond Irving : > Hello, > > Does any know of an optimized solution to get all the subclasses for a parent > class? That's not exactly a typical thing to want, although I can see a couple of ways to do it... what exactly are you trying to do, and are you using PHP5.3? -- PHP Genera

Re: [PHP] How to Delete the parent node, and child nodes/leafs for a db/tbl in php

2009-10-16 Thread David Otton
2009/10/16 bruce : > I've got a situation where I have a couple of tables. The relationship > between the tables is one of parent/child. I'm trying to figure out the best > approach to being able to delete the associated children in the child tbls, > of a given parentID in the parentTBL... > > I'v

Re: [PHP] Re: Insult my code!

2009-10-13 Thread David Otton
2009/10/13 Eric Bauman : > *sigh* sometimes I really wish PHP allowed one to be a bit more heavy-handed > with types (optional real type hinting would be nice). There's a scalar type-hinting patch floating around somewhere, but then your code would only work on machines with that patch. > I gues

Re: [PHP] How do YOU set default function/method params?

2009-10-12 Thread David Otton
2009/10/12 Stephan Ebelt : > as far as I understood/use it: I try to hardcode as many workable defaults in > the vo class as possible (ie. see $subject in the example). Then I create > objects > by passing result records from the database (arrays) to the constructor. That > either returns a objec

Re: [PHP] Re: Insult my code!

2009-10-12 Thread David Otton
2009/10/11 Eric Bauman : > As before, please feel free to insult my code. ;-) Any and all feedback is > of course most appreciated. I know you're more concerned with structure, but your checkInt() method is arguably buggy/has an un-noted assumption. It accepts ints formatted as ints and strings,

Re: [PHP] Insult my code!

2009-10-07 Thread David Otton
2009/10/7 Paul M Foster : > I think this is a bit extreme. It really depends on what's in your > parent model class. It could be something really simple, but something > you don't want to have to rewrite in every model you code. Thinking that Have you got an example of something that is needed by

Re: [PHP] Insult my code!

2009-10-07 Thread David Otton
2009/10/7 Eric Bauman : > > On 7/10/2009 7:25 PM, David Otton wrote: >> >> 2009/10/7 Eric Bauman: >> >>> Any thoughts would be much appreciated! >> >> One observation. "Model" isn't a synonym for "Database Table" - models &

Re: [PHP] Output buffering

2009-10-07 Thread David Otton
2009/10/7 Arno Kuhl : > Thanks David. After taking another look at the description for ob_start() I > began to suspect there was a difference, but the manual doesn't mention > anything about it. And the fact they use the same terminolgy for both the > settings and the functions is confusing. I can

Re: [PHP] Output buffering

2009-10-07 Thread David Otton
2009/10/7 Arno Kuhl : > According to the manual I shouldn't see anything at all when > output_buffering is off (or if memory serves me correctly I should see an > error about "headers already sent" or something). Looking at phpinfo > confirms the value echoed by the script. Has something changed w

Re: [PHP] Insult my code!

2009-10-07 Thread David Otton
2009/10/7 Eric Bauman : > Any thoughts would be much appreciated! One observation. "Model" isn't a synonym for "Database Table" - models can be anything that encapsulates business logic. Requiring all your models to inherit from Model is probably a bad idea. -- PHP General Mailing List (http://

Re: [PHP] PHPNW09

2009-10-06 Thread David Otton
2009/10/6 Ashley Sheridan > No, it is a little far out for me. Is there something similar in Londinium? Dozens, probably. Try the PHPLondon guys, and the PHP UK Conference for a start: http://www.phplondon.org/wiki/Main_Page http://www.phpconference.co.uk/ -- PHP General Mailing List (http:/

[PHP] PHPNW09

2009-10-06 Thread David Otton
Is anyone from the list heading to PHPNW this weekend? Saturday: Keynote: The Uncertainty Principle Passing The Joel Test in the PHP world SPL, not a bridge too far Tools and Talent The beauty and the beast – API documentation with phpDocumentor Getting a website out of the door Optimizing Your

Re: [PHP] catch an iconv E_NOTICE

2009-09-24 Thread David Otton
2009/9/24 Tom Worster : > but i'd like proceed with default error handling in the branch with the > question marks. how can i do that? An error handler that passes through to the previous error handler: http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] how to say "inverse your value" (to a boolean)?

2009-08-11 Thread David Otton
2009/8/11 Daevid Vincent : > NO! For the love of God and all that is holy, don't do that accumulator / > mod "hack". > That's so 1980's. And why make the CPU do all that math for every row... > > Just do this. It's quick and simple: > > CSS: >        .dataRow1 { background-color: #DFDFDF; } >

Re: [PHP] PHPBB Speed Issues

2009-07-31 Thread David Otton
2009/7/31 Paul Scott : -1. Measure everything. No point implementing a change that slows things down. Implement low-hanging-fruit first (eg a CDN) 0. Optimise your existing setup before adding more layers > 1. Cache as much as you can (everything) > 2. Minimise HTTP requests > 3. Use an opcode cac

Re: [PHP] Compare PHP settings of two different servers

2009-07-23 Thread David Otton
2009/7/23 Dave M G : > Is there a way I can take the output of phpinfo() from both servers and do a > compare that will tell me what the differences are? Just diff the HTML. WinMerge, Kompare, etc etc. Or probably built into your favourite IDE. -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] putenv usage

2009-07-22 Thread David Otton
2009/7/22 Manoj Singh : > Now my question is whether it is fine to use putenv in the production > environment? Whether the putenv changes the timezone value globally for all > request or for the current request only? "The environment variable will only exist for the duration of the current reques

Re: [PHP] Re: file_set_contents() do several times?

2009-07-20 Thread David Otton
2009/7/20 Martin Zvarík : >> 2009/7/20 Martin Zvarík : >>> >> $i = 0; >>> do { >>>   $i++; >>>   $r = file_put_contents('file.txt', 'content'); >>> } while($r === false && $i < 3); >>> >>> if ($r === false) die('error'); >>> >>> ?> >>> > I am not appending anything, just ensuring that it will be

Re: [PHP] file_set_contents() do several times?

2009-07-20 Thread David Otton
2009/7/20 Martin Zvarík : > > $i = 0; > do { >   $i++; >   $r = file_put_contents('file.txt', 'content'); > } while($r === false && $i < 3); > > if ($r === false) die('error'); > > ?> > > Makes sense? or is it enough to do it just once? Assuming 'content' changes, and this is the cut-down example

Re: [PHP] Exception not being caught

2009-07-16 Thread David Otton
2009/7/15 Weston C : > > class A { } > > $a = new A();                           // Ayn would be proud, right? > > try { >    echo "a is ",$a,"\n"; > } catch(Exception $e) { >    echo "\nException Caught: "; >    echo $e, $n; > } > > ?> > > This does not run as expected. I'd think that when the i

Re: [PHP] Function parameter passed by reference with default value to null

2009-07-06 Thread David Otton
2009/7/6 Lupus Michaelis : > > David Otton a écrit : > >> So there's some serious impedance mismatch going on there to make both >> features to work together. Just think of the default value as >> "something I can overwrite", eg: > >  Thanks for t

Re: [PHP] Function parameter passed by reference with default value to null

2009-07-06 Thread David Otton
2009/7/6 Lupus Michaelis : >  I'm happy PHP raises an error on foo(null) ; >  I'm in trouble when foo() doesn't. > >  The actual question is : why PHP doesn't raise an error ? This functionality (default values for passed-by-reference parameters) was added in PHP5. The problem is that you can't

Re: [PHP] Object type determined at runtime

2009-07-06 Thread David Otton
2009/7/6 James Colannino > Hey everyone.  I have a question.  Hopefully it's clear, because I'm not > sure quite how to ask it.  Basically, I have a variety of different > objects that a variable can be instantiated as in the same block of > code, its type being determined at runtime.  I want to

Re: [PHP] continue working after finishing up with the http client

2009-05-27 Thread David Otton
2009/5/27 Tom Worster : > without getting into whether or not this cache design makes sense, my > question in this example is: what options are there for ending the http > transition and then continuing on to do the cache update work? You either continue processing then-and-there (exec(), or what

Re: [PHP] Building an array, kind of?

2008-10-24 Thread David Otton
2008/10/24 Dan Shirah <[EMAIL PROTECTED]>: > How would I go about putting that in a variable to equal > "1234,1235,1236,1237,1238,1239" ? > Pseudocode: $t = array(); foreach($resultset as $row) $t[] = $row; $t = join(',',$t); -- http://www.otton.org/ -- PHP General Mailing List (http:

Re: [PHP] class constructor overloading

2008-10-23 Thread David Otton
2008/10/23 Alain Roger <[EMAIL PROTECTED]>: > thanks a lot, this is exactly what i needed. > if the construct of based class A accept arguments, i guess that construct > of class B must have the sames. No, you can change the signature of a method when you overload it. Below, B::__construct() accep

Re: [PHP] class constructor overloading

2008-10-23 Thread David Otton
2008/10/23 Alain Roger <[EMAIL PROTECTED]>: > is it possible to overload the class construct(or) ? > if yes, how ? class A { function __construct() { echo "A"; } } class B extends A { function __construct() { echo "B";

Re: [PHP] grab the complete commandline used ...

2008-08-29 Thread David Otton
2008/8/29 Jochem Maas <[EMAIL PROTECTED]>: > in what sense won't it work? the complete line is in the output of ps > somewhere > albeit after wildcard/shell expansion. With the pipe? I'd really like to see an example, beacuse I couldn't coax it out of ps, and it might be handy someday. > if life

Re: [PHP] _SERVER['DOCUMENT_ROOT'] not set?

2008-08-29 Thread David Otton
2008/8/29 Saurabh Agrawal <[EMAIL PROTECTED]>: > In one of the examples, I am supposed to access _SERVER['DOCUMENT_ROOT']. > However, when I am seeing its value in the debug stack, I am getting it to > be null! Even phpinfo() is showing that this particular variable does not > even exist, though t

Re: [PHP] grab the complete commandline used ...

2008-08-29 Thread David Otton
2008/8/28 Jochem Maas <[EMAIL PROTECTED]>: > I have a feeling I'm out of luck - probably security issues that keep > you from doing such a thing as well. > > I did have the idea of grabbing the PID and then grepping the output of > ps via exec() ... that would do it, but I reckon it smells. :-) T

Re: [PHP] grab the complete commandline used ...

2008-08-28 Thread David Otton
2008/8/28 Jochem Maas <[EMAIL PROTECTED]>: > anyone know if it's possible to grab the entire commandline > that was used to start up a php script on the CLI, an example > of what I'm looking to grab from within the script (test.php in > this example): > > "php -qC -ddisplay_errors=1 ./test.php -o

Re: [PHP] Remote File download is very slow

2008-08-25 Thread David Otton
2008/8/25 Shiplu <[EMAIL PROTECTED]>: > Nothing works. > I was using curl actually. > It was hell slow. > Then I added the fsockeopen option. > Its slwo too. > now I am thinking to add socket_* functions. > But If dont know what is the problem how can I resolve it. > change scheme may not solve it.

Re: [PHP] Remote File download is very slow

2008-08-25 Thread David Otton
2008/8/25 Shiplu <[EMAIL PROTECTED]>: > Hello folks, > I have written a method to download file from remote server. normally those > fill will be huge in size. from 1MB to 400MB. > I am using fsockopen and curl to download the file. > But the problem is its too slow. > Very very slow. What happen

Re: [PHP] comments function being spammed, how do I stop it?

2008-08-25 Thread David Otton
2008/8/25 Barnaby Walters <[EMAIL PROTECTED]>: > my comments function for my website (at www.waterpigs.co.uk/php/phpTest.php) > is being spammed, what would be your sugguestions of a way to deal with it? > I was thinking of something to do with searching the strings of comments > contained in the

Re: [PHP] newbie Q: How to say, "if the fileNAME is equal to...", or better yet, "if the fileNAME ends with '.jpg'"?

2008-08-25 Thread David Otton
2008/8/25 David Otton <[EMAIL PROTECTED]>: > You can check the manual for full details, but briefly, sql_regcase() > returns a case-insensitive regular expression, and glob() returns an > array of filenames that match the path given to it (in this case > "./thumbs/

Re: [PHP] newbie Q: How to say, "if the fileNAME is equal to...", or better yet, "if the fileNAME ends with '.jpg'"?

2008-08-25 Thread David Otton
2008/8/24 Govinda <[EMAIL PROTECTED]>: > $ThisDir = getcwd()."/thumbs"; > $DirHandle = opendir($ThisDir); > if ($DirHandle = opendir($ThisDir)) { > echo "Directory handle: $DirHandle\n"; > echo "Files:"; > > while ((false !== ($file = readdir($DirHandle))) & 1) { >if (true == ($file="x

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-23 Thread David Otton
2008/8/23 Ólafur Waage <[EMAIL PROTECTED]>: > Robert, thanks for the reply but i had tried __FILE__ and __DIR__ > (which is dirname(__FILE__)) but it doesnt work. > > And thanks for the reply also Ashley but as i said in my first post, i > had tried $_SERVER with limited results If checking the o

Re: [PHP] Which Exception to use ....

2008-08-23 Thread David Otton
2008/8/22 Jochem Maas <[EMAIL PROTECTED]>: > still leaves the questions as to what a DomainException and a ErrorException > is meant to model. A domain exception is thrown when a value is valid according to its type, but not within the domain of the function that it is being passed to. For examp

Re: [PHP] Timing problem, putting PNG into PDF

2008-08-21 Thread David Otton
2008/8/12 Brian Dunning <[EMAIL PROTECTED]>: > I'm using GD to crop & save an uploaded image, and then embedding it into a > PDF made with FPDI. It works great when the image is small or low-res. When > the uploaded file is bigger, more than a couple hundred K or so, it fails. I > think that the i

Re: [PHP] Number of duplicates in an array?

2008-08-18 Thread David Otton
2008/8/18 tedd <[EMAIL PROTECTED]>: > Anyone have a cool method of finding duplicate items in an array and the > number of times they appear? > > I'm doing it in a way that is probably less than optimum. I want to see how > you guys solve it. Hmm. Assuming the following inputs and outputs: $inpu

Re: [PHP] [PHP Header] Right-Click Download in Firefox showing php filename

2008-08-04 Thread David Otton
2008/8/4 Will <[EMAIL PROTECTED]>: > I am trying to have users download a file named 'Setup.msi', however > under a PHP file with the sent header information, the default name to > $forcename = "ApplicationSetup_v1_0.msi"; > $filename = "Setup.msi"; > > header("Content-Type: application/force-dow

Re: [PHP] strcmp($var1, $var2) versus if ($var1 < $var2)

2008-05-28 Thread David Otton
2008/5/28 C.R.Vegelin <[EMAIL PROTECTED]>: > $var1 = "01011090"; $var2 = "010190"; // 2 strings > if ($var1 < $var2) ECHO "var1 < var2"; else ECHO "var1 >= var2"; echo " />"; > $r = strcmp ( $var1 , $var2 ); > if ($r < 0) ECHO "var1 < var2", ""; > > 2nd line says: $var1 >= $var2 > 4th line says: $

Re: [PHP] SCanning text of PDF documents

2008-05-15 Thread David Otton
2008/5/15 Angelo Zanetti <[EMAIL PROTECTED]>: > A client of ours wants a solution that when a PDF document is uploaded that > we use PHP to scan the documents contents and save it in a DB. > > I know you can do this with normal text documents using the file commands > and functions. > > Is it

Re: [PHP] Good XML Parser

2008-05-12 Thread David Otton
2008/5/12 Waynn Lue <[EMAIL PROTECTED]>: > So if I'm looking to parse certain attributes out of an XML tree, if I > use SAX, it seems that I would need to keep track of state internally. > E.g., if I have a tree like > > > > > > > > > > > and say I'm interested in all that's betwe

Re: [PHP] Good XML Parser

2008-05-12 Thread David Otton
2008/5/12 Waynn Lue <[EMAIL PROTECTED]>: > What's the best way to pull down XML from a URL? fopen($URL), then > using xml_parse? Or should I be using XML_Parser or SimpleXML? XML parsers fall into two general camps - DOM and SAX. DOM parsers represent an entire XML document as a tree, in-memory,

Re: [PHP] Month with leading zeros

2008-05-10 Thread David Otton
> for ($i = 1; $i >= 12; $i++) I'm an idiot. for ($i = 1; $i <= 12; $i++) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Month with leading zeros

2008-05-10 Thread David Otton
2008/5/10 Ron Piggott <[EMAIL PROTECTED]>: > I am wanting to change > > echo " > to output the month number, between 01 and 12 --- DATE value m, the > month with leading 0's. How do I do this? $months is an array, as I > have shown below. Ron > > $months = array('1' => 'January', '2' =>

Re: [PHP] Improving development process / help with developer setup

2008-05-10 Thread David Otton
2008/5/10 robert mena <[EMAIL PROTECTED]>: > I am looking for tips regarding improving the development process. I'll > explain my current setup and please feel free to comment. > > My developers all use windows + eclipse PDT, the workspace is hosted (via > samba) in a Linux server with Apache/PHP

Re: [PHP] Recursion... Sort of...

2008-05-08 Thread David Otton
2008/5/8 Matt Neimeyer <[EMAIL PROTECTED]>: > Is there a way to tell if a function has been called that has resulted > in a call to the same function? debug_backtrace() Can't comment on performance, though. Its an inelegant solution. > We have an in-house CRM app that has a function that draws

Re: [PHP] How to create accessible by PHP

2008-05-03 Thread David Otton
2008/5/3 Todd Cary <[EMAIL PROTECTED]>: > Are there any examples of creating a dll that can be placed in the dll > directory of php that can be accessed by php? My language would be Delphi, > however an example in C would suffice. Custom PHP extensions. I don't know of any Delphi-specific example

Re: [PHP] Assigning functions

2008-05-02 Thread David Otton
2008/5/2 Philip Thompson <[EMAIL PROTECTED]>: > Hi all. I have several classes. Within each class, a new class is called. Is > there a way to assign a function in a *deeper* class to be called in the > first class? Example to follow.. > >class A { > function __construct () { > $

Re: [PHP] disappearing array?

2007-09-20 Thread David Otton
On Thu, 20 Sep 2007 12:58:28 -0600, you wrote: >I am not sure what the heck is going with this but here is my problem. > >I am trying to validate the contents of an array, then determine if the >errors are with the array or another form submitted variable. > >The problem is after the code validate

Re: [PHP] Run script every 30 seconds

2006-10-30 Thread David Otton
On Mon, 30 Oct 2006 21:26:29 +0300, Ahmad Al-Twaijiry wrote: The "right" way to do this, as others have mentioned, is with a daemon. Having said that... >is it possible to link the script to my php interface (the one that >the users is using it) and if the php interface page will run the >script

Re: [PHP] Cannot read variables

2006-06-06 Thread David Otton
On Tue, 6 Jun 2006 10:36:12 +0300, you wrote: >I just set up a test box for PHP/MySQL on a WinXP box and now I'm having >trouble with variables passed to browser from a link. > >For example I have a link that outputs this: >http://localhost/index.php?team=CF10b. Now the CF10b cannot be user in

Re: [PHP] Removing an aspect of a variable...

2006-06-06 Thread David Otton
On Tue, 6 Jun 2006 08:52:46 +0100, Robin Vickery wrote: >On 06/06/06, Rob W. <[EMAIL PROTECTED]> wrote: >> Say I have a variable setting an ip address of 192.168.100.0 >> >> I want to be able to remove the last to chr's of that variable ie: .0 >> >> What would be my best solution to do that? >> >

[PHP] PHP 4.3.11, call_user_func and instances of classes

2006-04-26 Thread David Otton
A bit of an oddity, this. There's some example code attached which illustrates my problem. I am attempting to call a method of an instance of an class from outside that instance, using call_user_func(). What's happening is that my attempt to call array ($this, 'AddOne') is silently being rewrit

Re: [PHP] Sort by string length...

2004-12-21 Thread David Otton
On Tue, 21 Dec 2004 16:18:52 -0500 (EST), you wrote: >Any idea how to sort an array by string length? You write a function that compares two strings (A and B), and returns 0 if len(A) == len(B), -1 if len(A) < len(B) or +1 if len(A) > len(B). function compare_by_length ($a, $b) { $la = strle

Re: [PHP] Letter incrementing

2004-03-18 Thread David Otton
On Thu, 18 Mar 2004 15:16:34 +0200, you wrote: >But I need to do a $variable = "B"; >and then do a $variable++ that will result in >$variable == "C" for ($i = 0; $i < 26; $i++) { echo (chr($i + ord('A'))); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.

Re: [PHP] diskusage

2004-02-16 Thread David Otton
On Mon, 16 Feb 2004 15:17:52 -0500, you wrote: >Chakravarthy Cuddapah wrote: >> In php I want to know space used (du) by user on a remote system. Can >> anyone pls tell me how this can be done. > >Just call du through exec(). He said "remote system", which I read to mean "on the client"[?]. In t

Re: [PHP] ODBC with SQL Server

2004-02-15 Thread David Otton
On Fri, 13 Feb 2004 12:30:42 +0100, you wrote: >I have a connectoin ODBC with a SQL Server database. A table has a field of >type 'nvarchar'. This field contains japanese characters. >How can I read these japanese characteres? When I read (with: "select name >from data") only read '?' character.

Re: [PHP] Question about php "forwarding" to javascript

2004-02-15 Thread David Otton
On Sun, 15 Feb 2004 07:52:11 +0100 (CET), you wrote: Could be missing the point here because your question is quite vague. However... >I am using a web page that uses the following php code to display the >contents of a dynamically update webpage: > >include("http://.../source.xls); >?> > >Is it

Re: [PHP] Headers and sessions in php .cgi

2004-01-10 Thread David Otton
On Sat, 10 Jan 2004 17:44:18 +0100 (MET), you wrote: >I have a problem setting my headers right with php running as .cgi. I >have to specify a Content-type for the cgi file to work. But how >should I do both that and start a session? > >I have a few options: > >#! /usr/local/bin/php >session_s

Re: [PHP] Calling cgi post form from within php

2004-01-10 Thread David Otton
On Sat, 10 Jan 2004 13:46:19 -0500, you wrote: >does anyone know how to call a cgi script and pass along a post-form from >within php? http://pear.php.net/package/HTTP_Request There are others, of course. But this will let you make a POST request. -- PHP General Mailing List (http://www.php.ne

Re: [PHP] if("NANC" < 0) - always evaluates TRUE...

2004-01-06 Thread David Otton
On Tue, 6 Jan 2004 10:57:52 -0800, you wrote: >...no matter what follows the NANC...seems like a bug. > >if("NA" < 0) >{ > print("err 1\n"); >} > >if("NAN" < 0) >{ > print("err 2\n"); >} > >if("NANC" < 0) >{ > print("err 3\n"); >} if ("NANC" < 0) { echo ("one"); } else { ech

Re: [PHP] Alternate way of e-mailing in PHP

2004-01-05 Thread David Otton
On Mon, 05 Jan 2004 01:38:09 -0500, you wrote: >I've been getting "data format errors" from Sendmail when trying to send >automatic e-mails from my websites recently, and as I can't find a fix for Quick questions: what does sendmail_path in php.ini look like? Where is the "data format error" mes

Re: [PHP] Unlinking files.

2003-12-24 Thread David Otton
On Tue, 23 Dec 2003 19:08:28 -0800 (PST), you wrote: >>How can I unlink files in a directory that are, for example older than 1 >>hour? > >`find /path/to/dir -cmin +60 -type f -print0 | xargs -0 rm -f`; Alternatively, for cross-platformness user opendir() and readdir() to iterate over the directo

Re: [PHP] Security Question

2003-12-18 Thread David Otton
On Thu, 18 Dec 2003 10:43:14 -0500, you wrote: >I'm trying to develop a secure web based application and my only tools are >php, mysql, and a SSL connection. > >Does anyone know of any good references for this kind of development? > >What I really need to do is to make sure that given users only g

Re: [PHP] new set of eyes?

2003-12-06 Thread David Otton
On Sat, 06 Dec 2003 11:38:18 -0700, you wrote: >I think I am loosing my mind this afternoon... could someone review this >snippit and tell me why it isn't working? > >$sql = mysql_query("SELECT $i FROM $table WHERE $i = $i",$db)or >die(mysql_error()); > while($b = mysql_fetch_array($sql))

Re: [PHP] Max Upload FIle Size

2003-12-05 Thread David Otton
On Fri, 05 Dec 2003 13:41:03 +0300, you wrote: >Steve Vernon wrote: >> I have search google, and PHP but I cannot find properly how to set the >> maximum post upload size as 200Kb? >Amazing what you can find in the manual these days >http://www.php.net/manual/en/configuration.directives.php#ini.

Re: [PHP] Problem with references

2003-12-04 Thread David Otton
On Thu, 4 Dec 2003 09:58:09 -0800, you wrote: >David Otton <[EMAIL PROTECTED]> >on Thursday, December 04, 2003 3:43 AM said: > >> function f() >> { >> return (array (7, 5)); >> } >> >> list ($a, $b) = f(); > >Hey cool! I never kne

Re: [PHP] What do you say to someone who says...

2003-12-04 Thread David Otton
On Thu, 4 Dec 2003 15:16:06 -, you wrote: >What do you say to someone who says: > >"PHP is just a kiddie language"? > >(Source: http://www.dhtmlcentral.com/forums/topic.asp?TOPIC_ID=19373) > >PHP is currently my strongest development language and it annoys me that it >is a much less bankable s

Re: [PHP] Premature end of script headers: php.exe

2003-12-04 Thread David Otton
On Thu, 4 Dec 2003 13:17:57 +0100 , you wrote: >I have a problem. When I start my PHP script, I get message "Premature end >of script headers: php.exe". How can I solve this problem? Run from the command line, or via a webserver? IIS or Apache? CGI or Apache module? Do all scripts throw the error

Re: [PHP] open rtf in IE

2003-12-04 Thread David Otton
On Thu, 4 Dec 2003 12:48:45 +0100, you wrote: >I generate and save a rtf file with php in my MySQL db. Is it possible to >open this file in IE? Probably not; I doubt IE understands RTF documents. You're probably asking how to make IE pass the document over to Word, though. Try variations on hea

Re: [PHP] Problem with references

2003-12-04 Thread David Otton
On Thu, 4 Dec 2003 11:16:10 -, you wrote: >I wonder if there is a simple techique to help me here. I wish to return 2 >references to objects from a function. > >The following code describes what I want to do but obviously will not work >(and I understand why): > >function Test (&$P1, &$P2) >{

Re: [PHP] File - Success Warning Message

2003-12-04 Thread David Otton
On Thu, 4 Dec 2003 01:54:31 -0800 (PST), you wrote: >Warning: file("http://webmail.juicemarketing.net";) - Success in /me notes this is a pyramid scam site Don't know about the rest of you... but there are some people I'd prefer /not/ to do free consultancy for. -- PHP General Mailing List (ht

Re: [PHP] for help :how to detect norton client through php socket

2003-12-04 Thread David Otton
On Thu, 4 Dec 2003 15:39:30 +0800, you wrote: >how can i detect whether norton antivirus client are installed on the hosts >through php socket ? Why would you want to? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

  1   2   3   4   >