[PHP] Setting php server
Hi, I am setting a lighty and php server in my local machine FC 6 for testing my php source code. Both index.html and index.php have been set in lighty. If I have an index.html on the server, the http response was fine. But, if I set an index.php on the server, the browser got a blank page, there were no errors on browser or lighty access.log. What I could be missing? $ php --version PHP 5.1.6 (cli) (built: Sep 18 2007 09:07:04) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies Thank you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Setting php server
hce wrote: Hi, I am setting a lighty and php server in my local machine FC 6 for testing my php source code. Both index.html and index.php have been set in lighty. If I have an index.html on the server, the http response was fine. But, if I set an index.php on the server, the browser got a blank page, there were no errors on browser or lighty access.log. What I could be missing? Did you check lighty error.log? Did you try with a simple ?php phpinfo(); ? to check php configuration? Iñigo $ php --version PHP 5.1.6 (cli) (built: Sep 18 2007 09:07:04) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies Thank you. -- Iñigo Medina García Librería Díaz de Santos Madrid (Spain) [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New Ajax search component
Nathan Nobbe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Tue, Apr 8, 2008 at 7:41 AM, Jeremy O'Connor [EMAIL PROTECTED] wrote: they pretty much have that in the scriptacuous lib under Ajax.Autocompleter, atm OK, but my control only does the Ajax call when the user clicks the Go button, whereas the scriptaculous library does an Ajax call everytime the user presses a key. -- Jeremy O'Connor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] require_once dying silently
Richard S. Crawford írta: Hi, everyone. This one's been driving me bonkers for an hour now. Anyone have any idea why require_once would be dying silently in the script below? $CFG-dirroot = /home/rcrawford/public_html/tanktrunk/tanktrunk; $CFG-dataroot = $CFG-dirroot.'/moodledata'; require_once($CFG-dirroot/lib/setup.php); the above won't work, as the parser will try to interpret $CFG and put it in the string first, then go ahead. try this: require_once($CFG-dirroot./lib/setup.php); or this: require_once({$CFG-dirroot}/lib/setup.php); greets, Zoltán Németh I've confirmed that the file setup.php exists and is readable. I've got error_reporting in php.ini set to E_ALL. I'm running Apache 2 and PHP5 on Kubuntu 7.10. Nothing shows up in my apache error log, and PHP itself produces absolutely no output, even though it will produce output galore when I put in a deliberate syntax error. I've also tried: require_once($CFG-dirroot./lib/setup.php); but this didn't help. Any assistance at all would be greatly appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to create combo-boxes/list boxes connected with MS SQL Server database in PHP scripts
Sir I want to create combo-boxes/list-boxes from a table which is available in MS-Sql server database. I have established connectivity with ms-sql server database using odbc. how can i create combo-boxes in my php scripts? waiting for an early reply. With regards Pardeep Singh Scientist-C NIC Hoshiarpur
Re: [PHP] limit mail() function
hi, thanks for all your opinions and suggestions, i'll have a look at all of them to see if i can implement a restricted system for mail() functions. I'll report back in a few days to let you know if i've come up with something that really works. Thanks for all. En/na Andrew Ballard ha escrit: On Tue, Apr 8, 2008 at 3:51 PM, Greg Bowser [EMAIL PROTECTED] wrote: postfix has rate-limitation facilities you can use for this I'm aware of several configuration directives that limit rate, none of which directly limit the send rate local users. Perhaps some kludgly or elusive trick involving multiple options would do the trick; I don't claim to be a postfix expert. Perhaps, instead of making empty statements, you might choose to enlighten me as per the exact configuration that will accomplish this. Of course, I spent some time googling, but it appears that not too many people know (or at least write about) how to implement such functionality. Not being a sysadmin I can't tell you HOW to do it, but I can tell you that nearly every shared-hosting service I have worked with implements some level of throttling such that an account on that machine cannot send more than some set number of messages per hour whether directly through local SMTP or through sendmail, mail(), etc., so I know it CAN be done, and it appears that more than a few people know how to do it. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic boxes problem... JS and PHP
Peter Ford wrote: Mark Weaver wrote: Ryan S wrote: Hey everyone, A bit of a puzzle here, dont know if this is a JS problem or PHP or FF or just me. (My money is on the last one :p ) Here's what I am trying to do: In a form I have a listbox with the values 1-5, and under the listbox i have a TD with the id of recips (like so: TD id='recips I have a onChange event linked to the list box and depending on what number the client picks it should dynamically put the number of text boxes there, here is the JS code: / ### Start JS code function change_no_of_recipients() { var nr=document.mainform.no_of_friends.options[document.mainform.no_of_friends.selectedIndex].value; if(nr5){nr=5;} // max number of recipients var msg = ; for (var x = 1; x = nr; x++) { msg += 'table width=50% border=0 cellspacing=2 cellpadding=2' + 'tr' + 'td nowrap=nowrap'+ x +'. Recipient\'s name:/td' + 'tdinput type=text name=rec_name[] id=rec_name[] //td' + 'td nowrap=nowrapRecipient\'s email:/td' + 'tdinput type=text name=rec_email[] id=rec_email[] //td' + '/tr' + 'tr' + '/table'; } document.getElementById('recips').innerHTML=msg; } / # End JS code So far on the page everything is working, but when I click the submit button this is my PHP processing script: ?php print_r($_REQUEST); ? It shows me everything that has been submitted but NOT any of the above dynamically made boxes values... but get this, it DOES show me all values... in IE7 _not_ in FF (am using 2.0.0.13) Anybody else face anything like this? Is this a bug in FF? Is $_REQUEST wrong to catch this? Dont know what the @#$@ to do... ANY help even a link to a site which can shed a little light would be appreciated. Thanks in advance. /Ryan Hi Ryan, Since I'm relatively new to PHP I could be off on this, but I'd say yes, $_REQUEST is wrong. I would think you'd want to use $_POST to receive the incoming values from a form. That would depend on the method that the form is using: GET or POST. I don't think that's the answer. Two things I would suggest: 1. Check that the Javascript is doing what you expect: you *are* using Firebug on Firefox, aren't you? Also the WebDeveloper toolbar plugin is useful - it has a View Generated Source tool which will show you what Firefox thinks your page actually looks like after the JS has run... 2. Check that the TD you are loading with content is actually inside the FORM tags - otherwise the inputs won't be included in the request/post variables... Cheers Pete Ryan, First, you should reply to the list - that way more people could see the links you posted and help out. Right, It looks like there may be a problem with the form tags - when I look at this code I see form action=process_ecard1.php method=post name=mainform/form That looks like you've closed your mainform before defining the inputs Don't know why IE works, but it's probably trying to be helpful... :) -- Peter Ford phone: 01580 89 Developer fax: 01580 893399 Justcroft International Ltd., Staplehurst, Kent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] require_once dying silently
Richard S. Crawford wrote: Hi, everyone. This one's been driving me bonkers for an hour now. Anyone have any idea why require_once would be dying silently in the script below? $CFG-dirroot = /home/rcrawford/public_html/tanktrunk/tanktrunk; $CFG-dataroot = $CFG-dirroot.'/moodledata'; require_once($CFG-dirroot/lib/setup.php); Hi, It reads as if $CFG is an object and -dirroot is not a public property of that object. So, I don't know what $CFG is, but I think the problem lays there. Also, OOP is nice and all (not to start a thread about OOP again), but putting your config into an object seems a bit overdo to me. -- Aschwin Wesselius /'What you would like to be done to you, do that to the other'/
Re: [PHP] require_once dying silently
Aschwin Wesselius írta: Richard S. Crawford wrote: Hi, everyone. This one's been driving me bonkers for an hour now. Anyone have any idea why require_once would be dying silently in the script below? $CFG-dirroot = /home/rcrawford/public_html/tanktrunk/tanktrunk; $CFG-dataroot = $CFG-dirroot.'/moodledata'; require_once($CFG-dirroot/lib/setup.php); Hi, It reads as if $CFG is an object and -dirroot is not a public property of that object. So, I don't know what $CFG is, but I think the problem lays there. if that property is not public but protected or private it would throw a fatal error. Also, OOP is nice and all (not to start a thread about OOP again), but putting your config into an object seems a bit overdo to me. I think you know I don't agree with that, but I too don't want to start this over ;) greets, Zoltán Németh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic boxes problem... JS and PHP
Hey Pete, ** First, you should reply to the list - that way more people could see the links you posted and help out. ** Oops, my mistake, I thought I did that. Will add a snip at the bottom of this email. ** It looks like there may be a problem with the form tags - when I look at this code I see form action=process_ecard1.php method=post name=mainform/form That looks like you've closed your mainform before defining the inputs ** can you tell me which line you see this? I did a search using that string on top and I couldnt find it... I even did a form search and still didnt find both of the form tags side by side.. Thanks again, R /// Snip of other mail with links /// but looks like posting links is the best option so will do: http://www.coinpass.com/test/step2.php (to run the script) http://www.coinpass.com/test/step2.phps (View the source, its just a html file really) All Javascript and CSS is in the http://www.coinpass.com/test/scripts/; directory The processing script just has print_r($_REQUEST); so its useless pointing you to the actual file source. / End snip/// __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic boxes problem... JS and PHP
Ryan S wrote: Hey Pete, ** First, you should reply to the list - that way more people could see the links you posted and help out. ** Oops, my mistake, I thought I did that. Will add a snip at the bottom of this email. ** It looks like there may be a problem with the form tags - when I look at this code I see form action=process_ecard1.php method=post name=mainform/form That looks like you've closed your mainform before defining the inputs ** can you tell me which line you see this? I did a search using that string on top and I couldnt find it... I even did a form search and still didnt find both of the form tags side by side.. Thanks again, R /// Snip of other mail with links /// but looks like posting links is the best option so will do: http://www.coinpass.com/test/step2.php (to run the script) http://www.coinpass.com/test/step2.phps (View the source, its just a html file really) All Javascript and CSS is in the http://www.coinpass.com/test/scripts/; directory The processing script just has print_r($_REQUEST); so its useless pointing you to the actual file source. / End snip/// __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com Ryan, You did reply to the list - it appeared in a separate thread in my viewer, so my bad. OK, the version with form .../form appeared when I used WebDeveloper toolbar to view the *generated* source. When I look at the source code as received by Firefox (which is what the regular View source option does), the closing form-tag is where you expect. i think I spotted a problem, however. Your original source code looks like it has a spurious tr after the first recipient block. I think you need to really check the nesting of your tags - try indenting stuff to make the opening and closing tags line up and see if it gets out of line somewhere. Anyway, I suspect what is happening is that Firefox is treating the /form as a closing tag for the spurious /tr and then implicitly closing the original form tag with an empty form. Your Javascript code also adds a spurious tr tag (line 17 of dynamic_no_of_recipients2.js) This is not really anything to do with PHP, of course... :) -- Peter Ford, Developer phone: 01580 89 fax: 01580 893399 Justcroft International Ltd. www.justcroft.com Justcroft House, High Street, Staplehurst, Kent TN12 0AH United Kingdom Registered in England and Wales: 2297906 Registered office: Stag Gates House, 63/64 The Avenue, Southampton SO17 1XS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New Ajax search component
On Wed, Apr 9, 2008 at 2:34 AM, Jeremy O'Connor [EMAIL PROTECTED] wrote: OK, but my control only does the Ajax call when the user clicks the Go button, whereas the scriptaculous library does an Ajax call everytime the user presses a key. Any library should be flexible enough to register event listeners on whatever trigger needed. The event itself isn't as important as how things are handled. I use YUI because it lets me focus on my work instead of browser quirks. It is a little heavier but that is okay because they have a team dedicated to testing all the A grade browsers so I don't have to. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New Ajax search component
On Wed, Apr 9, 2008 at 2:34 AM, Jeremy O'Connor [EMAIL PROTECTED] wrote: Nathan Nobbe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Tue, Apr 8, 2008 at 7:41 AM, Jeremy O'Connor [EMAIL PROTECTED] wrote: they pretty much have that in the scriptacuous lib under Ajax.Autocompleter, atm OK, but my control only does the Ajax call when the user clicks the Go button, whereas the scriptaculous library does an Ajax call everytime the user presses a key. not quite; it checks to see if anything has been entered in intervals that are specified by the frequency parameter. this allows users to potentially enter in several characters depending on the frequency interval. with the stock setting, i was able to type about 5 or 6 characters before an ajax request was issued. and its smart enough not to just incite an ajax request at every interval, because during the intervals, it checks to see if anything has been entered. you can easily analyze this behavior w/ the demo links i posted and firebugs' net tab. furthermore it has the tokens option. tokens enforce a tighter requirement on whether or not an autocompletion request will be invoked; in the case of Ajax.Autocompleter that means sending an ajax request to the server. not only do characters have to have been entered during the frequency interval, but one of the token characters has to have been entered. pretty slick if u ask me. you could easily add support for explicit autocompletion request (eg. by clicking a button) by subclassing Autocompleter.Base or one of the current subclasses (Ajax.Autocompleter or Autocompleter.Local) as long as those actually made sense for what you were trying to do. so scriptaculous has supplied performance conscience, convenient (for users and developers) controls and the ability to extend upon their work (using prototypes oo features). -nathan
Re: [PHP] New Ajax search component
On Wed, Apr 9, 2008 at 7:50 AM, Eric Butera [EMAIL PROTECTED] wrote: On Wed, Apr 9, 2008 at 2:34 AM, Jeremy O'Connor [EMAIL PROTECTED] wrote: OK, but my control only does the Ajax call when the user clicks the Go button, whereas the scriptaculous library does an Ajax call everytime the user presses a key. Any library should be flexible enough to register event listeners on whatever trigger needed. The event itself isn't as important as how things are handled. I use YUI because it lets me focus on my work instead of browser quirks. It is a little heavier but that is okay because they have a team dedicated to testing all the A grade browsers so I don't have to. any js lib worth mentioning these days fits that description and prototype / scriptaculous is no exception. i wish it were modular, so i didnt have to send the whole damn library out to the browser on every request, when i might just need a few classes. whats more, although scriptaculous does provide some ui components and controls out-of-the-box, they dont appear to have nearly the gamut of extJs.. one of the things thats great about prototype is that they sort of map javascripts oo model to something of the paradigm that php has; primarily inheritance. i believe extJs errs more on the 'you need to understand js' side of things. -nathan
Re: [PHP] New Ajax search component
On Wed, Apr 9, 2008 at 8:07 AM, Nathan Nobbe [EMAIL PROTECTED] wrote: On Wed, Apr 9, 2008 at 7:50 AM, Eric Butera [EMAIL PROTECTED] wrote: On Wed, Apr 9, 2008 at 2:34 AM, Jeremy O'Connor [EMAIL PROTECTED] wrote: OK, but my control only does the Ajax call when the user clicks the Go button, whereas the scriptaculous library does an Ajax call everytime the user presses a key. Any library should be flexible enough to register event listeners on whatever trigger needed. The event itself isn't as important as how things are handled. I use YUI because it lets me focus on my work instead of browser quirks. It is a little heavier but that is okay because they have a team dedicated to testing all the A grade browsers so I don't have to. any js lib worth mentioning these days fits that description and prototype / scriptaculous is no exception. i wish it were modular, so i didnt have to send the whole damn library out to the browser on every request, when i might just need a few classes. whats more, although scriptaculous does provide some ui components and controls out-of-the-box, they dont appear to have nearly the gamut of extJs.. one of the things thats great about prototype is that they sort of map javascripts oo model to something of the paradigm that php has; primarily inheritance. i believe extJs errs more on the 'you need to understand js' side of things. -nathan I figured as much. The YUI stuff is all very split up into defined modules such as DOM, Event, Connection, etc. Of course they all seem to depend on each other, so I end up sending like 8 files over the wire. I create a single file to stitch them together though, gzip it, and send it with a far future expire header. So in the end it really isn't the worst thing. I used prototype before but I was upset with my requests getting out of order when I was doing stuff. Then there is lots of talk about how it doesn't play nice with other scripts. The YUI stuff is all namespaced out. I also had compatibility issues with prototype using opera. But that was years ago and I'm sure everything is fine now, but I've already left. ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] require_once dying silently
the above won't work, as the parser will try to interpret $CFG and put it in the string first, In that case, $CFG is either null, or it is indeed an object. If it is a standard object, which I it appears to be, then a fatal error will be thrown because there is no __tostring() function. If it's null, then require_once is referencing a directory beginning with '-', again, there *should* be an error. Anyway.. I've seen $obj-property used many times in double quotes, and never had a problem with that working. Personally though, I always use the curly braces though because it highlights better in VIM :p Also, OOP is nice and all (not to start a thread about OOP again), but putting your config into an object seems a bit overdo to me. Me too!! (not to continue the unstarted OOP discussion) It's a practice I've seen used more than once. I think people find that syntax attractive. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New Ajax search component
Eric Butera írta: On Wed, Apr 9, 2008 at 8:07 AM, Nathan Nobbe [EMAIL PROTECTED] wrote: On Wed, Apr 9, 2008 at 7:50 AM, Eric Butera [EMAIL PROTECTED] wrote: On Wed, Apr 9, 2008 at 2:34 AM, Jeremy O'Connor [EMAIL PROTECTED] wrote: OK, but my control only does the Ajax call when the user clicks the Go button, whereas the scriptaculous library does an Ajax call everytime the user presses a key. Any library should be flexible enough to register event listeners on whatever trigger needed. The event itself isn't as important as how things are handled. I use YUI because it lets me focus on my work instead of browser quirks. It is a little heavier but that is okay because they have a team dedicated to testing all the A grade browsers so I don't have to. any js lib worth mentioning these days fits that description and prototype / scriptaculous is no exception. i wish it were modular, so i didnt have to send the whole damn library out to the browser on every request, when i might just need a few classes. whats more, although scriptaculous does provide some ui components and controls out-of-the-box, they dont appear to have nearly the gamut of extJs.. one of the things thats great about prototype is that they sort of map javascripts oo model to something of the paradigm that php has; primarily inheritance. i believe extJs errs more on the 'you need to understand js' side of things. -nathan I figured as much. The YUI stuff is all very split up into defined modules such as DOM, Event, Connection, etc. Of course they all seem to depend on each other, so I end up sending like 8 files over the wire. I create a single file to stitch them together though, gzip it, and send it with a far future expire header. So in the end it really isn't the worst thing. I used prototype before but I was upset with my requests getting out of order when I was doing stuff. Then there is lots of talk about how it doesn't play nice with other scripts. The YUI stuff is all namespaced out. I also had compatibility issues with prototype using opera. But that was years ago and I'm sure everything is fine now, but I've already left. ;) I use prototype together with some parts of YUI, some parts of ExtJS, TinyMCE, and a bunch of my own scripts, and there is no interference between them. And it all seems to work on the latest opera. greets, Zoltán Németh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Check XMLReader enable
On Wed, Apr 9, 2008 at 1:27 AM, hce [EMAIL PROTECTED] wrote: Hi, How can I check if the XMLReader is enabled or not in php? Also, how to config the php to support SOAP and WSDL? Thank you. Jim This should answer your first question. http://www.php.net/manual/en/function.extension-loaded.php Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] require_once dying silently
On Wed, Apr 9, 2008 at 2:40 AM, Zoltán Németh [EMAIL PROTECTED] wrote: Richard S. Crawford írta: Hi, everyone. This one's been driving me bonkers for an hour now. Anyone have any idea why require_once would be dying silently in the script below? $CFG-dirroot = /home/rcrawford/public_html/tanktrunk/tanktrunk; $CFG-dataroot = $CFG-dirroot.'/moodledata'; require_once($CFG-dirroot/lib/setup.php); the above won't work, as the parser will try to interpret $CFG and put it in the string first, then go ahead. try this: require_once($CFG-dirroot./lib/setup.php); or this: require_once({$CFG-dirroot}/lib/setup.php); greets, Zoltán Németh I've confirmed that the file setup.php exists and is readable. I've got error_reporting in php.ini set to E_ALL. I'm running Apache 2 and PHP5 on Kubuntu 7.10. Nothing shows up in my apache error log, and PHP itself produces absolutely no output, even though it will produce output galore when I put in a deliberate syntax error. I've also tried: require_once($CFG-dirroot./lib/setup.php); but this didn't help. Any assistance at all would be greatly appreciated. ?php header('Content-type: text/plain; charset=utf-8'); echo 'Zoltán, you forgot the PHP tags to get credit for your answer. :-)'; exit; ? Andrew
[PHP] Problem with DOMElement/Node
Could someone explain to me what I'm doing wrong? I'm trying to get an element from one DOMDocument and append it to a different DOMDocument. The (simplified) output of saveXML() from the first DOMDocument is as follows: ?xml version=1.0 encoding=UTF-8? BranchRoot id=rootoption1/optionoption2/option/BranchRoot Here is a snippet of code: ?php $oXmlDocument = new DOMDocument( '1.0', 'UTF-8' ); $oRootNode= $oXmlDocument-createElement( 'menu' ); $oRootNode-setAttribute( 'id', 'root' ); $oRootNode-setIdAttribute( 'id', TRUE ); $oRootNode-setAttribute( 'style', $sStyle ); $oRootNode-setAttribute( 'width', $iWidth ); $oRootNode-setAttribute( 'target', $sTarget ); $oRootNode-setAttribute( 'indent', $iIndent ); $oXmlDocument-appendChild( $oRootNode ); $oNewChildEl = $oFirstDoc-getElementById( 'root' ); $oRootNode-appendChild( $oNewChildEl ); ? I'm printing out what $oNewChildEl is to see if it's not returning the proper element, using echo '[' . $oNewChildEl-tagName . ']' . var_dump( $oNewChildEl ); and I'm seeing: object(DOMElement)#1055 (0) { } [BranchRoot] so it does look like it's returning the proper DOMElement. But even so, I'm getting a fatal error when $oRootNode is trying to appendChild(). Specifically, the error I'm getting is Fatal error: Uncaught exception 'DOMException' with message 'Wrong Document Error' What's going on? It doesn't seem like I'm doing anything wrong but something is causing the problem and I apparently do not understand exactly what. Could anyone lend any insight as to what's going on? And what I might do to get what I need done? thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with DOMElement/Node
On Wed, Apr 9, 2008 at 9:35 AM, Christoph Boget [EMAIL PROTECTED] wrote: Could someone explain to me what I'm doing wrong? I'm trying to get an element from one DOMDocument and append it to a different DOMDocument. The (simplified) output of saveXML() from the first DOMDocument is as follows: ?xml version=1.0 encoding=UTF-8? BranchRoot id=rootoption1/optionoption2/option/BranchRoot Here is a snippet of code: ?php $oXmlDocument = new DOMDocument( '1.0', 'UTF-8' ); $oRootNode= $oXmlDocument-createElement( 'menu' ); $oRootNode-setAttribute( 'id', 'root' ); $oRootNode-setIdAttribute( 'id', TRUE ); $oRootNode-setAttribute( 'style', $sStyle ); $oRootNode-setAttribute( 'width', $iWidth ); $oRootNode-setAttribute( 'target', $sTarget ); $oRootNode-setAttribute( 'indent', $iIndent ); $oXmlDocument-appendChild( $oRootNode ); $oNewChildEl = $oFirstDoc-getElementById( 'root' ); $oRootNode-appendChild( $oNewChildEl ); ? I'm printing out what $oNewChildEl is to see if it's not returning the proper element, using echo '[' . $oNewChildEl-tagName . ']' . var_dump( $oNewChildEl ); and I'm seeing: object(DOMElement)#1055 (0) { } [BranchRoot] so it does look like it's returning the proper DOMElement. But even so, I'm getting a fatal error when $oRootNode is trying to appendChild(). Specifically, the error I'm getting is Fatal error: Uncaught exception 'DOMException' with message 'Wrong Document Error' What's going on? It doesn't seem like I'm doing anything wrong but something is causing the problem and I apparently do not understand exactly what. Could anyone lend any insight as to what's going on? And what I might do to get what I need done? thnx, Chris DOM Nodes are specific to the document in which they were created, so you can't just append a node from one document into another document. The importNode function does what you want. http://us2.php.net/manual/en/function.dom-domdocument-importnode.php Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with DOMElement/Node
DOM Nodes are specific to the document in which they were created, so you can't just append a node from one document into another document. The importNode function does what you want. http://us2.php.net/manual/en/function.dom-domdocument-importnode.php Interesting. Why is that, out of curiosity? Thanks for the pointer! That's exactly what I needed. :) thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with DOMElement/Node
On Wed, Apr 9, 2008 at 10:17 AM, Christoph Boget [EMAIL PROTECTED] wrote: DOM Nodes are specific to the document in which they were created, so you can't just append a node from one document into another document. The importNode function does what you want. http://us2.php.net/manual/en/function.dom-domdocument-importnode.php Interesting. Why is that, out of curiosity? Thanks for the pointer! That's exactly what I needed. :) thnx, Chris Well, it's part of the DOM specification. I'm not totally sure why (and don't have the inclination to read all about it), but DOM nodes are specific to the document and contain pointers and other information related to that document. If you really want to know moe details, you can check out the W3C site (or STW). http://www.w3.org/DOM/faq.html#moveNode Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] require_once dying silently
Greg Bowser írta: the above won't work, as the parser will try to interpret $CFG and put it in the string first, In that case, $CFG is either null, or it is indeed an object. If it is a standard object, which I it appears to be, then a fatal error will be thrown because there is no __tostring() function. If it's null, then require_once is referencing a directory beginning with '-', again, there *should* be an error. Anyway.. I've seen $obj-property used many times in double quotes, and never had a problem with that working. Personally though, I always use the curly braces though because it highlights better in VIM :p I stand corrected, I just tried putting an object property into double quotes and it works greets, Zoltán Németh Also, OOP is nice and all (not to start a thread about OOP again), but putting your config into an object seems a bit overdo to me. Me too!! (not to continue the unstarted OOP discussion) It's a practice I've seen used more than once. I think people find that syntax attractive. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic boxes problem... JS and PHP
Ryan S wrote: Hey Pete, ** First, you should reply to the list - that way more people could see the links you posted and help out. ** Oops, my mistake, I thought I did that. Will add a snip at the bottom of this email. ** It looks like there may be a problem with the form tags - when I look at this code I see form action=process_ecard1.php method=post name=mainform/form That looks like you've closed your mainform before defining the inputs ** can you tell me which line you see this? I did a search using that string on top and I couldnt find it... I even did a form search and still didnt find both of the form tags side by side.. Thanks again, R While we are on the topic of the form../form tags, just a side note. It is invalid HTML syntax to have any tag between your tableILLEGALtrILLEGALtd ok here /tdILLEGAL/trILLEGAL/table As a note: the only legal tag that I know of that can be placed in between the above tags is the caption tag. oh and the thead, tbody, and tfoot tags. /// Snip of other mail with links /// but looks like posting links is the best option so will do: http://www.coinpass.com/test/step2.php (to run the script) http://www.coinpass.com/test/step2.phps (View the source, its just a html file really) All Javascript and CSS is in the http://www.coinpass.com/test/scripts/; directory The processing script just has print_r($_REQUEST); so its useless pointing you to the actual file source. / End snip/// __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic boxes problem... JS and PHP
On Apr 9, 2008, at 11:09 AM, Jim Lucas wrote: Ryan S wrote: Hey Pete, ** First, you should reply to the list - that way more people could see the links you posted and help out. ** Oops, my mistake, I thought I did that. Will add a snip at the bottom of this email. ** It looks like there may be a problem with the form tags - when I look at this code I see form action=process_ecard1.php method=post name=mainform/ form That looks like you've closed your mainform before defining the inputs ** can you tell me which line you see this? I did a search using that string on top and I couldnt find it... I even did a form search and still didnt find both of the form tags side by side.. Thanks again, R While we are on the topic of the form../form tags, just a side note. It is invalid HTML syntax to have any tag between your tableILLEGALtrILLEGALtd ok here /tdILLEGAL/ trILLEGAL/table But something like: tableTRTDstuff here/TD/TR/table is okay right? Just wanted to double check since that's how all my stuff is and it works... but just because it works doesn't mean it's right :) -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424-9337 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic boxes problem... JS and PHP
On Wed, Apr 9, 2008 at 11:18 AM, Jason Pruim [EMAIL PROTECTED] wrote: On Apr 9, 2008, at 11:09 AM, Jim Lucas wrote: While we are on the topic of the form../form tags, just a side note. It is invalid HTML syntax to have any tag between your tableILLEGALtrILLEGALtd ok here /tdILLEGAL/trILLEGAL/table But something like: tableTRTDstuff here/TD/TR/table is okay right? Just wanted to double check since that's how all my stuff is and it works... but just because it works doesn't mean it's right :) First day with the new eyes, Pruim, or decided to try to forget and then re-learn English and HTML simultaneously? ;-P Jim points out the correct XHTML layout, which shows ok here (or, as you have it, stuff here) between the td/TD tags. Case doesn't matter, but does make it look sloppy. In addition, case /should/ matter when matching closing to opening tags. For example, try to avoid td/TD and mix-and-match versions thereof. Keep in mind, no matter what, even the following will still Just Work[tm]. It just won't validate when run through a nose-in-the-air checker. Note the obvious messes, as well as some other issues. It's ugly, but it works. Table FORM method=post !-- An example of an UGLY form! -- TR input type=Hidden name=field1 value=value1 td / textarea NAME=userfield1?=print_r($_SERVER);?/TextArea /tD /tr /table input type=SUBMIT value=GO! / /form -- /Daniel P. Brown Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Requested PHP apps / sites
Maybe slightly off, but this is a general PHP question :-) I'm not a professional developer, just hobbyist at PHP. As now, when I want to learn something new such as a new framework, it's beneficial to build a PHP application in my free time as a learning exercise. Sometimes the learning is not always motivation enough (especially after the beer starts flowing). As extra motivation (above and beyond learning) I would like to either freely distribute my app or build a public site using my app. My problem is that I never can think of what to build and what I can think of has or most likely has been done and is available. So to my question: does anyone know of a site or forum where people request apps or sites to be built and then it can be voted on to track the people that are interested? I'm not talking about sites where people post paid development requests. Something open and non-contractual in the spirit of open source. The two open source projects that I have developed came from being part of a community and answering the same support requests in the forums day after day. It occurred to me that I could create something to do what the users kept asking. So this would be the same idea, just more broad. If no one knows of good site(s) like this, does anyone think it would be beneficial? Would you use it? Thanks! -Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic boxes problem... JS and PHP
At 3:20 PM -0700 4/8/08, Ryan S wrote: Hey! Thanks Andrew, will look into those points that you sent me. First thing to change will be the DOCTYPE I think, as i didht type that but must have copied code into a pre-made page... Cheers! R Ryan, Four observations: 1. Don't try to solve your problem by changing the DOCTYPE. Bad HTML is bad HTML. Changing the DOCTYPE may reduce the severity of the problem, but it won't solve it. 2. You have interpreted the fact that IE gave you what you expected while FF did not as a problem with FF, but the opposite is true. A problem with IE allowed it to accept HTML that it should not have accepted. FF treated it properly. 3. Firebug is a free download from Mozilla. I have it and it has solved more problems for me than I can remember. (Or, maybe I just don't have a very good memory.) Get it. You will see your form... tags inside the table /table tags, but not inside any td.../td tags. 4. Learn to use the W3C Markup Validation service - http://validator.w3.org/. It will point out many problems that you can solve quickly. -= Bill =- -- Murphy's Law Cardinal Conundrum - The optimist believes we live in the best of all possible worlds. The pessimist fears this is true. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic boxes problem... JS and PHP
Daniel Brown wrote: On Wed, Apr 9, 2008 at 11:18 AM, Jason Pruim [EMAIL PROTECTED] wrote: On Apr 9, 2008, at 11:09 AM, Jim Lucas wrote: While we are on the topic of the form../form tags, just a side note. It is invalid HTML syntax to have any tag between your tableILLEGALtrILLEGALtd ok here /tdILLEGAL/trILLEGAL/table But something like: tableTRTDstuff here/TD/TR/table is okay right? Just wanted to double check since that's how all my stuff is and it works... but just because it works doesn't mean it's right :) First day with the new eyes, Pruim, or decided to try to forget and then re-learn English and HTML simultaneously? ;-P Jim points out the correct XHTML layout, which shows ok here (or, as you have it, stuff here) between the td/TD tags. Case doesn't matter, but does make it look sloppy. In addition, case /should/ matter when matching closing to opening tags. For example, try to avoid td/TD and mix-and-match versions thereof. Keep in mind, no matter what, even the following will still Just Work[tm]. It just won't validate when run through a nose-in-the-air checker. Note the obvious messes, as well as some other issues. It's ugly, but it works. Table FORM method=post !-- An example of an UGLY form! -- TR input type=Hidden name=field1 value=value1 td / textarea NAME=userfield1?=print_r($_SERVER);?/TextArea /tD /tr /table input type=SUBMIT value=GO! / /form Yeah, if you used code like that IRL I would slap your hand! -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Requested PHP apps / sites
[snip] So to my question: does anyone know of a site or forum where people request apps or sites to be built and then it can be voted on to track the people that are interested? I'm not talking about sites where people post paid development requests. Something open and non-contractual in the spirit of open source. The two open source projects that I have developed came from being part of a community and answering the same support requests in the forums day after day. It occurred to me that I could create something to do what the users kept asking. So this would be the same idea, just more broad. If no one knows of good site(s) like this, does anyone think it would be beneficial? Would you use it? [/snip] http://sourceforge.net/index.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic boxes problem... JS and PHP
On Apr 9, 2008, at 11:29 AM, Daniel Brown wrote: On Wed, Apr 9, 2008 at 11:18 AM, Jason Pruim [EMAIL PROTECTED] wrote: On Apr 9, 2008, at 11:09 AM, Jim Lucas wrote: While we are on the topic of the form../form tags, just a side note. It is invalid HTML syntax to have any tag between your tableILLEGALtrILLEGALtd ok here /tdILLEGAL/trILLEGAL/table But something like: tableTRTDstuff here/TD/TR/table is okay right? Just wanted to double check since that's how all my stuff is and it works... but just because it works doesn't mean it's right :) First day with the new eyes, Pruim, or decided to try to forget and then re-learn English and HTML simultaneously? ;-P Both of little actually :) Jim points out the correct XHTML layout, which shows ok here (or, as you have it, stuff here) between the td/TD tags. Case doesn't matter, but does make it look sloppy. In addition, case /should/ matter when matching closing to opening tags. For example, try to avoid td/TD and mix-and-match versions thereof. I always used to type my HTML is lower case, but I've been trying to get switched over to UPPERCASE to help separate code from content. -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424-9337 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Requested PHP apps / sites
On Wed, Apr 9, 2008 at 11:36 AM, Shawn McKenzie [EMAIL PROTECTED] wrote: Maybe slightly off, but this is a general PHP question :-) [snip!] So to my question: does anyone know of a site or forum where people request apps or sites to be built and then it can be voted on to track the people that are interested? I'm not talking about sites where people post paid development requests. Something open and non-contractual in the spirit of open source. That depends, Shawn. Are you looking to be a part of an established project, or to start your own? If you wanted to work with a well-known team, I'd recommend starting with something like the phpBB group. You can start off by writing modules and such, and if you want, get into developing the core application itself. To develop full applications in open source technology to someone else's spec would make me very leery because there's almost a guarantee stamped right there that says, you're doing my work for free, you're making me rich. And while, to you, it is in the spirit of open source, overall it defeats the purpose of open source. The best way to come up with an idea and build a project is to follow these simple steps: 1.) Stop giving a damn if something similar exists. You may build a better mousetrap. If developers always said, no, that's already been done, there would be just one of everything - from open-source content management systems to full-blown operating systems. 2.) Stop thinking about how others will use your work for now. Be selfish and focus on yourself for a bit. This *does not* mean to ignore security and good coding practices, or even to ignore scalability only to not think about how others may accept your work when it's complete. Think of it as doing coding only for yourself, to make your life easier. 3.) Identify a problem that you experience yourself. For example, say you work part-time mowing lawns in the neighborhood. Each property pays you $5 per 100'x100' square per job, with a minimum of $5 required. You have 29 properties of various sizes that you mow each summer, and have always done one each day, taking the last day to scramble and try to be sure all accounts are paid. 4.) Outline how you want your application to work for you. In the example shown above, you might decide to have an administrative panel for you to enter the dimensions of each property under a different profile, with the ability to add users, and then view and invoice those with outstanding balances. You can then either merge an existing user-management framework (allowed by license) or write your own (it's one of the most fundamental, simple things to do). Then you may want to incorporate payment processing for PayPal and Authorize.net into that so that you won't have to knock on doors or drive to the bank. 5.) Use the application yourself for a while and work out the initial bugs. 6.) Place the code in a package on your own server with an explanation of what it does. Tell people who may be interested in using your work what it is, where it is, how to get it, and how to use it. 7.) You may even want to submit an entry to directories such as HotScripts (http://www.hotscripts.com/) or my old favorite, Resource Index (http://php.resourceindex.com/). Whatever you do, though, before you step into #6 above, be sure that you've clearly stated under which license you are distributing your code. Most commonly, of course, will be GPL, LGPL, and BSD, but you can use any existing license (such as Apache, PHP, MIT, etc.), or write your own. You may even choose to license your code for anything, anywhere as I do with some of mine (including all pseudocode) by using Copyleft- or Copycenter-style licensure. -- /Daniel P. Brown Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic boxes problem... JS and PHP
On Wed, Apr 9, 2008 at 12:21 PM, Jason Pruim [EMAIL PROTECTED] wrote: Jim points out the correct XHTML layout, which shows ok here (or, as you have it, stuff here) between the td/TD tags. Case doesn't matter, but does make it look sloppy. In addition, case /should/ matter when matching closing to opening tags. For example, try to avoid td/TD and mix-and-match versions thereof. I always used to type my HTML is lower case, but I've been trying to get switched over to UPPERCASE to help separate code from content. You might as well switch back to lowercase, since that's part of the XHTML 1.0 specs. Even if you don't use XHTML, consistent lowercase will still work with the previous HTML standards and it prevents you from having to fix a bunch of stuff if you someday find yourself having to upgrade everything to XHTML for some reason in the future. http://www.w3.org/TR/xhtml1/#h-4.2 Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC FastCGI != upload progress ?
On Sat, Apr 5, 2008 at 7:44 PM, Manuel Lemos [EMAIL PROTECTED] wrote: on 04/04/2008 03:16 AM steve said the following: FastCGI is *the* way to run PHP, but I think Apache is not the platform for it anymore. If need more than one server, Apache pre-forked model may limited. Otherwise it is just fine. Other than that, I think there are some features that only work with Apache SAPI. Apache SAPI is the easiest. But it falls apart when you have a higher load. FastCGI can stall those who are thinking of getting their second webserver. When you have a whole farm of them the differences are grossly obvious. Is the COMMET implementation on the client side long polling (reconnect) or does it stream using script tags? What goes on in the server? Does it push the buffer of blank data that WebKit requires? Is it a PHP daemon process running as a simple HTTP server? Actually it is just an hidden iframe that loads an HTML page with small Javascript chunks that flush each COMET AJAX server response. This is a regular HTTP request performed to the same script that serves that form. The form AJAX plug-in can detect the AJAX request and respond adequately. So it works equally well in all browsers including Webkit. So you keep a whole Apache/PHP process open for each user? That is nice for a small site, but doesn't work with tens of thousands of simultaneous connections. :( Webkit has a bug/feature that it would buffer the incoming data until it reached 1024 bytes. You can see how the django server deals with it in their comet implementation: http://code.google.com/p/django-evserver/source/browse/trunk/comet.py Orbited also uses 100 span/span as padding. So does meteor I believe. Here is what they say: Safari and IE have a buffer which must fill up before any response is parsed. Data received before the buffer is full will not be rendered or interpreted and will not fire the Interactive state of an XHR until the buffer is full or the connection is closed. The obvious solution to this is to send a blob of 'noise' at the start of any response that needs to be parsed incrementally. The size of the buffer that needs to be filled is 512 bytes in Internet Explorer, and between 256 bytes and 1K in Safari depending on the Content-type of the response (a non-standard content-type equals a 256b buffer, while a text/html content type may be as much as 1K) from http://meteorserver.org/browser-techniques/xssinfo It is also mentioned a bit in http://en.wikipedia.org/wiki/Comet_(programming) -s -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Requested PHP apps / sites
Jay Blanchard wrote: [snip] So to my question: does anyone know of a site or forum where people request apps or sites to be built and then it can be voted on to track the people that are interested? I'm not talking about sites where people post paid development requests. Something open and non-contractual in the spirit of open source. The two open source projects that I have developed came from being part of a community and answering the same support requests in the forums day after day. It occurred to me that I could create something to do what the users kept asking. So this would be the same idea, just more broad. If no one knows of good site(s) like this, does anyone think it would be beneficial? Would you use it? [/snip] http://sourceforge.net/index.php Thanks, I use SF a lot but is exactly opposite of what I was going for. -Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Requested PHP apps / sites
[snip] http://sourceforge.net/index.php Thanks, I use SF a lot but is exactly opposite of what I was going for. [/snip] My bad, I mis-read. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Requested PHP apps / sites
Daniel Brown wrote: On Wed, Apr 9, 2008 at 11:36 AM, Shawn McKenzie [EMAIL PROTECTED] wrote: Maybe slightly off, but this is a general PHP question :-) [snip!] So to my question: does anyone know of a site or forum where people request apps or sites to be built and then it can be voted on to track the people that are interested? I'm not talking about sites where people post paid development requests. Something open and non-contractual in the spirit of open source. That depends, Shawn. Are you looking to be a part of an established project, or to start your own? If you wanted to work with a well-known team, I'd recommend starting with something like the phpBB group. You can start off by writing modules and such, and if you want, get into developing the core application itself. To develop full applications in open source technology to someone else's spec would make me very leery because there's almost a guarantee stamped right there that says, you're doing my work for free, you're making me rich. And while, to you, it is in the spirit of open source, overall it defeats the purpose of open source. The best way to come up with an idea and build a project is to follow these simple steps: 1.) Stop giving a damn if something similar exists. You may build a better mousetrap. If developers always said, no, that's already been done, there would be just one of everything - from open-source content management systems to full-blown operating systems. 2.) Stop thinking about how others will use your work for now. Be selfish and focus on yourself for a bit. This *does not* mean to ignore security and good coding practices, or even to ignore scalability only to not think about how others may accept your work when it's complete. Think of it as doing coding only for yourself, to make your life easier. 3.) Identify a problem that you experience yourself. For example, say you work part-time mowing lawns in the neighborhood. Each property pays you $5 per 100'x100' square per job, with a minimum of $5 required. You have 29 properties of various sizes that you mow each summer, and have always done one each day, taking the last day to scramble and try to be sure all accounts are paid. 4.) Outline how you want your application to work for you. In the example shown above, you might decide to have an administrative panel for you to enter the dimensions of each property under a different profile, with the ability to add users, and then view and invoice those with outstanding balances. You can then either merge an existing user-management framework (allowed by license) or write your own (it's one of the most fundamental, simple things to do). Then you may want to incorporate payment processing for PayPal and Authorize.net into that so that you won't have to knock on doors or drive to the bank. 5.) Use the application yourself for a while and work out the initial bugs. 6.) Place the code in a package on your own server with an explanation of what it does. Tell people who may be interested in using your work what it is, where it is, how to get it, and how to use it. 7.) You may even want to submit an entry to directories such as HotScripts (http://www.hotscripts.com/) or my old favorite, Resource Index (http://php.resourceindex.com/). Whatever you do, though, before you step into #6 above, be sure that you've clearly stated under which license you are distributing your code. Most commonly, of course, will be GPL, LGPL, and BSD, but you can use any existing license (such as Apache, PHP, MIT, etc.), or write your own. You may even choose to license your code for anything, anywhere as I do with some of mine (including all pseudocode) by using Copyleft- or Copycenter-style licensure. Thanks Dan, Your approach is a great one and actually how I wound up with my current two projects, one of which I forked into a more full featured and fully supported commercial product. But those were my ideas based upon user need. I wouldn't and I wouldn't expect others to really develop the app for the requester. This would be an idea farm, because ideas are what I am lacking, especially ideas that would have broad appeal. I thought maybe others would have the same dilemma. So instead of free code from me or other developers, I view it as getting free ideas from others, users and seekers of the apps (free and for cost) :-) I'm sure that given a few weeks of free time, you and many others here, maybe even I could've built the original myspace or facebook. But we didn't, someone else had the idea. Hope this makes sense. Just kind of rambling now as I'm frustrated about not having ideas with broad appeal. Thanks! -Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Requested PHP apps / sites
On Wed, Apr 9, 2008 at 4:36 PM, Shawn McKenzie [EMAIL PROTECTED] wrote: Daniel Brown wrote: On Wed, Apr 9, 2008 at 11:36 AM, Shawn McKenzie [EMAIL PROTECTED] wrote: Maybe slightly off, but this is a general PHP question :-) [snip!] So to my question: does anyone know of a site or forum where people request apps or sites to be built and then it can be voted on to track the people that are interested? I'm not talking about sites where people post paid development requests. Something open and non-contractual in the spirit of open source. That depends, Shawn. Are you looking to be a part of an established project, or to start your own? If you wanted to work with a well-known team, I'd recommend starting with something like the phpBB group. You can start off by writing modules and such, and if you want, get into developing the core application itself. To develop full applications in open source technology to someone else's spec would make me very leery because there's almost a guarantee stamped right there that says, you're doing my work for free, you're making me rich. And while, to you, it is in the spirit of open source, overall it defeats the purpose of open source. The best way to come up with an idea and build a project is to follow these simple steps: 1.) Stop giving a damn if something similar exists. You may build a better mousetrap. If developers always said, no, that's already been done, there would be just one of everything - from open-source content management systems to full-blown operating systems. 2.) Stop thinking about how others will use your work for now. Be selfish and focus on yourself for a bit. This *does not* mean to ignore security and good coding practices, or even to ignore scalability only to not think about how others may accept your work when it's complete. Think of it as doing coding only for yourself, to make your life easier. 3.) Identify a problem that you experience yourself. For example, say you work part-time mowing lawns in the neighborhood. Each property pays you $5 per 100'x100' square per job, with a minimum of $5 required. You have 29 properties of various sizes that you mow each summer, and have always done one each day, taking the last day to scramble and try to be sure all accounts are paid. 4.) Outline how you want your application to work for you. In the example shown above, you might decide to have an administrative panel for you to enter the dimensions of each property under a different profile, with the ability to add users, and then view and invoice those with outstanding balances. You can then either merge an existing user-management framework (allowed by license) or write your own (it's one of the most fundamental, simple things to do). Then you may want to incorporate payment processing for PayPal and Authorize.net into that so that you won't have to knock on doors or drive to the bank. 5.) Use the application yourself for a while and work out the initial bugs. 6.) Place the code in a package on your own server with an explanation of what it does. Tell people who may be interested in using your work what it is, where it is, how to get it, and how to use it. 7.) You may even want to submit an entry to directories such as HotScripts (http://www.hotscripts.com/) or my old favorite, Resource Index (http://php.resourceindex.com/). Whatever you do, though, before you step into #6 above, be sure that you've clearly stated under which license you are distributing your code. Most commonly, of course, will be GPL, LGPL, and BSD, but you can use any existing license (such as Apache, PHP, MIT, etc.), or write your own. You may even choose to license your code for anything, anywhere as I do with some of mine (including all pseudocode) by using Copyleft- or Copycenter-style licensure. Thanks Dan, Your approach is a great one and actually how I wound up with my current two projects, one of which I forked into a more full featured and fully supported commercial product. But those were my ideas based upon user need. I wouldn't and I wouldn't expect others to really develop the app for the requester. This would be an idea farm, because ideas are what I am lacking, especially ideas that would have broad appeal. I thought maybe others would have the same dilemma. So instead of free code from me or other developers, I view it as getting free ideas from others, users and seekers of the apps (free and for cost) :-) I'm sure that given a few weeks of free time, you and many others here, maybe even I could've built the original myspace or facebook. But we didn't, someone else had the idea. Hope this makes sense. Just kind of rambling now as I'm frustrated about not having ideas with broad
Re: [PHP] Requested PHP apps / sites
Daniel Brown wrote: On Wed, Apr 9, 2008 at 4:36 PM, Shawn McKenzie [EMAIL PROTECTED] wrote: Daniel Brown wrote: On Wed, Apr 9, 2008 at 11:36 AM, Shawn McKenzie [EMAIL PROTECTED] wrote: Maybe slightly off, but this is a general PHP question :-) [snip!] So to my question: does anyone know of a site or forum where people request apps or sites to be built and then it can be voted on to track the people that are interested? I'm not talking about sites where people post paid development requests. Something open and non-contractual in the spirit of open source. That depends, Shawn. Are you looking to be a part of an established project, or to start your own? If you wanted to work with a well-known team, I'd recommend starting with something like the phpBB group. You can start off by writing modules and such, and if you want, get into developing the core application itself. To develop full applications in open source technology to someone else's spec would make me very leery because there's almost a guarantee stamped right there that says, you're doing my work for free, you're making me rich. And while, to you, it is in the spirit of open source, overall it defeats the purpose of open source. The best way to come up with an idea and build a project is to follow these simple steps: 1.) Stop giving a damn if something similar exists. You may build a better mousetrap. If developers always said, no, that's already been done, there would be just one of everything - from open-source content management systems to full-blown operating systems. 2.) Stop thinking about how others will use your work for now. Be selfish and focus on yourself for a bit. This *does not* mean to ignore security and good coding practices, or even to ignore scalability only to not think about how others may accept your work when it's complete. Think of it as doing coding only for yourself, to make your life easier. 3.) Identify a problem that you experience yourself. For example, say you work part-time mowing lawns in the neighborhood. Each property pays you $5 per 100'x100' square per job, with a minimum of $5 required. You have 29 properties of various sizes that you mow each summer, and have always done one each day, taking the last day to scramble and try to be sure all accounts are paid. 4.) Outline how you want your application to work for you. In the example shown above, you might decide to have an administrative panel for you to enter the dimensions of each property under a different profile, with the ability to add users, and then view and invoice those with outstanding balances. You can then either merge an existing user-management framework (allowed by license) or write your own (it's one of the most fundamental, simple things to do). Then you may want to incorporate payment processing for PayPal and Authorize.net into that so that you won't have to knock on doors or drive to the bank. 5.) Use the application yourself for a while and work out the initial bugs. 6.) Place the code in a package on your own server with an explanation of what it does. Tell people who may be interested in using your work what it is, where it is, how to get it, and how to use it. 7.) You may even want to submit an entry to directories such as HotScripts (http://www.hotscripts.com/) or my old favorite, Resource Index (http://php.resourceindex.com/). Whatever you do, though, before you step into #6 above, be sure that you've clearly stated under which license you are distributing your code. Most commonly, of course, will be GPL, LGPL, and BSD, but you can use any existing license (such as Apache, PHP, MIT, etc.), or write your own. You may even choose to license your code for anything, anywhere as I do with some of mine (including all pseudocode) by using Copyleft- or Copycenter-style licensure. Thanks Dan, Your approach is a great one and actually how I wound up with my current two projects, one of which I forked into a more full featured and fully supported commercial product. But those were my ideas based upon user need. I wouldn't and I wouldn't expect others to really develop the app for the requester. This would be an idea farm, because ideas are what I am lacking, especially ideas that would have broad appeal. I thought maybe others would have the same dilemma. So instead of free code from me or other developers, I view it as getting free ideas from others, users and seekers of the apps (free and for cost) :-) I'm sure that given a few weeks of free time, you and many others here, maybe even I could've built the original myspace or facebook. But we didn't, someone else had the idea. Hope this makes sense. Just kind of rambling now as I'm frustrated about not having ideas with broad appeal. Oh, what you're looking for is a think tank. I'd been trying to find people in my area to get together and do the same thing.
Re: [PHP] Requested PHP apps / sites
On Wed, Apr 9, 2008 at 4:51 PM, Shawn McKenzie [EMAIL PROTECTED] wrote: Daniel Brown wrote: On Wed, Apr 9, 2008 at 4:36 PM, Shawn McKenzie [EMAIL PROTECTED] wrote: Daniel Brown wrote: On Wed, Apr 9, 2008 at 11:36 AM, Shawn McKenzie [EMAIL PROTECTED] wrote: Maybe slightly off, but this is a general PHP question :-) [snip!] So to my question: does anyone know of a site or forum where people request apps or sites to be built and then it can be voted on to track the people that are interested? I'm not talking about sites where people post paid development requests. Something open and non-contractual in the spirit of open source. That depends, Shawn. Are you looking to be a part of an established project, or to start your own? If you wanted to work with a well-known team, I'd recommend starting with something like the phpBB group. You can start off by writing modules and such, and if you want, get into developing the core application itself. To develop full applications in open source technology to someone else's spec would make me very leery because there's almost a guarantee stamped right there that says, you're doing my work for free, you're making me rich. And while, to you, it is in the spirit of open source, overall it defeats the purpose of open source. The best way to come up with an idea and build a project is to follow these simple steps: 1.) Stop giving a damn if something similar exists. You may build a better mousetrap. If developers always said, no, that's already been done, there would be just one of everything - from open-source content management systems to full-blown operating systems. 2.) Stop thinking about how others will use your work for now. Be selfish and focus on yourself for a bit. This *does not* mean to ignore security and good coding practices, or even to ignore scalability only to not think about how others may accept your work when it's complete. Think of it as doing coding only for yourself, to make your life easier. 3.) Identify a problem that you experience yourself. For example, say you work part-time mowing lawns in the neighborhood. Each property pays you $5 per 100'x100' square per job, with a minimum of $5 required. You have 29 properties of various sizes that you mow each summer, and have always done one each day, taking the last day to scramble and try to be sure all accounts are paid. 4.) Outline how you want your application to work for you. In the example shown above, you might decide to have an administrative panel for you to enter the dimensions of each property under a different profile, with the ability to add users, and then view and invoice those with outstanding balances. You can then either merge an existing user-management framework (allowed by license) or write your own (it's one of the most fundamental, simple things to do). Then you may want to incorporate payment processing for PayPal and Authorize.net into that so that you won't have to knock on doors or drive to the bank. 5.) Use the application yourself for a while and work out the initial bugs. 6.) Place the code in a package on your own server with an explanation of what it does. Tell people who may be interested in using your work what it is, where it is, how to get it, and how to use it. 7.) You may even want to submit an entry to directories such as HotScripts (http://www.hotscripts.com/) or my old favorite, Resource Index (http://php.resourceindex.com/). Whatever you do, though, before you step into #6 above, be sure that you've clearly stated under which license you are distributing your code. Most commonly, of course, will be GPL, LGPL, and BSD, but you can use any existing license (such as Apache, PHP, MIT, etc.), or write your own. You may even choose to license your code for anything, anywhere as I do with some of mine (including all pseudocode) by using Copyleft- or Copycenter-style licensure. Thanks Dan, Your approach is a great one and actually how I wound up with my current two projects, one of which I forked into a more full featured and fully supported commercial product. But those were my ideas based upon user need. I wouldn't and I wouldn't expect others to really develop the app for the requester. This would be an idea farm, because ideas are what I am lacking, especially ideas that would have broad appeal. I thought maybe others would have the same dilemma. So instead of free code from me or other developers, I view it as getting
Re: [PHP] Requested PHP apps / sites
On Wed, Apr 9, 2008 at 4:54 PM, Andrew Ballard [EMAIL PROTECTED] wrote: Sounds to me like you already have an idea. That's what I was going to say. Shawn, the thing you're looking for is your idea. Are we making sense yet? ;-P -- /Daniel P. Brown Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Requested PHP apps / sites
Andrew Ballard wrote: On Wed, Apr 9, 2008 at 4:51 PM, Shawn McKenzie [EMAIL PROTECTED] wrote: Daniel Brown wrote: On Wed, Apr 9, 2008 at 4:36 PM, Shawn McKenzie [EMAIL PROTECTED] wrote: Daniel Brown wrote: On Wed, Apr 9, 2008 at 11:36 AM, Shawn McKenzie [EMAIL PROTECTED] wrote: Maybe slightly off, but this is a general PHP question :-) [snip!] So to my question: does anyone know of a site or forum where people request apps or sites to be built and then it can be voted on to track the people that are interested? I'm not talking about sites where people post paid development requests. Something open and non-contractual in the spirit of open source. That depends, Shawn. Are you looking to be a part of an established project, or to start your own? If you wanted to work with a well-known team, I'd recommend starting with something like the phpBB group. You can start off by writing modules and such, and if you want, get into developing the core application itself. To develop full applications in open source technology to someone else's spec would make me very leery because there's almost a guarantee stamped right there that says, you're doing my work for free, you're making me rich. And while, to you, it is in the spirit of open source, overall it defeats the purpose of open source. The best way to come up with an idea and build a project is to follow these simple steps: 1.) Stop giving a damn if something similar exists. You may build a better mousetrap. If developers always said, no, that's already been done, there would be just one of everything - from open-source content management systems to full-blown operating systems. 2.) Stop thinking about how others will use your work for now. Be selfish and focus on yourself for a bit. This *does not* mean to ignore security and good coding practices, or even to ignore scalability only to not think about how others may accept your work when it's complete. Think of it as doing coding only for yourself, to make your life easier. 3.) Identify a problem that you experience yourself. For example, say you work part-time mowing lawns in the neighborhood. Each property pays you $5 per 100'x100' square per job, with a minimum of $5 required. You have 29 properties of various sizes that you mow each summer, and have always done one each day, taking the last day to scramble and try to be sure all accounts are paid. 4.) Outline how you want your application to work for you. In the example shown above, you might decide to have an administrative panel for you to enter the dimensions of each property under a different profile, with the ability to add users, and then view and invoice those with outstanding balances. You can then either merge an existing user-management framework (allowed by license) or write your own (it's one of the most fundamental, simple things to do). Then you may want to incorporate payment processing for PayPal and Authorize.net into that so that you won't have to knock on doors or drive to the bank. 5.) Use the application yourself for a while and work out the initial bugs. 6.) Place the code in a package on your own server with an explanation of what it does. Tell people who may be interested in using your work what it is, where it is, how to get it, and how to use it. 7.) You may even want to submit an entry to directories such as HotScripts (http://www.hotscripts.com/) or my old favorite, Resource Index (http://php.resourceindex.com/). Whatever you do, though, before you step into #6 above, be sure that you've clearly stated under which license you are distributing your code. Most commonly, of course, will be GPL, LGPL, and BSD, but you can use any existing license (such as Apache, PHP, MIT, etc.), or write your own. You may even choose to license your code for anything, anywhere as I do with some of mine (including all pseudocode) by using Copyleft- or Copycenter-style licensure. Thanks Dan, Your approach is a great one and actually how I wound up with my current two projects, one of which I forked into a more full featured and fully supported commercial product. But those were my ideas based upon user need. I wouldn't and I wouldn't expect others to really develop the app for the requester. This would be an idea farm, because ideas are what I am lacking, especially ideas that would have broad appeal. I thought maybe others would have the same dilemma. So instead of free code from me or other developers, I view it as getting free ideas from others, users and seekers of the apps (free and for cost) :-) I'm sure that given a few weeks of free time, you and many others here, maybe even I could've built the original myspace or facebook. But we didn't, someone else had the idea. Hope this makes sense. Just kind of rambling now as I'm frustrated about not having ideas with broad appeal. Oh, what
Re: [PHP] Beware of round() function
On Mon, 24 Mar 2008 13:10:17 -0600, [EMAIL PROTECTED] wrote: Beware: round() apparently has changed its behavior from PHP 4. For certain special numbers that seem to be multiples of 100,000, the return value is in exponential format, rather than the usual decimal format. Some of these special values are 120, 140, 230, which are returned as 1.2E+6, 1.4E+6, etc. You can generate your own list of these special numbers using this code: ?php for( $tmp = 0, $i = 0; $i 100; $i++ ) { $tmp += 10; echo round($tmp),\n; } ? I now have a list of 3 ways this change in behavior can bite you and result in a failed transaction. In the examples below, assume that the value passed to round() is '120', so that the value returned from round() is '1.2E+6'. 1. When interpolating the value into xml, resulting in an xsd validation error: ? $xml = 'AnnualIncome' . round($income) . '/AnnualIncome'; ? 2. When validating user input, resulting in a false positive: ? if(!ereg(^[0-9]{1,10}$, round($_POST['income']))) { $errors .= liIncome should be whole dollars only (10 digits max)./li; } ? 3. When interpolating a value into a stored procedure call, resulting in a type mismatch between the value passed in and the database column data type (which is likely decimal for a monetary value): ? $sql = exec update_loan_financials @application_id='$appID', @total_debt= . round($totalDebt); ? BTW, a previous poster pointed out that this is a change in behavior of the float type, in general, not of the round() function, in particular. If you care. I don't. I just know I have broken code to fix and customers to apologize to. Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Connecting to an epp server
Hi im trying to connect to Nominets EPP server Details can be found here http://www.nominet.org.uk/registrars/systems/epp/ Im trying to send a login request the example can be found here http://www.nominet.org.uk/registrars/systems/epp/login/ My script seems to connect ok, but im recieving no response when I try to send the login xml details. ? $fp = @fsockopen('ssl://testbed-epp.nominet.org.uk', 700, $errno, $errstr, 100); echo (.$errno. .$errstr.); if(!$fp) { echo Not Connected!; } else { echo Connected!\r\n; $xml = '?xml version=1.0 encoding=UTF-8? epp xmlns=urn:ietf:params:xml:ns:epp-1.0 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd command login clIDEXAMPLE-TAG/clID pwfoo-BAR2/pw options version1.0/version langen/lang /options svcs objURIhttp://www.nominet.org.uk/epp/xml/nom-account-1.0 /objURI objURIhttp://www.nominet.org.uk/epp/xml/nom-domain-1.0/objURI objURIhttp://www.nominet.org.uk/epp/xml/nom-contact-1.0 /objURI objURIhttp://www.nominet.org.uk/epp/xml/nom-ns-1.0/objURI /svcs /login clTRIDABC-12345/clTRID /command /epp'; fputs($fp, $xml, strlen($xml)); while (!feof($fp)) { $response .= fgets($fp, 128); } echo $response; fclose($fp); } ?
Re: [PHP] dynamic boxes problem... JS and PHP
Hey! Thanks to you and everyone else who replied, I have fixed the problem by remaking the tables... This is not really anything to do with PHP, of course... :) :) True, in the end it was not. But in the beginning I couldnt figure out for the love of god why my PHP script was not getting the form values and variables... so thought it might be something to do with my script and PHP. Thanks again! /R Peter Ford, Developer phone: 01580 89 fax: 01580 893399 Justcroft International Ltd. www.justcroft.com Justcroft House, High Street, Staplehurst, Kent TN12 0AH United Kingdom Registered in England and Wales: 2297906 Registered office: Stag Gates House, 63/64 The Avenue, Southampton SO17 1XS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic boxes problem... JS and PHP
Hey Jim, Yep, That was the problem fixed that and now everything works. *** While we are on the topic of the form../form tags, just a side note. It is invalid HTML syntax to have any tag between your tableILLEGALtrILLEGALtd ok here /tdILLEGAL/trILLEGAL/table As a note: the only legal tag that I know of that can be placed in between the above tags is the caption tag. oh and the thead, tbody, and tfoot tags. *** Cheers! R __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic boxes problem... JS and PHP
At 12:21 PM -0400 4/9/08, Jason Pruim wrote: I always used to type my HTML is lower case, but I've been trying to get switched over to UPPERCASE to help separate code from content. No reason to do change case and every reason to continue using lowercase. Keep css and javascript unobtrusive in html. But as long as php presents html, then html will be sub-set of php to me. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic boxes problem... JS and PHP
Hey Bill, Thanks for the tips, makes sense and will try to follow them. Cheers! R * Ryan, Four observations: 1. Don't try to solve your problem by changing the DOCTYPE. Bad HTML is bad HTML. Changing the DOCTYPE may reduce the severity of the problem, but it won't solve it. 2. You have interpreted the fact that IE gave you what you expected while FF did not as a problem with FF, but the opposite is true. A problem with IE allowed it to accept HTML that it should not have accepted. FF treated it properly. 3. Firebug is a free download from Mozilla. I have it and it has solved more problems for me than I can remember. (Or, maybe I just don't have a very good memory.) Get it. You will see your form... tags inside the table /table tags, but not inside any td.../td tags. 4. Learn to use the W3C Markup Validation service - http://validator.w3.org/. It will point out many problems that you can solve quickly. -= Bill =- -- Murphy's Law Cardinal Conundrum - The optimist believes we live in the best of all possible worlds. The pessimist fears this is true. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Beware of round() function
[EMAIL PROTECTED] wrote: On Mon, 24 Mar 2008 13:10:17 -0600, [EMAIL PROTECTED] wrote: Beware: round() apparently has changed its behavior from PHP 4. For certain special numbers that seem to be multiples of 100,000, the return value is in exponential format, rather than the usual decimal format. Some of these special values are 120, 140, 230, which are returned as 1.2E+6, 1.4E+6, etc. You can generate your own list of these special numbers using this code: ?php for( $tmp = 0, $i = 0; $i 100; $i++ ) { $tmp += 10; echo round($tmp),\n; } ? I now have a list of 3 ways this change in behavior can bite you and result in a failed transaction. In the examples below, assume that the value passed to round() is '120', so that the value returned from round() is '1.2E+6'. 1. When interpolating the value into xml, resulting in an xsd validation error: ? $xml = 'AnnualIncome' . round($income) . '/AnnualIncome'; ? 2. When validating user input, resulting in a false positive: ? if(!ereg(^[0-9]{1,10}$, round($_POST['income']))) { $errors .= liIncome should be whole dollars only (10 digits max)./li; } ? For the above test, is there any reason you couldn't use is_numeric() Looks like it would work in this case. ?php if ( ! is_numeric($_POST['income']) ) { $errors .= liIncome should be whole dollars only . (10 digits max)./li; } ? 3. When interpolating a value into a stored procedure call, resulting in a type mismatch between the value passed in and the database column data type (which is likely decimal for a monetary value): ? $sql = exec update_loan_financials @application_id='$appID', @total_debt= . round($totalDebt); ? BTW, a previous poster pointed out that this is a change in behavior of the float type, in general, not of the round() function, in particular. If you care. I don't. I just know I have broken code to fix and customers to apologize to. Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php