Hi.
I'm in the process of building a web service which incorporates the
ability for the server to inform the client that a particular call has
been superseded by another.
So, cut down (I've removed all the other details), ...
class ServiceDetails
{
/**
* Superseded by
I do not know why php.net is not publishing yet the link I posted in specific
page, but if you want to resolve serialized recursion problem or you just want
to better understand the problem and possible solutions, you may be interested
in this post:
On 9 May 2008, at 02:02, Nathan Nobbe wrote:
function doStuff() {
static $callCount;
if(!isset($callCount))
$callCount = 1;
else
$callCount++;
/// do stuff w/ $callCount to potentially handle sub-tabs and stuff
if($callCount == 2) {
echo 'white on black';
} else {
echo
On Fri, May 9, 2008 at 1:52 AM, Stut [EMAIL PROTECTED] wrote:
On 9 May 2008, at 02:02, Nathan Nobbe wrote:
function doStuff() {
static $callCount;
if(!isset($callCount))
$callCount = 1;
else
$callCount++;
/// do stuff w/ $callCount to potentially handle sub-tabs and stuff
Wow! Thanks guys! Here's what I ended up doing... To get...
Black on White - 1
White on Black - 2
Black on White - 3
Black on White - 3
White on Black - 2
Black on White - 3
I had to do something like...
function doStuff()
{
static $callCount = 0;
$callCount++;
At 5:48 PM -0400 5/8/08, Matt Neimeyer wrote:
Is there a way to tell if a function has been called that has resulted
in a call to the same function?
We have an in-house CRM app that has a function that draws a tabbed
panel on a screen... BUT if there are sub-sub-tabbed panels we want to
invert
Is there a way to tell if a function has been called that has resulted
in a call to the same function?
We have an in-house CRM app that has a function that draws a tabbed
panel on a screen... BUT if there are sub-sub-tabbed panels we want to
invert the tab colors and panel colors...
So...
On Thu, May 8, 2008 at 3:48 PM, Matt Neimeyer [EMAIL PROTECTED] wrote:
Is there a way to tell if a function has been called that has resulted
in a call to the same function?
We have an in-house CRM app that has a function that draws a tabbed
panel on a screen... BUT if there are
Nathan Nobbe wrote:
On Thu, May 8, 2008 at 3:48 PM, Matt Neimeyer [EMAIL PROTECTED] wrote:
Is there a way to tell if a function has been called that has resulted
in a call to the same function?
We have an in-house CRM app that has a function that draws a tabbed
panel on a screen... BUT if
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 a
On Thu, May 8, 2008 at 6:23 PM, Jim Lucas [EMAIL PROTECTED] wrote:
Nathan Nobbe wrote:
On Thu, May 8, 2008 at 3:48 PM, Matt Neimeyer [EMAIL PROTECTED] wrote:
Is there a way to tell if a function has been called that has resulted
in a call to the same function?
We have an in-house CRM app
I have to write some PHP backend code for a threaded message board. The db
has a message table, and each message has a parent id.
Does anyone have any advice for someone whos never done this in PHP?
I'm currently thinking that I write function that takes a db row as an
argument, and initially,
Hi Tony,
Friday, August 10, 2007, 5:23:28 PM, you wrote:
I have to write some PHP backend code for a threaded message board.
The db has a message table, and each message has a parent id.
Does anyone have any advice for someone whos never done this in PHP?
I'm currently thinking that I
--- Tony Di Croce [EMAIL PROTECTED] wrote:
I have to write some PHP backend code for a threaded
message board. The db
has a message table, and each message has a parent
id.
Does anyone have any advice for someone whos never
done this in PHP?
You are reinventing the wheel here. Why?
On Friday 10 August 2007 18:29, Stephen wrote:
--- Tony Di Croce [EMAIL PROTECTED] wrote:
I have to write some PHP backend code for a threaded
message board. The db
has a message table, and each message has a parent
id.
Does anyone have any advice for someone whos never
done this in
On Fri, August 10, 2007 11:23 am, Tony Di Croce wrote:
I have to write some PHP backend code for a threaded message board.
The db
has a message table, and each message has a parent id.
Does anyone have any advice for someone whos never done this in PHP?
I'm currently thinking that I write
Chris W. Parker wrote:
Marek Kilimajer mailto:[EMAIL PROTECTED]
on Thursday, May 26, 2005 11:35 AM said:
untested:
function display($array, $prefix = '') {
echo $prefix ':' . $array['name'] . \n;
if(is_array($array['children']) $array['children']) {
Chris W. Parker wrote:
Hi everyone,
I've been working on a problem for a few days now and I'm not making any
headway so I think it's time I come to the list for some help (though
this really disappoints me since it appears I'm not capable of solving
this problem on my own!).
Anyway, I'm
Chris W. Parker wrote:
Hi everyone,
I've been working on a problem for a few days now and I'm not making any
headway so I think it's time I come to the list for some help (though
this really disappoints me since it appears I'm not capable of solving
this problem on my own!).
Anyway, I'm using
Food:Fruit:Red
Food:Fruit:Green
Food:Fruit:Yellow
Food:Vegetables:Long
Food:Vegetables:Round
Food:Vegetables:Round:Spikey
Food:Vegetables:Round:Smooth
How is your structure being built? Is it hard-coded or dynamic (e.g.
pulled from a DB)? We employ a similar tree structure for manging
Steve Brown mailto:[EMAIL PROTECTED]
on Thursday, May 26, 2005 11:47 AM said:
How is your structure being built? Is it hard-coded or dynamic (e.g.
pulled from a DB)?
From a database.
We employ a similar tree structure for manging
items in our store front. Believe me when I say, its a
On 5/27/05, Chris W. Parker [EMAIL PROTECTED] wrote:
Let's say you're entering a new product, you'd want to see a list of all
the available categories, not just the last node of a branch.
Not neccesarily; it depends on how big your tree structure is. If you
only have 10 categories where an
** email gagging, sorry if this is a DP **
On 5/27/05, Chris W. Parker [EMAIL PROTECTED] wrote:
Let's say you're entering a new product, you'd want to see a list of all
the available categories, not just the last node of a branch.
Not neccesarily; it depends on how big your tree structure is.
Steve Brown mailto:[EMAIL PROTECTED]
on Friday, May 27, 2005 2:17 PM said:
So in your case, if you wanted to create a new item in the category
Round, you would first have to navigate to Food Vegetables
Round, then create the new item. This may seem more complicated,
but think about how
Hi everyone,
I've been working on a problem for a few days now and I'm not making any
headway so I think it's time I come to the list for some help (though
this really disappoints me since it appears I'm not capable of solving
this problem on my own!).
Anyway, I'm using the Modified Preorder
Chris W. Parker wrote:
Hi everyone,
I've been working on a problem for a few days now and I'm not making any
headway so I think it's time I come to the list for some help (though
this really disappoints me since it appears I'm not capable of solving
this problem on my own!).
Anyway, I'm using
Marek Kilimajer mailto:[EMAIL PROTECTED]
on Thursday, May 26, 2005 11:35 AM said:
untested:
function display($array, $prefix = '') {
echo $prefix ':' . $array['name'] . \n;
if(is_array($array['children']) $array['children']) {
foreach($array['children'] as
This would have been easier if you'd posted the php code to create the
array, as opposed to the output of print_r. I did this:
?php
$arr = array(
array(
'name' = 'food',
'children' = array(
array(
'name' = 'meat',
I'm trying to sanitize my user input. My sanitize function does not work if
I send a variable that's an array. I'm using recursion to go through the
array. The example below shows that $_POST['city'] works but $_POST['user']
doesn't work. The array comes back blank.
Anyone see what's wrong
, not tested.
Best,
Yoed
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, October 08, 2004 5:15 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Recursion to sanitize user input
I'm trying to sanitize my user input. My sanitize function does not work if
I send
* Thus wrote Yoed Anis:
Simple your code should look like this:
...
if ( is_array($userInput) )
{
foreach ( $userInput as $key = $value )
{
return sanitize( $value ); // needed to return it or
else its not recurssive
This is wrong, only the
it should be this i think:
foreach ( $userInput as $key = $value )
{
$newvalue[] = sanitize( $value );
}
return $newvalue // returns an array - since this is the only
way to get all veriables from the function
}
else
I could be wrong but the only way it
this would probably be even better:
foreach ( $userInput as $key = $value )
{
$newvalue[$key] = sanitize( $value ); // reassign key with
sanatized value
}
return $newvalue // return array with sanatized $key = $value pairs
}
else
My 2 cents:
--
PHP General Mailing
foreach ( $userInput as $key = $value )
{
$newvalue[$key] = sanitize( $value );
}
return $newvalue;
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi Comex
Thanks! That worked! Robet you almost had it but missing the $key in
$newvalue[$key].
- Original Message -
From: Comex [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, October 08, 2004 8:05 PM
Subject: Re: [PHP] Recursion to sanitize user input
foreach ( $userInput
Im trying to dynamically construct a multidimensional array
to be used with PEAR's HTML_Menu.
http://pear.php.net/manual/en/package.html.html-menu.intro.php.
Basically, Im pulling the data from a DB table, and trying to
attempt to convert the original array to what is needed for HTML_Menu.
If you
your children function can return only one child, and one parent can
have more children. You should create an array of all children and loop
that.
Gerard Samuel wrote:
Im trying to dynamically construct a multidimensional array
to be used with PEAR's HTML_Menu.
Marek Kilimajer wrote:
your children function can return only one child, and one parent can
have more children. You should create an array of all children and loop
that.
As always, thanks for the nudge in the right direction.
I was in the middle of rewriting it, and applied your suggestion to
Hi all,
I am still pretty new to PHP, but I was chatting to a friend the other
day and he put some thoughts into my head about how tables are laid out
and processed.
At the moment I have three tables: Topic, Message, Comment. A topic has
messages and each message can have comments. I have set
At 14:43 19.02.2003, Jono Bacon said:
[snip]
At the moment I have three tables: Topic, Message, Comment. A topic has
messages and each message can have comments. I have set this up with a
table each and a field for the id of the parent (e.g. a comment will
Ernest E Vogelsinger wrote:
At 14:43 19.02.2003, Jono Bacon said:
[snip]
At the moment I have three tables: Topic, Message, Comment. A topic has
messages and each message can have comments. I have set this up with a
table each and a field for the id
On Wed, 19 Feb 2003 13:56:49 +, you wrote:
One questions though - if I delete a topic, I need to delete all of its
child messages and all of the child comments from each message. What is
the best technique to do this? This has been driving me up the wall as
it seems to involve some kind of
David Otton wrote:
On Wed, 19 Feb 2003 13:56:49 +, you wrote:
One questions though - if I delete a topic, I need to delete all of its
child messages and all of the child comments from each message. What is
the best technique to do this? This has been driving me up the wall as
it seems
General
[EMAIL PROTECTED]
ahoo.co.uk cc:
Subject: Re: [PHP] Recursion with
database
On Wed, 19 Feb 2003 14:16:47 +, you wrote:
Otherwise, yes, in MySQL you have to recurse down the tree deleting
comments.
How would I go about recursing down the tree? Has anyone done this before?
I have, but it's been a while. Something like (pseudo-code) .
def delete_comments(a) :
for
At 15:16 19.02.2003, Jono Bacon spoke out and said:
[snip]
How would I go about recursing down the tree? Has anyone done this before?
[snip]
Given the DB layout I sketched before, you would:
1) delete all comments
At 14:56 19.02.2003, Jono Bacon spoke out and said:
[snip]
The code that you posed is the technique I have used at the moment. This
technique works fine, but like my mate said, this limits me to a single
parent for a comment/message. I admit that is
Ok ... here is the sitituation... I am creating a registration form.
What I have so far works ... the user registers using this form and the
form calls another page that will check the validity of the data
(checking for username availability, etc...). If there is an error,
display the error and
not tested
Basically, have the form action call itself hince the recursion.
Any suggestion/examples?
?
$field1=false;
if(isset($_POST['submit']))
{
/*check*/
if(isset($_POST['field1']) $_POST['field1']=='okay')header('Location:
registration.php');
else $field1=true;
}
?
form
What I want to do is have the registration form, on submit, check the
data validity right then, if there is an error, redisplay
the form with an * next to the field that is incorrect.
This is the code logic rather than the actual working code:
---Start of PHP Page---
1. Check for form
- Original Message -
From: Andres Montiel [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, September 30, 2001 12:23 PM
Subject: [PHP] Recursion
One of my classes next semester needs me to program using a language
that does recurison. I don't really know what this means, though. Can
PHP do
One of my classes next semester needs me to program using a language
that does recurison. I don't really know what this means, though. Can
PHP do this?
Thanks!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
52 matches
Mail list logo