[PHP] Re: opening a new window from php script
On Friday, March 25, 2011, Grega Leskovek wrote: > Do I have to use target="_new" - I can not do this - I am working > this for my University seminar and it has to be valid HTML5. I guess that this is an HTML issue rather than PHP. However: Despite what the W3C validator might claim, I understand that the target attribute of the anchor tag is still valid in HTML5. In any case, HTML5 is a draft standard AFAICT, and so I have to question a university's insistence on adhering to a 'moving target'. http://www.w3.org/TR/2011/WD-html5-20110113/links.html#attr-hyperlink-target should give you some ammunition to demonstrate to your tutor that is valid. Quoting from that W3C document: The target attribute, if present, must be a valid browsing context name or keyword. It gives the name of the browsing context that will be used. User agents use this name when following hyperlinks. They also say: A valid browsing context name or keyword is any string that is either a valid browsing context name or that is an ASCII case-insensitive match for one of: _blank, _self, _parent, or _top. FWIW, the 'target' attribute has been removed from 'link' elements, which many have apparently wrongly taken to mean it's been removed from hyperlinks (i.e. anchor tags). However, and are not the same thing! An example of each: click here HTH, -- Geoff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [PHP-WIN] Re: [PHP] Which versions of Apache will PHP 5.3.6 work with??
Try third binary instead of official one. Best regards, Sharl.Jimh.Tsin (From China **Obviously Taiwan INCLUDED**) 2011/3/26 Tommy Pham : > On Fri, Mar 25, 2011 at 1:44 PM, Pierre Joye wrote: >> On Fri, Mar 25, 2011 at 8:12 PM, Tommy Pham wrote: >> >>> There used to be a VC6 binary release for PHP v5.3.3 at >>> windows.php.net but I don't see a VC6 build for v5.3 now. Any way, >>> since you're using using Windows, why not just run it as FastCGI? It >>> runs fine on Win2003 (x86), Win7 x64, Win08 (x86 & x64), and Win08r2. >> >> Apache module works just fine and is in many situations much faster than >> fcgi. > > I've never tested the difference for performance. If that's the case, > any particular reason to stop support ISAPI for IIS then? or is > FastCGI faster than ISAPI for IIS? Prior to upgrading to PHP v5.3 and > Windows 64bit, I had faster initial response time from ISAPI. Now > with FastCGI, the initial response takes longer. As for performance > difference through repeated requests, I don't notice the difference > between ISAPI v5.2 and FastCGI v5.3. > >> >>> Are using a specific Apache module that's why you need to use httpd? >>> If so, you could use the (non official) Apache Lounge's binary. >> >> There are no official builds of Apache, but convenience builds. >> >> Cheers, >> -- >> Pierre >> >> @pierrejoye | http://blog.thepimp.net | http://www.libgd.org >> > > I've meant official in the sense that one could download from the > official/mirror site. Thus it's more trust worthy, in terms of non > malicious code. > > -- > 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
[PHP] Re: putting variables in a variable
Hulf wrote: > Hi, > > I am making and HTML email. I have 3 images to put in. Currently I have > > $body .=" > > > > > > > > > > "; > > > ideally I would like to have > > $myimage1 = "image1.jpg"; > $myimage2 = "image2.jpg"; > $myimage3 = "image3.jpg"; > > > and put them into the HTML body variable. I have tried escaping them in > every way i can think of, dots and slashes and the rest. Any ideas? > > > Ross Did you try $body .=" "; It helps us help you if you can give examples of what you have tried and how it didn't work as you expected. Cheers -- David Robley Terminal glare: A look that kills... Today is Setting Orange, the 12nd day of Discord in the YOLD 3177. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] opening a new window from php script
On Fri, Mar 25, 2011 at 2:59 PM, Grega Leskovšek wrote: > I am working on CMS designed to those who are unfamiliar with a > computer world and I want to offer a task where on a push of a button > it will save current working page in textarea/s and open this page in > a new tab or in a new window. PHP is server side. "push of a button" is client side. Google javascript+onClick. > I googled some, but am still not sure how can I do it. > > Do I have to use target="_new" - I can not do this - I am working this > for my University seminar and it has to be valid HTML5. > > Please help me improve my plan > 1. I check wheter the user is using windows, linux, mac and then show > appropriate possibility of all browsers for the targeted platform > (WIN:IE,SA,FF,CH,OP, LINUX:FF.CHROMIUM and I need help for the mac > also besides SA and FF what does it have among browsers?) Have you tried to google for browser versions and platform? While searching for the same thing long time ago, I found a site that lists them. Also, note that since you'll be using onClick for "push of a button", beware of Javascript version difference among the browsers. IIRC, IE is supports 1.3 and FF supports 1.9. Haven't tested the others so couldn't tell you. > 2. When the browser clicks button with the image of browsers inside > anchor I target _new and location of the current file > > ?1 How can I offer option to open a new window not a new tab? > ?2 How can I avoid the target attribute? > ?3 How can I make a click on an image to produce action - or what do > You suggest me to use - I would prefer img element not button with an > image - how can I do this? > > Once I will finish it I will offer here software to everybody so I > will be able to get some response and improve it and this is one of > the major problems otherwise it is already functional. > > Please help me, thanks in advance - or ? You think I could do this better in > JS? > -- When the sun rises I receive and when it sets I forgive -> > http://moj.skavt.net/gleskovs/ > Always in Heart, Grega Leskovšek > I don't know if you have Flash in your tool belt but have you considering using it? It may simply your life with various browsers and their versions across different platforms. Note: Flash does tend to be sluggish in terms of loading time and how much of what you need the Flash to do. Regards, Tommy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-WIN] Re: [PHP] Which versions of Apache will PHP 5.3.6 work with??
On Fri, Mar 25, 2011 at 1:44 PM, Pierre Joye wrote: > On Fri, Mar 25, 2011 at 8:12 PM, Tommy Pham wrote: > >> There used to be a VC6 binary release for PHP v5.3.3 at >> windows.php.net but I don't see a VC6 build for v5.3 now. Any way, >> since you're using using Windows, why not just run it as FastCGI? It >> runs fine on Win2003 (x86), Win7 x64, Win08 (x86 & x64), and Win08r2. > > Apache module works just fine and is in many situations much faster than fcgi. I've never tested the difference for performance. If that's the case, any particular reason to stop support ISAPI for IIS then? or is FastCGI faster than ISAPI for IIS? Prior to upgrading to PHP v5.3 and Windows 64bit, I had faster initial response time from ISAPI. Now with FastCGI, the initial response takes longer. As for performance difference through repeated requests, I don't notice the difference between ISAPI v5.2 and FastCGI v5.3. > >> Are using a specific Apache module that's why you need to use httpd? >> If so, you could use the (non official) Apache Lounge's binary. > > There are no official builds of Apache, but convenience builds. > > Cheers, > -- > Pierre > > @pierrejoye | http://blog.thepimp.net | http://www.libgd.org > I've meant official in the sense that one could download from the official/mirror site. Thus it's more trust worthy, in terms of non malicious code. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] opening a new window from php script
I am working on CMS designed to those who are unfamiliar with a computer world and I want to offer a task where on a push of a button it will save current working page in textarea/s and open this page in a new tab or in a new window. I googled some, but am still not sure how can I do it. Do I have to use target="_new" - I can not do this - I am working this for my University seminar and it has to be valid HTML5. Please help me improve my plan 1. I check wheter the user is using windows, linux, mac and then show appropriate possibility of all browsers for the targeted platform (WIN:IE,SA,FF,CH,OP, LINUX:FF.CHROMIUM and I need help for the mac also besides SA and FF what does it have among browsers?) 2. When the browser clicks button with the image of browsers inside anchor I target _new and location of the current file ?1 How can I offer option to open a new window not a new tab? ?2 How can I avoid the target attribute? ?3 How can I make a click on an image to produce action - or what do You suggest me to use - I would prefer img element not button with an image - how can I do this? Once I will finish it I will offer here software to everybody so I will be able to get some response and improve it and this is one of the major problems otherwise it is already functional. Please help me, thanks in advance - or ? You think I could do this better in JS? -- When the sun rises I receive and when it sets I forgive -> http://moj.skavt.net/gleskovs/ Always in Heart, Grega Leskovšek -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session variable problem
More info (including some code) would be needed to get to the bottom of this, I'd say. Hard to diagnose what's happening otherwise. Regards Peter -- WWW: plphp.dk / plind.dk LinkedIn: plind BeWelcome/Couchsurfing: Fake51 Twitter: kafe15 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-WIN] Re: [PHP] Which versions of Apache will PHP 5.3.6 work with??
On Fri, Mar 25, 2011 at 8:12 PM, Tommy Pham wrote: > There used to be a VC6 binary release for PHP v5.3.3 at > windows.php.net but I don't see a VC6 build for v5.3 now. Any way, > since you're using using Windows, why not just run it as FastCGI? It > runs fine on Win2003 (x86), Win7 x64, Win08 (x86 & x64), and Win08r2. Apache module works just fine and is in many situations much faster than fcgi. > Are using a specific Apache module that's why you need to use httpd? > If so, you could use the (non official) Apache Lounge's binary. There are no official builds of Apache, but convenience builds. Cheers, -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session variable problem
On 3/25/2011 12:13 PM, Ken Robinson wrote: At 01:09 PM 3/25/2011, markb wrote: Very rusty with PHP. We moved our web site to a new hosting service (godaddy). PHP changed from 4x to 5.2.17. I can no longer change $_SESSION variables after the first use. First call to form - start session create variables Second call - can read variables, change existing ones (but they do not persist to next call) - cannot create new variable without an error What's the error you're getting? Also, do you have a call to session_start() at the beginning of each script before any output is sent to the browser? Ken More info perhaps. Changes I make using the page's form are persevered. Any changes made with php are not saved. Checking the session file confirms this. I'm missing something obvious here. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Which versions of Apache will PHP 5.3.6 work with??
On Fri, Mar 25, 2011 at 12:12 PM, Tommy Pham wrote: > On Fri, Mar 25, 2011 at 10:52 AM, Curtis Tammany > wrote: >> Help!! I am in a Windows environment (XP SP3 for development and Server 2003 >> for production. I have to upgrade to PHP 5.3.6. It does not appear to work >> with either Apache 2.2.11 or the new 2.2.17 from Apache Lounge. Apache will >> run by itself but when PHP is installed, it adds: >> >> #BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL >> PHPIniDir "C:\Program Files\PHP536\" >> LoadModule php5_module "C:\Program Files\PHP536\php5apache2_2.dll" >> #END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL >> >> Restarting Apache causes the following: >> >> httpd.exe - Application Error : The instruction at "0x0096c1bf" referenced >> memory at "0x100058a8". The memory could not be "written". >> >> Thanks in advance, >> >> Curtis >> >> >> > > Curtis, > > IIRC, you can't run VC9 (Visual Studio 2008) binary with VC6 binary > smoothly, which I believe where you got the official binary > distributions, PHP and httpd, respectively. Here's the info from [1]. > > There used to be a VC6 binary release for PHP v5.3.3 at > windows.php.net but I don't see a VC6 build for v5.3 now. Any way, > since you're using using Windows, why not just run it as FastCGI? It > runs fine on Win2003 (x86), Win7 x64, Win08 (x86 & x64), and Win08r2. > Are using a specific Apache module that's why you need to use httpd? > If so, you could use the (non official) Apache Lounge's binary. > > "The windows binary is build with original sources from ASF ( > http://httpd.apache.org ) and contains the latest patches. It is build > with the latest Windows® Platform SDK and Visual Studio C++ 2008 aka > VC9, which have improvements in areas like Performance, > MemoryManagement and Stability over the .msi binary from the ASF site > which is build with VC6. LoadRunner (Load Testing Software Suite) > shows that there are improvements in performance using Apache built > with VC 2008. That performance gain can be affected by numerous > factors (use of scripting language such as Perl, PHP, Python, etc…as > well as the actual scripts themselves). LoadRunner testing does show a > marked improvement for Apache compiled under VC 2008 in stability > under rigorous condition. > > Minimum system required: Windows 7, Windows Server 2008 R2, Windows > Vista, Windows Server 2008, Windows XPSP3 and Windows Server 2003 R2." > > Regards, > Tommy > > [1] http://www.apachelounge.com/download/ > argh.. didn't read it well >.> I was typing it while on the phone :))... Anyway, if you don't need to use any Apache module, then go with FastCGI. Goodluck! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Which versions of Apache will PHP 5.3.6 work with??
On Fri, Mar 25, 2011 at 10:52 AM, Curtis Tammany wrote: > Help!! I am in a Windows environment (XP SP3 for development and Server 2003 > for production. I have to upgrade to PHP 5.3.6. It does not appear to work > with either Apache 2.2.11 or the new 2.2.17 from Apache Lounge. Apache will > run by itself but when PHP is installed, it adds: > > #BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL > PHPIniDir "C:\Program Files\PHP536\" > LoadModule php5_module "C:\Program Files\PHP536\php5apache2_2.dll" > #END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL > > Restarting Apache causes the following: > > httpd.exe - Application Error : The instruction at "0x0096c1bf" referenced > memory at "0x100058a8". The memory could not be "written". > > Thanks in advance, > > Curtis > > > Curtis, IIRC, you can't run VC9 (Visual Studio 2008) binary with VC6 binary smoothly, which I believe where you got the official binary distributions, PHP and httpd, respectively. Here's the info from [1]. There used to be a VC6 binary release for PHP v5.3.3 at windows.php.net but I don't see a VC6 build for v5.3 now. Any way, since you're using using Windows, why not just run it as FastCGI? It runs fine on Win2003 (x86), Win7 x64, Win08 (x86 & x64), and Win08r2. Are using a specific Apache module that's why you need to use httpd? If so, you could use the (non official) Apache Lounge's binary. "The windows binary is build with original sources from ASF ( http://httpd.apache.org ) and contains the latest patches. It is build with the latest Windows® Platform SDK and Visual Studio C++ 2008 aka VC9, which have improvements in areas like Performance, MemoryManagement and Stability over the .msi binary from the ASF site which is build with VC6. LoadRunner (Load Testing Software Suite) shows that there are improvements in performance using Apache built with VC 2008. That performance gain can be affected by numerous factors (use of scripting language such as Perl, PHP, Python, etc…as well as the actual scripts themselves). LoadRunner testing does show a marked improvement for Apache compiled under VC 2008 in stability under rigorous condition. Minimum system required: Windows 7, Windows Server 2008 R2, Windows Vista, Windows Server 2008, Windows XPSP3 and Windows Server 2003 R2." Regards, Tommy [1] http://www.apachelounge.com/download/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Which versions of Apache will PHP 5.3.6 work with??
Help!! I am in a Windows environment (XP SP3 for development and Server 2003 for production. I have to upgrade to PHP 5.3.6. It does not appear to work with either Apache 2.2.11 or the new 2.2.17 from Apache Lounge. Apache will run by itself but when PHP is installed, it adds: #BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL PHPIniDir "C:\Program Files\PHP536\" LoadModule php5_module "C:\Program Files\PHP536\php5apache2_2.dll" #END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL Restarting Apache causes the following: httpd.exe - Application Error : The instruction at "0x0096c1bf" referenced memory at "0x100058a8". The memory could not be "written". Thanks in advance, Curtis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Slow sessions.
I decided to try changing the session.save_path, and I've had some interesting results. First I changed it to a local directory. Originally it was on a mounted directory on our main file server. When I switched to a local directory, everything started working fast again on the php 5.2.17 server. So then I tried switching it to a different server mount. I set the session.save_path to a directory mounted on our backup file server. Once again, everything ran super fast. So then I tried switching it to a different mount on the main file server again. And it was back to taking at least 30 seconds to load. So, here's where I'm at: 4 other php 5.1.6 servers are using \\server1\mnt\phpsess as their session.save_path and are working just fine. My new installation of php 5.2.17 takes 30 seconds to start a session when mounting \\server1\mnt\phpsess. It also takes 30 seconds to start a session when mounting \\server1\mnt\testSess (a newly created dir). The php 5.2.17 server loads a session instantly when mounting \\server2\mnt\phpsess. I suppose I could just change the other four servers to use server2, and I might end up doing that, but it'd be like claiming defeat. I'd really like to figure out why this is happening. Any suggestions? Thanks. -- Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php extension openssl testcases - openssl 1.0 vs openssl 0.9.8k
Hi, I have php-5.3.2 and openssl version 1.0.0b-fips installed on my Redhat 6 machine. I noticed the expected results are different from the actual results when I ran these testcases in the ext/openssl/tests directory: openssl_x509_parse_basic.phpt, bug28382.phpt, bug47828.phpt. Then I ran: openssl x509 -purpose -in ext/openssl/tests/cert.crt ,on 2 different systems - one with openssl 1.0.0b-fips installed and the other with openssl 0.9.8k installed. I compared the results and the result from the system with openssl 1.0.0b-fips installed contains more information, such as: Time Stamp signing : No Time Stamp signing CA : Yes My guess is that those testcases' results that I mentioned above probably are affected by the newer version of openssl. Is it time to update those testcases' expected results for running against openssl 1.0.0b-fips? or am I missing something? Thanks! Waiki Wright -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session variable problem
On 3/25/2011 12:13 PM, Ken Robinson wrote: At 01:09 PM 3/25/2011, markb wrote: Very rusty with PHP. We moved our web site to a new hosting service (godaddy). PHP changed from 4x to 5.2.17. I can no longer change $_SESSION variables after the first use. First call to form - start session create variables Second call - can read variables, change existing ones (but they do not persist to next call) - cannot create new variable without an error What's the error you're getting? Also, do you have a call to session_start() at the beginning of each script before any output is sent to the browser? Ken No error messages at all. error_reporting(E_ALL ^ E_NOTICE ); (I thought I was getting an error when creating new variables but that must have been a typo.) Session_start() called before any output (script was working on old host). -- Mark B -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Array Search
It´s a job to array_key_exists function. -- João Cândido de Souza Neto "Ethan Rosenberg" escreveu na mensagem news:0lim00hi3ihny...@mta4.srv.hcvlny.cv.net... > Dear List - > > Here is a code snippet: > > $bla = array("g1" => $results[7][6], >"h1" => $results[7][7]); > print_r($bla); > $value = "h1"; >$locate1 = array_search($value, $bla); >echo "This is locate" ; print_r($locate1); >if(in_array($value, $bla)) print_r($bla); > > Neither the array_search or the in_array functions give any results. I > have tried it with both h1 and "h1"; > > $results[7][6] = Wn; > $results[7][7] = Wr; > > This is a chess board where g1 and h1 are the coordinates and the results > array contains the pieces at that coordinate. > > What am I doing wrong? > > Advice and comments please. > > Thanks. > > Ethan Rosenberg > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session variable problem
At 01:09 PM 3/25/2011, markb wrote: Very rusty with PHP. We moved our web site to a new hosting service (godaddy). PHP changed from 4x to 5.2.17. I can no longer change $_SESSION variables after the first use. First call to form - start session create variables Second call - can read variables, change existing ones (but they do not persist to next call) - cannot create new variable without an error What's the error you're getting? Also, do you have a call to session_start() at the beginning of each script before any output is sent to the browser? Ken -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Array Search
Dear List - Here is a code snippet: $bla = array("g1" => $results[7][6], "h1" => $results[7][7]); print_r($bla); $value = "h1"; $locate1 = array_search($value, $bla); echo "This is locate" ; print_r($locate1); if(in_array($value, $bla)) print_r($bla); Neither the array_search or the in_array functions give any results. I have tried it with both h1 and "h1"; $results[7][6] = Wn; $results[7][7] = Wr; This is a chess board where g1 and h1 are the coordinates and the results array contains the pieces at that coordinate. What am I doing wrong? Advice and comments please. Thanks. Ethan Rosenberg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session variable problem
Very rusty with PHP. We moved our web site to a new hosting service (godaddy). PHP changed from 4x to 5.2.17. I can no longer change $_SESSION variables after the first use. First call to form - start session create variables Second call - can read variables, change existing ones (but they do not persist to next call) - cannot create new variable without an error Using $_SESSION['varname'] always session.auto_start off register_globals off session.use_only_cookies off I assume this is setting difference but I can't seem to find it. -- Mark B -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DOMElement::setAttribute couldn't fetch class extending DOMElement
On 25 March 2011 15:42, Richard Quadling wrote: > On 25 March 2011 14:16, Hosh wrote: >> I have a piece of code that extracts .p3t files (sample file can be found >> here: http://download.ps3-themes.com/downloads3/11518-MyFirstTheme.p3t ). >> It uses PHPs unpack() function. The complete script can be found at: >> http://pastebin.com/bRGL9KFh . However I am getting this error: >> >> Warning: DOMElement::setAttribute() [domelement.setattribute]: Couldn't >> fetch P3TElement in D:\www\p3textract\extract.php on line 115 >> >> I have no idea what this means and I have asked on multiple boards for >> help, no one seems to know the answer. >> >> Any help regarding this would be welcome. >> >> Regards, >> >> Hosh >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > I assume you saw http://www.ps3-themes.com/theme-extractor > > You've been busy asking this question (the first 3 links I found were > to your question!). > > I'm not an expert on DOM, but http://bugs.php.net/bug.php?id=39593 may > be the issue. > > I don't think you are creating a real DOM, just an element. I think. > > I'd suggest, creating the DOMDocument first and then add the elements > as they are created, and then add the attributes. > > > > > -- > Richard Quadling > Twitter : EE : Zend > @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY > http://uk2.php.net/manual/en/domelement.construct.php "Creates a new DOMElement object. This object is read only. It may be appended to a document, but additional nodes may not be appended to this node until the node is associated with a document. To create a writeable node, use DOMDocument::createElement or DOMDocument::createElementNS." setAttribute('Not', 'working'); ?> outputs ... PHP Fatal error: Uncaught exception 'DOMException' with message 'No Modification Allowed Error' in -:3 Stack trace: #0 -(3): DOMElement->setAttribute('Not', 'working') #1 {main} thrown in - on line 3 Fatal error: Uncaught exception 'DOMException' with message 'No Modification Allowed Error' in -:3 Stack trace: #0 -(3): DOMElement->setAttribute('Not', 'working') #1 {main} thrown in - on line 3 But ... appendChild($ele = $doc->createElement('GoingToWork')); $ele->setAttribute('It', 'works'); echo $doc->saveXML(); ?> outputs ... -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DOMElement::setAttribute couldn't fetch class extending DOMElement
On 25 March 2011 14:16, Hosh wrote: > I have a piece of code that extracts .p3t files (sample file can be found > here: http://download.ps3-themes.com/downloads3/11518-MyFirstTheme.p3t ). > It uses PHPs unpack() function. The complete script can be found at: > http://pastebin.com/bRGL9KFh . However I am getting this error: > > Warning: DOMElement::setAttribute() [domelement.setattribute]: Couldn't > fetch P3TElement in D:\www\p3textract\extract.php on line 115 > > I have no idea what this means and I have asked on multiple boards for > help, no one seems to know the answer. > > Any help regarding this would be welcome. > > Regards, > > Hosh > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > I assume you saw http://www.ps3-themes.com/theme-extractor You've been busy asking this question (the first 3 links I found were to your question!). I'm not an expert on DOM, but http://bugs.php.net/bug.php?id=39593 may be the issue. I don't think you are creating a real DOM, just an element. I think. I'd suggest, creating the DOMDocument first and then add the elements as they are created, and then add the attributes. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] DOMElement::setAttribute couldn't fetch class extending DOMElement
I have a piece of code that extracts .p3t files (sample file can be found here: http://download.ps3-themes.com/downloads3/11518-MyFirstTheme.p3t ). It uses PHPs unpack() function. The complete script can be found at: http://pastebin.com/bRGL9KFh . However I am getting this error: Warning: DOMElement::setAttribute() [domelement.setattribute]: Couldn't fetch P3TElement in D:\www\p3textract\extract.php on line 115 I have no idea what this means and I have asked on multiple boards for help, no one seems to know the answer. Any help regarding this would be welcome. Regards, Hosh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] possible variable declaration error
On Fri, Mar 25, 2011 at 09:00, matty jones wrote: > I used the format of your link and that gave me something like what I was > looking for, so I am sure now the error is just in my markup. How would I > get this to work without passing it a value or does the function not work > like that, in which case no biggy I am just trying to figure all this out > the old fashioned way. I read the manual page for the function and I > thought that the type of setup I was using would work. If you're not passing a publisher name, then you probably just want to list everything else, right? If that's the case, change up your ->execute() call like so: execute(array($_GET['publisher']))) { while ($row = $d_series_fetch->fetch()) { print_r($row); } } // If ?publisher was NOT sent via GET } else { if ($d_series_fetch->execute()) { while ($row = $d_series_fetch->fetch()) { print_r($row); } } } ?> As for why it's not being set, if it's an AJAX call, there's probably something wrong on the client side (JavaScript). And finally, with regard to the east coast comment, no joke you're only a couple of hours from me (I'm down in Scranton), so you can empathize --- I swear the below-average (read: Siberian) temperatures we keep having roll in make it still feel early when it's 2:30p. -- Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] possible variable declaration error
On Fri, Mar 25, 2011 at 8:23 AM, wrote: > Correct me if I wrong, but you're declaring $id AFTER binding the SQL > parameter, therefore your :id isn't being bound to anything, hence the empty > returned array. > > I think: > $d_series_fetch = $db->prepare("SELECT * FROM defaultseries WHERE publisher > >> :id"); > $id = 'DC Comics'; > $d_series_fetch->bindParam(':id',$id); > > *should* work. > > No that doesn't work either, I have a few INSERT statements using prepared statements like so $defaultseries = 'Batman'; //declare the php variable $publisher = 'DC Comics'; //declare the php variable $d_series->execute(); //execute the prepared statement and they work just fine. Not entirely sure yet why, I am just starting to really get into PDO's. > Original Message > >From: matty jones > >To: php-general@lists.php.net > >Sent: Fri, Mar 25, 2011, 8:19 AM > >Subject: [PHP] possible variable declaration error > > > >I get the following error " PHP Notice: Undefined index: publisher in > >/var/www/testfunctions.php on line 65" and I have narrowed it down to what > I > >*think* is a variable not being declared. Here is the code. > > > > > >//this will fetch the data from a table > >$d_series_fetch = $db->prepare("SELECT * FROM defaultseries WHERE > publisher > >= :id"); > >$d_series_fetch ->bindParam(':id', $id); > >$id = 'DC Comics'; > > > > > >if ($d_series_fetch ->execute(array($_GET['publisher']))) { > >while ($row = $d_series_fetch -> fetch()) { > >print_r($row); > >} > >} > > > >I have prepared statements to open a connection and insert data and they > >work fine if I comment the preceding block out so I am fairly certain the > >problem is in there somewhere. I am using the latest version of PHP and > am > >running Postgres8.4 as my db. If I use the isset() function and add an > echo > >(code below) I get no errors but the query still doesn't work so again I > am > >fairly certain that I am forgetting to declare something somewhere. > > > >//this will fetch the data from a table > >$d_series_fetch = $db->prepare("SELECT * FROM defaultseries WHERE > publisher > >= :id"); > >$d_series_fetch ->bindParam(':id', $id); > >$id = 'DC Comics'; > > > >$publisher = ''; > > > >if (isset($_GET['publisher'])) > >{ > > > >if ($d_series_fetch ->execute(array($_GET['publisher']))) { > >while ($row = $d_series_fetch -> fetch()) { > >print_r($row); > > > >} > >} > >} > > > >else {echo"this didn't work";} > > > >$dbh = null; //close the database connection by setting the PDO object to > >NULL > > } > > > >I am fairly new to PHP and have very little idea on PDO's so this is most > >likely a simple error(s) I know. > >Thank > > > >Matt > >
Re: [PHP] possible variable declaration error
On Fri, Mar 25, 2011 at 8:24 AM, Daniel Brown wrote: > On Fri, Mar 25, 2011 at 08:18, matty jones wrote: > > I get the following error " PHP Notice: Undefined index: publisher in > > /var/www/testfunctions.php on line 65" and I have narrowed it down to > what I > > *think* is a variable not being declared. Here is the code. > > This line is the issue: > > > if ($d_series_fetch ->execute(array($_GET['publisher']))) { > > $_GET is populated, in part, by the query string --- the data > following the question mark in your browser. For example: > >http://example.com/fake.php?publisher=Random%20House > > > >So, as you can see, it's complaining because you didn't give it > that information. If you don't always want to have to do so, surround > it with an isset() case. > > I used the format of your link and that gave me something like what I was looking for, so I am sure now the error is just in my markup. How would I get this to work without passing it a value or does the function not work like that, in which case no biggy I am just trying to figure all this out the old fashioned way. I read the manual page for the function and I thought that the type of setup I was using would work. > -- > > Network Infrastructure Manager > http://www.php.net/ >
Re: [PHP] possible variable declaration error
On Fri, Mar 25, 2011 at 8:34 AM, Daniel Brown wrote: > On Fri, Mar 25, 2011 at 08:24, Daniel Brown wrote: > > And, now that I'm not on a three-inch screen, I can see that I > didn't read your entire message, so my response appears rather idiotic > --- because you already did the isset(). Sorry for that. > >You're not even seeing your "it didn't work" error kick out? > > No problem, it is still early here on the East Coast. No I dohave that error message kicked out, I put it there as a test to try and isolate the offending code block, which it did. Now I just have to figure out how to get it to work. I understand your point with the GET so here is what I am trying to do in the big picture. I have a form with a drop down menu, for now, where the user picks a value. This value is sent using AJAX(XMLHttpRequest) to the php script. I want the script to grab this value, run the prepared query with it and return a table structure again, using AJAX( innerHTML). I figured I would start small and try to get it working with just simple values and then would move on to passing the values to the script. On the INSERT statements, I posted one below, I just bind the value and then set it and it works fine with no errors or warnings, thats why I am still scratching my head over the query. //insert values into the default series table $d_series = $db->prepare("INSERT INTO defaultseries (defaultseries, publisher) VALUES (:defaultseries, :publisher)"); //SQL statement $d_series->bindParam(':defaultseries', $defaultseries); //bind the prepared value to a php variable $d_series->bindParam(':publisher', $publisher);//bind the prepared value to a php variable //the first row to be inserted $defaultseries = 'Batman'; //declare the php variable $publisher = 'DC Comics'; //declare the php variable $d_series->execute(); //execute the prepared statement
Re: [PHP] possible variable declaration error
On Fri, Mar 25, 2011 at 08:24, Daniel Brown wrote: > > So, as you can see, it's complaining because you didn't give it > that information. If you don't always want to have to do so, surround > it with an isset() case. And, now that I'm not on a three-inch screen, I can see that I didn't read your entire message, so my response appears rather idiotic --- because you already did the isset(). Sorry for that. You're not even seeing your "it didn't work" error kick out? -- Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] possible variable declaration error
On Fri, Mar 25, 2011 at 08:18, matty jones wrote: > I get the following error " PHP Notice: Undefined index: publisher in > /var/www/testfunctions.php on line 65" and I have narrowed it down to what I > *think* is a variable not being declared. Here is the code. This line is the issue: > if ($d_series_fetch ->execute(array($_GET['publisher']))) { $_GET is populated, in part, by the query string --- the data following the question mark in your browser. For example: http://example.com/fake.php?publisher=Random%20House So, as you can see, it's complaining because you didn't give it that information. If you don't always want to have to do so, surround it with an isset() case. -- Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] possible variable declaration error
Correct me if I wrong, but you're declaring $id AFTER binding the SQL parameter, therefore your :id isn't being bound to anything, hence the empty returned array. I think: $d_series_fetch = $db->prepare("SELECT * FROM defaultseries WHERE publisher >> :id"); $id = 'DC Comics'; $d_series_fetch->bindParam(':id',$id); *should* work. > Original Message >From: matty jones >To: php-general@lists.php.net >Sent: Fri, Mar 25, 2011, 8:19 AM >Subject: [PHP] possible variable declaration error > >I get the following error " PHP Notice: Undefined index: publisher in >/var/www/testfunctions.php on line 65" and I have narrowed it down to what I >*think* is a variable not being declared. Here is the code. > > >//this will fetch the data from a table >$d_series_fetch = $db->prepare("SELECT * FROM defaultseries WHERE publisher >= :id"); >$d_series_fetch ->bindParam(':id', $id); >$id = 'DC Comics'; > > >if ($d_series_fetch ->execute(array($_GET['publisher']))) { >while ($row = $d_series_fetch -> fetch()) { >print_r($row); >} >} > >I have prepared statements to open a connection and insert data and they >work fine if I comment the preceding block out so I am fairly certain the >problem is in there somewhere. I am using the latest version of PHP and am >running Postgres8.4 as my db. If I use the isset() function and add an echo >(code below) I get no errors but the query still doesn't work so again I am >fairly certain that I am forgetting to declare something somewhere. > >//this will fetch the data from a table >$d_series_fetch = $db->prepare("SELECT * FROM defaultseries WHERE publisher >= :id"); >$d_series_fetch ->bindParam(':id', $id); >$id = 'DC Comics'; > >$publisher = ''; > >if (isset($_GET['publisher'])) >{ > >if ($d_series_fetch ->execute(array($_GET['publisher']))) { >while ($row = $d_series_fetch -> fetch()) { >print_r($row); > >} >} >} > >else {echo"this didn't work";} > >$dbh = null; //close the database connection by setting the PDO object to >NULL > } > >I am fairly new to PHP and have very little idea on PDO's so this is most >likely a simple error(s) I know. >Thank > >Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] possible variable declaration error
I get the following error " PHP Notice: Undefined index: publisher in /var/www/testfunctions.php on line 65" and I have narrowed it down to what I *think* is a variable not being declared. Here is the code. //this will fetch the data from a table $d_series_fetch = $db->prepare("SELECT * FROM defaultseries WHERE publisher = :id"); $d_series_fetch ->bindParam(':id', $id); $id = 'DC Comics'; if ($d_series_fetch ->execute(array($_GET['publisher']))) { while ($row = $d_series_fetch -> fetch()) { print_r($row); } } I have prepared statements to open a connection and insert data and they work fine if I comment the preceding block out so I am fairly certain the problem is in there somewhere. I am using the latest version of PHP and am running Postgres8.4 as my db. If I use the isset() function and add an echo (code below) I get no errors but the query still doesn't work so again I am fairly certain that I am forgetting to declare something somewhere. //this will fetch the data from a table $d_series_fetch = $db->prepare("SELECT * FROM defaultseries WHERE publisher = :id"); $d_series_fetch ->bindParam(':id', $id); $id = 'DC Comics'; $publisher = ''; if (isset($_GET['publisher'])) { if ($d_series_fetch ->execute(array($_GET['publisher']))) { while ($row = $d_series_fetch -> fetch()) { print_r($row); } } } else {echo"this didn't work";} $dbh = null; //close the database connection by setting the PDO object to NULL } I am fairly new to PHP and have very little idea on PDO's so this is most likely a simple error(s) I know. Thank Matt
Re: [PHP] [OT:Friday] Kunal invites you to join Games24x7.com
On Fri, 2011-03-25 at 10:56 +, Richard Quadling wrote: > On 25 March 2011 09:57, Kalle Sommer Nielsen wrote: > > Dear usang...@gmail.com, > > > > We are sorry to inform you back that the PHP project only is of the age 15, > > which means we are not eligible to take participate within your games. > > > > You may in the future, when the PHP project have reach the age of 18, resend > > an invitation and we can take it from there. > > > > > > -- > > regards, > > > > Kalle Sommer Nielsen > > ka...@php.net > > > > When PHP _is_ 18, do you think it would be allowed to construct an app > that plays the games automatically? > > > -- > Richard Quadling > Twitter : EE : Zend > @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY > H... didn't PHP start development in 1994 (technical birth year)? so that would technically make it 17 years old, not the 15 that they are claiming it is. Also, you have to admit, the way they spelled "Like" (lyk) was awesome! Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [OT:Friday] Kunal invites you to join Games24x7.com
On 25 March 2011 09:57, Kalle Sommer Nielsen wrote: > Dear usang...@gmail.com, > > We are sorry to inform you back that the PHP project only is of the age 15, > which means we are not eligible to take participate within your games. > > You may in the future, when the PHP project have reach the age of 18, resend > an invitation and we can take it from there. > > > -- > regards, > > Kalle Sommer Nielsen > ka...@php.net > When PHP _is_ 18, do you think it would be allowed to construct an app that plays the games automatically? -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php