Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 5th, 2005, 02:53 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

There you see. It was the HTML.

Richard, why does the error occur only with IE when the dump was the same for both browsers? Just trying to learn a bit here.

--
http://yupapa.com
 
Old October 5th, 2005, 02:57 PM
Registered User
 
Join Date: Oct 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You were right too, "meow". Thank you both very much.

In regards to trim(), Rich - I AM using it: before going into the loop, I say:

$value = trim( $value );

I think it only trims trailing spaces, though. Let me check the PHP manual again.

 
Old October 5th, 2005, 03:13 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

> why does the error occur only with IE

I'm not convinced that was the case. Having that default value of   introduced some potential for inconsistency, then using a function that relies on a particular schema to be present in a string, where even if the input string is correct (not-with-standing spaces), the mechanism can potentially fail. I think that looking for the existence of the string in the other string would probably be a better approach. Though, I don't know the specifics of this project so I can't say for sure. If that is the case, that would be done with strstr() or stristr(). http://www.php.net/strstr and http://www.php.net/stristr. The latter is case-insensitive.

> I AM using it: before going into the loop, I say $value = trim( $value );

If you're doing it *before* the loop, then you aren't trimming the value. $value is set with each iteration of the foreach loop, so that statement must appear inside of the loop for it to work.

Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
 
Old October 6th, 2005, 06:33 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

OK, then I understand better, I think. Thanks. :)

--
http://yupapa.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Table works in IE but not Firefox bumpy Javascript How-To 1 June 24th, 2007 03:47 PM
Shopping Cart works on Local Sys, but fails on IIS IronSights ASP.NET 2.0 Basics 0 July 27th, 2006 09:52 AM
Javscript works well in aspx page but fails... vivek_inos ASP.NET 1.0 and 1.1 Professional 2 June 18th, 2006 11:26 PM
Writing works then reading fails childoftv XSLT 3 April 22nd, 2006 04:09 AM
.ASP login page fails offline, but works online ?? putte74 Classic ASP Basics 1 January 10th, 2006 07:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.