Re: [PHP] Get reference count on a variable.
On Sat, 2004-08-21 at 00:10, Curt Zirzow wrote: > * Thus wrote Robert Cummings: > > Hi All, > > > > I think I'm looking for something that doesn't exist, but just in > > case thought I'd check the list. Does anyone know if a PHP function > > exists to get the number of references on a given variable's data? I was > > hoping to create a way for a factory to automatically recycle resources > > without the need for the developer to call some kind of free() method. > > If I could get the internal reference count then I'd be able to > > determine if it is free by virtue of only 1 reference (the factory). > > This is for PHP4 btw, the solution is trivial in PHP5 using destructors. > > unfortantly there isn't a method to determain this. > > Be careful with PHP5, i'm not sure if its applicable in your > situation, but there does seem to be rumor that php5 objects are > assigned by reference, which isn't true: > > $o1 = new object(); > $o2 = $o1; > unset($o2); > > the Object still exists, and the destructor isn't called. > > vs. > > $o3 = new object(); > $o4 =& $o3; > unset($o3); > > The object will no longer exist, destructor is called. > > > To elaborate a bit more on this... objects in php5 add a new > layer to variable existance. > > When an object is created it creates itself into its own memory > space and a new variable ($o1) is allocated to point to that > objects memory space. > > When the variable ($o1) is assigned to another variable ($o2), a > memory is allocated to point to the object as well. So now > two allocated variables are pointing to the same object. When one > of the variables is destroyed, since another variable still points > to the object, the object will continue to exist. Until all > variables pointing to that object no longer exits. > > In unix filesystem terms, a variable of an object is very much like > how a hard link is treated. The allocated filename (variable in > php's case), points to the allocated data (object). When no other > filename points to the same data, the data is released from usage. > > In the later example (using =&), the new variable created ($o4), > points to ($o3). So, as the manual explains, the new variable > ($o4) is a symoblic link to the original variable ($o3). Hmmm, I think you got some wires crossed :) Your two examples are identical in functionality; except that your assertion that the object no longer exists in example 2 is incorrect. In PHP5 object assignment results in a reference assignment instead of a copy as in PHP4. Try running the following sample script: foo."\n"; } } $o1 = new Foo(); $o2 = $o1; $o1->foo = 1; echo "Checkpoint 1\n"; unset( $o1 ); echo "Checkpoint 2\n"; unset( $o2 ); echo "Checkpoint 3\n"; $o3 = new Foo(); $o4 =& $o3; $o3->foo = 2; echo "Checkpoint A\n"; unset( $o3 ); echo "Checkpoint B\n"; unset( $o4 ); echo "Checkpoint C\n"; So to take your example of symbolic links. When a new object is created the memory is allocated and a symbolic link is created to that memory. Then when you assign the object to another variable then another symbolic link is created. So in your examples the mere assignment of the newly created object: $o1 = new object(); creates a symbolic link. Thus when the __destruct() method is automatically called I can be certain that no "symbolic links" exist. So for my factory example the __destruct() method could inform the factory that the the resource consumed by the object being destroyed is now re-usable. In PHP5 to get a copy of, versus a reference to, an object the developer must call the __clone() method for the target object: $obj = new Foo(); $copyNotReference = $obj->__clone(); Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re:Re: [PHP] How do I use sessions if cookies are turned off in the browser?
--- John Holmes <[EMAIL PROTECTED]> wrote: > From: "fongming" <[EMAIL PROTECTED]> > > You also can use follows: > > > > > > You can, if you want to make the (incorrect) assumption that everyone > will have "PHPSESSID" as the name of their sessions... > > That's what session_name() is for and the SID constant... Yep, and... That syntax is wrong anyway - session_id() only returns the session identifier when used in PHP, not within HTML. :-) Chris = Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming Fall 2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Linkpoint API question
* Thus wrote Brian Dunning: > I telephoned *just* as the Linkpoint API support folks left for the > weekend > > Currently we are doing just a SALE transaction. I want instead to first > submit an authorization with AVS and CVV2 information, make a decision > (2 out of 3) and then process the charge or not. The documentation is > not clear to me: does anybody know which of Linkpoint's "ordertypes" > these would be? Would the first be PREAUTH and the second be POSTAUTH? I'm not sure and am just throwing a wild guess at this but from the sounds of it, that info should be provided with PREAUTH. Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Get reference count on a variable.
* Thus wrote Robert Cummings: > Hi All, > > I think I'm looking for something that doesn't exist, but just in > case thought I'd check the list. Does anyone know if a PHP function > exists to get the number of references on a given variable's data? I was > hoping to create a way for a factory to automatically recycle resources > without the need for the developer to call some kind of free() method. > If I could get the internal reference count then I'd be able to > determine if it is free by virtue of only 1 reference (the factory). > This is for PHP4 btw, the solution is trivial in PHP5 using destructors. unfortantly there isn't a method to determain this. Be careful with PHP5, i'm not sure if its applicable in your situation, but there does seem to be rumor that php5 objects are assigned by reference, which isn't true: $o1 = new object(); $o2 = $o1; unset($o2); the Object still exists, and the destructor isn't called. vs. $o3 = new object(); $o4 =& $o3; unset($o3); The object will no longer exist, destructor is called. To elaborate a bit more on this... objects in php5 add a new layer to variable existance. When an object is created it creates itself into its own memory space and a new variable ($o1) is allocated to point to that objects memory space. When the variable ($o1) is assigned to another variable ($o2), a memory is allocated to point to the object as well. So now two allocated variables are pointing to the same object. When one of the variables is destroyed, since another variable still points to the object, the object will continue to exist. Until all variables pointing to that object no longer exits. In unix filesystem terms, a variable of an object is very much like how a hard link is treated. The allocated filename (variable in php's case), points to the allocated data (object). When no other filename points to the same data, the data is released from usage. In the later example (using =&), the new variable created ($o4), points to ($o3). So, as the manual explains, the new variable ($o4) is a symoblic link to the original variable ($o3). I hope that wasn't too much info :) Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Get reference count on a variable.
Hi All, I think I'm looking for something that doesn't exist, but just in case thought I'd check the list. Does anyone know if a PHP function exists to get the number of references on a given variable's data? I was hoping to create a way for a factory to automatically recycle resources without the need for the developer to call some kind of free() method. If I could get the internal reference count then I'd be able to determine if it is free by virtue of only 1 reference (the factory). This is for PHP4 btw, the solution is trivial in PHP5 using destructors. Thanks in advance. Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Linkpoint API question
On Fri, 20 Aug 2004 17:16:03 -0700, Brian Dunning <[EMAIL PROTECTED]> wrote: > I telephoned *just* as the Linkpoint API support folks left for the > weekend > > Currently we are doing just a SALE transaction. I want instead to first > submit an authorization with AVS and CVV2 information, make a decision > (2 out of 3) and then process the charge or not. The documentation is > not clear to me: does anybody know which of Linkpoint's "ordertypes" > these would be? Would the first be PREAUTH and the second be POSTAUTH? > I don't know about Linkpoint, but with Verisign, this would be: "Authorization" for the initial check "Delayed Capture" to actually charge the card "Void" to cancel the Authorization -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Linkpoint API question
I telephoned *just* as the Linkpoint API support folks left for the weekend Currently we are doing just a SALE transaction. I want instead to first submit an authorization with AVS and CVV2 information, make a decision (2 out of 3) and then process the charge or not. The documentation is not clear to me: does anybody know which of Linkpoint's "ordertypes" these would be? Would the first be PREAUTH and the second be POSTAUTH? Many thanks, - Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SimpleXML
Rick Fletcher wrote: Daniel Schierbeck wrote: I am having some problems with the XML features (I use the fancy new SimpleXML). It works like a dream when I'm retrieving information from an XML document, but when I want to insert new tags it screws up. I'm trying to create a function that saves error logs in an XML file, which should look like this: 2 Could not bla bla filename.php 56 1 Failed to bla bla filename2.php 123 I tried to use SimpleXML myself and had some strange behavior, so I ended up switching to DOM. I was already basically familiar with DOM anyway from javascript so development went quickly. You should take a look: http://www.php.net/dom There's more than one way to do it, of course, but code to add an element to this tree could look something like this: load( "errors.xml" ); // count the number of existing "error" nodes $errors_node = $doc->documentElement; $error_count = $errors_node->getElementsByTagName( "error" )->length; // create the new "error" node... $error_node = $doc->createElement( "error" ); // ...and its children $number_node = $doc->createElement( "number", $error_count + 1 ); $string_node = $doc->createElement( "string", "New error message" ); $file_node = $doc->createElement( "file", "foo.php" ); $line_node = $doc->createElement( "line", "32" ); // add the children to the error node $error_node->appendChild( $number_node ); $error_node->appendChild( $string_node ); $error_node->appendChild( $file_node ); $error_node->appendChild( $line_node ); // add the new "error" node to the tree $doc->documentElement->appendChild( $error_node ); // save back to the file $doc->save( "errors.xml" ); ?> -- Rick Thanks, that looks promising! It would be slick if SimpleXML could handle that type of insertion, but i guess you can't get everything, eh? Best regards, Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [OFF] Double charges to credit cards
On Fri, 20 Aug 2004 13:37:23 -0700, Brian Dunning <[EMAIL PROTECTED]> wrote: > This question is not necessarily PHP-specific, though we are running > PHP classes. > > Online store, credit card authorized at time of order, credit card > charged at time of shipment (could be anywhere from a few minutes to a > couple weeks later). Standard stuff. But customers are complaining that > they're being double-charged. Turns out that both the authorization and > the charge are showing up on their statements. Our merchant provider, > ConcordEFSnet whose API we're using, says that this is just the way it > works and there's nothing we can do about it. This is bull, there's no way it works this way. > > Sounds too incredible to be true. I've never seen anything like this on > my own credit card statements, and I can't imagine that Amazon, et. al. > have this problem, though they follow our same business process. Can > anyone shed any light on this? > How are you "charging" when the order ships? Are you doing a "Sale" or a "Capture" transaction. Normally when you authorize an amount, it puts a hold on the amount on the credit card. When you want to charge, you have to do a "Capture" of the "Authorization". If you instead do a "Sale", the authorization will show up as a block on the credit card. It *should* go away after 30 or so days. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SimpleXML
Daniel Schierbeck wrote: I am having some problems with the XML features (I use the fancy new SimpleXML). It works like a dream when I'm retrieving information from an XML document, but when I want to insert new tags it screws up. I'm trying to create a function that saves error logs in an XML file, which should look like this: 2 Could not bla bla filename.php 56 1 Failed to bla bla filename2.php 123 I tried to use SimpleXML myself and had some strange behavior, so I ended up switching to DOM. I was already basically familiar with DOM anyway from javascript so development went quickly. You should take a look: http://www.php.net/dom There's more than one way to do it, of course, but code to add an element to this tree could look something like this: load( "errors.xml" ); // count the number of existing "error" nodes $errors_node = $doc->documentElement; $error_count = $errors_node->getElementsByTagName( "error" )->length; // create the new "error" node... $error_node = $doc->createElement( "error" ); // ...and its children $number_node = $doc->createElement( "number", $error_count + 1 ); $string_node = $doc->createElement( "string", "New error message" ); $file_node = $doc->createElement( "file", "foo.php" ); $line_node = $doc->createElement( "line", "32" ); // add the children to the error node $error_node->appendChild( $number_node ); $error_node->appendChild( $string_node ); $error_node->appendChild( $file_node ); $error_node->appendChild( $line_node ); // add the new "error" node to the tree $doc->documentElement->appendChild( $error_node ); // save back to the file $doc->save( "errors.xml" ); ?> -- Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] avi to wmv convert
Jason Wong wrote: On Saturday 21 August 2004 03:24, John Nichel wrote: Ah-hadoing that, I have learned that you missed a step... fclose ( $manual ); That was intentional, you should have it open all the time and read from it continually. That's why you guys get the big bucks. ;) -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [OFF] Double charges to credit cards
Hi, > Online store, credit card authorized at time of order, credit card > charged at time of shipment (could be anywhere from a few minutes to a > couple weeks later). Standard stuff. But customers are complaining that > they're being double-charged. Turns out that both the authorization and > the charge are showing up on their statements. Our merchant provider, > ConcordEFSnet whose API we're using, says that this is just the way it > works and there's nothing we can do about it. The way that it works with the provider we're using, is that you authorize the card, the authorization could stay there until up to 30 days. There is an option to Cancel the transaction, this makes it go away pretty much immediately. The cancel request has to be sent in before we send our settlement file though. Once its settled, it's a done deal. > Sounds too incredible to be true. I've never seen anything like this on > my own credit card statements, and I can't imagine that Amazon, et. al. > have this problem, though they follow our same business process. Can > anyone shed any light on this? I guess I was under the impression that Amazon and others didn't charge (or authorize) your card until the time of shipping, and that if the card was declined, they contact you then. That's how it seems to me, but I don't really know. Hope that helps. -Dan Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] avi to wmv convert
On Saturday 21 August 2004 03:24, John Nichel wrote: > Ah-hadoing that, I have learned that you missed a step... > > fclose ( $manual ); That was intentional, you should have it open all the time and read from it continually. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* To err is human -- but it feels divine. -- Mae West */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [OFF] Double charges to credit cards
This question is not necessarily PHP-specific, though we are running PHP classes. Online store, credit card authorized at time of order, credit card charged at time of shipment (could be anywhere from a few minutes to a couple weeks later). Standard stuff. But customers are complaining that they're being double-charged. Turns out that both the authorization and the charge are showing up on their statements. Our merchant provider, ConcordEFSnet whose API we're using, says that this is just the way it works and there's nothing we can do about it. Sounds too incredible to be true. I've never seen anything like this on my own credit card statements, and I can't imagine that Amazon, et. al. have this problem, though they follow our same business process. Can anyone shed any light on this? - Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] GD installation problem
[snip] Can anyone tell me how to install GD 2.0.28 (which support GIF) with php? Can you tell me all the instructions to follow? [/snip] All of the instructions http://www.boutell.com/gd/manual2.0.28.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Is this the right way to increase the amount of time session variables are dropped
Thanks Torsten. I wasn't 100% sure that was the right env var to change but now I am :) "Torsten Roehr" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Boot" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Currently session variables are dropped in a shorter time period than I > > would like when a user sits with a page open but idle. > > > > My PHP.INI has session_gc_maxlifetime set to 1440. > > > > If I want variables kept for two hours, is setting session_gc_maxlifetime > > the correct setting to change (to 7200) ? > > > > > > Thanks! > > If you cannot edit your php.ini put this line at the top of all your > scripts: > ini_set('session.gc_maxlifetime', 7200); > > You can also set this environment variable with a .htaccess file. Search the > archives to find out how the exact syntax is. > > Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GD installation problem
Deepak Dhake wrote: Can anyone tell me how to install GD 2.0.28 (which support GIF) with php? Can you tell me all the instructions to follow? http://us4.php.net/gd -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] GD installation problem
Can anyone tell me how to install GD 2.0.28 (which support GIF) with php? Can you tell me all the instructions to follow? Thanks, _deepak -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 5.01 and HTML
Thanks alot, worked great. You're the man!! "Matt M." <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > > > > $db = new COM("ADODB.Connection"); > > $dsn = "DRIVER=SQL Server; SERVER=D63WV941;UID=sa;PWD=sa; > > DATABASE=BINDER"; > > $db->Open($dsn); > > $rs = $db->Execute("SELECT * from company"); > > while (!$rs->EOF) > > { > > $Name = $rs->Fields['Name']->Value; > > // This doesn't get listed. > > "".$Name; > > $rs->MoveNext(); > > } > > ?> > > > > print "".$Name; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 5.01 and HTML
> >$db = new COM("ADODB.Connection"); > $dsn = "DRIVER=SQL Server; SERVER=D63WV941;UID=sa;PWD=sa; > DATABASE=BINDER"; > $db->Open($dsn); > $rs = $db->Execute("SELECT * from company"); > while (!$rs->EOF) > { > $Name = $rs->Fields['Name']->Value; > // This doesn't get listed. > "".$Name; > $rs->MoveNext(); > } > ?> > print "".$Name; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] WAHT is my error???
On Fri, 20 Aug 2004 19:34:51 +0100, Andre <[EMAIL PROTECTED]> wrote: > > Inside of one ARRAY can I make one WHILE > > function tabelas($tabela_tipo){ > $sql = mysql_query("SELECT * FROM ".$tabela_tipo."_credito ORDER BY > ".$tabela_tipo."_ordenar"); > $return = "\n"; > $tabela_array = array("". No, you can't do such a thing. First of all, array() is a language construct and creates an array from values passed into it. Second, you're using period (.) here...what exactly are you trying to do? Perhaps you should try: $tablea_array = array(); >while($registo = mysql_fetch_array($sql)){ >array ("".$registo[0]."", *WHY* are you concatenating a value to two empty strings? This effectively changes the type of the variable to a string, but since it's coming from the DB it's already a string. And besides which, it very rarely matters to PHP whether something is a string or a number, it will convert between them automatically. > "".$registo[0]." ".$registo[0].""); Maybe you mean to do: $tablea_array[] = array ($registo[0], $registo[0].' '.$registo[0]); > }."" And remove the ."" here. >foreach($tabela_array as $subarray) { >list($num, $text) = $subarray; >$return .= " selected>$text\n"; >} >$return .= "\n"; >return $return; > } > You really need to go back and run through some PHP tutorials, it seems you don't really understand the language. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 5.01 and HTML
Hello everyone. I have the following script that creates a listbox. My box appears, but I can't get any data into it. Can someone let me know what I'm doing wrong. Open($dsn); $rs = $db->Execute("SELECT * from company"); while (!$rs->EOF) { $Name = $rs->Fields['Name']->Value; // This doesn't get listed. "".$Name; $rs->MoveNext(); } ?> I appreciate the help, Chuck -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] avi to wmv convert
Curt Zirzow wrote: * Thus wrote John Nichel: Jay Blanchard wrote: [snip] In what manual? [/snip] TFM! I'm sorry, I didn't quite catch that. Could you hold my hand, and point it out to me? If you were a real pal, you would write the code for me too. ;) $manual = fopen('http://php.net/manual', 'r'); while ($contents = fread($manual) ) { ulearn($contents); } :) Curt Ah-hadoing that, I have learned that you missed a step... fclose ( $manual ); *L* -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] avi to wmv convert
Peter Clarke wrote: John Nichel wrote: Jay Blanchard wrote: [snip] In what manual? [/snip] TFM! I'm sorry, I didn't quite catch that. Could you hold my hand, and point it out to me? If you were a real pal, you would write the code for me too. ;) The only manual I know of is at www.php.net It provides a tool for searching the online documentation. Searching for 'avi' produces just one result of: http://www.php.net/function.getimagesize in which a user posts about finding dimensions etc from media files. I cannot find anywhere that mentions converting avi files to wmv files. The point of the razzing is to get one to do some research. If you don't see it in the manual, chances are PHP cannot do it on it's own. Without seeing any 'video' functions listed in 'THE MANUAL', I would hazard a guess that converting between two different video formats is a bit beyond the scope of PHP. Not to say that this cannot be done, as I'm sure there is an API out there that PHP can interact with, but someplace like Google would be a better place to start a search like there. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP5: problem with mysqli_prepare/mysqli_bind_param
[snip] 172: $q = $this->DB["cms"]->prepare("SELECT t.Extension FROM Site_Mime as m,Type as t WHERE m.SNr=? && m.TNr=t.Nr"); 173: $q->bind_param("i",$this->Site["Nr"]); 174: $q->execute(); 175: $q->store_result(); [/snip] I've got a very serious problem in big class, but these two lines are probably the origin if my problem: $this->DB["CMS"] is a valid mysqli_connection $this->Site["Nr"] is a number - in the current test-case it is 3 I've also checked the tables. There is a row with SNr=3 and TNr=2 in Site_Mime, and there is a row in the table Type with Nr=2. So I would expect to get at least one row as a result of this query, but $q->num_rows has only the value "" Then I tried simply to add ' on both sides of the ? but it got only ('?' instead of ?)weird: Warning: mysqli_stmt::bind_param() [function.bind-param.html]: Number of variables doesn't match number of parameters in prepared statement in C:\Programme\Apache Group\Apache2\htdocs\cms\lib\cms\site.class.php on line 173 has anyone an idea of what is wrong there? is it possible that this is a bug? thx for helping ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Is this the right way to increase the amount of time session variables are dropped
"Boot" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Currently session variables are dropped in a shorter time period than I > would like when a user sits with a page open but idle. > > My PHP.INI has session_gc_maxlifetime set to 1440. > > If I want variables kept for two hours, is setting session_gc_maxlifetime > the correct setting to change (to 7200) ? > > > Thanks! If you cannot edit your php.ini put this line at the top of all your scripts: ini_set('session.gc_maxlifetime', 7200); You can also set this environment variable with a .htaccess file. Search the archives to find out how the exact syntax is. Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: WAHT is my error???
"Andre" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Inside of one ARRAY can I make one WHILE > > function tabelas($tabela_tipo){ > $sql = mysql_query("SELECT * FROM ".$tabela_tipo."_credito ORDER BY > ".$tabela_tipo."_ordenar"); > $return = "\n"; > $tabela_array = array("". >while($registo = mysql_fetch_array($sql)){ >array ("".$registo[0]."", > "".$registo[0]." ".$registo[0].""); > }."" >foreach($tabela_array as $subarray) >list($num, $text) = $subarray; >$return .= " selected>$text\n"; >} >$return .= "\n"; >return $return; > } > > I guess your loop should look like this: while ($registo = mysql_fetch_array($sql)) { echo '' . $registo[1] . ''; } You can use mysql_fetch_assoc() and then access the values by their column name: $registo['column1'], $registo['column2'] etc. Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] avi to wmv convert
* Thus wrote John Nichel: > Jay Blanchard wrote: > >[snip] > >In what manual? > >[/snip] > > > >TFM! > > > > I'm sorry, I didn't quite catch that. Could you hold my hand, and point > it out to me? If you were a real pal, you would write the code for me > too. ;) $manual = fopen('http://php.net/manual', 'r'); while ($contents = fread($manual) ) { ulearn($contents); } :) Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is this the right way to increase the amount of time session variables are dropped
Currently session variables are dropped in a shorter time period than I would like when a user sits with a page open but idle. My PHP.INI has session_gc_maxlifetime set to 1440. If I want variables kept for two hours, is setting session_gc_maxlifetime the correct setting to change (to 7200) ? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] avi to wmv convert
John Nichel wrote: Jay Blanchard wrote: [snip] In what manual? [/snip] TFM! I'm sorry, I didn't quite catch that. Could you hold my hand, and point it out to me? If you were a real pal, you would write the code for me too. ;) The only manual I know of is at www.php.net It provides a tool for searching the online documentation. Searching for 'avi' produces just one result of: http://www.php.net/function.getimagesize in which a user posts about finding dimensions etc from media files. I cannot find anywhere that mentions converting avi files to wmv files. So, yes could you hold my hand and give me a url to the manual page. Don't worry about the code, just the link will do. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] WAHT is my error???
Inside of one ARRAY can I make one WHILE function tabelas($tabela_tipo){ $sql = mysql_query("SELECT * FROM ".$tabela_tipo."_credito ORDER BY ".$tabela_tipo."_ordenar"); $return = "\n"; $tabela_array = array("". while($registo = mysql_fetch_array($sql)){ array ("".$registo[0]."", "".$registo[0]." ".$registo[0].""); }."" foreach($tabela_array as $subarray) { list($num, $text) = $subarray; $return .= "$text\n"; } $return .= "\n"; return $return; }
Re: [PHP] avi to wmv convert
Jay Blanchard wrote: [snip] In what manual? [/snip] TFM! I'm sorry, I didn't quite catch that. Could you hold my hand, and point it out to me? If you were a real pal, you would write the code for me too. ;) -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP with CVS...
On Fri, 20 Aug 2004 11:12:47 -0400, Paul Danko <[EMAIL PROTECTED]> wrote: > I'm a newbie using CVS with PHP development. I created a CVS repository, > which contains two directories. > > /CVSROOT/ > /project/ > > where project has my code. > > My problem is that CVS modifies the files in the /project/ folder. the > extension becomes *.php,v. I want to be able to checkout the code, check > it back in, and then essentially "refresh" my browser and see the > changes. In this case, the repository itself cannot be used by apache > (because the files are modified as mentioned previously), a checked out > version is required. this seems like extra steps. > > 1.) Check out my copy of the code > 2.) Make changes to code > 3.) Check the code back into cvs > 4.) Checkout a copy of the current code to the web directory > 5.) View the changes via the web. > > Is this how it is typically done? Thanks for any help! > At my current job, I wrote a script (called "deploy") which checks things out of CVS and puts them in their right place in our web tree. It ended up being fairly complicated as we have lots of different secionts and applications, but for a simple thing, you could make it a shell alias if you wanted to. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re:Re: [PHP] How do I use sessions if cookies are turned off in the browser?
From: "fongming" <[EMAIL PROTECTED]> You also can use follows: You can, if you want to make the (incorrect) assumption that everyone will have "PHPSESSID" as the name of their sessions... That's what session_name() is for and the SID constant... ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] statistical classes
Does anyone know of a good place to get some php classes that deal with calculating quintile and decile points? I am working to write some but am looking for other examples. I have looked at pear and phpclasses but didn't notice any. Thanks, Eddie
Re: [PHP] Storing, formatting and displaying data
Oh thank you. This is exactly what I need. I can create regular expressions to do the job, but I wanted some ideas for the mark points used. Teddy Teddy - Original Message - From: "Justin French" <[EMAIL PROTECTED]> To: "Octavian Rasnita" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, August 20, 2004 7:02 PM Subject: Re: [PHP] Storing, formatting and displaying data > Octavian, > > If you wish to avoid WYSIWYG editors and stick with some thing > ASCI-based, I can highly recommend Textile [1], which is distributed as > part of a new PHP-based CMS called Textpattern [2]. > > Textile is a sort-of shorthand mark-up for converting ASCI to valid > XHTML. > > This is a paragraph with a line > break, *strong* and _emphasised_ text. > > * this is > * an unordered -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] avi to wmv convert
[snip] In what manual? [/snip] TFM! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] avi to wmv convert
In what manual? From: Jason Wong <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: Re: [PHP] avi to wmv convert Date: Sat, 21 Aug 2004 00:45:07 +0800 On Saturday 21 August 2004 00:36, R B wrote: > I'm making a php video system, buy i need to convert the avi videos to wmv > videos. > Some one knows a good, free, and functional avi to wmv converter? There are a few listed in the manual. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* panic ("No CPUs found. System halted. "); 2.4.3 linux/arch/parisc/kernel/setup.c */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ MSN Amor: busca tu ½ naranja http://latam.msn.com/amor/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] avi to wmv convert
On Saturday 21 August 2004 00:36, R B wrote: > I'm making a php video system, buy i need to convert the avi videos to wmv > videos. > Some one knows a good, free, and functional avi to wmv converter? There are a few listed in the manual. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* panic ("No CPUs found. System halted. "); 2.4.3 linux/arch/parisc/kernel/setup.c */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] avi to wmv convert
I'm making a php video system, buy i need to convert the avi videos to wmv videos. Some one knows a good, free, and functional avi to wmv converter? Thanks, RB _ Charla con tus amigos en línea mediante MSN Messenger: http://messenger.latam.msn.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Storing, formatting and displaying data
Octavian, If you wish to avoid WYSIWYG editors and stick with some thing ASCI-based, I can highly recommend Textile [1], which is distributed as part of a new PHP-based CMS called Textpattern [2]. Textile is a sort-of shorthand mark-up for converting ASCI to valid XHTML. This is a paragraph with a line break, *strong* and _emphasised_ text. * this is * an unordered * list # this is # an ordered # list |tables|are|easy|too| |tables|are|easy|too| "Links":http://example.com are easy too! There's a demo and lots more sample text on the Textism site [1], and you can get a copy of Textile in the (GPL) source of Textpattern. [1] http://textism.com/tools/textile/ [2] http://textpattern.com/ Justin French On 20/08/2004, at 3:14 PM, Octavian Rasnita wrote: Hi all, I would like to create a program that allow users to insert text into a database, than that text to appear in a web page formatted as HTML. It is simple to replace the end of line with \n in order to format that text as html, but I don't know how I could let the users to create bulleted lists, tables, etc. Lets say that the users are admins that I can trust, but they don't know HTML at all, however, they want to insert a table, or a list, etc. Are there any solutions for this? I am thinking to something like inserting COL1##COL2##COL3 CEL1##CEL2##CEL3 ...for the tables, or something like that, then to make the program transform this in a true table. But maybe there are better solutions. Thanks for any ideas. Teddy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Justin French http://indent.com.au -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP with CVS...
Paul Danko wrote: I'm a newbie using CVS with PHP development. I created a CVS repository, which contains two directories. /CVSROOT/ /project/ where project has my code. My problem is that CVS modifies the files in the /project/ folder. the extension becomes *.php,v. I want to be able to checkout the code, check it back in, and then essentially "refresh" my browser and see the changes. In this case, the repository itself cannot be used by apache (because the files are modified as mentioned previously), a checked out version is required. this seems like extra steps. 1.) Check out my copy of the code 2.) Make changes to code 3.) Check the code back into cvs 4.) Checkout a copy of the current code to the web directory 5.) View the changes via the web. Is this how it is typically done? Thanks for any help! -Paul This isn't a php issue...it's not really an issue at all. Your 'project' folder isn't meant for web viewing, and/or modifying directly. It's where CVS stores the files. Check the CVS documentation. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP with CVS...
Paul Danko wrote: I'm a newbie using CVS with PHP development. I created a CVS repository, which contains two directories. /CVSROOT/ /project/ where project has my code. My problem is that CVS modifies the files in the /project/ folder. the extension becomes *.php,v. I want to be able to checkout the code, check it back in, and then essentially "refresh" my browser and see the changes. In this case, the repository itself cannot be used by apache (because the files are modified as mentioned previously), a checked out version is required. this seems like extra steps. 1.) Check out my copy of the code 2.) Make changes to code 3.) Check the code back into cvs 4.) Checkout a copy of the current code to the web directory 5.) View the changes via the web. Is this how it is typically done? Thanks for any help! -Paul I don't know how it is typically done, but I implemented a similar system months ago. You need to edit one of the commit support files in CVSROOT, the loginfo file. (Note : when editing the loginfo file, check it out, edit it and commit it as you would a normal file in the repository. Don't edit it in place.) (for more info on the commit support files, see https://www.cvshome.org/docs/manual/cvs-1.11.17/cvs_18.htm ) The loginfo file speficies a set of actions to be done when the commit is complete. If you add the line: ^project(date; cat; (sleep 2; cd /var/some/dir; cvs -q update -d) &) >> $CVSROOT/CVSROOT/updatelog 2>&1 This will cause commits to the projects directory to update the checked out version in /var/some/dir (the above line was shamelessky taken from the manual in the link above, section C.3.5.2 :D) Of course you need to take of permissions issues. Ensure that the user cvs is running in CAN write to /var/some/dir. HTH! --- ramil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I use sessions if cookies are turned off in the browser?
Hi: May be you can use follows: some thing -- ¡»From: ¦¹«H¬O¥Ñ®ç¤p¹q¤l¶l¥ó1.5ª©©Òµo¥X... http://www.tyes.tyc.edu.tw [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re:Re: [PHP] How do I use sessions if cookies are turned off in the browser?
Hi: You also can use follows: -- ¡»From: ¦¹«H¬O¥Ñ®ç¤p¹q¤l¶l¥ó1.5ª©©Òµo¥X... http://www.tyes.tyc.edu.tw [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect() new_link not working? Lost connection to server during query when using multiple processes.
Gah... > To investigate my suspicion that it's not opening a new link, i've > set tcpdump going on the server and will analyse the dumpfile once Realising my stupidity, i have now stopped tcpdump. Of course it will not capture anything as i am using a local socket connection! :) Having said that, though... can you have more than one connection through a single mysql.sock? I've not worked much with non-TCP sockets, and don't know much about them. Thanks, - Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP5 functions problems... help!
Hi I am upgrading to PHP5 and having some difficulties : "undefined function". I also don't understand how some other functions work... I need LDAP and SSL support so I installed OpenLDAP --with-TLS and OpenSSL. Then I installed PHP5.1. I configured it using --with-openssl --with-ldap --with-sasl-ldap and some other options... I end up having ldap_start_tls undefined while all the other ldap functions are understood ( I tried phpinfo() ) By the way, what is the SASL mechanism used by ldap_sasl_bind? EXTERNAL?? And how does ldap_start_tls work? I mean, how is the server certificate exactly handled? More complicated : how can PHP handle a client certificate when using ldap_start_tls??? I already asked this but got no answer. I still have no clue how to configure the tls support!! It worked for me with PHP4.2.2 but without mutual certificate authentication. If anyone could help... please!! Thanks in advance Steph
[PHP] PHP with CVS...
I'm a newbie using CVS with PHP development. I created a CVS repository, which contains two directories. /CVSROOT/ /project/ where project has my code. My problem is that CVS modifies the files in the /project/ folder. the extension becomes *.php,v. I want to be able to checkout the code, check it back in, and then essentially "refresh" my browser and see the changes. In this case, the repository itself cannot be used by apache (because the files are modified as mentioned previously), a checked out version is required. this seems like extra steps. 1.) Check out my copy of the code 2.) Make changes to code 3.) Check the code back into cvs 4.) Checkout a copy of the current code to the web directory 5.) View the changes via the web. Is this how it is typically done? Thanks for any help! -Paul Paul Danko Director of Information Technology & Systems Development American Mortgage and Investment, Corp. [EMAIL PROTECTED] 443.677.7279 Mobile 301.883.8881 x 127 Office
[PHP] mysql_connect() new_link not working? Lost connection to server during query when using multiple processes.
Hi, Firstly, i'm using PHP 4.3.8 and MySQL 4.0.20, on Linux. PHP is connecting to MySQL over a local socket connection. I have a PHP script that runs constantly on one of my servers. It basically does some processing work with data in a MySQL database, pnctl_fork()s a child process to do some slow-ish task afterwards (posting some data to a less-than-reliable webserver, and then modifying an SQL table with the results), and sleeps for 10 seconds. It wasn't too often that the child process in question was still running during the next iteration of the loop in the parent, but i assume that if it was the situation i describe below would also have cropped up then. So, okay, the above was working fine. Then i added some code /after/ the fork, but before sleeping and the next iteration of the loop, which executes in the parent. So now the likelihood of both parent and children attempting to run SQL queries at the same time increases quite a bit. Since adding the above mentioned code, i now get "Lost connection to MySQL server during query". Not often, though - at most it seems to occur once a day, often only every couple of days, with this script running 24/7. I've searched mailing lists, and Google. This is the most promising thing google turned up: http://bugs.php.net/bug.php?id=26490 However, i'd anticipated that multiple processes using one resource would cause problems, and inside the child i create a new MySQL resource and use that. I'm using the exact same parameters to MySQL connect in the child as the parent, except i am supplying new_link, and setting it to true. I've checked and double checked all my MySQL functions in the child are using this new SQL resource, and they are. I am calling mysql_close($theresource) before the child process exits. In the parent, i am not specifying a resource - however, PHP should use the last resource link opened AFAIK, and as far as the parent process is concerned no other link has ever been opened. I mean, the most likely candidate for the cause of this problem is the whole processes trying to write to one connection symultaneously thing - especially as the problem didn't manifest itself until i added SQL queries immediately after on both sides of the fork... but unless new_link isn't working, i don't see how it can be the cause of this issue. To investigate my suspicion that it's not opening a new link, i've set tcpdump going on the server and will analyse the dumpfile once the error crops up again - however i'm posting here asking for advice as i really need to get it fixed /soon/. I thought someone might have other ideas. Has anyone else had similar problems? Any ideas? I've checked the MySQL server error logs. There doesn't seem to be anything related to this problem in there at all. Thanks a lot for any assistance, i'm tearing my hair out over this one :( - Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Overloaded Class & The __tostring() Method
John Holmes wrote: - Original Message - From: "Daniel Schierbeck" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, August 20, 2004 10:47 AM Subject: [PHP] Overloaded Class & The __tostring() Method I am trying to build an XML-formatted string from an object. I use this code: class XML_Object { private $childs = array(); public function __get ($prop) { if (isset($this->childs[$prop])) { return $this->childs[$prop]; } else { trigger_error("Property '$prop' not defined.", E_USER_WARNING); } } public function __set ($prop, $val) { $this->childs[$prop] = $val; } public function __tostring () { $re = ""; foreach ($this->childs as $key => $val) { $re .= "<$key>$val"; } return $re; } } $error = new XML_Object; $error->no = 2; $error->str = "Blablabla"; $error->file = "a_file.php"; $error->line = 54; $xml = new XML_Object; $xml->error = $error; echo $xml; ?> But i only get this response: Object id #1 Can someone help me? I want to print the contents of the $error object as well... echo $xml->error->no; echo $xml->error->str; etc... Not sure if that's exactly what you're after, though... ---John Holmes... It's more the principle of automatically building the string... I just used the error thing as an example. What i'd like to do is to be able to create an XML string out of an object, no matter how many levels of properties that object has. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Overloaded Class & The __tostring() Method
- Original Message - From: "Daniel Schierbeck" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, August 20, 2004 10:47 AM Subject: [PHP] Overloaded Class & The __tostring() Method I am trying to build an XML-formatted string from an object. I use this code: class XML_Object { private $childs = array(); public function __get ($prop) { if (isset($this->childs[$prop])) { return $this->childs[$prop]; } else { trigger_error("Property '$prop' not defined.", E_USER_WARNING); } } public function __set ($prop, $val) { $this->childs[$prop] = $val; } public function __tostring () { $re = ""; foreach ($this->childs as $key => $val) { $re .= "<$key>$val"; } return $re; } } $error = new XML_Object; $error->no = 2; $error->str = "Blablabla"; $error->file = "a_file.php"; $error->line = 54; $xml = new XML_Object; $xml->error = $error; echo $xml; ?> But i only get this response: Object id #1 Can someone help me? I want to print the contents of the $error object as well... echo $xml->error->no; echo $xml->error->str; etc... Not sure if that's exactly what you're after, though... ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I use sessions if cookies are turned off in the browser?
From: "Don" <[EMAIL PROTECTED]> OK! I got it to work. Although session_id() would not work, using the SID constant did. Below is the code I used: Compare the URL created with this: Increment Your Counter! to the URL created with this: echo 'Increment Your Counter!'; and you'll see the reason why the second didn't work. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to get a unique series of numbers?
From: "Henri Marc" <[EMAIL PROTECTED]> I want to generate a few numbers and those numbers must not be generated two times. function getnumbers($howmany, $min, $max) { $retval = array(); while(count($retval) < $howmany) { $retval[mt_rand($min,$max)] = 1; } return array_keys($retval); } Not tested, but should work. Probably want to add some checks in there so you don't end up in an infinite loop, though. :) ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Overloaded Class & The __tostring() Method
I am trying to build an XML-formatted string from an object. I use this code: class XML_Object { private $childs = array(); public function __get ($prop) { if (isset($this->childs[$prop])) { return $this->childs[$prop]; } else { trigger_error("Property '$prop' not defined.", E_USER_WARNING); } } public function __set ($prop, $val) { $this->childs[$prop] = $val; } public function __tostring () { $re = ""; foreach ($this->childs as $key => $val) { $re .= "<$key>$val"; } return $re; } } $error = new XML_Object; $error->no = 2; $error->str = "Blablabla"; $error->file = "a_file.php"; $error->line = 54; $xml = new XML_Object; $xml->error = $error; echo $xml; ?> But i only get this response: Object id #1 Can someone help me? I want to print the contents of the $error object as well... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] downloading files
Aaron Todd wrote: I have been using the following code to try to make it work: The webroot of my site is at: /var/www/html So far this will create a new file on my computer where ever I want, but it does not download the contents of the file. Any suggestions? Thanks, Aaron It seems that PHP can't read the file '/home/site/member/filename.xxx', what are the permissions for this file? PHP's rights are the same as the user Apache runs on. This is usually "httpd" or "apache" in most linux distributions. In your previous post, you were asking where to best place the file so it is "protected" somehow. You could actually place it in a simpler directory like /var/www/downloads then set x bit for the _other_ users of the downloads directory, so PHP can access files under it chmod o+x downloads and set all files under this directory to be readable by others (esp PHP) chmod o+r downloads/* THis way, PHP can't modify files in this directory. And no one can just download a file by entering a URL (since the files are outside the webserver path). goodluck! HTH. --- ramil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I use sessions if cookies are turned off in the browser?
> = Start of Code = > session_start(); > header("Cache-control: private"); //IE 6 Fix > if(!$_SESSION['count']){ > $_SESSION['count'] = 1; > $sid = session_id(); > echo 'Session is: ' . $sid . ''; > } else { > $_SESSION['count']++; > } > echo 'You have visited pages so > far!'; > echo 'Increment Your > Counter!'; > ?> are you sure $sid is getting set? this if(!$_SESSION['count']) might skip it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] EPS to PDF?
Does anyone know of a class or technology that can convert an EPS document in memory to an outputtable PDF? GD? ImageMagick? Thanks, - Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session_cache_limiter confusion
I've been looking through the online docs and man is this one confusing. Seems there are plenty of different ways to use this. Using this with forms, what is the best setting to avoid back button mishaps? (none,private, etc..) Thanks, Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP5 DOM extension as a PECL package for PHP4?
Not at all possible PHP5/DOM uses a lot of ZendEngine 2 specific feature, you can't port it to PHP 4 chregu On Fri, 20 Aug 2004 10:56:41 +, libogen . <[EMAIL PROTECTED]> wrote: > Hi All, > > I was just wondering if there's any possibility that someone will port > PHP5's DOM extension to PHP4, maybe making it available as a PECL package? > I'm not even sure if it can be done! > > This would make the better DOM functions available to users maybe a year > earlier on shared webhost's servers, than waiting until the webhosts are > comfortable upgrading from PHP4 to PHP5. > > It would make it easier for website maintainers/developers to transition to > PHP5's DOM extension as only a single PHP4 interpreter would be needed. They > could also test old (DOMXML) and new (DOM) scripts side by side. > > Cheers, > Scrumpy :) > > _ > Add photos to your messages with MSN 8. Get 2 months FREE*. > http://join.msn.com/?page=features/featuredemail > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71 http://www.bitflux.ch | [EMAIL PROTECTED] | gnupg-keyid 0x5CE1DECB -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How do I use sessions if cookies are turned off in the browser?
OK! I got it to work. Although session_id() would not work, using the SID constant did. Below is the code I used: = Start of Code = First time through'; } else { $_SESSION['count']++; } ?> You have visited pages so far! Increment Your Counter!== End of Code == -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 5.0.1 compiled with mysql and mysqli in FreeBSD always core dump
FreeBSD 4.10/5.2.1 mysql 4.1.3 linuxthreads in FreeBSD4, KSE in FreeBSD5 Compile PHP with mysql and mysqli together,i get core dump always. And the most core dump is using mysqli functions. Is it a bug?Any body have good idea? Now i am back to PHP 5.0.0 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] downloading files
I have been using the following code to try to make it work: The webroot of my site is at: /var/www/html So far this will create a new file on my computer where ever I want, but it does not download the contents of the file. Any suggestions? Thanks, Aaron "Octavian Rasnita" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > You can put the files that need to be downloaded in a directory somewhere > outside of the web server root, but in that case your PHP program will > need > to read the file and print it to the browser, and it will also need > printing > the HTTP headers: > > Content-type: application/octet-stream > Content-disposition: attachment; file=$filename > Content-length: xxx > [blank line] > > Or you can put the files somewhere on the web server tree, protect the > directory with .htaccess (username + password), and just put a simple link > to those files. > When someone will click that link, it will be asked for a username and > password in a popup window that the browser will open. > > If you don't want to appear that window, you can set your server to > redirect > the user to a php script, for a certain Status code that is generated when > authorization is required, and that PHP script can ask nice for a username > and password that can be used then by the script to allow access to that > file (but this way might be more complicated without real benefits). > > Teddy > > Teddy > > - Original Message - > From: "Aaron Todd" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, August 19, 2004 8:30 PM > Subject: [PHP] downloading files > > >> I posted a simular question before and never really got an answer. The > post >> drifted off into some other valuable information, but I still have the > same >> question. >> >> I am trying to create a site with file downloads. The files on the >> server >> that are to be downloaded need to be protected somehow. I have already >> created a login page for the site so users must log in. The download > files >> are in a directory protected by htaccess which it is my understanding >> that >> PHP can go underneath htaccess to get access to the files. My problem is >> where do I put this directory? I was already told to put it outside the > web >> root directory, but I really dont know where the best place is. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How do I use sessions if cookies are turned off in the browser?
Dazed and confused. I've tried the suggestions thus far (I believe) and no luck. Below is the current code. For somw reason, when I disable cookies in my browser: 1. The session ID is NOT being passed in the URL 2. The session ID changes everytime I click on the link; probably because it creates a new session evertime. Suggestions? = Start of Code = Session is: ' . $sid . ''; } else { $_SESSION['count']++; } echo 'You have visited pages so far!'; echo 'Increment Your Counter!'; ?> == End of Code == -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to destroy session ID
On Fri, 20 Aug 2004 03:23:48 -0700 (PDT), khuram noman <[EMAIL PROTECTED]> wrote: > hello > > i have problem in destroying session id, i use the > following code > > session_start(); > print "before Destroy".session_id(); > session_destroy() ; > > session_start(); > print "After Destroy".session_id(); > > ?> > > in before and after it prints the same sessionID so > how to destroy session id . waiting for soon reply you could try http://us4.php.net/session_regenerate_id -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to get a unique series of numbers?
[snip] How would you do? [/snip] I would take each number and place it in an array. Then for each subsequent number I would test to see if in_array()...if not add the number to the array, if it is then do the calc again... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to get a unique series of numbers?
Hello, I want to generate a few numbers and those numbers must not be generated two times. For example the user chooses to have two series of 5 numbers. then I have to generate (with MT_RAND) two series of 5 numbers. No problem for the first, then the second must be different from the first. I have to test that the third is different from the second and from the first... If one of them is equal to a previous number then I have to generate a new number. Once the first series is finished I can move to the second. It will be the same instructions. I did it using an array like: while ($number[2]==$number[1]) {//Rand again number 2... It works even if it's not nice, as far as I know how many series I must generate. But if I don't know how many series the user will want, I can't write the same lines of code hundreds of times. How would you do? Thank you so much for sharing your knowledge with me. Vous manquez despace pour stocker vos mails ? Yahoo! Mail vous offre GRATUITEMENT 100 Mo ! Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/ Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer instantanément avec vos amis. A télécharger gratuitement sur http://fr.messenger.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to destroy session ID
Try with session_unset(); it works for me... -Original Message- From: khuram noman [mailto:[EMAIL PROTECTED] Sent: Friday, August 20, 2004 5:39 AM To: [EMAIL PROTECTED] Subject: [PHP] How to destroy session ID hello i have problem in destroying session id, i use the following code in before and after it prints the same sessionID so how to destroy session id . waiting for soon reply Thanks Khuram Noman __ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail -- 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] Outfile not working
[snip] I've been tinkering with the code for the above for some time now and keep getting the same error: "Access Denied..." Can anyone help me find a solution to this as the user in question has full privileges to the database so I assume it's a directory access issue... [/snip] I am going to take a S.W.A.G. and assume that you are talking about SELECT stuff INTO OUTFILE "/path/where/I/want/file/to/go.txt" FROM table If this is the case a. This is a SQL question 2. You must have write permissions to the path (an OS question) Since the DB has write permissions to the directory where it stores the databases you could specify that path. Or you could find the permissions of that path and apply them to another directory. The directory must be world-writable by the SQL user (if MySQL, the user is usually mysqlbut can be different if you're working from the command line). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Outfile not working
Morning all. I've been tinkering with the code for the above for some time now and keep getting the same error: "Access Denied..." Can anyone help me find a solution to this as the user in question has full privileges to the database so I assume it's a directory access issue... -- - Michael Mason Arras People www.arraspeople.co.uk - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How to destroy session ID
Khuram Noman wrote: > i have problem in destroying session id, i use the > following code > > session_start(); > print "before Destroy".session_id(); > session_destroy() ; > > session_start(); > print "After Destroy".session_id(); > > ?> > > in before and after it prints the same sessionID so > how to destroy session id . waiting for soon reply This happens if session ID is stored in cookie. You need to force page reload so client rereads its cookies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP5 DOM extension as a PECL package for PHP4?
Hi All, I was just wondering if there's any possibility that someone will port PHP5's DOM extension to PHP4, maybe making it available as a PECL package? I'm not even sure if it can be done! This would make the better DOM functions available to users maybe a year earlier on shared webhost's servers, than waiting until the webhosts are comfortable upgrading from PHP4 to PHP5. It would make it easier for website maintainers/developers to transition to PHP5's DOM extension as only a single PHP4 interpreter would be needed. They could also test old (DOMXML) and new (DOM) scripts side by side. Cheers, Scrumpy :) _ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to destroy session ID
hello i have problem in destroying session id, i use the following code in before and after it prints the same sessionID so how to destroy session id . waiting for soon reply Thanks Khuram Noman __ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to destroy session ID
hello i have problem in destroying session id, i use the following code in before and after it prints the same sessionID so how to destroy session id . waiting for soon reply Thanks Khuram Noman ___ Do you Yahoo!? Win 1 of 4,000 free domain names from Yahoo! Enter now. http://promotions.yahoo.com/goldrush -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sun Identity Server and PHP
Hello, we had our users in LDAP. We use web authentification throug that LDAP. Now, we are switching to Sun Indentity Server (we will use Sun ONE Messaging Server) and I'm not shure will I be able to authenticate with PHP. Any Ideas? TNX -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot Load DLLs (WinXP, Apache 2, PHP 5)
Hy! You have to restart windows after changing the path-variable, else it has no effect. it it functioning for me -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP, over javascript code simple \n
try simply escaping the "\" before the "n" with an additional "\" or in other words: use "\\n" instead of "\n". PHP will interpret "\\" as an "\". -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] file permissions
Hi, I have a question concerning file permissions on the server. When i try to use fopen($file,"w") i am said i am not permitted to do so unless i set the file permissions manualy (FTP) to 666 (cannot use chmod() as well). Well i am asking how big risk it is to leave files with 666 (or dirs with 777) file permissions on the public server when php scripts of other users have open_basedir in effect. Thanks in advance, Petr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot Load DLLs (WinXP, Apache 2, PHP 5)
Rory McKinley wrote: Sorry Philip, but I have to disagree I did an install on Wednesday of this week. I placed an entry for my PHP folder in the PATH and it made no difference. Only once I had overwritten the libmysql.dll in the Windows system folder with the version that ships with PHP5 did I get everything to play nicely together. What was the order in your PATH entry? I suspect that the copy in the system folder was being found first. PATH is very badly managed now in windows, it's fine if you only have one copy of a file, but you can not rely on it if old copies exist elsewhere in the PATH. -- Lester Caine - L.S.Caine Electronic Services -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot Load DLLs (WinXP, Apache 2, PHP 5)
Philip Olson wrote: New installation instructions exist that recommend never copying any files to the Windows system directory. It's preferred to leave all files in the PHP directory and make it (the PHP folder) available to the systems PATH by editing the appropriate system environment variable. People copy files into the Windows system directory because it's in the PATH so no additional setup is required. Do not fall into this trap. Add the PHP directory to your PATH as doing so will make the world a better place. The updated manual is as follows: http://php.net/manual/en/install.windows.manual.php If setup this way the above problem would not exist, PHP will find libmysql.dll. A FAQ on editing the systems path is here: Sorry Philip, but I have to disagree I did an install on Wednesday of this week. I placed an entry for my PHP folder in the PATH and it made no difference. Only once I had overwritten the libmysql.dll in the Windows system folder with the version that ships with PHP5 did I get everything to play nicely together. Regards -- Rory McKinley Nebula Solutions +27 21 555 3227 - office +27 21 551 0676 - fax +27 82 857 2391 - mobile www.nebula.co.za This e-mail is intended only for the person to whom it is addressed and may contain confidential information which may be legally privileged. Nebula Solutions accepts no liability for any loss, expense or damage arising from this e-mail and/or any attachments. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] make an old extention work with php5
Is there any possibility to make an old exention that created for work with php 4 to work with php 5 if the extention is not yet converted to work with php 5 ? If yes then how ?