Re: [PHP] A Review Request

2011-05-22 Thread Nisse Engström
On Sat, 21 May 2011 09:26:02 -0400, tedd wrote: > The function strcmp() simply evaluates two strings and reports back > -1, 0, or 1 depending upon their alphabetical relationship. It might do that, but don't bet your horse on it. /Nisse --

[PHP] Re: Help! Made a boo-boo encrypting credit cards

2011-03-04 Thread Nisse Engström
On Fri, 11 Feb 2011 14:42:18 -0800, Brian Dunning wrote: > Hey all - > > I'm using mcrypt to store credit cards into MySQL. About 90% > of them decrypt fine, but about 10% decrypt as nonsense > ("b1�\�JEÚU�A���" is a good example). Maybe there is a > character that appears in about 10% of my encr

[PHP] Re: How is this possible???? (addslashes)

2011-02-17 Thread Nisse Engström
On Thu, 17 Feb 2011 06:56:33 +0700, "Paul S" wrote: > Can anyone please tell me how the addslashes output ("note = Everyone''s a > card on the \earth") in the following example is possible. It is > "addslashes" output but this result is consistent with the output from > "post" when runtime is set:

Re: [PHP] email address syntax checker

2011-01-21 Thread Nisse Engström
On Fri, 21 Jan 2011 18:32:56 +0530, Nilesh Govindarajan wrote: > Okay let me tell you guys one more thing that the validator I posted > earlier is not exactly as per RFC. It does have some variations. > "@"@example.com may be a valid email address, but I doubt very much if > any provider in the

Re: [PHP] email address syntax checker

2011-01-20 Thread Nisse Engström
On Thu, 20 Jan 2011 19:03:22 +0530, Nilesh Govindarajan wrote: > Well, I had created an email validator long ago, after a neat research > on Google, reading RFCs, etc. > I don't guarantee that it's without bugs, but it has been correct for me > in all valid & invalid email addresses I used for t

[PHP] Re: [OUTPUT BUFFER] - problems with redirects

2010-08-20 Thread Nisse Engström
On Fri, 20 Aug 2010 13:11:05 +0100, Nathan Rixham wrote: > Nisse Engström wrote: > >> Actually, the HTTP spec. allows most headers to be sent >> after the content. The feature just wasn't implemented >> by too many HTTP agents (W3's HTML validator and link &g

[PHP] Re: [OUTPUT BUFFER] - problems with redirects

2010-08-20 Thread Nisse Engström
On Thu, 19 Aug 2010 17:47:01 -0600, Tristan wrote: > A rewrite of the entire site would be needed in order to fix. So, I guess > you are saying as best options for workaround are > > - use the ob_ functions to work around. > - stick output buffer on or high > > so best case scenario using ob_ fu

[PHP] Re: imagettftext

2010-07-10 Thread Nisse Engström
On Fri, 9 Jul 2010 20:12:38 -0500, Karl DeSaulniers wrote: > Is there a way to get the width and height of text created with > imagettftext? /Nisse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.ph

[PHP] Re: Simple XML - problem with errors

2010-07-08 Thread Nisse Engström
On Thu, 8 Jul 2010 17:15:02 +0200, "Gary ." wrote: > Okay. At least one of the problems with this so called HTML seems to > be that the body tag looks like > > and xml_parse complains that "> required" on that line (i.e. it is > claiming it can't find the end of the tag!). > > I'm guessing that

[PHP] Re: DOMDocument throws Unexpected end tag error when loading valid HTML

2010-06-07 Thread Nisse Engström
On Sun, 6 Jun 2010 13:56:25 -0500, Raymond Irving wrote: > Here's the script. Can anyone confirm this error or is there a known > workaround? > > > $html = ' > > > > > > var html = "Bold Text,Normal Text"; > document.write(html);

Re: [PHP] Convert UTF-8 to PHP defines

2010-05-29 Thread Nisse Engström
On Sat, 29 May 2010 10:16:39 -0400, tedd wrote: > At 7:15 AM +0200 5/29/10, Nisse =?utf-8?Q?Engstr=C3=B6m?= wrote: >> >>No. There are no glyphs in Unicode. This is spelled out for >>you in chapter 2, figure 2-2. "Characters versus Glyphs". > Code points are simply unique numbers assigned to speci

Re: [PHP] Convert UTF-8 to PHP defines

2010-05-28 Thread Nisse Engström
On Fri, 28 May 2010 16:52:09 -0400, tedd wrote: > At 8:52 PM +0200 5/28/10, Nisse =?utf-8?Q?Engstr=C3=B6m?= wrote: >>On Fri, 28 May 2010 11:13:35 -0400, tedd wrote: >> >> > As is my understanding, UTF-8 will accommodate all the languages >>> (glyphs) of the world and then some. It will be a whil

Re: [PHP] Convert UTF-8 to PHP defines

2010-05-28 Thread Nisse Engström
On Fri, 28 May 2010 11:13:35 -0400, tedd wrote: > Bob wrtote: > >>>The real question is whether unicode is even relevant now that the UTF >>>series is available. > > Ashley answered: > >>Bob, UTF is unicode (Unicode Transformation Format) Or more precisely, UTF-{8,16,32} are different ways to

Re: [PHP] Select Values Didn't Get Passed in From Two Different Forms

2010-05-26 Thread Nisse Engström
On Wed, 26 May 2010 11:02:10 -0400, Alice Wei wrote: [De-indented to preserve sanity] > > Bzzt. Only elements can be children of . > Select the type of your starting point of interest: > > Bzzt. You didn't close the previous . You can *not* have nested elements. >

Re: [PHP] Creating an Entire .html page with PHP

2010-01-30 Thread Nisse Engström
On Fri, 29 Jan 2010 14:48:47 +, Ashley Sheridan wrote: > On Fri, 2010-01-29 at 20:15 +0530, Raman . wrote: > >> you can use Apache mod rewrite to create html pages having all programing >> saved in .php pages. I have never tried generating .html pages with this but >> have successfully genera

Re: [PHP] Cookies & sessions

2010-01-25 Thread Nisse Engström
On Mon, 25 Jan 2010 21:26:05 +, Ashley Sheridan wrote: > On Mon, 2010-01-25 at 22:13 +0100, Nisse Engström wrote: > >> The HTTP spec allows cookies to be sent after the content, >> in trailing headers, but it's not usable practically. Few >> browsers support

Re: [PHP] Cookies & sessions

2010-01-25 Thread Nisse Engström
On Thu, 21 Jan 2010 08:43:58 +1100, clanc...@cybec.com.au wrote: > When you are working with sessions, provided you start your program with > session_id(), you > can then do anything you like with session variables at any point in your > program. In my > original question I asked if there was a

[PHP] Re: mysql_real_escape_string(0xffffffff) yields -1

2010-01-16 Thread Nisse Engström
On Fri, 15 Jan 2010 16:22:46 -0600 (CST), "Richard Lynch" wrote: > The subject line says it all: > > mysql_real_escape_string(0x) yields -1 Says nothing. Are you really asking PHP to convert an integer literal to string before passing it to m_r_e_s? That could easily explain the "-1", an

Re: [PHP] Re: Detecting The Encoding Of A Text File

2009-11-26 Thread Nisse Engström
On Thu, 26 Nov 2009 15:39:04 +0200, דניאל דנון wrote: > If windows notepad can detect encoding there must be a way to do it > yourself. > > Maybe try to get the file's headers, I think it should also contain the > encoding of the file... Plain text files don't have any headers. Perhaps they use

[PHP] Re: Detecting The Encoding Of A Text File

2009-11-26 Thread Nisse Engström
On Thu, 26 Nov 2009 06:55:31 +0200, Nitsan Bin-Nun wrote: > Hi, > > I have been trying for the last couple of hours to determine the > encoding of a text file (.txt in windowz). > > I have this code: > > $contents = file_get_contents($config[' > txt_dir'] . $file); > $encoding =

[PHP] Re: Which query is more correct?

2009-11-20 Thread Nisse Engström
On Fri, 20 Nov 2009 16:41:58 -0600, LAMP wrote: > SELECT r.* > FROM registrants r > where r.reg_status=1 AND r.reg_id NOT IN (SELECT tbrc_reg_id FROM > toberecleared) > > > SELECT r.* > FROM registrants r > where r.reg_status=1 AND (SELECT count(*) FROM toberecleared where > tbrc_reg_id=r.reg_

Re: [PHP] Noob question: Making search results clickable.

2009-11-19 Thread Nisse Engström
On Thu, 19 Nov 2009 15:07:42 +, Ashley Sheridan wrote: > On Thu, 2009-11-19 at 10:09 -0500, Paul M Foster wrote: >> >> Ahem. You are correct. I should have escaped the double quotes. I've >> *never* made this kind of mistake before. ;-} > > Gonna go to PHP hell for that faux pas! I'll see y

Re: [PHP] Noob question: Making search results clickable.

2009-11-19 Thread Nisse Engström
On Thu, 19 Nov 2009 17:02:53 -, "Ford, Mike" wrote: >> -Original Message- >> From: Nisse Engström [mailto:news.nospam.0ixbt...@luden.se] >> >> Without actually checking, I don't think "$row[...]" >> is going to work in doub

Re: [PHP] Noob question: Making search results clickable.

2009-11-19 Thread Nisse Engström
On Wed, 18 Nov 2009 10:31:59 -0500, Paul M Foster wrote: > Replace your query with: > > "SELECT title, id FROM videos WHERE topid1 = '$topic'" > > or whatever index you have to select a particular video from your table. > > Replace your echo statement above with: > > echo "$row[title]"; Witho

[PHP] Re: [php] & [mysql] select and subselect

2009-11-17 Thread Nisse Engström
On Mon, 16 Nov 2009 14:21:41 -0800, Allen McCabe wrote: > I have an order table that keeps track of the order_id, the date, the > status, etc. I also have an order_lineitem table that is the contents of the > order. This has a one-to-many structure (without foreign keys because it is > mysql).

[PHP] Re: File To Blob Corruption

2009-11-15 Thread Nisse Engström
On Sat, 14 Nov 2009 17:39:20 -0800, Don Wieland wrote: > Hello, > > I am trying to create an UPLOAD page to Update a Images and PDFs into > a BLOB field in mySQL. The image keeps getting corrupted (it draws a > portion of the image and the rest is GRAY) We tried it with Safari and > Firefox

[PHP] Re: Form Validation filter - Regex Q

2009-11-12 Thread Nisse Engström
On Tue, 10 Nov 2009 09:34:52 -0800, Haig Davis wrote: > foreach($_POST as $keyTemp => $valueTemp){ > $key = mysqlclean($keyTemp); > $value = mysqlclean($valueTemp); Mysql and form validation are totally unrelated. In my mind, this seems spectacularly misguided. >

Re: [PHP] Sanitizing potential MySQL strings with no database connection

2009-10-20 Thread Nisse Engström
On Tue, 20 Oct 2009 20:04:51 +0200, Nisse Engström wrote: > On Mon, 19 Oct 2009 15:39:40 -0700, Jim Lucas wrote: > >> /** >>* Character to escape... >>* \x0 \n \r \ ' " \x1a >> **/ >&g

Re: [PHP] Sanitizing potential MySQL strings with no database connection

2009-10-20 Thread Nisse Engström
On Mon, 19 Oct 2009 15:39:40 -0700, Jim Lucas wrote: > I have no idea if it will work, [...] Well, you're right so far... > > function clean_string($input) { > > /** >* Character to escape... >* \x0 \n \r \ ' " \x1a > **/ > > $patterns = array(

Re: [PHP] Sanitizing potential MySQL strings with no database connection

2009-10-20 Thread Nisse Engström
On Tue, 20 Oct 2009 14:58:32 +0200, Dotan Cohen wrote: >> Yes, the mysql_real_escape_string() function uses the databases >> character encoding to determine how to encode the string, whereas the >> older deprecated version mysql_escape_string() required no connection >> as it always assumed Latin-

[PHP] Re: PHP inserting carriage returns into POST values?

2009-09-04 Thread Nisse Engström
On Fri, 04 Sep 2009 12:16:47 -0700, James Colannino wrote: > Hey everyone. I ran into a really weird issue that I was hoping I could > find some clarification on. In short, I have javascript functions that > operate on hidden text values. Those values may be posted, in which > case PHP then pri

Re: [PHP] Converting URL's to hyperlinks.

2009-08-29 Thread Nisse Engström
On Sat, 29 Aug 2009 16:47:47 -0600, LinuxManMikeC wrote: > 2009/8/29 Nisse Engström : >> On Sat, 29 Aug 2009 16:19:05 -0600, LinuxManMikeC wrote: >> >>> As for your "more elaborate example", I'm sure that heredoc will >>> validate nicely. >>

Re: [PHP] Converting URL's to hyperlinks.

2009-08-29 Thread Nisse Engström
On Sat, 29 Aug 2009 16:19:05 -0600, LinuxManMikeC wrote: > As for your "more elaborate example", I'm sure that heredoc will > validate nicely. It does. > and rethink your code so you aren't processing the same data over and > over again. I "see this kind of slop all over." Touché! Would you b

Re: [PHP] Converting URL's to hyperlinks.

2009-08-29 Thread Nisse Engström
On Fri, 28 Aug 2009 17:22:20 -0600, LinuxManMikeC wrote: > click here *Groan* Throw any random web site to an HTML validator and you're likely to see this kind of slop all over. The correct solution is of course: $u = htmlspecialchars ($url); echo "$u"; [A more elaborate way to flay this

Re: [PHP] Re: Best way to test for form submission?

2009-08-29 Thread Nisse Engström
On Sat, 29 Aug 2009 12:50:41 +0800, "Keith" wrote: > I don't know why or in what condition that pressing [ENTER] will not submit > the whole form include the $_POST['submit']. /Nisse -- PHP Genera

[PHP] Re: Extract column names from a (my)SQL query

2009-08-21 Thread Nisse Engström
On Wed, 19 Aug 2009 22:42:36 +0300, דניאל דנון wrote: > Lets assume I have the following string: > "SELECT field1, field2, field3 FROM tablename WHERE field1 = 'something' " > > Is there any way to get "field1, field2, field3"? assuming it might also > have join, left join - things like that. If

[PHP] Re: MySQL auto_increment fields Server version: 5.1.32-community-log

2009-08-11 Thread Nisse Engström
On Mon, 10 Aug 2009 01:17:21 +0200, "Ralph Deffke" wrote: >> On Sun, 9 Aug 2009 20:17:15 +0200, "Ralph Deffke" wrote: >> >>> I'm facing the fact that it seems that auto_increment fields in a table not >>> start at 1 like it was in earlier versions even if I install mySQL brand new >>> creating all

[PHP] Re: MySQL auto_increment fields Server version: 5.1.32-community-log

2009-08-09 Thread Nisse Engström
On Sun, 9 Aug 2009 20:17:15 +0200, "Ralph Deffke" wrote: > I'm facing the fact that it seems that auto_increment fields in a table not > start at 1 like it was in earlier versions even if I install mySQL brand new > creating all tables new. it seems to me that auto_increments handling has > change

Re: [PHP] Re: dynamically naming PHP vars on the fly?

2009-08-08 Thread Nisse Engström
On Sat, 8 Aug 2009 16:25:24 +0200, "Ralph Deffke" wrote: > but then ur byond simple select, man, I do hate unions > and try to avoid those. Hear, hear! I'll look into that stuff in my next life, perhaps. /Nisse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://w

Re: [PHP] Re: does array_slice not work on multidimensional arrays?

2009-08-08 Thread Nisse Engström
On Sat, 08 Aug 2009 16:05:20 +0100, Ashley Sheridan wrote: > It is annoying working with arrays sometimes, as some functions work on > the actual array, while others return the results of working on the > array without changing anything. Is there any particular reason for > that? Well in this cas

Re: [PHP] Re: does array_slice not work on multidimensional arrays?

2009-08-08 Thread Nisse Engström
On Sat, 8 Aug 2009 08:29:36 -0600, John Butler wrote: > It seems clear to me, but do you also agree that my evidence is that > array_slice() does NOT work on multi-dimmed arrays on v.4.3.9? > Here is the evidence: > > this: > > var_dump($BuildPerUniqueDateArray); > echo"\n\n~\n\n";

Re: [PHP] Re: dynamically naming PHP vars on the fly?

2009-08-08 Thread Nisse Engström
On Sat, 8 Aug 2009 15:01:42 +0200, "Ralph Deffke" wrote: > of course u can do this by sql. > > see this > SELECT * > FROM `sometable` > LIMIT 0 , 30 > > gives u max 30 records if existstarting at record 0 > > on the next request u could say > SELECT * > FROM `sometable` > LIMIT 30 , 30 > > giv

[PHP] Re: does array_slice not work on multidimensional arrays?

2009-08-08 Thread Nisse Engström
On Fri, 7 Aug 2009 17:06:45 -0600, John Butler wrote: > does array_slice not work on multidimensional arrays? > > I have one multidimensional array, and when I run it thru' > array_slice() nothing happens, that I can tell. > > If it does not work on multidimensional arrays, what is the *simp

Re: [PHP] Re: dynamically naming PHP vars on the fly?

2009-08-08 Thread Nisse Engström
On Thu, 6 Aug 2009 12:42:49 -0600, Govinda wrote: >> Others have mentioned variable variables. While I have >> used those, I tend to prefer arrays: > > ah, yes, I see that too, now. Thanks for reminding me about arrays. > (You must be quite adept at arrays. ) I don't know, but I often stuff t

[PHP] Re: dynamically naming PHP vars on the fly?

2009-08-06 Thread Nisse Engström
On Wed, 5 Aug 2009 16:17:26 -0600, Govinda wrote: > I want to do this: > (I am just assuming it won't work; I haven't even tried it yet) > > $var1='apple'; > $Fruit_$var1="organic"; > echo "$Fruit_apple"; // I want this to return "organic" > > Or how are you guys dynamically naming PHP vars on t

[PHP] Re: Character encoding

2009-08-05 Thread Nisse Engström
On Wed, 5 Aug 2009 18:11:44 +0200, "Ralph Deffke" wrote: > I assume that the comments are collected by a browser form provided by you ! > do u use the form attribute "accept-charset" ? I always do and I always use > UTF-8 homogeniously throughout my application I never had that problem. Don't for

Re: [PHP] Freeing Memory

2009-07-31 Thread Nisse Engström
On Fri, 31 Jul 2009 07:54:13 -0400, Dan Shirah wrote: >> >> How does that work considering that mysql_query() only >> returns true or false on INSERT? I'd expect the script >> to fail on $result not being a valid resource. >> > > I don't know about mysql as I work with MSSQL Server and Informix,

Re: [PHP] Freeing Memory

2009-07-31 Thread Nisse Engström
On Thu, 30 Jul 2009 10:42:26 -0400, Dan Shirah wrote: > I don't know what version of SQL you are using, but I have found that using: > > mysql_free_result($result); > mssql_free_result($result); > ifx_free_result($result); > > Helped my queries run much faster and use less resources. I had somet

[PHP] Re: GeoIP Character Encoding

2009-07-29 Thread Nisse Engström
On Tue, 28 Jul 2009 18:10:33 -0400, APseudoUtopia wrote: > I'm using the PECL GeoIP module on php 5.2.10. When I look up an IP > address, the geoip_record_by_name() function is giving me a string > that contains "special" characters, such as the following: The PECL GeoIP page links to

[PHP] Re: GeoIP Character Encoding

2009-07-29 Thread Nisse Engström
On Tue, 28 Jul 2009 18:10:33 -0400, APseudoUtopia wrote: > 'Portugal, 09, Vila Real De Santo António' > 'Norway, 08, Ålesund' > 'Portugal, 04, Vila Nova De Famalicão' > > (Note the ó, Å, and ã). > > I'm using PostgreSQL as my database. The database's encoding is UTF8, > and the locale is C. > >

Re: [PHP] A prepared statements question

2009-07-12 Thread Nisse Engström
On Sun, 12 Jul 2009 15:25:15 -0400 (EDT), "Jason Carson" wrote: > For anyone reading this thread, here is the final code that I used... > > $link = mysqli_connect($hostname, $username, $password, $database); > $stmt = mysqli_prepare($link, "SELECT * FROM administrators WHERE > adminusers=?); > my

Re: [PHP] MySql Injection advice

2009-07-12 Thread Nisse Engström
On Sat, 11 Jul 2009 21:26:36 -0400, Haig Dedeyan wrote: >> On Sun, Jul 12, 2009 at 4:09 AM, Haig Dedeyan wrote: >>> mysql_query("INSERT INTO phonedir >>> (fname, lname) VALUES('$new_fname','$new_lname')") >>> or die(mysql_error()); > > I won;t be using 2x escapes but I just need to know if I sho

[PHP] Re: check a variable after EACH function

2009-07-01 Thread Nisse Engström
On Tue, 30 Jun 2009 18:31:54 -0500, Flint Million wrote: > Suppose I have some kind of check variable - say for example > $abort_now. Or it could be a function. Something to be evaluated to a > value. > > I want to execute a block of statements, but after EACH statement > executes, check the valu

[PHP] Re: point me to functions to parse the URL? (best one for *this*job?)

2009-06-25 Thread Nisse Engström
On Thu, 25 Jun 2009 18:20:36 -0500, Shawn McKenzie wrote: > Shawn McKenzie wrote: >> Govinda wrote: >>> I need to parse those URLs and set the value of $myfolder to as follows: >>> >>> domain.com/unix/asdfsdf.html >>> $myfolder=unix >>> domain.com/macos/khsdfg.html >>> $myfolder=macos >>> >>> BUT

Re: [PHP] how to extract fields from associative array into different variables

2009-06-18 Thread Nisse Engström
On Tue, 16 Jun 2009 08:50:45 -0400, PJ wrote: > Ashley Sheridan wrote: >> On Mon, 2009-06-15 at 17:38 -0400, PJ wrote: >> >>> Then I have to add some loopy thing to assign the values to the >>> $variables... a real pita since my variable do not lend themselves too >>> well to linear alterations

Re: [PHP] Re: sloppiness & stupidity

2009-06-18 Thread Nisse Engström
On Wed, 17 Jun 2009 18:59:36 -0400, tedd wrote: > As I understand it and is my experience, that is > true -- a stand-alone HTML attribute should be > equal to itself, such as selected="selected", or In HTML (as opposed to XHTML), there are a bunch of shortcut features[1] that allow you to writ

Re: [PHP] Re: sloppiness & stupidity

2009-06-18 Thread Nisse Engström
On Wed, 17 Jun 2009 22:51:55 +0100, Ashley Sheridan wrote: > I read somewhere that the XHTML standards say that for all attributes > that would normally be standalone in HTML, they should be given a value > that is the same as the attribute name, so you would use > multiple="multiple", selected="s

Re: [PHP] Re: sloppiness & stupidity

2009-06-17 Thread Nisse Engström
On Wed, 17 Jun 2009 10:18:09 +0100, "Ford, Mike" wrote: > This is very true -- but XHTML requires *all* attributes to have a > value, so an XHTML conformant page will use name="selector"> (or something similar such as name="selector">). The only inconsistency here is that different people > have

Re: [PHP] utf-8-safe replacement for strtr()?

2009-03-26 Thread Nisse Engström
On Wed, 25 Mar 2009 11:32:42 +0100, Nisse Engström wrote: > On Tue, 24 Mar 2009 08:15:35 -0400, Tom Worster wrote: > >> strtr() with three parameters is certainly unsafe. but my tests are showing >> that it may be ok with two parameters if the strings in the second parameter

Re: [PHP] utf-8-safe replacement for strtr()?

2009-03-25 Thread Nisse Engström
On Tue, 24 Mar 2009 08:15:35 -0400, Tom Worster wrote: > On 3/23/09 2:02 PM, "Tom Worster" wrote: > >> i havea general replacement or workaround for every php function in my code >> that i know to be utf-8-unsafe. except one: strtr(). > > strtr() with three parameters is certainly unsafe. but m

Re: [PHP] mysql_real_escape_string paranoid enough?

2009-03-21 Thread Nisse Engström
On Fri, 20 Mar 2009 09:49:23 -0700, mike wrote: > Slightly off topic here, but I find it annoying to have to use the > connection identifier for the mysqli_real_escape_string. > > It would be great if there was a function that I could say > mysql_escape_string that is using utf-8 instead of defau

[PHP] Re: Unexplained Issue Using Regex

2009-03-07 Thread Nisse Engström
On Fri, 6 Mar 2009 21:32:53 +0200, Nitsan Bin-Nun wrote: > Hi lista, > > I have been trying to figure this out for the last couple of hours but I'm > lack of luck. > Take a look at these regex's, the string that was inputed into the > preg_replace (using Uis modificators) and the results: > (the

[PHP] Re: PHP script lag (5 secs) when declaring mime type.

2009-03-05 Thread Nisse Engström
On Thu, 5 Mar 2009 19:14:20 +0100, Nisse Engström wrote: > On Thu, 05 Mar 2009 15:45:35 +0100, Jsbeginner wrote: > >> > header('Content-Type: application/x-javascript'); >> header('Content-Length: '.filesize('test.js')); >> readfile('

[PHP] Re: PHP script lag (5 secs) when declaring mime type.

2009-03-05 Thread Nisse Engström
On Thu, 05 Mar 2009 15:45:35 +0100, Jsbeginner wrote: > header('Content-Type: application/x-javascript'); > header('Content-Length: '.filesize('test.js')); > readfile('test.js'); > ?> > > test.js is only a few lines long, and if I remove the header content > type the file loads instantaniously

Re: [PHP] Which file "Included" me?

2009-02-19 Thread Nisse Engström
On Wed, 18 Feb 2009 10:37:53 -0800, "Michael A. Peters" wrote: > http://www.gfx-depot.com/forum/-php-server-php-self-validation-t-1636.html > > explains a technique to validate the input as well (don't trust that is > clean) Amazing! Not once did they mention htmlspecialchars(). /Nisse -- P

Re: [PHP] Re: require() causing strange characters ?

2009-02-10 Thread Nisse Engström
On Mon, 9 Feb 2009 15:46:35 +0100, cr.vege...@gmail.com wrote: > I've tested it again, from scratch with Notepad editor: > > echoUTF8.php > echoUTF8sub.php > and keep getting strange characters. > > Would you be so kind to run these 2 scripts on your pc ? Works fine for me, probably

Re: [PHP] Re: require() causing strange characters ?

2009-02-08 Thread Nisse Engström
On Fri, 6 Feb 2009 10:11:49 +0100, cr.vege...@gmail.com wrote: > I saved both scripts with ANSI in stead of UTF-8 and the problem is gone. > So the utf-8 BOM character (Byte Order Mark) caused it. > Unfortunately my editor has no option to store BOM-free scripts. > > Is it standard that PHP scrip

[PHP] Re: require() causing strange characters ?

2009-02-06 Thread Nisse Engström
On Fri, 6 Feb 2009 06:34:41 +0100, cr.vege...@gmail.com wrote: > I have a script called "test.php": > > > and a script called "echo.php": > > > With IE and Firefox it shows: CtestD > but when I view the source, it seems to be: C�testD > > When debugging it, it seems that: >> "CtestD" has

Re: [PHP] Re: iconv is messing up a spreadsheet generated by the Spreadsheet Excel Writer

2009-01-14 Thread Nisse Engström
On Wed, 14 Jan 2009 13:19:31 +0200, Thodoris wrote: > Variable_name Value > character_set_client utf8 > character_set_connection utf8 > character_set_databaselatin1 > character_set_filesystem binary > character_set_results utf8 > character_set_server latin1 > ch

Re: [PHP] Re: iconv is messing up a spreadsheet generated by the Spreadsheet Excel Writer

2009-01-14 Thread Nisse Engström
On Wed, 14 Jan 2009 11:33:25 +0200, Thodoris wrote: >> On Tue, 13 Jan 2009 15:51:01 +0200, Thodoris wrote: >> >> >>> Hi gang, >>> I am generating a spreadsheet using the contents of a mysql table. I >>> guess that there is something in the data that causes iconv used in the >>> module's s

[PHP] Re: iconv is messing up a spreadsheet generated by the Spreadsheet Excel Writer

2009-01-13 Thread Nisse Engström
On Tue, 13 Jan 2009 15:51:01 +0200, Thodoris wrote: > Hi gang, > I am generating a spreadsheet using the contents of a mysql table. I > guess that there is something in the data that causes iconv used in the > module's script to generate this error: > > *Notice*: iconv() [function.iconv >

Re: [PHP] IE Problem Detecting Post Variables

2009-01-04 Thread Nisse Engström
On Fri, 2 Jan 2009 18:06:18 -0500, "Andrew Ballard" wrote: > If you mean an INPUT element with the type="button", then yes. > (Although it will no longer be a submit button, so you'll have to > capture the click and perform the submit using Javascript which leads > back to accessibility issues, et

Re: [PHP] IE Problem Detecting Post Variables

2009-01-01 Thread Nisse Engström
On Thu, 1 Jan 2009 03:17:01 -0500, "L. Herbert" wrote: > On Dec 31, 2008, at 11:07 PM, Lupus Michaelis wrote: > >> MSIE pushes input_name.x and input_name.y to the server, when the >> input is an image. > Thanks! I see the issue clearly now. Oh well, time to modify my code > to compensate

Re: [PHP] Chrome 1.0 released

2008-12-14 Thread Nisse Engström
On Sat, 13 Dec 2008 15:08:44 -0800, Yeti wrote: > I have to defend poor little IE a little now. It supports XHTML and > CSS2 pretty well so far. And those standards came out a couple of > months ago. ??? CSS2 dates back to 1997-98 and XHTML to 1998-2000. And some claim that XHTML is still not s

Re: [PHP] How to submit form via PHP

2008-09-29 Thread Nisse Engström
On Mon, 29 Sep 2008 11:33:41 -0500, Richard Lynch wrote: > Actually, I believe action="" submitting to the same URL is *documented* HTTP > spec behavior. > > I welcome correction/confirmation if somebody wants to wade through the docs > again... HTML 4.01 says: action = uri [CT] This

Re: [PHP] ASCII Captcha

2008-09-12 Thread Nisse Engström
On Wed, 10 Sep 2008 09:28:27 -0400, tedd wrote: > At 11:14 AM +0200 9/1/08, Nisse =?utf-8?Q?Engstr=C3=B6m?= wrote: >>On Fri, 29 Aug 2008 16:11:01 -0400, tedd wrote: >>> >>> http://webbytedd.com/aa/assorted-captcha/ >> >>Some of these are really cool. Assuming they are >>actually working, that is.

Re: [PHP] ASCII Captcha

2008-09-01 Thread Nisse Engström
On Mon, 1 Sep 2008 11:14:39 +0200, Nisse Engström wrote: > On Fri, 29 Aug 2008 16:11:01 -0400, tedd wrote: >> >> http://webbytedd.com/aa/assorted-captcha/ > > Performance CAPTCHA: > > This one actually works. Well, sort of... And maybe your cod

Re: [PHP] ASCII Captcha

2008-09-01 Thread Nisse Engström
On Fri, 29 Aug 2008 16:11:01 -0400, tedd wrote: > > http://webbytedd.com/aa/assorted-captcha/ Some of these are really cool. Assuming they are actually working, that is... Graphic CAPTCHA: Error! Reload the page! Audio CAPTCHA: -- There is nothing to cli

Re: [PHP] Re: Posting Summary for Week Ending 18 January,2008:php-general@lists.php.net

2008-01-27 Thread Nisse Engström
On Mon, 21 Jan 2008 00:14:34 +, David Powers wrote: > A Google check on my email address shows that, with one exception, it > has been released into the public domain solely through archives and > mirrors of this list. The exception is a private group, whose > administrator I have alerted t

Re: [PHP] $_GET and multiple spaces.

2008-01-14 Thread Nisse Engström
On Mon, 14 Jan 2008 10:17:03 +0100, Jochem Maas wrote: > clive schreef: >> Hi - What Al said, but you want to use the url_encode/url_decode >> functions in php > > you don't need to use url_decode() because php will do that automatically > for incoming data - the caveat being situations where do

Re: [PHP] First stupid post of the year. [SOLVED]

2008-01-09 Thread Nisse Engström
On Wed, 9 Jan 2008 10:30:59 -0500, tedd wrote: > Yes, I said that there is no "windows-1252" > setting for Safari. It does not offer that > "named" setting in it's list of text encodings > available. There is no 1252 mentioned either -- > however, that does not mean that it's not there > unde

Re: [PHP] First stupid post of the year. [SOLVED]

2008-01-09 Thread Nisse Engström
On Mon, 7 Jan 2008 10:29:45 -0500, tedd wrote: > At 12:03 PM +0100 1/7/08, Nisse Engström wrote: >>How does the following pages compare? The display >>should be identical: >> >><http://luden.se/test/t-1252.html> >><http://luden.se/test/t-utf8.html> >

Re: [PHP] First stupid post of the year. [SOLVED]

2008-01-07 Thread Nisse Engström
On Sun, 6 Jan 2008 11:28:55 -0500, tedd wrote: > At 11:04 PM +0100 1/5/08, Nisse Engström wrote: >> >>The page encoding is determined by the HTTP >>`Content-Type:´ header. Period. A element >>may provide hints to a browser if the HTTP header >>is missing (eg

Re: [PHP] First stupid post of the year. [SOLVED]

2008-01-05 Thread Nisse Engström
On Sat, 5 Jan 2008 01:08:13 -0500, tedd wrote: > At 1:41 AM +0100 1/5/08, Nisse Engström wrote: >>On Fri, 4 Jan 2008 09:16:54 -0500, tedd wrote: >> >>> At 10:33 AM +0100 1/4/08, Nisse Engström wrote: >>>>On Thu, 3 Jan 2008 12:39:36 -0500, tedd wrote: >>

Re: [PHP] First stupid post of the year. [SOLVED]

2008-01-04 Thread Nisse Engström
On Fri, 4 Jan 2008 09:16:54 -0500, tedd wrote: > At 10:33 AM +0100 1/4/08, Nisse Engström wrote: >>On Thu, 3 Jan 2008 12:39:36 -0500, tedd wrote: > > Nisse: > > I thank you for your most enlightened and informative reply. > > I cut/pasted your post into my list of

Re: [PHP] First stupid post of the year. [SOLVED]

2008-01-04 Thread Nisse Engström
On Thu, 3 Jan 2008 12:39:36 -0500, tedd wrote: > At 4:24 PM +0100 1/3/08, Nisse =?utf-8?Q?Engstr=C3=B6m?= wrote: >>On Wed, 2 Jan 2008 19:36:56 -0500, tedd wrote: >> >>> To find out, I did put the operation through FireFox and reversed the >>> POST/GET operations to get a look at the string -- it

Re: [PHP] First stupid post of the year. [SOLVED]

2008-01-03 Thread Nisse Engström
On Wed, 2 Jan 2008 19:36:56 -0500, tedd wrote: > To find out, I did put the operation through FireFox and reversed the > POST/GET operations to get a look at the string -- it is: > > %C2%A0%C2%A0%C2%A0Z%C2%A0%C2%A0%C2%A0 < where Z is the value passed. > > Now, C2 (HEX) is a linefeed (194 DEC)

Re: [PHP] safe_mode_include_dir

2007-12-13 Thread Nisse Engström
On Wed, 12 Dec 2007 15:43:28 -0500, "Daniel Brown" wrote: > Is there a specific reason you're using require_once() instead of > include_once() ? There actually is a difference include() and > include_once() will only include the file if that line of code is > executed, whereas require() a

Re: [PHP] Cookies and sent headers

2007-08-19 Thread Nisse Engström
On Sat, 18 Aug 2007 17:03:35 +0200, "M. Sokolewicz" wrote: > The reason why setting cookies for you doesn't work is because of the > way a HTTP response is structured. It consists of 2 parts: header and > body separated by 2 new lines (\n\n). It is _required_ that _all_ > headers come _before_

Re: [PHP] Hidden include_path Fall Back?

2007-08-12 Thread Nisse Engström
On Thu, 09 Aug 2007 04:08:37 +0800, imacat wrote: > On Wed, 8 Aug 2007 10:39:03 +0100 > "Ford, Mike" <[EMAIL PROTECTED]> wrote: >> On 08 August 2007 10:06, imacat wrote: >>> I found that include_path seems to have a hidden fall back that's >>> not documented anywhere. It seems to always look

Re: [PHP] magic quotes

2007-08-12 Thread Nisse Engström
On Thu, 9 Aug 2007 00:29:15 -0500 (CDT), "Richard Lynch" wrote: > Problem #7: > Magic Quotes was designed for the ASCII character set, and is > downright dangerous to use for anything else (Unicode/UTF-8/etc). > ... > [Though maybe not, as maybe addslashes can't do any harm to Unicode if > there'

Re: [PHP] session_start(): Cannot send session cache limiter...

2007-08-05 Thread Nisse Engström
On Fri, 20 Jul 2007 16:39:51 -0500 (CDT), "Richard Lynch" wrote: > Did you save it as UTF-8 with that byte-order-mark (BOM) thingie? > > Does UTF-8 even HAVE a BOM? : "byte order markFEFF" U+FEFF is in UTF-8. /Nisse -- PHP Genera

Re: [PHP] Displaying HTML characters in real format

2007-07-20 Thread Nisse Engström
s, you have bugs in your code. Are there any modern browsers that don't support UTF-8 and the 8859-encodings? > Or not, in the case of the reply window I'm typing into right now, > which has turned your name into: > > Nisse Engström > > instead of: > Nisse Engström

Re: [PHP] Displaying HTML characters in real format

2007-07-17 Thread Nisse Engström
On Fri, 13 Jul 2007 01:24:09 -0500 (CDT), "Richard Lynch" wrote: > > htmlspecialchars ONLY escapes four characters: < > & " > > htmlentities escapes ALL characters that need it What characters other than the four (or five) NEED escaping, and why? /Nisse -- PHP General Mailing List (http://ww

[PHP] Re: Downloading utf-8 encoded files

2007-01-03 Thread Nisse Engström
On Tue, 26 Dec 2006 17:22:39 +0500, "Fahad Pervaiz" wrote: > I want to download UTF-8 encoded kml files from a website. I have written a > script that automatically downloads KML file. Problem is that some of the > utf-8 charc are distrubed after saving file on windows. below is the script. > >

Re: [PHP] $POST Q

2006-12-18 Thread Nisse Engström
On Fri, 15 Dec 2006 23:22:13 -0600 (CST), "Richard Lynch" wrote: > $selected = $l == $limit ? 'selected="selected"' : ''; > echo "$l\n"; [snip] > The value="x" *is* optional, but you'll never convince the people who > tell you it isn't, unless you force them to read the RFCs and W3C > re

[PHP] Re: Error Display

2006-12-14 Thread Nisse Engström
On Sat, 9 Dec 2006 21:07:26 -0500, "Craige Leeder" wrote: > I have been working with PHP5 since it's release, and until a few > months ago, have never experienced the problem I am about to describe > to you. I am not sure weather it has been discovered previously or > not, nor do I know exactly ho

[PHP] Re: utf8 encoding £ to £ problem

2006-12-13 Thread Nisse Engström
On Tue, 5 Dec 2006 12:37:48 -, "Chris Dean" wrote: > I was just wondering if anyone knows why php's utf8_encode > function converts the £ symbol into £ Yes. The '£' character is a two-octet sequence in UTF-8. The problem is that you are viewing it as if it were encoded in ISO-8859-1 (or s

Re: [PHP] Spam using email on website

2006-11-10 Thread Nisse Engström
On Tue, 7 Nov 2006 13:14:54 -0600 (CST), "Richard Lynch" wrote: > The Bad Guys are probably cramming your $subject and $from data with > an ENTIRE eamil, so your mail() function is, in effect, and Open > Relay. (That's very very very bad.) > > Example: > Normal Input > $subject = "Hi!"; > > Bad

[PHP] Re: Encoding PC-850

2006-11-03 Thread Nisse Engström
On Mon, 30 Oct 2006 16:21:58 +0100, [EMAIL PROTECTED] wrote: > I need to be able to encode text to PC-850 but I have big trouble > finding out info about this encoding. Does it even exist? I get a few > google hits, but nothing useful. Any idea of how I can convert for > example an UTF-8 string or

  1   2   >