php-general Digest 27 Mar 2012 23:45:09 -0000 Issue 7748

Topics (messages 317291 through 317310):

Re: updating code asap to multiple domains, windows to unix, with source 
control software (was: Re: [PHP] including PHP code from another server..)
        317291 by: rene7705
        317292 by: marco.behnke.biz
        317293 by: rene7705
        317294 by: Matijn Woudt
        317295 by: rene7705
        317296 by: Matijn Woudt
        317297 by: rene7705
        317298 by: rene7705
        317299 by: rene7705
        317300 by: Curtis Maurand

Uploading and creating an email attachment, WITHOUT a DB on server
        317301 by: Christopher Svanefalk
        317302 by: Christopher Svanefalk
        317304 by: Bastien Koert
        317305 by: Maciek Sokolewicz

Re: Thinking out loud - a continuation...
        317303 by: Jay Blanchard
        317306 by: Jay Blanchard

List working?
        317307 by: Jay Blanchard
        317308 by: Shawn McKenzie
        317309 by: Matijn Woudt
        317310 by: Shawn McKenzie

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On Tue, Mar 27, 2012 at 12:08 PM, rene7705 <rene7...@gmail.com> wrote:

> On Mon, Mar 26, 2012 at 9:16 PM, Stuart Dallas <stu...@3ft9.com> wrote:
>
>> Rene: please read a book / website / something on PHP security. Some
>> things are important whether you believe they are or not.
>>
>> Yea, I will do that within a week or so..
>
> I can also confirm that I'm not using any source of source control at the
> moment.
> I have used visual source control of Microsoft in the past, but that was
> on a windows-only environment.
>
> I now have several domains on a shared unix hoster that I have to update
> with files from a windows 7 system.
> Basically, I have on the windows dev server X:\data1\www\htdocs\code (the
> copy I work on), which have to be updated to
> X:\data1\www\htdocs\sites\[domainname]\code, preferably as quickly as
> possible, and then, once release worthy, to the accounts on the shared unix
> hoster.
> On the shared unix hoster (godaddy.com 4G hosting), I have 1 FTP account
> which points to a "primary domain" (abc.com), which has a filesystem
> underneath it also with the /sites/[domainname], and the non-primary
> domains there point to these /sites/[domainname]/ for their
> $_SERVER['DOCUMENT_ROOT']. I do not have seperate FTP accounts for each
> domain on the unix hoster.
>
> If someone could explain to me which (free) source control system to use
> and perhaps how, or even point me in the direction of a good tutorial on
> that subject, you'd make me very happy. I also think it's time I got at
> least a bit more professional.
> Yet, I'm looking for the simplest and most efficient solution.
>
> I've done a search for "rsync windows", and I get some rsync apps
> allright, but it's not clear to me yet how I would use these windows rsync
> clones to get done what I want.
>

oh, one more thing; I just found that I won't always be working on the
windows dev server's ...\htdocs\code, sometimes i'll find myself working on
the /code copy in one of the /sites/[domainname]/code on the windows 7 dev
system. how would I use a modern source control system to distribute the
code from one of the subdomains to all other locations?

--- End Message ---
--- Begin Message ---

rene7705 <rene7...@gmail.com> hat am 27. März 2012 um 12:16 geschrieben:

> On Tue, Mar 27, 2012 at 12:08 PM, rene7705 <rene7...@gmail.com> wrote:
> > I've done a search for "rsync windows", and I get some rsync apps
> > allright, but it's not clear to me yet how I would use these windows
rsync
> > clones to get done what I want.
> >
>
> oh, one more thing; I just found that I won't always be working on the
> windows dev server's ...\htdocs\code, sometimes i'll find myself working
on
> the /code copy in one of the /sites/[domainname]/code on the windows 7
dev
> system. how would I use a modern source control system to distribute the
> code from one of the subdomains to all other locations?

Well, I guess google on rsync man page or read the documentation of these
tools OR write to a mailing list that focusses on the use of linux tools.
Then go and read about cron jobs or git/svn/putyoutoolhere
post-receive/post-commit hooks or anything like that.


Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3

Tel.: 0174 / 9722336
e-Mail: ma...@behnke.biz

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz

--- End Message ---
--- Begin Message ---
On Tue, Mar 27, 2012 at 12:22 PM, ma...@behnke.biz <ma...@behnke.biz> wrote:

>
>
> rene7705 <rene7...@gmail.com> hat am 27. März 2012 um 12:16 geschrieben:
>
> > On Tue, Mar 27, 2012 at 12:08 PM, rene7705 <rene7...@gmail.com> wrote:
> > > I've done a search for "rsync windows", and I get some rsync apps
> > > allright, but it's not clear to me yet how I would use these windows
> rsync
> > > clones to get done what I want.
> > >
> >
> > oh, one more thing; I just found that I won't always be working on the
> > windows dev server's ...\htdocs\code, sometimes i'll find myself working
> on
> > the /code copy in one of the /sites/[domainname]/code on the windows 7
> dev
> > system. how would I use a modern source control system to distribute the
> > code from one of the subdomains to all other locations?
>
> Well, I guess google on rsync man page or read the documentation of these
> tools OR write to a mailing list that focusses on the use of linux tools.
> Then go and read about cron jobs or git/svn/putyoutoolhere
> post-receive/post-commit hooks or anything like that.
>
>
> Ok, I'll be reading everything I can find on rsync today, but I don't
think I wanna use auto-updates from cron, instead I want to hit an icon on
my desktop to start the update, either on only the windows system, or from
the windows system to all the unix domain directories..

--- End Message ---
--- Begin Message ---
On Tue, Mar 27, 2012 at 12:31 PM, rene7705 <rene7...@gmail.com> wrote:
> On Tue, Mar 27, 2012 at 12:22 PM, ma...@behnke.biz <ma...@behnke.biz> wrote:
>
>>
>>
>> rene7705 <rene7...@gmail.com> hat am 27. März 2012 um 12:16 geschrieben:
>>
>> > On Tue, Mar 27, 2012 at 12:08 PM, rene7705 <rene7...@gmail.com> wrote:
>> > > I've done a search for "rsync windows", and I get some rsync apps
>> > > allright, but it's not clear to me yet how I would use these windows
>> rsync
>> > > clones to get done what I want.
>> > >
>> >
>> > oh, one more thing; I just found that I won't always be working on the
>> > windows dev server's ...\htdocs\code, sometimes i'll find myself working
>> on
>> > the /code copy in one of the /sites/[domainname]/code on the windows 7
>> dev
>> > system. how would I use a modern source control system to distribute the
>> > code from one of the subdomains to all other locations?
>>
>> Well, I guess google on rsync man page or read the documentation of these
>> tools OR write to a mailing list that focusses on the use of linux tools.
>> Then go and read about cron jobs or git/svn/putyoutoolhere
>> post-receive/post-commit hooks or anything like that.
>>
>>
>> Ok, I'll be reading everything I can find on rsync today, but I don't
> think I wanna use auto-updates from cron, instead I want to hit an icon on
> my desktop to start the update, either on only the windows system, or from
> the windows system to all the unix domain directories..

Are you sure you want to develop on a windows machine, and then push
it out on all of your linux systems? That sounds dangerous to me. It's
much safer to try it on a machine with same configuration as the
production systems first.

- Matijn

--- End Message ---
--- Begin Message ---
On Tue, Mar 27, 2012 at 12:45 PM, Matijn Woudt <tijn...@gmail.com> wrote:

> On Tue, Mar 27, 2012 at 12:31 PM, rene7705 <rene7...@gmail.com> wrote:
> > On Tue, Mar 27, 2012 at 12:22 PM, ma...@behnke.biz <ma...@behnke.biz>
> wrote:
> >
> >>
> >>
> >> rene7705 <rene7...@gmail.com> hat am 27. März 2012 um 12:16
> geschrieben:
> >>
> >> > On Tue, Mar 27, 2012 at 12:08 PM, rene7705 <rene7...@gmail.com>
> wrote:
> >> > > I've done a search for "rsync windows", and I get some rsync apps
> >> > > allright, but it's not clear to me yet how I would use these windows
> >> rsync
> >> > > clones to get done what I want.
> >> > >
> >> >
> >> > oh, one more thing; I just found that I won't always be working on the
> >> > windows dev server's ...\htdocs\code, sometimes i'll find myself
> working
> >> on
> >> > the /code copy in one of the /sites/[domainname]/code on the windows 7
> >> dev
> >> > system. how would I use a modern source control system to distribute
> the
> >> > code from one of the subdomains to all other locations?
> >>
> >> Well, I guess google on rsync man page or read the documentation of
> these
> >> tools OR write to a mailing list that focusses on the use of linux
> tools.
> >> Then go and read about cron jobs or git/svn/putyoutoolhere
> >> post-receive/post-commit hooks or anything like that.
> >>
> >>
> >> Ok, I'll be reading everything I can find on rsync today, but I don't
> > think I wanna use auto-updates from cron, instead I want to hit an icon
> on
> > my desktop to start the update, either on only the windows system, or
> from
> > the windows system to all the unix domain directories..
>
> Are you sure you want to develop on a windows machine, and then push
> it out on all of your linux systems? That sounds dangerous to me. It's
> much safer to try it on a machine with same configuration as the
> production systems first.
>
> Yea, i'm quite sure I want to develop on Windows 7. Ubuntu still has
quircks when it comes to using 3 monitors on a single system, as far as I
know. I just like windows 7 a lot better at the moment.
And how would it be dangerous to do so?

--- End Message ---
--- Begin Message ---
On Tue, Mar 27, 2012 at 12:47 PM, rene7705 <rene7...@gmail.com> wrote:
>
>
> On Tue, Mar 27, 2012 at 12:45 PM, Matijn Woudt <tijn...@gmail.com> wrote:
>>
>> On Tue, Mar 27, 2012 at 12:31 PM, rene7705 <rene7...@gmail.com> wrote:
>> > On Tue, Mar 27, 2012 at 12:22 PM, ma...@behnke.biz <ma...@behnke.biz>
>> > wrote:
>> >
>> >>
>> >>
>> >> rene7705 <rene7...@gmail.com> hat am 27. März 2012 um 12:16
>> >> geschrieben:
>> >>
>> >> > On Tue, Mar 27, 2012 at 12:08 PM, rene7705 <rene7...@gmail.com>
>> >> > wrote:
>> >> > > I've done a search for "rsync windows", and I get some rsync apps
>> >> > > allright, but it's not clear to me yet how I would use these
>> >> > > windows
>> >> rsync
>> >> > > clones to get done what I want.
>> >> > >
>> >> >
>> >> > oh, one more thing; I just found that I won't always be working on
>> >> > the
>> >> > windows dev server's ...\htdocs\code, sometimes i'll find myself
>> >> > working
>> >> on
>> >> > the /code copy in one of the /sites/[domainname]/code on the windows
>> >> > 7
>> >> dev
>> >> > system. how would I use a modern source control system to distribute
>> >> > the
>> >> > code from one of the subdomains to all other locations?
>> >>
>> >> Well, I guess google on rsync man page or read the documentation of
>> >> these
>> >> tools OR write to a mailing list that focusses on the use of linux
>> >> tools.
>> >> Then go and read about cron jobs or git/svn/putyoutoolhere
>> >> post-receive/post-commit hooks or anything like that.
>> >>
>> >>
>> >> Ok, I'll be reading everything I can find on rsync today, but I don't
>> > think I wanna use auto-updates from cron, instead I want to hit an icon
>> > on
>> > my desktop to start the update, either on only the windows system, or
>> > from
>> > the windows system to all the unix domain directories..
>>
>> Are you sure you want to develop on a windows machine, and then push
>> it out on all of your linux systems? That sounds dangerous to me. It's
>> much safer to try it on a machine with same configuration as the
>> production systems first.
>>
> Yea, i'm quite sure I want to develop on Windows 7. Ubuntu still has quircks
> when it comes to using 3 monitors on a single system, as far as I know. I
> just like windows 7 a lot better at the moment.
> And how would it be dangerous to do so?
>
>

Code that you write on a windows box might work different/not work at
all on a linux machine. Think of different filesystem, different
Apache/PHP versions, etc. I have to develop on windows too sometimes,
and what I usually do in such cases is first push the code to a
subdomain test.mydomain.com. If that works correctly, I push it over
to www.mydomain.com.

--- End Message ---
--- Begin Message ---
On Tue, Mar 27, 2012 at 1:02 PM, Matijn Woudt <tijn...@gmail.com> wrote:

> On Tue, Mar 27, 2012 at 12:47 PM, rene7705 <rene7...@gmail.com> wrote:
> >
> >
> > On Tue, Mar 27, 2012 at 12:45 PM, Matijn Woudt <tijn...@gmail.com>
> wrote:
> >>
> >> On Tue, Mar 27, 2012 at 12:31 PM, rene7705 <rene7...@gmail.com> wrote:
> >> > On Tue, Mar 27, 2012 at 12:22 PM, ma...@behnke.biz <ma...@behnke.biz>
> >> > wrote:
> >> >
> >> >>
> >> >>
> >> >> rene7705 <rene7...@gmail.com> hat am 27. März 2012 um 12:16
> >> >> geschrieben:
> >> >>
> >> >> > On Tue, Mar 27, 2012 at 12:08 PM, rene7705 <rene7...@gmail.com>
> >> >> > wrote:
> >> >> > > I've done a search for "rsync windows", and I get some rsync apps
> >> >> > > allright, but it's not clear to me yet how I would use these
> >> >> > > windows
> >> >> rsync
> >> >> > > clones to get done what I want.
> >> >> > >
> >> >> >
> >> >> > oh, one more thing; I just found that I won't always be working on
> >> >> > the
> >> >> > windows dev server's ...\htdocs\code, sometimes i'll find myself
> >> >> > working
> >> >> on
> >> >> > the /code copy in one of the /sites/[domainname]/code on the
> windows
> >> >> > 7
> >> >> dev
> >> >> > system. how would I use a modern source control system to
> distribute
> >> >> > the
> >> >> > code from one of the subdomains to all other locations?
> >> >>
> >> >> Well, I guess google on rsync man page or read the documentation of
> >> >> these
> >> >> tools OR write to a mailing list that focusses on the use of linux
> >> >> tools.
> >> >> Then go and read about cron jobs or git/svn/putyoutoolhere
> >> >> post-receive/post-commit hooks or anything like that.
> >> >>
> >> >>
> >> >> Ok, I'll be reading everything I can find on rsync today, but I don't
> >> > think I wanna use auto-updates from cron, instead I want to hit an
> icon
> >> > on
> >> > my desktop to start the update, either on only the windows system, or
> >> > from
> >> > the windows system to all the unix domain directories..
> >>
> >> Are you sure you want to develop on a windows machine, and then push
> >> it out on all of your linux systems? That sounds dangerous to me. It's
> >> much safer to try it on a machine with same configuration as the
> >> production systems first.
> >>
> > Yea, i'm quite sure I want to develop on Windows 7. Ubuntu still has
> quircks
> > when it comes to using 3 monitors on a single system, as far as I know. I
> > just like windows 7 a lot better at the moment.
> > And how would it be dangerous to do so?
> >
> >
>
> Code that you write on a windows box might work different/not work at
> all on a linux machine. Think of different filesystem, different
> Apache/PHP versions, etc. I have to develop on windows too sometimes,
> and what I usually do in such cases is first push the code to a
> subdomain test.mydomain.com. If that works correctly, I push it over
> to www.mydomain.com.
>

So far the code that I've written and am using works OK on both windows and
unix.

But I've just booted up my ubuntu installation and am currently upgrading
from 11.04 to 11.10, maybe that fixes the issues I was having with it, and
if it does I'll seriously consider using ubuntu as my primary dev
environment again..

--- End Message ---
--- Begin Message ---
hey, I just read the rsync man page for the first time, and while it sure
looks simple enough for my taste, wouldn't updating multiple remote domains
be like a whole series of the same FTP updates to these different domain
directories there? In other words, take a long time because of my 200kb/s
link to the unix hoster?

--- End Message ---
--- Begin Message ---
On Tue, Mar 27, 2012 at 1:21 PM, Peter Ford <p...@justcroft.com> wrote:

> On 27/03/12 12:13, rene7705 wrote:
>
>> hey, I just read the rsync man page for the first time, and while it sure
>> looks simple enough for my taste, wouldn't updating multiple remote
>> domains
>> be like a whole series of the same FTP updates to these different domain
>> directories there? In other words, take a long time because of my 200kb/s
>> link to the unix hoster?
>>
>>
> The first time might be slow, but you can then do incremental updates
> which would be a lot quicker.
>
> ok, that'll do nicely..

--- End Message ---
--- Begin Message ---

rene7705 wrote:
> On Tue, Mar 27, 2012 at 1:21 PM, Peter Ford
<p...@justcroft.com> wrote:
> 
>> On 27/03/12
12:13, rene7705 wrote:
>>
>>> hey, I just read
the rsync man page for the first time, and while it
>>>
sure
>>> looks simple enough for my taste, wouldn't updating
multiple remote
>>> domains
>>> be like a
whole series of the same FTP updates to these different
>>>
domain
>>> directories there? In other words, take a long
time because of my
>>> 200kb/s
>>> link to the
unix hoster?
>>>
>>>
>> The first
time might be slow, but you can then do incremental updates
>>
which would be a lot quicker.
>>
>> ok, that'll do
nicely..

Depending upon whether or not you have shell access to
the hosts, you could update a host and then use rsync from that host to
the rest.



>

--- End Message ---
--- Begin Message ---
Dear all,

I am rather green to PHP and web programming in general, and would just
like some pointers how to accomplish the following.

I have a webpage on a remote host, which supports PHP but does not have a
DB installed. Here, I have a form where the user can input personal
credentials, which are then processed and sent as an email message to me
from the server. This part work so far.

I want to do the following: the user should be able to upload his/her CV.
To do so, I need the following:
1) A way for the user to open a conventional file system view to select the
file to upload
2) A way to take this file, add it as an attachment to the mail created in
the form, and finally send the mail + attachment to my mail.

Is this possible to do without intermediary storage in a DB? I.e. is it
possible just to pass the attachment directly from working memory to the
function for sending email? Or does it have to go intermediare storage?

Thanks in advance for any help!

-- 
Best,

Christopher Svanefalk

--- End Message ---
--- Begin Message ---
Addendum: what standard functions could I invoke to accomplish the file
system view part?

On Tue, Mar 27, 2012 at 2:37 PM, Christopher Svanefalk <
christopher.svanef...@gmail.com> wrote:

> Dear all,
>
> I am rather green to PHP and web programming in general, and would just
> like some pointers how to accomplish the following.
>
> I have a webpage on a remote host, which supports PHP but does not have a
> DB installed. Here, I have a form where the user can input personal
> credentials, which are then processed and sent as an email message to me
> from the server. This part work so far.
>
> I want to do the following: the user should be able to upload his/her CV.
> To do so, I need the following:
> 1) A way for the user to open a conventional file system view to select
> the file to upload
> 2) A way to take this file, add it as an attachment to the mail created in
> the form, and finally send the mail + attachment to my mail.
>
> Is this possible to do without intermediary storage in a DB? I.e. is it
> possible just to pass the attachment directly from working memory to the
> function for sending email? Or does it have to go intermediare storage?
>
> Thanks in advance for any help!
>
> --
> Best,
>
> Christopher Svanefalk
>
>


-- 
Best,

Christopher Svanefalk

--- End Message ---
--- Begin Message ---
On Tue, Mar 27, 2012 at 8:41 AM, Christopher Svanefalk
<christopher.svanef...@gmail.com> wrote:
> Addendum: what standard functions could I invoke to accomplish the file
> system view part?
>
> On Tue, Mar 27, 2012 at 2:37 PM, Christopher Svanefalk <
> christopher.svanef...@gmail.com> wrote:
>
>> Dear all,
>>
>> I am rather green to PHP and web programming in general, and would just
>> like some pointers how to accomplish the following.
>>
>> I have a webpage on a remote host, which supports PHP but does not have a
>> DB installed. Here, I have a form where the user can input personal
>> credentials, which are then processed and sent as an email message to me
>> from the server. This part work so far.
>>
>> I want to do the following: the user should be able to upload his/her CV.
>> To do so, I need the following:
>> 1) A way for the user to open a conventional file system view to select
>> the file to upload
>> 2) A way to take this file, add it as an attachment to the mail created in
>> the form, and finally send the mail + attachment to my mail.
>>
>> Is this possible to do without intermediary storage in a DB? I.e. is it
>> possible just to pass the attachment directly from working memory to the
>> function for sending email? Or does it have to go intermediare storage?
>>
>> Thanks in advance for any help!
>>
>> --
>> Best,
>>
>> Christopher Svanefalk
>>
>>
>
>
> --
> Best,
>
> Christopher Svanefalk

Yo don't need a db for this, but you will need to place the CV onto
the file system so you can attach it to the email. Its not a hard
process if you use something like phpmailer.

Show user form with upload field
process the form on the server (incl file upload)
check the file extension to ensure you're not sending something bad
create the email
attach the file
send
log that you received the file and send the email
unlink the file

-- 

Bastien

Cat, the other other white meat

--- End Message ---
--- Begin Message ---
On 27-03-2012 15:16, Bastien Koert wrote:
On Tue, Mar 27, 2012 at 8:41 AM, Christopher Svanefalk
<christopher.svanef...@gmail.com>  wrote:
Addendum: what standard functions could I invoke to accomplish the file
system view part?

On Tue, Mar 27, 2012 at 2:37 PM, Christopher Svanefalk<
christopher.svanef...@gmail.com>  wrote:

Dear all,

I am rather green to PHP and web programming in general, and would just
like some pointers how to accomplish the following.

I have a webpage on a remote host, which supports PHP but does not have a
DB installed. Here, I have a form where the user can input personal
credentials, which are then processed and sent as an email message to me
from the server. This part work so far.

I want to do the following: the user should be able to upload his/her CV.
To do so, I need the following:
1) A way for the user to open a conventional file system view to select
the file to upload
2) A way to take this file, add it as an attachment to the mail created in
the form, and finally send the mail + attachment to my mail.

Is this possible to do without intermediary storage in a DB? I.e. is it
possible just to pass the attachment directly from working memory to the
function for sending email? Or does it have to go intermediare storage?

Thanks in advance for any help!

--
Best,

Christopher Svanefalk




--
Best,

Christopher Svanefalk

Yo don't need a db for this, but you will need to place the CV onto
the file system so you can attach it to the email. Its not a hard
process if you use something like phpmailer.

Show user form with upload field
process the form on the server (incl file upload)
check the file extension to ensure you're not sending something bad
create the email
attach the file
send
log that you received the file and send the email
unlink the file


No you don't, you can write the message, and upload a file in the same form, then just combine em into an email message on the posted-to page.

there are a ton of notes on the php.net/mail page which can help you with that. Alternatively you can also use a set of prewritten functions, such as the phpmailer package mentioned above (though I personally prefer to use my own).

Also note: checking file extensions has nothing to do with security; relying on such a crude technique to work is a very very bad idea. It also limits the possible formats that people would like to send their CV as; for example I can imagine people would want to use extensions such as .doc, .docx, but also .pdf. If you only allow those, you'll make life hard on people wanting to post a .txt or .rtf!

As for the whole "tree view"-thing, if you include a simple <input type="file"> HTML-tag, the browser will add the viewer automatically; to be more precise, you don't even have the option of doing anything like that with PHP (since it's not client-side but serverside only), HTML or JavaScript (which is strictly forbidden to do this by its standards). If you really really want to customize that part, you'd need to use Flash or some kind of other browser-plugin. But it's easiest (and most reliable) to just rely on the HTML input type=file tag.


--- End Message ---
--- Begin Message ---
[snip]On 3/27/2012 12:21 AM, Robert Cummings wrote:
I think you need two things... the recursive post processor that removes the string indexes for the children. And then a function that creates a JavaScript array expression from an object or array. The question I have for you... is given the following array structure that might be generated from my previous code:

<?php

array
(
    'exec-001' => array
    (
        'name' => 'exec-001',
        'children' => array
        (
            'sub-exec-011' => array
            (
                'name' => 'sub-exec-011',
                'children' => array
                (
                    'sub-sub-exec-111' => array
                    (
                        'name' => 'sub-sub-exec-111',
                        'children' => array()
                    ),
                    'sub-sub-exec-112' => array
                    (
                        'name' => 'sub-sub-exec-112',
                        'children' => array()
                    )
                )
            ),
            'sub-exec-012' => array
            (
                'name' => 'sub-exec-012',
                'children' => array
                (
                    'sub-sub-exec-121' => array
                    (
                        'name' => 'sub-sub-exec-121',
                        'children' => array()
                    ),
                    'sub-sub-exec-122' => array
                    (
                        'name' => 'sub-sub-exec-122',
                        'children' => array()
                    )
                )
            )
        )
    ),
    'exec-002' => array
    (
        'name' => 'exec-002',
        'children' => array
        (
            'sub-exec-021' => array
            (
                'name' => 'sub-exec-021',
                'children' => array
                (
                    'sub-sub-exec-211' => array
                    (
                        'name' => 'sub-sub-exec-211',
                        'children' => array()
                    ),
                    'sub-sub-exec-212' => array
                    (
                        'name' => 'sub-sub-exec-212',
                        'children' => array()
                    )
                )
            ),
            'sub-exec-022' => array
            (
                'name' => 'sub-exec-022',
                'children' => array
                (
                    'sub-sub-exec-221' => array
                    (
                        'name' => 'sub-sub-exec-221',
                        'children' => array()
                    ),
                    'sub-sub-exec-222' => array
                    (
                        'name' => 'sub-sub-exec-222',
                        'children' => array()
                    )
                )
            )
        )
    )
);

?>

On first blush, I think you want the following structure (from your recent posts):

<?php

array
(
    0 => array
    (
        'name' => 'exec-001',
        'children' => array
        (
            0 => array
            (
                'name' => 'sub-exec-011',
                'children' => array
                (
                    0 => array
                    (
                        'name' => 'sub-sub-exec-111',
                        'children' => array()
                    ),
                    1 => array
                    (
                        'name' => 'sub-sub-exec-112',
                        'children' => array()
                    )
                )
            ),
            1 => array
            (
                'name' => 'sub-exec-012',
                'children' => array
                (
                    0 => array
                    (
                        'name' => 'sub-sub-exec-121',
                        'children' => array()
                    ),
                    1 => array
                    (
                        'name' => 'sub-sub-exec-122',
                        'children' => array()
                    )
                )
            )
        )
    ),
    1 => array
    (
        'name' => 'exec-002',
        'children' => array
        (
            0 => array
            (
                'name' => 'sub-exec-021',
                'children' => array
                (
                    0 => array
                    (
                        'name' => 'sub-sub-exec-211',
                        'children' => array()
                    ),
                    1 => array
                    (
                        'name' => 'sub-sub-exec-212',
                        'children' => array()
                    )
                )
            ),
            1 => array
            (
                'name' => 'sub-exec-022',
                'children' => array
                (
                    0 => array
                    (
                        'name' => 'sub-sub-exec-221',
                        'children' => array()
                    ),
                    1 => array
                    (
                        'name' => 'sub-sub-exec-222',
                        'children' => array()
                    )
                )
            )
        )
    )
);

?>

Essentially, entries at the root and entries for the children are just auto indexed array items but the actual entries in those arrays retain the associative index structure for retrieval of the specific information. let me know and I can probably whip you up something.

Robert that looks correct. Here is an example of the JSON that the guy provided for me -

 var json = {
        id: "node02",
        name: "0.2",
        data: {},
        children: [{
            id: "node13",
            name: "1.3",
            data: {},
            children: [{
                id: "node24",
                name: "2.4",
                data: {},
                children: [{
                    id: "node35",
                    name: "3.5",
                    data: {},
                    children: [{
                        id: "node46",
                        name: "4.6",
                        data: {},
                        children: []
                    }]
                }, {
                    id: "node37",
                    name: "3.7",
                    data: {},
                    children: [{
                        id: "node48",
                        name: "4.8",
                        data: {},
                        children: []
                    }, {
                        id: "node49",
                        name: "4.9",
                        data: {},
                        children: []
                    }, {
                        id: "node410",
                        name: "4.10",
                        data: {},
                        children: []
                    }, {
                        id: "node411",
                        name: "4.11",
                        data: {},
                        children: []
                    }]
                },
Of course he properly closes up the JSON. I inserted id's (just an auto-incrementing number) and the data portion where needed. The name: is the part that has been the result of what you did before.
--- End Message ---
--- Begin Message ---
[snip]On 3/27/2012 12:21 AM, Robert Cummings wrote:
I think you need two things... the recursive post processor that removes the string indexes for the children. And then a function that creates a JavaScript array expression from an object or array. The question I have for you... is given the following array structure that might be generated from my previous code:

<?php

array
(
    'exec-001' => array
    (
        'name' => 'exec-001',
        'children' => array
        (
            'sub-exec-011' => array
            (
                'name' => 'sub-exec-011',
                'children' => array
                (
                    'sub-sub-exec-111' => array
                    (
                        'name' => 'sub-sub-exec-111',
                        'children' => array()
                    ),
                    'sub-sub-exec-112' => array
                    (
                        'name' => 'sub-sub-exec-112',
                        'children' => array()
                    )
                )
            ),
            'sub-exec-012' => array
            (
                'name' => 'sub-exec-012',
                'children' => array
                (
                    'sub-sub-exec-121' => array
                    (
                        'name' => 'sub-sub-exec-121',
                        'children' => array()
                    ),
                    'sub-sub-exec-122' => array
                    (
                        'name' => 'sub-sub-exec-122',
                        'children' => array()
                    )
                )
            )
        )
    ),
    'exec-002' => array
    (
        'name' => 'exec-002',
        'children' => array
        (
            'sub-exec-021' => array
            (
                'name' => 'sub-exec-021',
                'children' => array
                (
                    'sub-sub-exec-211' => array
                    (
                        'name' => 'sub-sub-exec-211',
                        'children' => array()
                    ),
                    'sub-sub-exec-212' => array
                    (
                        'name' => 'sub-sub-exec-212',
                        'children' => array()
                    )
                )
            ),
            'sub-exec-022' => array
            (
                'name' => 'sub-exec-022',
                'children' => array
                (
                    'sub-sub-exec-221' => array
                    (
                        'name' => 'sub-sub-exec-221',
                        'children' => array()
                    ),
                    'sub-sub-exec-222' => array
                    (
                        'name' => 'sub-sub-exec-222',
                        'children' => array()
                    )
                )
            )
        )
    )
);

?>

On first blush, I think you want the following structure (from your recent posts):

<?php

array
(
    0 => array
    (
        'name' => 'exec-001',
        'children' => array
        (
            0 => array
            (
                'name' => 'sub-exec-011',
                'children' => array
                (
                    0 => array
                    (
                        'name' => 'sub-sub-exec-111',
                        'children' => array()
                    ),
                    1 => array
                    (
                        'name' => 'sub-sub-exec-112',
                        'children' => array()
                    )
                )
            ),
            1 => array
            (
                'name' => 'sub-exec-012',
                'children' => array
                (
                    0 => array
                    (
                        'name' => 'sub-sub-exec-121',
                        'children' => array()
                    ),
                    1 => array
                    (
                        'name' => 'sub-sub-exec-122',
                        'children' => array()
                    )
                )
            )
        )
    ),
    1 => array
    (
        'name' => 'exec-002',
        'children' => array
        (
            0 => array
            (
                'name' => 'sub-exec-021',
                'children' => array
                (
                    0 => array
                    (
                        'name' => 'sub-sub-exec-211',
                        'children' => array()
                    ),
                    1 => array
                    (
                        'name' => 'sub-sub-exec-212',
                        'children' => array()
                    )
                )
            ),
            1 => array
            (
                'name' => 'sub-exec-022',
                'children' => array
                (
                    0 => array
                    (
                        'name' => 'sub-sub-exec-221',
                        'children' => array()
                    ),
                    1 => array
                    (
                        'name' => 'sub-sub-exec-222',
                        'children' => array()
                    )
                )
            )
        )
    )
);

?>

Essentially, entries at the root and entries for the children are just auto indexed array items but the actual entries in those arrays retain the associative index structure for retrieval of the specific information. let me know and I can probably whip you up something.

Robert that looks correct. Here is an example of the JSON that the guy provided for me -

 var json = {
        id: "node02",
        name: "0.2",
        data: {},
        children: [{
            id: "node13",
            name: "1.3",
            data: {},
            children: [{
                id: "node24",
                name: "2.4",
                data: {},
                children: [{
                    id: "node35",
                    name: "3.5",
                    data: {},
                    children: [{
                        id: "node46",
                        name: "4.6",
                        data: {},
                        children: []
                    }]
                }, {
                    id: "node37",
                    name: "3.7",
                    data: {},
                    children: [{
                        id: "node48",
                        name: "4.8",
                        data: {},
                        children: []
                    }, {
                        id: "node49",
                        name: "4.9",
                        data: {},
                        children: []
                    }, {
                        id: "node410",
                        name: "4.10",
                        data: {},
                        children: []
                    }, {
                        id: "node411",
                        name: "4.11",
                        data: {},
                        children: []
                    }]
                },
Of course he properly closes up the JSON. I inserted id's (just an auto-incrementing number) and the data portion where needed. The name: is the part that has been the result of what you did before.
--- End Message ---
--- Begin Message ---
Seems unusual not to have any traffic on it all day long.

--- End Message ---
--- Begin Message ---
On 03/27/2012 04:23 PM, Jay Blanchard wrote:
> Seems unusual not to have any traffic on it all day long.

i put in my codes but i only get blank page...

-- 
Thanks!
-Shawn
http://www.spidean.com

--- End Message ---
--- Begin Message ---
On Tue, Mar 27, 2012 at 11:32 PM, Shawn McKenzie <nos...@mckenzies.net> wrote:
> On 03/27/2012 04:23 PM, Jay Blanchard wrote:
>> Seems unusual not to have any traffic on it all day long.
>
> i put in my codes but i only get blank page...
>

List seems to be working fine, last message was at 3:11 PM GMT. That's
about 6 hours ago which doesn't seem unusual..

--- End Message ---
--- Begin Message ---
On 03/27/2012 04:34 PM, Matijn Woudt wrote:
> On Tue, Mar 27, 2012 at 11:32 PM, Shawn McKenzie <nos...@mckenzies.net> wrote:
>> On 03/27/2012 04:23 PM, Jay Blanchard wrote:
>>> Seems unusual not to have any traffic on it all day long.
>>
>> i put in my codes but i only get blank page...
>>
> 
> List seems to be working fine, last message was at 3:11 PM GMT. That's
> about 6 hours ago which doesn't seem unusual..

is not working fine, i put in my php codes and need help with blank screen

-- 
Thanks!
-Shawn
http://www.spidean.com

--- End Message ---

Reply via email to