Re: [PHP] Basic question - Starting a background task without waiting for its end.

2007-01-01 Thread Martin Alterisio
2006/12/31, Michel <[EMAIL PROTECTED]>: I (very simply) try to open a "notepad" on a simple text file in a simplistic PHP script, and would like to go on and display the next page without waiting for this notepad to be shut. After various attempts, I have used an : exec ('bash -c cmd /C start

Re: [PHP] classes and objects: php5. The Basics

2007-01-16 Thread Martin Alterisio
Backward compatibility with PHP4, where member functions couldn't be declared as static. Any member function could be called statically providing a static context instead of an object instance. 2007/1/16, Cheseldine, D. L. <[EMAIL PROTECTED]>: Hi I'm stuck on The Basics page of the php5 Object

Re: [PHP] classes and objects: php5. The Basics

2007-01-16 Thread Martin Alterisio
Forgot to mention that calling a non-statical function this way should generate an E_STRICT warning. 2007/1/16, Martin Alterisio <[EMAIL PROTECTED]>: Backward compatibility with PHP4, where member functions couldn't be declared as static. Any member function could be called

Re: [PHP] nuSoap -method '' not defined in service

2007-01-20 Thread Martin Alterisio
Try the following: $server->register('getColumns', array(), array()); The second argument is an array containing an entry for each argument of the webservice call, and the third argument is an array for the return value. Since you don't have either arguments nor return value, empty arrays should

Re: [PHP] preg_match problem

2007-01-20 Thread Martin Alterisio
Double slash to prevent PHP interpreting the slashes. Also using single quotes would be a good idea: if (preg_match('/[\\w\\x2F]{6,}/',$a)) 2007/1/19, Németh Zoltán <[EMAIL PROTECTED]>: Hi all, I have a simple checking like if (preg_match("/[\w\x2F]{6,}/",$a)) as I would like to allow all

Re: [PHP] preg_match problem

2007-01-21 Thread Martin Alterisio
2007/1/20, Arpad Ray <[EMAIL PROTECTED]>: Martin Alterisio wrote: > Double slash to prevent PHP interpreting the slashes. Also using single > quotes would be a good idea: > > if (preg_match('/[\\w\\x2F]{6,}/',$a)) > Just switching to single quotes would do the t

Re: [PHP] preg_match problem

2007-01-23 Thread Martin Alterisio
2007/1/22, Beauford <[EMAIL PROTECTED]>: ... much blah blah blah ... I've probably read 100 pages on this, and no matter what I try it doesn't work. Including all of what you suggested above - is my PHP possessed? if(preg_match("/[EMAIL PROTECTED]&()*;:_.'/\\ ]+$/", $string)) { gives me this

Re: [PHP] nested, referenced foreach & implicit current array pointer issues

2007-01-30 Thread Martin Alterisio
2007/1/30, speedy <[EMAIL PROTECTED]>: Hello PHP crew, As a followup to: http://bugs.php.net/bug.php?id=22879 That's not a bug, just an user doing things the wrong way and blaming the language. I've stumbled upon this problem in a way: function f() { global $arr; foreach($arr as $

Re: Re[2]: [PHP] nested, referenced foreach & implicit current array pointer issues

2007-01-31 Thread Martin Alterisio
2007/1/30, speedy <[EMAIL PROTECTED]>: Hello Martin, > Tuesday, January 30, 2007, 8:45:50 PM, you wrote: > > function f() > { >global $arr; > >foreach($arr as $k=>$v) { >$v->do_something(); >} > } > > I don't see your point anywhere... foreach iterates over a copy of > the

Re: [PHP] OT - Regular Expression

2007-02-09 Thread Martin Alterisio
If you want to do it in one regular expression, without listing each case, you can use a lookahead assertion: /^(?=.*8.*)[0-9]{4}$/ The assertion (?=.*8.*) checks that the following matches the expression contained (.*8.*) which fails if there is not an 8. 2007/2/9, Peter Lauri <[EMAIL PROTECTE

Re: [PHP] OT - Regular Expression

2007-02-09 Thread Martin Alterisio
2007/2/9, Martin Alterisio <[EMAIL PROTECTED]>: If you want to do it in one regular expression, without listing each case, you can use a lookahead assertion: /^(?=.*8.*)[0-9]{4}$/ The assertion (?=.*8.*) checks that the following matches the expression contained (.*8.*) which fails if t

Re: [PHP] Variable variables and references

2007-03-11 Thread Martin Alterisio
2007/3/10, Dave Goodchild <[EMAIL PROTECTED]>: Hi guys, I have just read 'Programming PHP' (O'Reilly) and although I think it's a great book, I am confused about variable variables and references - not the mechanics, just where you would use them. The subject of variable variables is explained

Re: [PHP] References challenge with PHP4

2007-03-21 Thread Martin Alterisio
2007/3/20, Jochem Maas <[EMAIL PROTECTED]>: Robert Cummings wrote: > On Tue, 2007-03-20 at 11:52 +0100, Jochem Maas wrote: >> ok, I tried it in a whole number of variations - >> no joy. >> >> you should use php5 if you want this kind of reference >> stuff - in php5 it just works, php 4 will give

Re: [PHP] References challenge with PHP4

2007-03-25 Thread Martin Alterisio
2007/3/23, Jochem Maas <[EMAIL PROTECTED]>: Martin Alterisio wrote: > 2007/3/20, Jochem Maas <[EMAIL PROTECTED] >: > > Robert Cummings wrote: > > On Tue, 2007-03-20 at 11:52 +0100, Jochem Maas wrote: > >> ok, I tried it in a whole nu

Re: [PHP] finding a particular record within a MySQL result set

2007-04-04 Thread Martin Alterisio
2007/4/4, James Tu <[EMAIL PROTECTED]>: I've cross posted this to the MySQL list... Here's my original post. > Is there some quick way to do the following in MySQL? (I know I > can use PHP to search through the result set, but I wanted to see > if there's a quick way using some sort of query)

[PHP] Design Dilemma - Database Data Abstraction

2007-04-07 Thread Martin Alterisio
I have a dilemma on a design where I humbly ask your help. I'm working on the model part of a web application (not to be understood in the "web2.0" way, but in a more general way, where anything mounted on HTTP is a web application) done in PHP5 following the MVC design pattern. But the strong poi

Re: [PHP] Design Dilemma - Database Data Abstraction

2007-04-08 Thread Martin Alterisio
2007/4/8, Paul Novitski <[EMAIL PROTECTED]>: At 4/7/2007 09:49 AM, Martin Alterisio wrote: >The solution I presented is to access, and act upon, a database as if they >were PHP arrays, meaning that a table is presented as an array of records. This implies to me that you'll

Re: [PHP] Design Dilemma - Database Data Abstraction

2007-04-09 Thread Martin Alterisio
2007/4/9, Lester Caine <[EMAIL PROTECTED]>: Martin Alterisio wrote: > I have a dilemma on a design where I humbly ask your help. I'm working on > the model part of a web application (not to be understood in the "web2.0 " > way, but in a more general way, where any

Re: [PHP] Re: Design Dilemma - Database Data Abstraction

2007-04-09 Thread Martin Alterisio
2007/4/9, Tony Marston <[EMAIL PROTECTED]>: ""Martin Alterisio"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I have a dilemma on a design where I humbly ask your help. I'm working on > the model part of a web application (not to be

Re: [PHP] Design Dilemma - Database Data Abstraction

2007-04-11 Thread Martin Alterisio
2007/4/10, Richard Lynch <[EMAIL PROTECTED]>: On Sat, April 7, 2007 11:49 am, Martin Alterisio wrote: > The solution I presented is to access, and act upon, a database as if > they > were PHP arrays, meaning that a table is presented as an array of > records. I don't

Re: [PHP] Re: Design Dilemma - Database Data Abstraction

2007-04-11 Thread Martin Alterisio
2007/4/11, Roman Neuhauser <[EMAIL PROTECTED]>: # [EMAIL PROTECTED] / 2007-04-09 19:45:41 -0300: > Thanks but that's not what I'm looking for. As I said before, my problem > isn't to find an implementation of an ORM, but that the concept I'm working > on will use a very restricted API (array ope

Re: [PHP] Classes and access to outside variables

2007-09-29 Thread Martin Alterisio
Refer to the global on the constructor. Anyway, using a global like that is not a good practice. Just pass the variable to the constructor. 2007/9/29, Merlin <[EMAIL PROTECTED]>: > > Hi there, > > I am new to PHP classes and I do want to access a variable outside the > class, but somehow that doe

Re: [PHP] Classes and access to outside variables

2007-09-30 Thread Martin Alterisio
That's incorrectly syntactically. Won't run. Ok, let's write some code to show how this can be done: class SearchHelper extends AjaxACApplication { private $dbh; public function __construct() { $this->dbh = $GLOBALS['dbh']; } } Better yet, pass the database host in the cons

Re: [PHP] counting with leading zeros

2007-10-01 Thread Martin Alterisio
// glob returns an ordered list (rtfm: man glob) // relies on the use of the operator ++ to generate string sequences. function lastFileInSequence($path, $prefix, $first, $suffix) { return array_pop(glob($path . "/" . $prefix . str_repeat('?', strlen($first)) . $suffix)); } function nextFileI

[PHP] A workaround for type hinting native types (and a little of self-advertising)

2007-11-06 Thread Martin Alterisio
$me->apologizeFor($this->isSelfAdvertising()); if ($you->lookingFor($php->workaround(TYPE_HINT_FOR_NATIVE_TYPES)) { check('http://www.phpclasses.org/browse/package/4195.html'); } $package = new Package('http://www.phpclasses.org/browse/package/4195.html' ); $package->usageExample = <

Re: [PHP] Regular Expressions

2007-11-06 Thread Martin Alterisio
2007/11/6, Alberto García Gómez <[EMAIL PROTECTED]>: > > I'm a mess in regular expressions and I make this code: > > $link = ereg_replace('ñ','n',$link); > $link = ereg_replace('á','a',$link); > $link = ereg_replace('é','e',$link); > $link = ereg_replace('í','i',$link); > $link = ereg_replace('ó','

Re: [PHP] Code Critique Please :)

2007-11-26 Thread Martin Alterisio
2007/11/21, Simeon F. Willbanks <[EMAIL PROTECTED]>: > > Hello, > > I am trying to increase my knowledge and understanding of OO and OO > Design Patterns. I'd like to request a critique of a program that > extracts MySQL table information and translates it into XML. In the > program, I tried to a

Re: [PHP] sprintf() oddness

2007-12-02 Thread Martin Alterisio
2007/12/1, Christoph Boget <[EMAIL PROTECTED]>: > > Why does > > sprintf( '%.03f', 0.1525 ) > > return 0.152 while > > sprintf( '%.03f', 0.1575 ) > > return 0.158? > Welcome to the world of f floating point numbers. Discrete mathematics, leave all hope, ye that enter. It's the way fl

Re: [PHP] Structured Code vs. Performance

2007-12-02 Thread Martin Alterisio
2007/12/2, tedd <[EMAIL PROTECTED]>: > > > To me, good structure starts at the function level. Like the lattice > of a crystal, coding grows and reflects the most basic element. Keep > that element consistent and you'll find that it will be reflected in > everything you do. > > How's that for philo

Re: [PHP] Structured Code vs. Performance

2007-12-03 Thread Martin Alterisio
2007/12/2, tedd <[EMAIL PROTECTED]>: > > Oh yes, it's very much like fractals, but the term "fractalism" is > usually reserved for art forms based on fractals. > > However, one could conclude that all crystalline forms are a > "real-world" examples of fractals. In similar vein, all repetitive > pro

Re: [PHP] // ?>

2007-12-04 Thread Martin Alterisio
2007/12/4, Kevin Schmeichel <[EMAIL PROTECTED]>: > > Here's some unexpected behavior: > > // ?> what? > ?> > > This will output "what?" - I expected no output, as is the case if the > inline comment was a /* */ comment. Is this a bug? > Expected behavior. Read the manual: http://php.net/manual/

Re: [PHP] Try{} Catch()

2007-12-23 Thread Martin Alterisio
It's not supposed to be practical, it's just a way to handle errors. You shouldn't rely on try/catch for algorithm implementation. You create exceptions for errors and unexpected behavior. Then in some other part of the system you use try/catch to prevent the code from terminating abruptly. You ca

[PHP] Sayonara PHP

2007-12-25 Thread Martin Alterisio
Please let me do a little explanation of the title first. Japanese is an interesting language where context is vital to the meaning of a word. Sayonara usually means a simple "good bye", but within a different context can mean "we'll probably never meet again". To understand this mail you'll have

Re: [PHP] Re: [PHP-DEV] Sayonara PHP

2007-12-28 Thread Martin Alterisio
"I liked the php development market because it was safe, but now I doubt its safety". That's all. I don't think that rant may be of use to anyone, but at least it felt nice to let go of some steam. Best Regards and Happy New Year, Martin Alterisio

Re: [PHP] Sayonara PHP

2007-12-28 Thread Martin Alterisio
he future (... ok, that was kind of The > Godfather's script, lol). > > Enjoy your holidays, > > Rob > We'll see... for now I'll follow the stupid decision of finally doing what I intended when I began this whole dance of software development. I hoping with all my heart that this will go well and I'll never have to work in web development again. If not, well, I'll come back to whatever it's that's being used in that specific moment, be it PHP or whatever may come. Just know that I'm not leaving for some petty reason. And I really hope that someone else could find anything sensible in the things I posted in the first mail, and keep on building on top of them. Best Regards and Happy New Year, Martin Alterisio

Re: [PHP] Try{} Catch()

2008-01-01 Thread Martin Alterisio
2007/12/31, Richard Lynch <[EMAIL PROTECTED]>: > > On Sun, December 23, 2007 3:50 pm, Martin Alterisio wrote: > > It's not supposed to be practical, it's just a way to handle errors. > > You > > shouldn't rely on try/catch for algorithm implementation.

Re: [PHP] function -> action

2007-08-10 Thread Martin Alterisio
2007/8/7, Richard Lynch <[EMAIL PROTECTED]>: > > On Fri, August 3, 2007 1:38 am, Ralph Kutschera wrote: > > I'm working on a project, where we distinguish between "functions" > > and > > "actions" in design, although in PHP both are implemented as > > functions. > > Is there a chance that PHP can

Re: [PHP] function -> action

2007-08-10 Thread Martin Alterisio
2007/8/3, Ken Tozier <[EMAIL PROTECTED]>: > > > On Aug 3, 2007, at 9:39 AM, Ken Tozier wrote: > > > > > On Aug 3, 2007, at 2:38 AM, Ralph Kutschera wrote: > > > >> Hallo! > >> > >> I'm working on a project, where we distinguish between > >> "functions" and > >> "actions" in design, although in PH

Re: [PHP] working on a template system...

2006-06-28 Thread Martin Alterisio
2006/6/28, Robert Cummings <[EMAIL PROTECTED]>: On Wed, 2006-06-28 at 07:32, Martin Marques wrote: > On Wed, 28 Jun 2006, Ligaya Turmelle wrote: > > > Martin Marques wrote: > >> Why not try to use one of the template systems that already exist? > >> HTML_Template_IT, Smarty, etc. > >> > > Or jus

Re: [PHP] working on a template system...

2006-06-28 Thread Martin Alterisio
essy... /* The Smarty way */ $smarty->assign('display_variable',$display_variable); ... {* template *} {foreach key=key item=var from=$display_variable} {$key}{$var} {/foreach} /* The PHP way */ $var) { ?> Is it really *that* bad? jon Martin Alterisio wrote: >

[PHP] Re: Sad PHP Poem

2006-06-30 Thread Martin Alterisio
2006/6/26, Martin Alterisio <[EMAIL PROTECTED]>: A sad poem of an algorithm where solitude brought excessive use of cpu cycles and memory allocation for redundant data (it copied over and over again the same image till all memory was filled w

[PHP] PHP Love Letter

2006-07-18 Thread Martin Alterisio
Been quiet too much... *This time, I seriously advise against running this piece of code unless you know what you're doing* Enjoy... --- Love Letter acquaintances)) { ?> Dear name?>, I really enjoy your company and I would love to meet you again. I had a lot of fun last time and I

Re: [PHP] Re: PHP Frameworks - Opinion

2006-08-03 Thread Martin Alterisio
2006/8/3, Manuel Lemos <[EMAIL PROTECTED]>: Hello, on 08/01/2006 01:35 PM Gabe said the following: > What's the common consensus as to a solid PHP framework to use for > application development? There seems to be a number of them out there, > but I'm not sure which one's are the most robust, a

Re: [PHP] Re: PHP Frameworks - Opinion

2006-08-06 Thread Martin Alterisio
2006/8/4, Manuel Lemos <[EMAIL PROTECTED]>: Hello, on 08/03/2006 05:18 PM Martin Alterisio said the following: >> Anyway, you may want to read this more in depth reflection of the state >> of the PHP framework world and recommendations on how to pick what suits >>

Re: [PHP] How to get rid off empty elements of an array?

2006-08-07 Thread Martin Alterisio
2006/8/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: Hi to all! I have a form with 6 text fields where visitor has to enter product serial number (same type data). he has to enter AT LEAST ONE. for ($i=0; $i<6; $i++) { echo ''; } After the form is submitted I'm getting an array Array ( [

Re: [PHP] Mixing sprintf and mysql_real_escape_string

2006-08-07 Thread Martin Alterisio
2006/8/7, Peter Lauri <[EMAIL PROTECTED]>: I should maybe add that the data actually comes from a form: mysql_query(sprintf("INSERT INTO table (value1, value2) VALUES (1, '%s')", mysql_real_escape_string($_POST['formvalue']))); And when I have ' in the field, it will insert \' into the databas

Re: [PHP] Error Handling Library?

2006-08-31 Thread Martin Alterisio
I'm curious, what features are you looking for in an error handling library? 2006/8/31, Jay Paulson <[EMAIL PROTECTED]>: I've been doing some research and was wondering if anyone out there has written a library for error handling? I haven't found anything as of yet but would love to hear sugge

Re: [PHP] Iteration through letter

2006-09-15 Thread Martin Alterisio
2006/9/14, Norbert Wenzel <[EMAIL PROTECTED]>: Hi, just for fun I tried the following code: for($letter = 'A'; $letter <= 'Z'; ++$letter) { echo($letter . ' '); } What surprised me was the output, which looked like this: A B C [...] Y Z AA AB AC [...] YY YZ I don't have any idea h

Re: [PHP] Help converting C to PHP

2006-09-22 Thread Martin Alterisio
2006/9/22, Rory Browne <[EMAIL PROTECTED]>: On 9/22/06, Kevin Waterson <[EMAIL PROTECTED]> wrote: > > This one time, at band camp, "Curt Zirzow" <[EMAIL PROTECTED]> wrote: > > > what about using: > > php.net/pi > > > > note the precision description. > > > > or are we talking about a different

Re: [PHP] Help converting C to PHP

2006-09-22 Thread Martin Alterisio
2006/9/22, Tom Atkinson <[EMAIL PROTECTED]>: Martin Alterisio wrote: > 2006/9/22, Rory Browne <[EMAIL PROTECTED]>: >> >> On 9/22/06, Kevin Waterson <[EMAIL PROTECTED]> wrote: >> > >> > This one time, at band camp, "Curt Zirzow&

Re: [PHP] array_sum($result)=100

2006-09-25 Thread Martin Alterisio
2006/9/25, Robin Vickery <[EMAIL PROTECTED]>: On 24/09/06, Ahmad Al-Twaijiry <[EMAIL PROTECTED]> wrote: > Hi everyone > > I have array of numbers and I want to get out of it a list of numbers > that if I sum them it will be 100, here is my list (for example ) : > > $list = array(10,20,10,10,30,5

Re: [PHP] How do i check if a variable is a reference or a copy?

2006-09-28 Thread Martin Alterisio
2006/9/28, Mathijs <[EMAIL PROTECTED]>: Hello there, Is there a way to check if a variable is passed by reference or if it is just a copy. With something like is_copy or is_reference? Thx in advance. Is this part of the "I don't know if two vars reference the same object in PHP4" dilemma?

[PHP] OOP Hello World

2006-09-28 Thread Martin Alterisio
What's up folks? I just wanted to tell you about a thread that's going on in the spanish php mailing list. A fellow software developer which had just started with OOP was asking for "Hello World" examples using OOP. The examples of code he had been doing was not that different from the usual Hell

Re: [PHP] class usage

2006-09-29 Thread Martin Alterisio
2006/9/29, benifactor <[EMAIL PROTECTED]>: ok, about five minutes ago i decided to learn classes and delve into php's oop side. what i came up with was this... //start example code class newsletter { function send ($email,$subject,$message) { if ($email) { echo("th

Re: [PHP] Re: class usage

2006-09-29 Thread Martin Alterisio
2006/9/29, M.Sokolewicz <[EMAIL PROTECTED]>: Well, you could say that there is no difference really. Classes are mainly used as collections; They're a collection of functions (methods) sharing a common goal/dataset/whatever. That's a module, my friend, not a class: http://en.wikipedia.org/wik

Re: [PHP] class usage

2006-09-29 Thread Martin Alterisio
2006/9/29, Ray Hauge <[EMAIL PROTECTED]>: I think people have pretty much hit the nail on the head with OOP. One thing that I would like to point out is that OOP isn't necessarily needed in every case. Actually there's never a need to use OOP. As I said before OOP doesn't provide anything in

[PHP] Re: OOP Hello World

2006-10-04 Thread Martin Alterisio
the decorated saluters (this last part I thought it just now, I'll post it later on the spanish list) Well, I think that sums it all up. 2006/9/29, Martin Alterisio <[EMAIL PROTECTED]>: What's up folks? I just wanted to tell you about a thread that's going on in the spanish

Re: [PHP] Re: OOP Hello World

2006-10-05 Thread Martin Alterisio
, John Wells <[EMAIL PROTECTED]>: Are you sure you're not on a Spanish *Java* mailing list? :) On 10/5/06, Martin Alterisio <[EMAIL PROTECTED]> wrote: > Me... again, still boring you to death with meaningless OOP rantings. > > First I would like to point out that there wa

Re: [PHP] Help on objects

2006-10-05 Thread Martin Alterisio
2006/10/4, Deckard <[EMAIL PROTECTED]>: Hi, I'm trying to lay my hands on PHP OOP, but it's not easy :( I've read several examples in the web, but cannot transpose to may case. I'm trying to set a class to make SQL inserts in mysql. I have the class: --

Re: [PHP] Help on objects

2006-10-05 Thread Martin Alterisio
2006/10/5, Satyam <[EMAIL PROTECTED]>: I've seen you already had a good answer on the errors in the code so I won't go on that. As for OOP, the one design error you have is that you are asking for an action, not an object. You want to make SQL inserts, that is your purpose, and that is an act

Re: [PHP] Re: OOP Hello World

2006-10-05 Thread Martin Alterisio
2006/10/5, John Wells <[EMAIL PROTECTED]>: On 10/5/06, Martin Alterisio <[EMAIL PROTECTED]> wrote: > PHP seems to be getting more and more object oriented, I think it's the > right time to start questioning what have been done so far in terms of OOP > in PHP, becaus

Re: [PHP] Help on objects

2006-10-05 Thread Martin Alterisio
2006/10/5, Satyam <[EMAIL PROTECTED]>: - Original Message - *From:* Martin Alterisio <[EMAIL PROTECTED]> *To:* Satyam <[EMAIL PROTECTED]> *Cc:* Deckard <[EMAIL PROTECTED]> ; php-general@lists.php.net *Sent:* Thursday, October 05, 2006 3:50 PM *Subject:* Re: [PH

Re: [PHP] EZ array problem - What's wrong with my brain?

2006-12-04 Thread Martin Alterisio
2006/11/30, Brian Dunning <[EMAIL PROTECTED]>: var_dump() gives me this: array(1) { ["1.2"]=> array(2) { ["code"]=> array(1) { [0]=> string(3) "111" } ["status"]=> array(1) { [0]=> string(3) "new" } } } I'm trying to set a vari

Re: [PHP] Clarification: Jump to a record/PHP paging...

2006-12-24 Thread Martin Alterisio
To solve a problem like yours I ussualy do the following: First you need to use a deterministic order criteria when displaying the results, this means that according to the order columns you provide, MySQL will not have to decide how to order two rows that have the same values for this columns. F

Re: [PHP] Odd behavior

2006-12-25 Thread Martin Alterisio
2006/12/25, jekillen <[EMAIL PROTECTED]>: On Dec 25, 2006, at 7:21 AM, Roman Neuhauser wrote: > # [EMAIL PROTECTED] / 2006-12-24 18:11:03 -0800: >> function display($list, $in, $out, $save, $req, $x) >> { >> for($i = 0; $i < count($in); $i++) >> {$j = $i + 1; >> // two sets

Re: [PHP] Clarification: Jump to a record/PHP paging...

2006-12-25 Thread Martin Alterisio
2006/12/25, Robert Cummings <[EMAIL PROTECTED]>: WRONG! See Martin Alterisio's post for the same thread. You must not have understood the OP's requirements. xD I was starting to think my mails weren't getting through the list, maybe its nothing else than only a bigger delay than the usual. A

Re: [PHP] array_intersect problem

2006-12-25 Thread Martin Alterisio
2006/12/25, Leo Liu <[EMAIL PROTECTED]>: Hi, I try to intersect associative array and it seems to fail to do so. Can anyone show me a walk around? For example I have array1 Array ( [0] => Array ( [imageID] => 1 ) [1] => Array (

Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-10 Thread Martin Alterisio
Maybe you can read the contents of the feeds using fsockopen() and stream_set_timeout() to adjust the timeout, or stream_set_blocking() to read it asynchronously, and then load the xml with simplexml_load_string(). PS: I forgot to reply to all and mention you'll have to send the GET http command a

Re: [PHP] function by reference

2006-04-11 Thread Martin Alterisio
The ampersand before the function name indicates that the function returns a reference instead of a copy of the variable, for example: $var2) return $var1; else return $var2; } $global1 = 10; $global2 = 9; $maxglobal =& max($global1, $global2); $maxglobal++; echo $global1; //th

Fwd: [PHP] Include Problem

2006-04-16 Thread Martin Alterisio
Ups, I forgot to reply to everyone again, sorry. -- Forwarded message -- From: Martin Alterisio <[EMAIL PROTECTED]> Date: 16-abr-2006 13:53 Subject: Re: [PHP] Include Problem To: Shaun <[EMAIL PROTECTED]> You're using an absolute path to the file, maybe what yo

Re: [PHP] Passing Form As Argument

2006-04-20 Thread Martin Alterisio
My first answer to your question would be: "no, you can't refer to an html form in any way in php". My second answer would be, as usual, a question: "what, exactly, are you trying to do?" 2006/4/20, Chris Kennon <[EMAIL PROTECTED]>: > > Hi, > > > I'm new to the list so "Hello" to all. I'm drafting

Re: [PHP] Creating an OO Shopping Cart

2006-04-20 Thread Martin Alterisio
The $_SESSION array is already being serialized before saving it to the session datafile. You'll only have to: $_SESSION['cart'] = $cart; And before session_start(): require_once 'fileWhereClassIsDefined'; . . . session_start(); If the class isn't defined before serialization (session start) an

Re: [PHP] Linebreak

2006-04-20 Thread Martin Alterisio
You wouldn't feel/look stupid if you had RTFM: http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.single 2006/4/20, Peter Lauri <[EMAIL PROTECTED]>: > > I feel stupid. > > > > In many examples I have seen similar to: > > > > echo 'Whatever.\n'; > > echo 'An other w

Re: [PHP] Re: Creating an OO Shopping Cart

2006-04-21 Thread Martin Alterisio
You don't need the unserialize(), it's done internally by the session_start(). All the things you put inside $_SESSION, except for resources, will be rebuilt when the session is regenerated. This way you don't need to worry about serializing. Read the manual section about sessions. 2006/4/21, Stev

Re: [PHP] array problem

2006-04-22 Thread Martin Alterisio
You're wrong, he isn't using an associative array, since the keys used are only integers. array(10,10,40,30,30,10); and array(0=>10,1=>10,2=>40,3=>30,4=>30,5=>10); create the same array. The problem is that array_unique preserves keys (read the manual!!!) If you don't want this, use array_values(

Re: [PHP] How to execute multiples querys

2006-04-26 Thread Martin Alterisio
You should be able to do this in two calls to the mysql_query() function. mysql_query("SET @var1=3"); mysql_query("SELECT * from table1 Where [EMAIL PROTECTED]"); 2006/4/26, Mauricio Pellegrini <[EMAIL PROTECTED]>: > > Hi all > > I'm trying to execute two querys and they execute perfectly in fact,

Re: [PHP] Debuggin PHP

2006-04-26 Thread Martin Alterisio
2006/4/26, John Nichel <[EMAIL PROTECTED]>: > > hicham wrote: > > Hello > > I'm a newbie in php world , and I'm trying to get a php 4 script work > > on an php5 version > > how do i debug php ? I get a blank page and nothing tells me what 's > wrong ? > > > > Thanks > > hicham > > > > Turn on erro

Re: [PHP] PHP 4.3.11, call_user_func and instances of classes

2006-04-26 Thread Martin Alterisio
The problem is not what it seems. PHP4 assigns object by copy, not by reference. This is causing the call_user_func() to use a copy of the object instead of the original object. So, all modifications are lost once the call is done. One solution to this is to assign objects by reference: $addition

Re: [PHP] how to get the absolute path of an included file?

2006-04-27 Thread Martin Alterisio
2006/4/27, Bing Du <[EMAIL PROTECTED]>: > > Hello, > > Here are the two scripts. The result is 'var is' rather than 'var is > foo'. My suspect is I did not set the file path right in 'include'. So > in file2.php, how should I get the actual absolute path it really gets for > file1.php? Is it st

Re: [PHP] Re: forms and dynamic creation and unique field names

2006-04-27 Thread Martin Alterisio
2006/4/27, Jason Gerfen <[EMAIL PROTECTED]>: > > Oops, I thought there might be an array function that would be better to > use then foreach loops. Thanks. There are other functions (check the Array Functions section in the manual), but they just don't get along with the KISS principle. Dave Goo

Re: [PHP] Recommended PHP frameworks

2006-04-27 Thread Martin Alterisio
2006/4/27, Robert Cummings <[EMAIL PROTECTED]>: > > A funny PHPClasses article... > > > http://www.phpclasses.org/blog/post/52-Recommended-PHP-frameworks.html One thing I understood after hitting my head many times to a wall is that "a good idea can be, and should be, explained in just three line

Re: [PHP] Help!

2006-04-28 Thread Martin Alterisio
2006/4/28, Dave Goodchild <[EMAIL PROTECTED]>: Hi all - I am attempting to solve some maddening behaviour that has me totally stumped and before I take a blade to my throat I thought I would pick the brains of the group/hive/gang. I am working on a viral marketing application that uses multipar

Re: [PHP] Help!

2006-04-28 Thread Martin Alterisio
2006/4/28, Barry <[EMAIL PROTECTED]>: Martin Alterisio schrieb: > 2006/4/28, Dave Goodchild <[EMAIL PROTECTED]>: >> >> Hi all - I am attempting to solve some maddening behaviour that has me >> totally stumped and before I take a blade to my throat I thought

Re: [PHP] undefined variable

2006-04-29 Thread Martin Alterisio
2006/4/29, Smart Software <[EMAIL PROTECTED]>: code below shows all records from products table with an textbox and an order button for each record "> if someone presses the button, an item will be ordered. How can i add the content of the textbox? i tried this: "> but all

Re: [PHP] Help!

2006-04-29 Thread Martin Alterisio
e app and am the only person who will ever use it. Rather anal. On 29/04/06, Martin Alterisio < [EMAIL PROTECTED]> wrote: > > 2006/4/28, Barry < [EMAIL PROTECTED]>: > > > > Martin Alterisio schrieb: > > > 2006/4/28, Dave Goodchild <[EMAIL PROTECTED]>: &

Re: [PHP] Syntax Oddity

2006-05-02 Thread Martin Alterisio
2006/5/2, Richard Lynch <[EMAIL PROTECTED]>: Does anybody have a rational explanation for what purpose in life the following syntax is considered acceptable? Note that the line with just $query; on it doesn't, like, "do" anything. I suppose in a Zen-like sort of way, it "exists" and all, but

Re: [PHP] Class/function scope general question

2006-05-12 Thread Martin Alterisio
2006/5/12, Edward Vermillion <[EMAIL PROTECTED]>: I'm doing some re-writing of a huge class I've got (don't think OOP cause it's really not, just the usual class full of functions). What I'm doing is moving the functions out of the class and into separate files so the (I'm hoping) memory footpri

Re: [PHP] Class/function scope general question

2006-05-12 Thread Martin Alterisio
2006/5/12, Edward Vermillion <[EMAIL PROTECTED]>: On May 12, 2006, at 1:09 PM, Martin Alterisio wrote: class foo { function bar() { function baz(){} } } baz() will be a global function there. There are other ways to add member functions at r

Re: [PHP] Handling Large Check Box Data

2006-05-17 Thread Martin Alterisio
2006/5/17, Rahul S. Johari <[EMAIL PROTECTED]>: Ave, I¹m a little confused as to what¹s the best way to handle this. I have a form which, apart from lots of other fields, has a set of 25 ­ 30 Check Boxes, each of which asks the user for some kind of information which the user can check or leave

Re: [PHP] Converting characters

2006-05-17 Thread Martin Alterisio
2006/5/17, Jonas Rosling <[EMAIL PROTECTED]>: Hi, the PHP newbie is here again asking questions. Is there anyway in PHP to convert none international characters so the are displayed correct? In my case I have lots of data in the database with å,ä and ö. Thanks // Jonas -- PHP General Mailing L

Re: [PHP] PHP Notice: Undefined index

2006-05-19 Thread Martin Alterisio
2006/5/19, John Taylor-Johnston <[EMAIL PROTECTED] : Any idea why this bit of code if("yes" == $_POST['submitter']) { mysql_select_db($db,$myconnection); $sql = "INSERT INTO `$db`.`$table` (name,email,comments,entrydate) values ('$name','$email','$comments','$entrydate')"; mysq

Re: [PHP] Re: Can php convert doc to HTML?

2006-05-23 Thread Martin Alterisio
2006/5/23, Dotan Cohen <[EMAIL PROTECTED]>: On 5/23/06, tedd <[EMAIL PROTECTED]> wrote: > At 7:09 PM +0300 5/23/06, Dotan Cohen wrote: > >This may be far-fetched, but can php convert a doc file to HTML? I > >vaguely remember a thread that discussed converting pdf's, but I > >cannot find referenc

Re: [PHP] Re: Can php convert doc to HTML?

2006-05-23 Thread Martin Alterisio
2006/5/23, Dotan Cohen <[EMAIL PROTECTED]>: On 5/23/06, Martin Alterisio <[EMAIL PROTECTED]> wrote: > > If that's the case, why don't you just use the "export as web page" or "save > as web page" tools of MS Word (if you don't have it a

Re: [PHP] Re: Can php convert doc to HTML?

2006-05-23 Thread Martin Alterisio
2006/5/23, Jochem Maas <[EMAIL PROTECTED]>: my 2cents Martin Alterisio wrote: > 2006/5/23, Dotan Cohen <[EMAIL PROTECTED]>: > >> >> On 5/23/06, Martin Alterisio <[EMAIL PROTECTED]> wrote: >> > >> > If that's the case, why don'

Re: [PHP] Including Functions; one file or many?

2006-05-27 Thread Martin Alterisio
2006/5/27, Jochem Maas <[EMAIL PROTECTED]>: 2. any include file that does contain code that runs on inclusion contains something like the following as the first line of code: if (!defined('MY_APP_IS_SETUP')) die('try http://'.$SERVER['SERVER_NAME'].'/'); An enhancement to this strategy could

Re: [PHP] Using 'header' as redirect

2006-05-30 Thread Martin Alterisio
2006/5/30, Philip Thompson <[EMAIL PROTECTED]>: Are you checking what the user is sending inside $_GET['page']? If not, your system is vulnerable to a remote file injection.

Re: [PHP] Help with enter key in Forms

2006-06-02 Thread Martin Alterisio
2006/6/2, George Babichev <[EMAIL PROTECTED]>: Awesome, thank you so much! It works! On 6/1/06, Chris <[EMAIL PROTECTED]> wrote: > > George Babichev wrote: > > Ok, I sent it to everyone and you. Now can you answer my question > please? > > I type in > > 1 > > > > > > > > 2 > > into my form in t

Re: [PHP] How do I make a HTML tree for a set of nodes?

2006-06-04 Thread Martin Alterisio
2006/6/4, Niels <[EMAIL PROTECTED]>: Hi, I have a set of nodes. Each node has a parent and so the set can be thought of as a tree. I want to show that tree somehow on a webpage, served by PHP. I cannot use Dot/Graphwiz for various reasons. What I'm looking for is an output of DIVs or tablecell

Re: [PHP] How do I make a HTML tree for a set of nodes?

2006-06-04 Thread Martin Alterisio
2006/6/4, Niels <[EMAIL PROTECTED]>: Hi! On Sunday 04 June 2006 18:13, Martin Alterisio wrote: [snip] > I had a similar problem that, although it was with a binary tree, it can > be used with your tree. PHP doesn't like too much the use of recursion, > but this time recurs

Re: [PHP] When is "z" != "z" ?

2006-06-04 Thread Martin Alterisio
2006/6/4, Rasmus Lerdorf <[EMAIL PROTECTED]>: tedd wrote: > Hi gang: > > Here's your opportunity to pound me again for not knowing the basics of php. > > I vaguely remember something like this being discussed a while back, but can't find the reference. > > In any event, if one uses -- > > for ($

  1   2   >