Re: [PHP] XML Parser misbehaves with &
Hi Jeff, Nachricht vom Montag, 18. August 2003, 18:14:37: > I've come across this frustrating behavior with the XML parser when it > reads an escaped ampersand (&) > If the xml being evaluated is: Blue, Green & Red > it calls the character data handler 3 times: > the first time the $data is "Blue, Green " > the second time is "&" > and the third time is " Red" > Needless to say this is screwing up my parser, and the stuff I'm > doing won't make it easy to add this allowance. I'm hoping > somebody can point out a way to turn off this behavior. If this is > the proper operation, is it documented anywhere? I've been unable to > find it. xml is a www.w3c.org recomendation. Its documented at http://www.w3.org/TR/REC-xml http://www.w3.org/TR/REC-xml#syntax states: "The ampersand character (&) and the left angle bracket (<) may appear in their literal form only when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section. If they are needed elsewhere, they must be escaped using either numeric character references or the strings "&" and "<" respectively." HTH Timo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Err:"Uninitialized string offset: 0" when doing count on multidim array
Hi! I have an multidimensional array with contents like: $myarr["url"][]="http://www.example.com";; $myarr["img"][]="http://www.example.com/test.gif";; $myarr["text"][]="example.com"; I want to display all entries like: for ($i=0; $ihttp://www.gmx.net +++ Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] REPLY NEEDED
Hi, Message of Friday, 4th April 2003, 12:28:44: PK> STRICTLY CONFIDENTIAL PK> WE ARE MEMBERS OF A SPECIAL COMMITTEE FOR BUDGET AND PLANNING OF PK> THE NIGERIAN NATIONAL PETROLEUM CORPORATION (NNPC). THIS COMMITTEE PK> IS PRINCIPALLY CONCERNED WITH CONTRACT AWARDS AND APPROVAL. PK> WITH OUR POSITIONS, WE HAVE SUCCESSFULLY SECURED FOR OURSELVES THE PK> SUM OF THIRTY ONE MILLION, FIVE HUNDRED THOUSAND UNITED STATES PK> DOLLARS (US$31.5M). THIS AMOUNT WAS CAREFULLY MANIPULATED BY PK> OVER-INVOICING OF AN OLD CONTRACT. PK> BASED ON INFORMATION GATHERED ABOUT YOU, WE BELIEVE YOU WOULD BE PK> IN A POSITION TO HELP US IN TRANSFERING THIS FUND (US$31.5M) INTO PK> A SAFE ACCOUNT. IT HAS BEEN AGREED THAT THE OWNER OF THE ACCOUNT PK> WILL BE COMPENSATED WITH 30% OF THE REMITTED FUNDS, WHILE WE KEEP PK> 60% AS THE INITIATORS AND 10% WILL BE SET ASIDE TO OFFSET EXPENSES PK> AND PAY THE NECESSARY TAXES. PK> ALL MODALITIES OF THIS TRANSACTION HAVE BEEN CAREFULLY WORKED OUT PK> AND ONCE STARTED WILL NOT TAKE MORE THAN SEVEN (7) WORKING DAYS, PK> WITH YOUR FULL SUPPORT. THIS TRANSACTION IS 100% RISK FREE.BE PK> REST ASSURED OF SUCCESS. PK> IF THIS PROPOSAL SATISFIES YOU, PLEASE REACH US ONLY BY EMAIL FOR PK> MORE INFORMATION. PLEASE, TREAT AS URGENT AND VERY IMPORTANT. PK> YOURS FAITHFULLY, PK> DR.PATRICK KOFI. Apart from this being as Off-topic as I have ever seen, I think we should help him: So that he doesn't have to spend his valuable funds and time for coping with spam, we should all get his address out of the lists of those spammers... (you know, "klick here if you don't want to receive this newsletter anymore"). That way, he can perhaps get a grip on his situation himself. Timo -- This mail was printed on 100% recycled spam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Submit Image Button
Hi -{, Nachricht vom Donnerstag, 3. April 2003, 16:27:56: > If(!$_GET['sub_x'] && !$_GET['sub_y']) { > // display form > } else { > // it was submitted Use "isset" to test the variables... it is cleaner code. PHP will complain if you do not. (Except of course if you silence it and turn warnings of.) I have started to to to develop with error_reporting(E_ALL); set. This way, PHP complains about every unclean bit in code, like reading from unset variables. Makes you write cleaner/less bug-prone code. If ((!isset($_GET['sub_x'])) and (!isset($_GET['sub_y']))) { // display form } else { // it was submitted } BTW, in my experience it is enough to check one of these values with isset, even if this one is 0, it will be SET to 0. You wont catch a click at the coordinates x=0/y=0 with your code (don't know if that is even possible, will have to read the specs...) Timo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] REPLY NEEDED
Hi David, Nachricht vom Freitag, 4. April 2003, 14:52:14: > On Friday 04 April 2003 03:56 am, Timo Boettcher wrote: >> Hi, >> >> Message of Friday, 4th April 2003, 12:28:44: >> Apart from this being as Off-topic as I have ever seen, I think we >> should help him: >> So that he doesn't have to spend his valuable funds and time for >> coping with spam, we should all get his address out of the lists of >> those spammers... (you know, "klick here if you don't want to receive >> this newsletter anymore"). That way, he can perhaps get a grip on his >> situation himself. > Clicking on those links does not help the situation, it only verifies to the > spammer that the E-mail address was indeed valid and they've found the > prefect person to spam. I waas thinking about the pages where you can enter a mail address to get out of these mailing list. We should perhaps help our friend PATRICK KOFI out of some of these lists. Timo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] w3c-compliant form-action parameters
Hi, I am trying to get my pages through the w3c-validator for html. It doesn't like my Changing & to & got my page through the validator, but broke my app, which seems not to be getting any parameters over URL anymore. How can I fix that? PS.: Moving that information from the URL to hidden fields or cookies/sessions is not an option. Timo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] w3c-compliant form-action parameters
Hi John, Nachricht vom Freitag, 24. Oktober 2003, 19:06:33: > Timo Boettcher wrote: >> Hi, >> >> I am trying to get my pages through the w3c-validator for html. >> It doesn't like my >> >> Changing & to & got my page through the validator, but broke my >> app, which seems not to be getting any parameters over URL anymore. >> How can I fix that? >> >> PS.: Moving that information from the URL to hidden fields or >> cookies/sessions is not an option. >> >> Timo >> > I'm curiouswhy are hidden fields not an option? Its not easy to get the value of a hidden field in a bookmark. Timo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] w3c-compliant form-action parameters
Hi Pablo, Nachricht vom Freitag, 24. Oktober 2003, 19:14:31: > Hi, Timo. Why can't use use hidden fields instead of appending the > values to the url? It would be the same to access them via > $_GET['para1'] $_GET['para2] (unless you were using post as your method, > in which case it would simply be $_POST['varname']) if they were on the > url or in hidden fields. > Why can't you make this switch? You can't set a bookmark to include the value of a hidden field, but with a url-param, it is possible. > Also, have you tried using the % entity for ampersand (%26 if memory > serves me correct) instead of & or the literal ampersand? > So instead of mypage.php?para1=val1¶2=val2 you would use > mypage.php?para1=val1%26para2=val2. I'll try that. > Cheers, > Pablo > -Original Message- > From: Timo Boettcher [mailto:[EMAIL PROTECTED] > Sent: Friday, October 24, 2003 9:59 AM > To: [EMAIL PROTECTED] > Subject: [PHP] w3c-compliant form-action parameters > Hi, > I am trying to get my pages through the w3c-validator for html. > It doesn't like my > > Changing & to & got my page through the validator, but broke my > app, which seems not to be getting any parameters over URL anymore. > How can I fix that? > PS.: Moving that information from the URL to hidden fields or > cookies/sessions is not an option. > Timo Timo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] w3c-compliant form-action parameters
Hi Marek, Nachricht vom Samstag, 25. Oktober 2003, 13:02:06: > Timo Boettcher wrote: >> Its not easy to get the value of a hidden field in a bookmark. > Don't use & in bookmarks, use just &. But when I say "Bookmark this Page" (in any browser) that gets me a bookmark on the url, and not on hidden fields. Timo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] w3c-compliant form-action parameters
Hi Marek, Nachricht vom Freitag, 24. Oktober 2003, 19:17:36: > Whoops. The first sentense should be a question. > Marek Kilimajer wrote: >> It breaks your server side scripts. & should be translated to & by >> the browser and never get to php. >> >> Timo Boettcher wrote: >> >>> Hi, >>> >>> I am trying to get my pages through the w3c-validator for html. >>> It doesn't like my >>> >>> Changing & to & got my page through the validator, but broke my >>> app, which seems not to be getting any parameters over URL anymore. >>> How can I fix that? >>> >>> PS.: Moving that information from the URL to hidden fields or >>> cookies/sessions is not an option. >>> >>> Timo Yes. When I use everything works ok, the form is submitted to the given address. When I do the form is submitted to the given address, too, and that includes the & so that my application gets broken parameters and breaks. Timo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] w3c-compliant form-action parameters
Hi Chris, Nachricht vom Freitag, 24. Oktober 2003, 21:12:06: > --- Timo Boettcher <[EMAIL PROTECTED]> wrote: >> I am trying to get my pages through the w3c-validator for html. >> It doesn't like my >> >> Changing & to & got my page through the validator, but broke my >> app, which seems not to be getting any parameters over URL >> anymore. > I find that *very* hard to believe. I'm not aware of any browser > that mishandles HTML entities. Basically, when you say this: > action="/mypage.php?para1=val1¶2=val2" > Your browser's HTTP request line will appear as: > /mypage.php?para1=val1¶2=val2 That seems to be different here. With IE and opera, I get "mypage.php?para1=val1¶2=val2" as the page address. > So, by the time PHP sees it, everything is the same either way. My guess is > that you have some other problem. > Hope that helps. > Chris Timo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] w3c-compliant form-action parameters
Hi Marek, Nachricht vom Samstag, 25. Oktober 2003, 16:42:49: > Hi, I'm not sure if this was asked, but what browser are you using? Opera 7.21 IE 6.0.2800.1106 > I get everything correctly and I don't remember any browser with > this kind of bug. Also, can you post the relevant part of page source? As the page is fairly complex (and that effect is experienced over three pages, that submit to each other or send header("Location:...") to another, I'll try to build an example-page to show that effect more easily... > Timo Boettcher wrote: >> Yes. When I use >> >> everything works ok, the form is submitted to the given address. >> When I do >> >> the form is submitted to the given address, too, and that includes the >> & so that my application gets broken parameters and breaks. Timo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] w3c-compliant form-action parameters
Hi Chris, Nachricht vom Samstag, 25. Oktober 2003, 18:13:10: > --- Marek Kilimajer <[EMAIL PROTECTED]> wrote: >> > >> >> Get variables in action URL don't work with get method, at least in >> Mozilla. > Marek's right, and this is the case for every browser I know of. > In this case, you can specify para1 and para2 as hidden form > variables, and it will work. It will not work. One of the requirements of my app is that I can place a bookmark on any page and return to it. That wouldn't work with hidden fields, would it? BTW, I am using http-post. > Hope that helps. > Chris Timo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] w3c-compliant form-action parameters
Hi Chris, Nachricht vom Samstag, 25. Oktober 2003, 18:28:27: > --- Timo Boettcher <[EMAIL PROTECTED]> wrote: >> > I find that *very* hard to believe. I'm not aware of any browser >> > that mishandles HTML entities. Basically, when you say this: >> > >> > action="/mypage.php?para1=val1¶2=val2" >> > >> > Your browser's HTTP request line will appear as: >> > >> > /mypage.php?para1=val1¶2=val2 >> >> That seems to be different here. With IE and opera, I get >> "mypage.php?para1=val1¶2=val2" as the page address. > I'm curious now. Try this page: > http://shiflett.org/dev/php-general/ampersand.php can you put the source of that online, too? > View source and make sure this matches your situation. When I click > the submit button, the next page looks like this for me: [...] > Also, the URL I go to is: > http://shiflett.org/dev/php-general/ampersand.php?foo=1&bar=2 > Note that the HTML entity was decoded by my browser. What are your > results? I get the same result as you do. BUT: that page doesn't validate *g* I guess I have got a problem with my encoding or something... I have: Title . . . > Chris Timo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] w3c-compliant form-action parameters
Hi Chris, Nachricht vom Samstag, 25. Oktober 2003, 19:06:10: > --- Timo Boettcher <[EMAIL PROTECTED]> wrote: >> > http://shiflett.org/dev/php-general/ampersand.php >> >> can you put the source of that online, too? > You can view the source in your browser to see the HTML, which is > the relevant part. I know that, but I wanted to see if you PHP-source gets the same results on my server (testing if my server is misconfigured) > If you see the HTML entity for an ampersand in your browser's > location bar after submitting the form, then your browser has a bug. > If you only see a plain ampersand, your browser is fine, and your > code has a bug. I guess its the latter... *g* >> I get the same result as you do. >> BUT: that page doesn't validate *g* > Look again. Mine is not a full page, obviously, in order to focus > your attention to the relevant markup. Having the php-source of that part would make it easier to build a full page out of it, to put it through the W3C Validator. > What is there is XHTML-compliant. > I'm not sure what "validate" means to you, but your earlier > complaint about an ampersand not validating leads me to believe you > were validating against XHTML transitional or strict. > You can let us know which, if you want, but it is irrelevant to your > immediate problem. That was in the post you ansered with this one. I am trying to get > I am trying to not let you distract yourself; this is what makes > solving problems more difficult for many people. I am trying to get that page to work AND validate as in the W3C HTML Validator. I was able to get both, but not at the same time, so that is one problem, and splitting it in two doesn't help me to solve it. > Chris Timo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] w3c-compliant form-action parameters [solved]
Hi Timo, Nachricht vom Freitag, 24. Oktober 2003, 17:58:39: > I am trying to get my pages through the w3c-validator for html. > It doesn't like my > > Changing & to & got my page through the validator, but broke > my app, which seems not to be getting any parameters over URL > anymore. How can I fix that? I found that & works in http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php