[PHP] PHP OOP
I have a problem, I can't create an array of classes into a class, for example: class one { var $a; function foo() { echo "foo"; } } class two { var $b; function initialize() { $b[0] = new one(); $b[1] = new one(); } } $test = new two(); $test->initialize(); $test->b[0]->foo(); //It doesn't work $test->b[1]->foo(); //It doesn't work Any suggestion? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP OOP
I have a problem, I can't create an array of classes into a class, for example: class one { var $a; function foo() { echo "foo"; } } class two { var $b; function initialize() { $b[0] = new one(); $b[1] = new one(); } } $test = new two(); $test->initialize(); $test->b[0]->foo(); //It doesn't work $test->b[1]->foo(); //It doesn't work Any suggestion? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP OOP
I made a mistake while I was writting the example, in my original code I wrote it as you did, with $this->b[0] = new one(); but it doesn't work. Thank you. "Philip Hallstrom" <[EMAIL PROTECTED]> escribió en el mensaje [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Not tested, but what if you change > > $b[0] = new one(); > $b[1] = new one(); > > to: > > $this->b[0] = new one(); > $this->b[1] = new one(); > > On Tue, 3 Sep 2002, Rodrigo Dominguez wrote: > > > I have a problem, I can't create an array of classes into a class, for > > example: > > > > class one { > > var $a; > > > > function foo() { > > echo "foo"; > > } > > } > > > > class two { > > var $b; > > > > function initialize() { > > $b[0] = new one(); > > $b[1] = new one(); > > } > > } > > > > $test = new two(); > > $test->initialize(); > > > > $test->b[0]->foo(); //It doesn't work > > $test->b[1]->foo(); //It doesn't work > > > > Any suggestion? > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Uploading file
You are doing wrong... you are checking for the temp file and after that you are deleting the temp file, you should copy the files first This is your code if(isset($UploadedFile)) { unlink($UploadedFile); // Here you are deleting the temp file print("Local File: $UploadedFile \n"); print("Name: $UploadedFile_name \n"); print("Size: $UploadedFile_size \n"); print("Type: $UploadedFile_type \n"); print("\n"); } You should write something like this if(isset($UploadedFile)) { copy($UploadedFile, "/uploaded_files/" . $UploadedFile_name); // Here we first copy the temp file to a secure path, you should change the /uploaded_files/ // path print("Local File: $UploadedFile \n"); print("Name: $UploadedFile_name \n"); print("Size: $UploadedFile_size \n"); print("Type: $UploadedFile_type \n"); print("\n"); unlink($UploadedFile); // Now we can delete the temp file } "Clemson Chan" <[EMAIL PROTECTED]> escribió en el mensaje [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Thanks Juan, and other listers, > > I have this example, > > > > Figure 7-3 > > > //check for file upload > if(isset($UploadedFile)) > { > unlink($UploadedFile); > print("Local File: $UploadedFile \n"); > print("Name: $UploadedFile_name \n"); > print("Size: $UploadedFile_size \n"); > print("Type: $UploadedFile_type \n"); > print("\n"); > } > ?> > ACTION="7-3.php" METHOD="post"> > > > > > > > > > and the result is this after I uploaded a file > > Local File: /tmp/phpnYLV2J > Name: 323lake.jpg > Size: 48254 > Type: image/pjpeg > > But I couldn't find the uploaded file, nor the /tmp/phpnYLV2J path. > Do I normally do a copy after the upload? > Can I just change the tmp path and filename when I upload? > Thanks. > > --Clemson > > > > -Original Message- > From: Juan Pablo Aqueveque [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 03, 2002 7:58 AM > To: Clemson Chan; [EMAIL PROTECTED] > Subject: Re: [PHP] Uploading file > > > Hi friend, > > http://www.php.net/manual/en/features.file-upload.php > And take a look to the User Contributed Notes > > --jp > > At 13:03 03-09-2002 -0700, Clemson Chan wrote: > >Hi, I am new to this group. > >I am trying to figure out how to let people to upload image files to my > >website. > >My ISP is using PHP 3 (I believe). > >If someone can give me simple example, that will be great. > >Thanks. > > > >--Clemson > > > >How can I tell what version of PHP is running on the system (linux)? > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > > Juan Pablo Aqueveque <[EMAIL PROTECTED]> > Ingeniero de Sistemas > Departamento de Redes y Comunicaciones http://www.drc.uct.cl > Universidad Católica de Temuco. > Tel:(5645) 205 630 Fax:(5645) 205 628 > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] XML vs Everything Else
I'm writting an application, a control panel for a web site, and it will be great if I can separe data from presentation, I know that I have to work with XML and XSL but I didn't understand how it works. Can you give me a simple example? Let guess that a client request index.php, and I have index.xml for the data, index.xsl for the data transformation and index.php, how it works? "Geoff Hankerson" <[EMAIL PROTECTED]> escribió en el mensaje [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > > > >Can anyone direct me to a page with xml in use? Something that can help me > >grasp what its all about. > > > > > > > > I didn't understand xml at all until I started using it . I asked > pretty much the same question as you (what is it good for?). Now I will > almost always use xml in any app I work on. > > One application that is simply wonderful is xsl transformations. This > allows you to take xml and transform it into html, wml, pdf, rtf , etc... > > What this ultimately means to me is seperation of presentation from > logic and data which makes for a very flexible and easy to maintain > application. > > I have made a php class to make a database query into xml in the form of: > value > > Now stuff I used to do that took a whole page to code nows uses about 5 > lines. This is a real world benefit for me. > > Spend some time learning about xml and you won't regret it > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Pass array in HTTP_POST_VARS question
If you are in a session you can register the array and it will be available on the next page, once you finish working with the array, just unregister the array. File1.php action= file2.php session_start(); session_register("foo"); var $foo = array(); File2.php session_start(); Work with $foo session_unregister("foo"); "Paul Maine" <[EMAIL PROTECTED]> escribió en el mensaje [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Is it possible to pass an array in a form post? If so, how do I reference > the array on the next page? > > Thank You > Paul > php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] XML doubt
I don't know how to work with XML... I know that it's a good standard to pass information between computer or applications, but I don't know how to separe my data from my presentation on my PHP projects. I always use OOP, I organize all the data in databases and clases, but I always have to put some code on my presentation files, like index.php, viewstock.php, and it will be great if I can organize my projects so the presentation can be handled by any designersm, at this time I always have to make the changes on the presentation files because I am the one who know about PHP. Can you give some example about how to separate the data from the presentation using XML and databases? Or can you tell me about a project where I can see it? Thank you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] XML doubt
Ok, thank you just one more doubt Is it threading safe? For example: At 13:30:10 [Proccess 1] cliente request index.php At 13:30:11 [Proccess 1] index.php is putting the content of the querey into index.xml At 13:30:12 [Proccess 2]a new client request index.php At 13:30:13 [Proccess 2]a new instance of index.php is invoked and it starts to put the content of the query into index.xml, but [Proccess 1] is still working with index.xml What happends? "Geoff Hankerson" <[EMAIL PROTECTED]> escribió en el mensaje [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Forgot a step: (1C) make an xslt stylesheet which is basically just a > beefed-up html page. > Check out devshed.cm > xml.com > and w3c.org for info on xslt stlyesheets > > Geoff Hankerson wrote: > > > Rodrigo Dominguez wrote: > > > >> I don't know how to work with XML... I know that it's a good standard to > >> pass information between computer or applications, but I don't know > >> how to > >> separe my data from my presentation on my PHP projects. > >> > >> I always use OOP, I organize all the data in databases and clases, but I > >> always have to put some code on my presentation files, like index.php, > >> viewstock.php, and it will be great if I can organize my projects so the > >> presentation can be handled by any designersm, at this time I always > >> have to > >> make the changes on the presentation files because I am the one who know > >> about PHP. > >> > >> Can you give some example about how to separate the data from the > >> presentation using XML and databases? Or can you tell me about a project > >> where I can see it? > >> > >> Thank you. > >> > >> > >> > > 1. Convert sql queries into xml (I'm glad to send a copy of my class > > if you'd like) > >basically its: > >A. Loop over query as you normally would > >B. Loop through each column in a record for a query and make an xml > > compatible string like: > > > > value > > > > 2. Then just follow the xslt section of the php manual it's pretty > > straight forward > > > > Give it a shot, if you have trouble send specific questions to the > > list I and quite a few other will be glad to help > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: checkbox question
Why you can't use square brackets? "Alex Shi" <[EMAIL PROTECTED]> escribió en el mensaje [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > How to ontain data from a group of checkbox using same name? > For example, in a form there're 6 checkboxes and all named as > "Interesting_Area". I know if put a pairs of square brackets at the > end of the name then in php all the values of them can be ontained. > However, for some reason I cannot use square brackets. Please > help me out if anyone know how to do the trick. THanks! > > Alex > > > -- > --- > TrafficBuilder Network: > http://www.bestadv.net/index.cfm?ref=7029 > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php