[PHP] PHP 4.4.1 on Apache 2.0.x issue
Hi list, after upgrading to PHP 4.4.1, I'm having the following problem: Apache is running in prefork mode. index.php includes func.php, which defines some functions and connects to MySQL. For a while (1-2 requests) everything runs ok, except mysql sockets keep stacking up. And then - wham, suddenly, I'm getting errors: Cannot redeclare mquery() (previously declared in /home/test/func.php:9) in /home/test/func.php on line 9 If I wait a few seconds, it "works" for a couple of requests again. And then the error is back. What on EARTH is happening? My wild guess is, somehow the memory gets shared, and the previous script is still loaded into a thread when the new one is called, but how can this be happening? I would greatly appreciate any advice... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pictureupload
On Thursday 03 November 2005 19:12, twistednetadmin wrote: My advise is not to use $_FILES['img']['type'] or use it with some switch statement. Different browsers send different mime types for same image format. For example on mozila you have image/png on IE you have image/x-png (or vise versa) Also the are different mimes for JPEG image/jpg image/jpeg .. image/gif image/x-gif You better see what is the type of the image when the error occurs. > The errormessage is from this part of the script. > > echo "Result:\n"; > echo "Now that didn't seem to work... \n > Did you try a wrong format or size? \n > File that failed--> (".$_FILES['guildimage']['name '].")"; > > So it seems that the file is wrong type or size, but as it works with the > same picture from my own computer that is odd. > > The timeout part I have to check before I answer to, but I have 4mb > connection and the last user it failed for has a 2mb connection. 300kb > shouldn't make the script time out? Or could it? Where do I check the > timeout settings btw? PHP.ini? > Or can I run phpinfo() on it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Convert fake Unicode to real UTF-8
Thanks for the tip! htmlentities() didn't work, as it just converted the "&" in the string to "&". However, following the trail I did get it working the other way round, using: html_entity_decode($row['text'], ENT_NOQUOTES, "UTF-8") After this call, I had a real unicode text in my output file. About the question where I saw it - both in phpMyAdmin and in my own PHP script. It seems to be really stored as an ASCII text in the DB, as a substr($row['text'], 0, 1) also simply outputs "&". Thanks for your help, Andreas Minuk Choi schrieb: > Have you tried feeding that through htmlentities()? > > e.g. echo htmlentities("Га"); > > see if that outputs what you want on the page. > > -Mk > > > Andreas Jakl wrote: > >> I've been searching for quite some time now and tried several functions, >> but didn't find a solution. I hope somebody can point me in the right >> direction. >> >> The problem: >> >> Russian text is entered through a web form. It's a rather badly >> administrated external webserver with old versions of everything, so I >> can not set the table to UTF-8. In the MySQL-Table the text gets >> converted to something like "Га" as an ASCII text. >> >> Using PHP I need to get the text out into a plain text file, as a real >> UTF-8 string. >> >> How can I convert this? All the conversion methods from PHP that I tried >> failed, as the text seems to really consist of the individual ASCII >> chars like "&", "#". Therefore, a normal to-unicode-conversion doesn't >> change anything. >> >> Thanks in advance, >> Andreas Jakl >> >> >> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP from the command line
jasper, what i meant to say is show us the code, as well as the output of the err msgs generated by the connection code. in some cases, the app runs as a different user when the code is run as the apache user or the 'command line' user. if you're going to try to figure out the issue/problem, you need to look at what might be the problem, and prioritize. from my experience: -might be running as a different user -might be some weird setup having to do with the host/port addresses -might be weird php.ini config settings.. -etc.. so rather than guess, let's get the guy's data/information and go from there. but all things remaning equal, i'm inclined to agree that the same code 'should' work. so, give us the data/output, and we'll see what it looks like. i'm also willing to bet that the issue will be something fairly simple/trivial to fix. -bruce -Original Message- From: Jasper Bryant-Greene [mailto:[EMAIL PROTECTED] Sent: Thursday, November 03, 2005 11:30 PM To: [EMAIL PROTECTED] Cc: 'Robbert van Andel'; 'David Tulloh'; php-general@lists.php.net Subject: RE: [PHP] PHP from the command line On Thu, 2005-11-03 at 20:58 -0800, bruce wrote: > ok.. > > show us the connection code you're using to access the db.. I think you're on the wrong track. The connection code is known good because it works in CLI mode. What I would like to see is any notable differences between the output of phpinfo() in CLI mode and through your webserver. Jasper > -Original Message- > From: Robbert van Andel [mailto:[EMAIL PROTECTED] > Sent: Thursday, November 03, 2005 8:37 PM > To: [EMAIL PROTECTED]; 'David Tulloh' > Cc: php-general@lists.php.net > Subject: RE: [PHP] PHP from the command line > > > From the web, all I get is that the connection failed. Nothing more useful > than that. PHP_INFO tells me that it sees the MS SQL ini file and the MS > SQL configuration settings are displayed further down the list. > > The username and password work in the script because I am able to connect > using the exact same script from the command line. > > -Original Message- > From: bruce [mailto:[EMAIL PROTECTED] > Sent: Thursday, November 03, 2005 7:28 PM > To: 'David Tulloh'; 'Robbert van Andel' > Cc: php-general@lists.php.net > Subject: RE: [PHP] PHP from the command line > > what's the error that you're getting from the web php app... > > also, what do you get from the php_info() for the web app? this tells you a > great deal of information regarding your php/web setup (if you didn't > already know!) > > get us the information and we can help track down your issue... > > also, is there a user/passwd setup to access the mssql db? > > -bruce > > > -Original Message- > From: David Tulloh [mailto:[EMAIL PROTECTED] > Sent: Thursday, November 03, 2005 6:22 PM > To: Robbert van Andel > Cc: php-general@lists.php.net > Subject: Re: [PHP] PHP from the command line > > > Many linux distributions use a different php config file for the apache > and cli versions. > Using two different configurations might explain the problems you are > seeing. > > David > > Robbert van Andel wrote: > > >I run a linux webserver with Apache and PHP5. Does anyone out there know > >why a php script would work from the command line but fail when running it > >through a web browser? In particular, I'm trying to get a connection to an > >MSSQL server but PHP fails to connect when I run the script with a web > >browser. My regular scripts (i.e. ones without any mssql functions) work > >fine from the browser. When I run the script from the command line, the > >connection succeeds. Any idea if this is a PHP error or an apache error. > If > >this is an apache error, does anyone know what I need to search for to find > >an answer? > > > > > > > >Thanks, > > > >Robbert van Andel > > > > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- Jasper Bryant-Greene General Manager Album Limited e: [EMAIL PROTECTED] w: http://www.album.co.nz/ b: http://jbg.name/ p: 0800 4 ALBUM (0800 425 286) or +64 21 232 3303 a: PO Box 579, Christchurch 8015, New Zealand -- 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
Re: [PHP] actually the è not the ampersand
On Thu, 2005-10-13 at 09:25 -0400, John Nichel wrote: > jonathan wrote: > > do you then have to do the reverse operation to get it back for > > rendering. Since it was erroring on me during DOM creation, I feel like > > I'm going around it to put it into a format it likes but then on > > display via XSL transformation, I will have to convert it back. Or am I > > missing something? > > I'm only on the sending end; I don't know if the people I send the > documents too have to convert it back. Don't quote me on this, but if > you're going to display the information in a web browser, *I think* it > will display the decimal value properly. Don't worry about being quoted on that -- it most definitely will. Using decimal values in HTML entities is very common, especially for writing non-ASCII and non-usual-HTML-entities characters (such as CJK Kanji, mathematical operators or cyrillic glyphs) without worrying about the transfer charset. Personally though, I usually convert into proper UTF-8 instead of using entities. It takes a *lot* less space, providing that the web server is properly configured not to say that the document is ISO-8859-1 or something. Personally, I use a seven-liner perl script to convert the official HTML entitity DTDs into a PHP include file: print(") { if(/ $2,\n"; } } print("\t);\n?>\n"); The result is as follows: 160, "iexcl" => 161, "cent" => 162, "pound" => 163, "curren" => 164, "yen" => 165, "brvbar" => 166, "sect" => 167, "uml" => 168, "copy" => 169, "ordf" => 170, "laquo" => 171, "not" => 172, "shy" => 173, "reg" => 174, "macr" => 175, "deg" => 176, "plusmn" => 177, "sup2" => 178, "sup3" => 179, "acute" => 180, "micro" => 181, "para" => 182, "middot" => 183, "cedil" => 184, "sup1" => 185, "ordm" => 186, "raquo" => 187, "frac14" => 188, "frac12" => 189, "frac34" => 190, "iquest" => 191, "Agrave" => 192, "Aacute" => 193, "Acirc" => 194, "Atilde" => 195, "Auml" => 196, "Aring" => 197, "AElig" => 198, "Ccedil" => 199, "Egrave" => 200, "Eacute" => 201, "Ecirc" => 202, "Euml" => 203, "Igrave" => 204, "Iacute" => 205, "Icirc" => 206, "Iuml" => 207, "ETH" => 208, "Ntilde" => 209, "Ograve" => 210, "Oacute" => 211, "Ocirc" => 212, "Otilde" => 213, "Ouml" => 214, "times" => 215, "Oslash" => 216, "Ugrave" => 217, "Uacute" => 218, "Ucirc" => 219, "Uuml" => 220, "Yacute" => 221, "THORN" => 222, "szlig" => 223, "agrave" => 224, "aacute" => 225, "acirc" => 226, "atilde" => 227, "auml" => 228, "aring" => 229, "aelig" => 230, "ccedil" => 231, "egrave" => 232, "eacute" => 233, "ecirc" => 234, "euml" => 235, "igrave" => 236, "iacute" => 237, "icirc" => 238, "iuml" => 239, "eth" => 240, "ntilde" => 241, "ograve" => 242, "oacute" => 243, "ocirc" => 244, "otilde" => 245, "ouml" => 246, "divide" => 247, "oslash" => 248, "ugrave" => 249, "uacute" => 250, "ucirc" => 251, "uuml" => 252, "yacute" => 253, "thorn" => 254, "yuml" => 255, "fnof" => 402, "Alpha" => 913, "Beta" => 914, "Gamma" => 915, "Delta" => 916, "Epsilon" => 917, "Zeta" => 918, "Eta" => 919, "Theta" => 920, "Iota" => 921, "Kappa" => 922, "Lambda" => 923, "Mu" => 924, "Nu" => 925, "Xi" => 926, "Omicron" => 927, "Pi" => 928, "Rho" => 929, "Sigma" => 931, "Tau" => 932, "Upsilon" => 933, "Phi" => 934, "Chi" => 935, "Psi" => 936, "Omega" => 937, "alpha" => 945, "beta" => 946, "gamma" => 947, "delta" => 948, "epsilon" => 949, "zeta" => 950, "eta" => 951, "theta" => 952, "iota" => 953, "kappa" => 954, "lambda" => 955, "mu" => 956, "nu" => 957, "xi" => 958, "omicron" => 959, "pi" => 960, "rho" => 961, "sigmaf" => 962, "sigma" => 963, "tau" => 964, "upsilon" => 965, "phi" => 966, "chi" => 967, "psi" => 968, "omega" => 969, "thetasym" => 977, "upsih" => 978, "piv" => 982, "bull" => 8226, "hellip" => 8230, "prime" => 8242, "Prime" => 8243,
RE: [PHP] if statement help
On 03 November 2005 15:26, Brent Baisley wrote: > You only need one "if". The parenthesis will evaluation order. > > if( ( !empty( $var1 ) || ( !empty( $var2 ) && !empty( $var3 ) ) || > $var1 == "something" ) However, the $var1=="something" test is redundant in this, since if that is true the !empty($var1) test will also be true and the rest of the test will not be evaluated. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [php] dependable combo boxes with mysql database
Hello All, I have a php page which contains three combo boxes. The first one will have the value from the mysql database table on page load itself. Then depending upon the value selected in the first combobox the second combo box should be populated with the respective values from another mysql database table, and once again depending upon the value selected in second combobox the third combobox should be populated with the respective values from one more different database table. I have read through mailing list and also searched in google and found that it can be done with javascript onblur function but nothing is working. Here is the code: -- $row[0]"); } } ?> Untitled Page : : : Service Product Nature of Problem Complaint Registration Upper Middle Lower Problem Description : Severity of Problem : -- In the above code there are three combo box namely D1, D2 and D3. D1 will be populated on pageload. Now D2 should be populated on event like 'onblur' to D1 and similarly D3 should be populated on event like 'onblur' to D2. Pl. give me the exact code or proper guideline how should I accomplish this on the same page. Appreciate your replies. Thanks and regards. BJV __ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-DEV] php version of GD lib
Erron Walker wrote: Thanks for the response, I will look into that. I'm a little unsure what given that you don't pay me large ammounts of money to support your php problems I'd apprieciate it if we kept the discussion 'onlist' - that way other benefit from any solutions/ideas that might come about AND other people can see your questions and give a response (chances are cleverer, more experienced people then me!) you meant by using flock() on a separate file though. I have an image file that is required by different requests made to apache at the same time...what kind of separate file would I use? any file. just a file. say you need to regenerate /var/images/abc.jpg then when your processes attempt that they must first successfully flock another e.g. /var/images/gen-locks/abc.jpg where /var/images/gen-locks/abc.jpg is just an empty file, your process needs to create it and flock it successfully before going ahead and generating. actually using directories instead of files as lock markers is better because creation of directories is atomic - if you need more info: a/ pray someone reads this that knows more than I do. b/ try google on 'file directory locks' (or something) hth, unfortunately I can't help much further - I have reached the boundaries of my practical knowledge ;-) Thank you for your help in advance. Erron - Original Message - From: "Jochem Maas" <[EMAIL PROTECTED]> To: "Erron Walker" <[EMAIL PROTECTED]> Sent: Friday, November 04, 2005 7:36 AM Subject: Re: [PHP-DEV] php version of GD lib Erron Walker wrote: I am using the version of GD packaged with php 4.3.x for windows and am having a problem with opening images and not being able to lock them. As soon as I have multiple users requiring the same dynamically generated image, the image sent to the browser is all distorted and blurred but only happens when multiple users are accessing the exact same dynamically generated image. I would like to lock the images before processing but the functions for gd (eg. imagecreatefromgif() require a filename string and not a resource handle created by flock(). this is a question for the generals mailing I think - if you can't use generated unique names (e.g. uniqid()) then try flock()ing a seperate file... and checking against that (in rather the same way that, for instance, cvs uses 'lock' dirs to keep things atomic.) Any insight would be appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [php] dependable combo boxes with mysql database
[snip] In the above code there are three combo box namely D1, D2 and D3. D1 will be populated on pageload. Now D2 should be populated on event like 'onblur' to D1 and similarly D3 should be populated on event like 'onblur' to D2. Pl. give me the exact code or proper guideline how should I accomplish this on the same page. [/snip] Unfortunately this is a PHP list and your question concerns JavaScript. I found this while googling "onblur executes JavaScript whenever a user moves with the mouse the focus away from an element within a form. In other words, whenever a person first clicks an element, and then clicks anywhere outside of it." Here is a tutorial http://www.javascriptkit.com/javatutors/form6.shtml -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [php] dependable combo boxes with mysql database
This might be slightly OT on this list, but here goes nothing. 1. Submit the form when the user shifts focus from D1 using Javascript's onBlur event 2. On the server side, use PHP to retrieve the values for D2 and generate the page again 3. Repeat 1 & 2 when the value of D2 changes. HTH Pranav www.concept-i.co.in Bhoomi Vora wrote: Hello All, I have a php page which contains three combo boxes. The first one will have the value from the mysql database table on page load itself. Then depending upon the value selected in the first combobox the second combo box should be populated with the respective values from another mysql database table, and once again depending upon the value selected in second combobox the third combobox should be populated with the respective values from one more different database table. I have read through mailing list and also searched in google and found that it can be done with javascript onblur function but nothing is working. Here is the code: .d similarly D3 should be populated on event like 'onblur' to D2. Pl. give me the exact code or proper guideline how should I accomplish this on the same page. Appreciate your replies. Thanks and regards. BJV __ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] reg ex help
New to php so please bear with me. I'm trying to parse through a field that has some information in it, the information is stored with other information and is delimited in a certain pattern so I figure using reg ex I can get the information I want out of the text. So here is an example. Silver Small Corp;X^%\n#\n Gold Medium Corp;RE^%\n#\n Platinum Large Corp;YRE^%\n#\n Reall all I need is the information on Silver Small Corp, etc and the X all the rest is gibberish. Is Reg Ex the best way to do this or would it be some other way. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] reg ex help
[snip] New to php so please bear with me. I'm trying to parse through a field that has some information in it, the information is stored with other information and is delimited in a certain pattern so I figure using reg ex I can get the information I want out of the text. So here is an example. Silver Small Corp;X^%\n#\n Gold Medium Corp;RE^%\n#\n Platinum Large Corp;YRE^%\n#\n Reall all I need is the information on Silver Small Corp, etc and the X all the rest is gibberish. Is Reg Ex the best way to do this or would it be some other way. [/snip] You couuld use explode $myField = "Silver Small Corp;X^%\n#\n"; $foo = explode(";", $myField); echo $foo[0]; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reg ex help
The problem with that is there are about 40 different listings in the one field. Silver Small Corp;X^%\n#\n Gold Medium Corp;RE^%\n#\n Platinum Large Corp;YRE^%\n#\n being three of them so maybe this is a bettter way of listing it ... Silver Small Corp;X^%\n#\nGold Medium Corp;RE^%\n#\nPlatinum Large Corp;YRE^%\n#\n ... On 11/4/05, Jay Blanchard <[EMAIL PROTECTED]> wrote: > [snip] > New to php so please bear with me. I'm trying to parse through a > field that has some information in it, the information is stored with > other information and is delimited in a certain pattern so I figure > using reg ex I can get the information I want out of the text. > > So here is an example. > > Silver Small Corp;X^%\n#\n > Gold Medium Corp;RE^%\n#\n > Platinum Large Corp;YRE^%\n#\n > > Reall all I need is the information on Silver Small Corp, etc and the > X all the rest is gibberish. Is Reg Ex the best way to do this or > would it be some other way. > [/snip] > > You couuld use explode > > $myField = "Silver Small Corp;X^%\n#\n"; > > $foo = explode(";", $myField); > > echo $foo[0]; > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] reg ex help
[snip] New to php so please bear with me. I'm trying to parse through a field that has some information in it, the information is stored with other information and is delimited in a certain pattern so I figure using reg ex I can get the information I want out of the text. So here is an example. Silver Small Corp;X^%\n#\n Gold Medium Corp;RE^%\n#\n Platinum Large Corp;YRE^%\n#\n Reall all I need is the information on Silver Small Corp, etc and the X all the rest is gibberish. Is Reg Ex the best way to do this or would it be some other way.[/snip] If the number of semi-colons is fixed, then explode will do the trick. $foo = 'Silver Small Corp;X^%\n#\n'; $bar = explode(';', $foo); echo $bar[0]; However if the number of semi-colons is not fixed, then substr in conjunction with strpos will do the trick. $foo = 'Silver Small Corp;X^%\n#\n'; $bar = substr($foo, 0, strpos($foo, ';')); echo $bar; HTH, Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] reg ex help
[snip] The problem with that is there are about 40 different listings in the one field. Silver Small Corp;X^%\n#\n Gold Medium Corp;RE^%\n#\n Platinum Large Corp;YRE^%\n#\n being three of them so maybe this is a bettter way of listing it ... Silver Small Corp;X^%\n#\nGold Medium Corp;RE^%\n#\nPlatinum Large Corp;YRE^%\n#\n ...[/snip] Try this: $values = array(); // we'll put the extracted vars here $str = "This is supposed to be your string"; $tmpStr = explode("#\n", $str); foreach ($tmpStr as $foo) { if (strlen(trim($foo)) > 0) { array_push($values, substr($foo, 0, strpos($foo, ';'))); } } HTH, Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] extracting foo.bar from path/to/file.php/foo.bar
Greetings, What do I need to do to extract foo.bar from path/to/file.php/foo.bar $_SERVER['REQUEST_URI'] will return the whole string but is there anything more direct than doing a regex and 'REQUEST_URI'? Thanks, -- Leonard Burton, N9URK [EMAIL PROTECTED] "The prolonged evacuation would have dramatically affected the survivability of the occupants." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] extracting foo.bar from path/to/file.php/foo.bar
[snip] What do I need to do to extract foo.bar from path/to/file.php/foo.bar [/snip] The manual is your friend ;o) http://www.php.net/basename/ HTH, Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reg ex help
Here is what the field content from the database would look like. I have removed any sensitive data. str = "Name;Grill Transom (GT302)^% - Sort;Find/Replace^% - Calc;2568.09x^% - Type;Veck^% - PO Number;^% - Previous Order Number;^% - Fabric Whole;Dyna-Dry^% - Fabric Body;^% - Fabric Yoke;^% - Fabric Sleeves;^% - Fabric Panels;^% - ID;32398^%^%^%^%^% - Size;6.0^%^%^%^%^% - Layer;0^%^%^%^%^% - Coords;147^173^400^%^^^%^^^%^^^%^^^% - ID;%32400^%^%%%^% - Coords;%147^110^400^%^^^%%%^^^% - Back Number Font;%Athletic^Athletic^% - Front Text ID;%%32402^%32403^%^%^%^%^%^% - Roch Small Sum;0^% - Cards Med Extra;0^% - Roch Large Sum;0^% - Silver Small Corp;X^% - Gold Medium Corp;RE^% - Platinum Large Corp;YRE^%"; That is one field. On 11/4/05, Pablo Gosse <[EMAIL PROTECTED]> wrote: > [snip] > The problem with that is there are about 40 different listings in the > one field. > > Silver Small Corp;X^%\n#\n > Gold Medium Corp;RE^%\n#\n > Platinum Large Corp;YRE^%\n#\n > > being three of them so maybe this is a bettter way of listing it > > ... Silver Small Corp;X^%\n#\nGold Medium > Corp;RE^%\n#\nPlatinum Large Corp;YRE^%\n#\n > ...[/snip] > > Try this: > > $values = array(); // we'll put the extracted vars here > $str = "This is supposed to be your string"; > > $tmpStr = explode("#\n", $str); > > foreach ($tmpStr as $foo) { >if (strlen(trim($foo)) > 0) { >array_push($values, substr($foo, 0, strpos($foo, ';'))); > >} > } > > HTH, > > Pablo > > -- > 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
Re: [PHP] reg ex help
The name like "Roch Small Sum" and others dont change, they will be in there whether there is a value associated with them or not. On 11/4/05, conditional motion <[EMAIL PROTECTED]> wrote: > Here is what the field content from the database would look like. I > have removed any sensitive data. > > str = "Name;Grill Transom (GT302)^% - > Sort;Find/Replace^% - Calc;2568.09x^% - > Type;Veck^% - PO Number;^% - Previous Order > Number;^% - Fabric Whole;Dyna-Dry^% - Fabric > Body;^% - Fabric Yoke;^% - Fabric > Sleeves;^% - Fabric Panels;^% - > ID;32398^%^%^%^%^% - > Size;6.0^%^%^%^%^% - > Layer;0^%^%^%^%^% - > Coords;147^173^400^%^^^%^^^%^^^%^^^% > - ID;%32400^%^%%%^% > - > Coords;%147^110^400^%^^^%%%^^^% > - Back Number > Font;%Athletic^Athletic^% > - Front Text > ID;%%32402^%32403^%^%^%^%^%^% > - Roch Small Sum;0^% - Cards Med Extra;0^% > - Roch Large Sum;0^% - Silver Small Corp;X^% > - Gold Medium Corp;RE^% - Platinum Large > Corp;YRE^%"; > > That is one field. > > On 11/4/05, Pablo Gosse <[EMAIL PROTECTED]> wrote: > > [snip] > > The problem with that is there are about 40 different listings in the > > one field. > > > > Silver Small Corp;X^%\n#\n > > Gold Medium Corp;RE^%\n#\n > > Platinum Large Corp;YRE^%\n#\n > > > > being three of them so maybe this is a bettter way of listing it > > > > ... Silver Small Corp;X^%\n#\nGold Medium > > Corp;RE^%\n#\nPlatinum Large Corp;YRE^%\n#\n > > ...[/snip] > > > > Try this: > > > > $values = array(); // we'll put the extracted vars here > > $str = "This is supposed to be your string"; > > > > $tmpStr = explode("#\n", $str); > > > > foreach ($tmpStr as $foo) { > >if (strlen(trim($foo)) > 0) { > >array_push($values, substr($foo, 0, strpos($foo, ';'))); > > > >} > > } > > > > HTH, > > > > Pablo > > > > -- > > 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
Re: [PHP] reg ex help
Whos responsible for putting all that information into one field. LOL On 11/4/05, conditional motion <[EMAIL PROTECTED]> wrote: > The name like "Roch Small Sum" and others dont change, they will be in > there whether there is a value associated with them or not. > > > On 11/4/05, conditional motion <[EMAIL PROTECTED]> wrote: > > Here is what the field content from the database would look like. I > > have removed any sensitive data. > > > > str = "Name;Grill Transom (GT302)^% - > > Sort;Find/Replace^% - Calc;2568.09x^% - > > Type;Veck^% - PO Number;^% - Previous Order > > Number;^% - Fabric Whole;Dyna-Dry^% - Fabric > > Body;^% - Fabric Yoke;^% - Fabric > > Sleeves;^% - Fabric Panels;^% - > > ID;32398^%^%^%^%^% - > > Size;6.0^%^%^%^%^% - > > Layer;0^%^%^%^%^% - > > Coords;147^173^400^%^^^%^^^%^^^%^^^% > > - ID;%32400^%^%%%^% > > - > > Coords;%147^110^400^%^^^%%%^^^% > > - Back Number > > Font;%Athletic^Athletic^% > > - Front Text > > ID;%%32402^%32403^%^%^%^%^%^% > > - Roch Small Sum;0^% - Cards Med Extra;0^% > > - Roch Large Sum;0^% - Silver Small Corp;X^% > > - Gold Medium Corp;RE^% - Platinum Large > > Corp;YRE^%"; > > > > That is one field. > > > > On 11/4/05, Pablo Gosse <[EMAIL PROTECTED]> wrote: > > > [snip] > > > The problem with that is there are about 40 different listings in the > > > one field. > > > > > > Silver Small Corp;X^%\n#\n > > > Gold Medium Corp;RE^%\n#\n > > > Platinum Large Corp;YRE^%\n#\n > > > > > > being three of them so maybe this is a bettter way of listing it > > > > > > ... Silver Small Corp;X^%\n#\nGold Medium > > > Corp;RE^%\n#\nPlatinum Large Corp;YRE^%\n#\n > > > ...[/snip] > > > > > > Try this: > > > > > > $values = array(); // we'll put the extracted vars here > > > $str = "This is supposed to be your string"; > > > > > > $tmpStr = explode("#\n", $str); > > > > > > foreach ($tmpStr as $foo) { > > >if (strlen(trim($foo)) > 0) { > > >array_push($values, substr($foo, 0, strpos($foo, ';'))); > > > > > >} > > > } > > > > > > HTH, > > > > > > Pablo > > > > > > -- > > > 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reg ex help
explode on this first: '^% -' then probably on explode ';' like Jay mentioned. then you can probably massage the really weird stuff into shape somehow, stuff like (wtf :-)): Back Number Font;%Athletic^Athletic ..hth conditional motion wrote: The name like "Roch Small Sum" and others dont change, they will be in there whether there is a value associated with them or not. On 11/4/05, conditional motion <[EMAIL PROTECTED]> wrote: Here is what the field content from the database would look like. I have removed any sensitive data. str = "Name;Grill Transom (GT302)^% - Sort;Find/Replace^% - Calc;2568.09x^% - Type;Veck^% - PO Number;^% - Previous Order Number;^% - Fabric Whole;Dyna-Dry^% - Fabric Body;^% - Fabric Yoke;^% - Fabric Sleeves;^% - Fabric Panels;^% - ID;32398^%^%^%^%^% - Size;6.0^%^%^%^%^% - Layer;0^%^%^%^%^% - Coords;147^173^400^%^^^%^^^%^^^%^^^% - ID;%32400^%^%%%^% - Coords;%147^110^400^%^^^%%%^^^% - Back Number Font;%Athletic^Athletic^% - Front Text ID;%%32402^%32403^%^%^%^%^%^% - Roch Small Sum;0^% - Cards Med Extra;0^% - Roch Large Sum;0^% - Silver Small Corp;X^% - Gold Medium Corp;RE^% - Platinum Large Corp;YRE^%"; That is one field. On 11/4/05, Pablo Gosse <[EMAIL PROTECTED]> wrote: [snip] The problem with that is there are about 40 different listings in the one field. Silver Small Corp;X^%\n#\n Gold Medium Corp;RE^%\n#\n Platinum Large Corp;YRE^%\n#\n being three of them so maybe this is a bettter way of listing it ... Silver Small Corp;X^%\n#\nGold Medium Corp;RE^%\n#\nPlatinum Large Corp;YRE^%\n#\n ...[/snip] Try this: $values = array(); // we'll put the extracted vars here $str = "This is supposed to be your string"; $tmpStr = explode("#\n", $str); foreach ($tmpStr as $foo) { if (strlen(trim($foo)) > 0) { array_push($values, substr($foo, 0, strpos($foo, ';'))); } } HTH, Pablo -- 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] protect password?
Hello, Some functions need you to provide username and password, for instance odbc_connect. Even though the username/password just has minimum access privileges to the resource, putting it there in clear text in a script gives me heartburn. How do people handle username/password in such kind of cases? I'm sure there must be some way to store critical information in some encrypted format but it's still readable to scripts for authentication purpose. But don't know how. Any ideas or pointer would be greatly appreciated. Bing -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] extracting foo.bar from path/to/file.php/foo.bar
> > [snip] > What do I need to do to extract foo.bar from path/to/file.php/foo.bar > [/snip] > > The manual is your friend ;o) > > http://www.php.net/basename/ > Beware that, in the case of an url like "http://www.example.com/path/to/file.php/foo.bar?foo=bar&bar=foo";, basename() will return everything past the last "/", in this case "foo.bar?foo=bar&bar=foo". JM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: protect password?
I'm not sure if there's a way around this, though there's a few simple precautions you can take. You can put a function that returns the resource in an include file outside of the public html folders, which helps a little bit. It's also always good to give the least permission possible and to only allow connections from localhost. Now I know this isn't exactly what you asked, but someone will probably come along shortly and offer something more in line. Ben On Fri, 04 Nov 2005 15:36:47 -0500, "Bing Du" <[EMAIL PROTECTED]> wrote: Hello, Some functions need you to provide username and password, for instance odbc_connect. Even though the username/password just has minimum access privileges to the resource, putting it there in clear text in a script gives me heartburn. How do people handle username/password in such kind of cases? I'm sure there must be some way to store critical information in some encrypted format but it's still readable to scripts for authentication purpose. But don't know how. Any ideas or pointer would be greatly appreciated. Bing -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] protect password?
[snip] Some functions need you to provide username and password, for instance odbc_connect. Even though the username/password just has minimum access privileges to the resource, putting it there in clear text in a script gives me heartburn. How do people handle username/password in such kind of cases? I'm sure there must be some way to store critical information in some encrypted format but it's still readable to scripts for authentication purpose. But don't know how. Any ideas or pointer would be greatly appreciated. [/snip] Some time ago Chris Shifflet provided a nice suggestion on how to make your passwords more secure. It's still not rock solid, but far better than storing them in clear text. The methodology I present below (which Chris presented originally) assumes Apache as your web server. Though I've recently gotten into IIS administration I'm not sure of how you would specifically do this under IIS. Create a file outside of your webroot, and in it use SetEnv declarations to set a username and password as environment vars. SetEnv dbname username SetEnv dbpass password Chown this file such that it is only readable by root, and then (assuming you're on a shared host) have it included in your virtual host block of the server config file. If you're on a dedicated box include it in the configuration section for the site in question. Then when the server is restarted you will be able to access the username and password via $_SERVER['dbuser'] and $_SERVER['dbpass'] in your scripts. As the first response to your post, not exactly what you were looking for, but much more secure than plain text or even simple include files. HTH. Cheers, Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] protect password?
pablo... i fail to see how your suggestion is much more secure than placing the user/passwd information in a file that's outside the web access space, and then including the file. in either case, the user wouldn't be able to read the include file. -bruce -Original Message- From: Pablo Gosse [mailto:[EMAIL PROTECTED] Sent: Friday, November 04, 2005 3:16 PM To: php-general@lists.php.net Subject: RE: [PHP] protect password? [snip] Some functions need you to provide username and password, for instance odbc_connect. Even though the username/password just has minimum access privileges to the resource, putting it there in clear text in a script gives me heartburn. How do people handle username/password in such kind of cases? I'm sure there must be some way to store critical information in some encrypted format but it's still readable to scripts for authentication purpose. But don't know how. Any ideas or pointer would be greatly appreciated. [/snip] Some time ago Chris Shifflet provided a nice suggestion on how to make your passwords more secure. It's still not rock solid, but far better than storing them in clear text. The methodology I present below (which Chris presented originally) assumes Apache as your web server. Though I've recently gotten into IIS administration I'm not sure of how you would specifically do this under IIS. Create a file outside of your webroot, and in it use SetEnv declarations to set a username and password as environment vars. SetEnv dbname username SetEnv dbpass password Chown this file such that it is only readable by root, and then (assuming you're on a shared host) have it included in your virtual host block of the server config file. If you're on a dedicated box include it in the configuration section for the site in question. Then when the server is restarted you will be able to access the username and password via $_SERVER['dbuser'] and $_SERVER['dbpass'] in your scripts. As the first response to your post, not exactly what you were looking for, but much more secure than plain text or even simple include files. HTH. Cheers, Pablo -- 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
RE: [PHP] protect password?
[snip] pablo... i fail to see how your suggestion is much more secure than placing the user/passwd information in a file that's outside the web access space, and then including the file. in either case, the user wouldn't be able to read the include file. [/snip] Greeting, Bruce. On a dedicated server there wouldn't be much difference. However if the site in question were on a shared host (which is usually the case) there would be a huge difference. On shared hosts since files to be included need to be readable by the user the server runs as their permissions must be set to: -rw-r--r-- And since every one else who has a site on the same server must also have files to be included set to be readable by the server user, one could easily write a trolling script to traverse the directories of other users on the site and grab whatever info they needed. The shared host I use for my personal site used to have this problem until I made them aware of it. In less than two minutes I was able to find several database usernames and passwords. They've since made changes to eliminate this problem. All that needs to be done is secure up the directory permissions and the problem goes away. By setting the file readable only by root this problem is completely eliminated. Unless a hacker has the root password, they will not be able to compromise the information in this file. This is how I understand it, at least. If Chris reads this perhaps he can confirm this for me? Cheers, Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions and register_long_arrays
how do you reference the sessions? do you refrence them *with* the old arrays? because that would obviously be a problem
RE: [PHP] protect password?
here again the solution could be managed by the host/sys admin setting the appropriate privs for the files. in either case the sys admin should be protecting your files from view by other users!!! although i can see why one would go with the route where you deal with the env vars... my priamry point was to stress the file aspect is essentially the same, all things being equal. -Original Message- From: Pablo Gosse [mailto:[EMAIL PROTECTED] Sent: Friday, November 04, 2005 3:45 PM To: [EMAIL PROTECTED]; php-general@lists.php.net Subject: RE: [PHP] protect password? [snip] pablo... i fail to see how your suggestion is much more secure than placing the user/passwd information in a file that's outside the web access space, and then including the file. in either case, the user wouldn't be able to read the include file. [/snip] Greeting, Bruce. On a dedicated server there wouldn't be much difference. However if the site in question were on a shared host (which is usually the case) there would be a huge difference. On shared hosts since files to be included need to be readable by the user the server runs as their permissions must be set to: -rw-r--r-- And since every one else who has a site on the same server must also have files to be included set to be readable by the server user, one could easily write a trolling script to traverse the directories of other users on the site and grab whatever info they needed. The shared host I use for my personal site used to have this problem until I made them aware of it. In less than two minutes I was able to find several database usernames and passwords. They've since made changes to eliminate this problem. All that needs to be done is secure up the directory permissions and the problem goes away. By setting the file readable only by root this problem is completely eliminated. Unless a hacker has the root password, they will not be able to compromise the information in this file. This is how I understand it, at least. If Chris reads this perhaps he can confirm this for me? Cheers, Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reg ex help
On Fri, 04 Nov 2005 14:09:06 -0500, conditional motion wrote: > Here is what the field content from the database would look like. I have > removed any sensitive data. > > str = "Name;Grill Transom (GT302)^% - > Sort;Find/Replace^% - Calc;2568.09x^% - > Type;Veck^% - PO Number;^% - Previous Order > Number;^% - Fabric Whole;Dyna-Dry^% - Fabric > ... If you really want a regex.. something like: preg_match_all('/\s*([^;]+);{5}([^^]*)^/U', $str, $matches); var_dump($matches); And you'll have an array of field => values (excuding the Coords field). I do wonder why this is stored in the db like this. Curt. -- http://news.zirzow.dyndns.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: extracting foo.bar from path/to/file.php/foo.bar
On Fri, 04 Nov 2005 09:59:16 -0500, Leonard Burton wrote: > Greetings, > > What do I need to do to extract foo.bar from path/to/file.php/foo.bar > > $_SERVER['REQUEST_URI'] will return the whole string but is there anything > more direct than doing a regex and 'REQUEST_URI'? See: $_SERVER['PATH_INFO']; Curt. -- http://news.zirzow.dyndns.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Register Globals
Ok, you are all used to working with register_gloabsl=off. mail($to, stripslashes($subject), wordwrap($message, 60), "From: $from\r\n"); I change this line to: mail($to, stripslashes($_POST["subject"]), wordwrap($_POST["message"], 60), "From: $_POST["from"]\r\n"); and I get: Parse error: parse error, unexpected '\"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /www-html/emailer/index.html on line 41 What is the problem? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Register Globals
mail($to, stripslashes($_POST["subject"]), wordwrap($_POST ["message"], 60), "From: $_POST["from"]\r\n"); and I get: Parse error: parse error, unexpected '\"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /www-html/emailer/index.html on line 41 The use of $var['index'] or $var["index"] ($_POST['from'], $_GET ["to"], etc.) within double quotation marks is causing the problem. To fix this, wrap the whole construct in curly braces: mail($to, stripslashes($_POST["subject"]), wordwrap($_POST ["message"], 60), "From: {$_POST["from"]}\r\n"); You only have to do this within other quotation marks and only if the array's index is a string. Hope that helps, Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Register Globals
I'm guessing it's because of the double quotes within double quotes in the "From" part: mail($to, stripslashes($_POST["subject"]), wordwrap($_POST["message"], 60), "From: $_POST["from"]\r\n"); Your $_POST["subject"] is ok because that's all that's in that part of the parameter, but the part: "From: $_POST["from"]\r\n" ..is going to cause problems because the "from" double quotes interfere with the outside double quotes. Try changing it to: "From: $_POST['from']\r\n" ..with single quotes on the 'from' or put the $_POST variable outside the quotes: "From: " . $_POST["from"] . "\r\n" Hope that helps! -TG = = = Original message = = = Ok, you are all used to working with register_gloabsl=off. mail($to, stripslashes($subject), wordwrap($message, 60), "From: $from\r\n"); I change this line to: mail($to, stripslashes($_POST["subject"]), wordwrap($_POST["message"], 60), "From: $_POST["from"]\r\n"); and I get: Parse error: parse error, unexpected '\"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /www-html/emailer/index.html on line 41 What is the problem? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Register Globals
Got it: mail($to, $_POST["subject"], wordwrap($_POST["message"], 60), "From: {$_POST["from"]}\r\n"); No more errors. But nothing comes through from smtp. I checked to be sure with phpinfo. All values exist. This worked though: mail("[EMAIL PROTECTED],[EMAIL PROTECTED]", "123", "456", "From: [EMAIL PROTECTED]"); ? Larry E. Ullman wrote: mail($to, stripslashes($_POST["subject"]), wordwrap($_POST ["message"], 60), "From: $_POST["from"]\r\n"); and I get: Parse error: parse error, unexpected '\"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /www-html/emailer/index.html on line 41 The use of $var['index'] or $var["index"] ($_POST['from'], $_GET ["to"], etc.) within double quotation marks is causing the problem. To fix this, wrap the whole construct in curly braces: mail($to, stripslashes($_POST["subject"]), wordwrap($_POST ["message"], 60), "From: {$_POST["from"]}\r\n"); You only have to do this within other quotation marks and only if the array's index is a string. Hope that helps, Larry -- John Taylor-Johnston - "If it's not Open Source, it's Murphy's Law." ' ' 'Collège de Sherbrooke: ô¿ôhttp://www.collegesherbrooke.qc.ca/languesmodernes/ - 819-569-2064 °v° Bibliography of Comparative Studies in Canadian, Québec and Foreign Literatures /(_)\ Université de Sherbrooke ^ ^ http://compcanlit.ca/ T: 819.569.2064 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PGP 5 start up issue
php 5 on windows xp with apache 2 and mysql 5. Php start up unable to load dynamic library: E:\php\ext\php_bz2.dll with error 'The specified module could not be found' same for and php_yaz.dll I have php5ts.dll in both E:\php\ and E:\php\ext I had a similar problem for php_mcrypt which was solved by installing libmcrypt.dll in E:\windows\system32 but I just cannot seem to solve the problems with these two. I tried copying versions of yaz.dll and php_yaz.dll from http://www.indexdata.dk/phpyaz but to no avail. That only screwed up php 5 because those versions seemed to be looking for php4ts.dll rather than php5ts.dll so I seemed to have got stumped. Can anyone help out? Thanks in advance david -- 40 yrs navigating and computing in blue waters. English Owner & Captain of British Registered 60' bluewater Ketch S/V Taurus. Currently in San Diego, CA. Sailing bound for Europe via Panama Canal after completing engineroom refit. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] No forums?
On Fri, 2005-11-04 at 22:09, GamblerZG wrote: > AFAIK, there are no "official" forums for PHP. Considering the fact that > PHP is a web development tool, such distaste for message boards is > ironic at the least. So why exactly there aren't any forums on php.net? > > I've monitored this list long enough to predict the most probable > replies to this message. To save everybody some time, I will ansver them > here, without waiting someone to key them in. > > Reply: There are forums on zend.com. > My Reply: zend.com != php.com. > > R: There is a web interface for this mailing list. > MR: You cant' post new messages there, and it's just another way of > showing emails anyway. > > R: There is a newsgroup interface. > MR: Yeah, I'm using it right now. But it requires special software, and > is terribly slow, unless you have very good connection and moderately > powerful PC. > > R: Forums suck, mailing lists rule. > MR: Not if you don't like receiving 200 messages + spam every day. > > R: Synchronizing mail lists and forums is very difficult and nobody will > do it. > MR: There is no need to synchronize anything. A threaded web-based email client works just like you want. Still complaining about 200+ messages?? Well a forum would get as many anyways. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Register Globals
On Thu, 03 Nov 2005 21:17:39 -0500, John Taylor-Johnston wrote: > Ok, you are all used to working with register_gloabsl=off. > > mail($to, stripslashes($subject), wordwrap($message, 60), "From: > $from\r\n"); > > I change this line to: > > mail($to, stripslashes($_POST["subject"]), wordwrap($_POST["message"], > 60), "From: $_POST["from"]\r\n"); You do realize you have an open relay. I can send in the post data: &subject=I%20Love%20Your&from=something\r\nBCC:moreaddresses&message=a_mime_encoded_virus Dont trust tainted variables, you should really fix that. Curt. -- http://news.zirzow.dyndns.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] No forums?
You missed the most important: This list works, why break it? (Apart from a personal dislike of most forum formats - they're no improvement. I can ding down a list of emails a lot more quickly than clicking in and out of forum topics.) MT At 11:09 PM 11/4/2005, GamblerZG wrote: AFAIK, there are no "official" forums for PHP. Considering the fact that PHP is a web development tool, such distaste for message boards is ironic at the least. So why exactly there aren't any forums on php.net? I've monitored this list long enough to predict the most probable replies to this message. To save everybody some time, I will ansver them here, without waiting someone to key them in. Reply: There are forums on zend.com. My Reply: zend.com != php.com. R: There is a web interface for this mailing list. MR: You cant' post new messages there, and it's just another way of showing emails anyway. R: There is a newsgroup interface. MR: Yeah, I'm using it right now. But it requires special software, and is terribly slow, unless you have very good connection and moderately powerful PC. R: Forums suck, mailing lists rule. MR: Not if you don't like receiving 200 messages + spam every day. R: Synchronizing mail lists and forums is very difficult and nobody will do it. MR: There is no need to synchronize anything. -- Best regards, Roman S.I. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Register Globals (more)
Patience please :) See my html below. Basically, if type=checkbox is checked, I'm trying to build $to string in mail(). parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING line 4 How do I rebuild this peice of code to be register_globals=off friendly? Just when I thought I was getting good. This keeps up, I'm changing back the php.ini myself. John 1>for ($i = 1; $i <= $_POST["NMax"]; $i++) 2>{ 3> $CheckVariable = "\{$_POST['Check$i']}"; 4> eval("\$CheckVariable = \"$CheckVariable\";"); 5> $nameVariable = "\{$_POST['name$i']}"; 6> eval("\$nameVariable = \"$nameVariable\";"); 7> $emailVariable = "\{$_POST['email$i']}"; 8> eval("\$emailVariable = \"$emailVariable\";"); 9> 10>#echo ${"Check$i"}; 11>#echo "$CheckVariable $emailVariable - $i"; 12> 13>if ($CheckVariable) 14>$to .= "\"$nameVariable\" <".$emailVariable.">,"; 15> 16>} 17> 18>echo $to; "John" "Alessandra" ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Unsubscribing from several PHP lists
Hi All, Does anyone know of a way to unsubscribe an email address from the PHP email lists when you can't send a reply to the confirmation email? My host for my currently subscribed email address has an issue with its SSL certificate which means that I can't send replies from that account (which has gone on for months and I've given up on waiting for it to be resolved). For this reason, I'm swapping my subscriptions over to another email account through a different host, but of course the reason why I'm subscribing from another account is also the reason why I can't reply to confirm the unsubscription from the 'broken' account. Any help appreciated. Much warmth, Murray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] No forums?
AFAIK, there are no "official" forums for PHP. Considering the fact that PHP is a web development tool, such distaste for message boards is ironic at the least. So why exactly there aren't any forums on php.net? One of the fallacies in your argument is that the lack of an official forum on php.net implies "such distaste for message boards". I don't have a big screen TV but I have anything but distaste for them! Also, you should realize that your question could be rephrased as "Why hasn't someone else done all this extra work (creating and managing a forum) because I would prefer it?" The obvious answer, which someone else has already suggested, is that maybe others (or those in charge of php.net) don't feel the need. In any case, if you are sincerely interested in either a support Web forum or a legitimate answer to your question, you may have better luck if your inquiry were more "I would appreciate it if..." or "has an official forum been considered?" and less "this system that you've been using for years sucks and this is why I'm right". All that being said, I think everyone should send me $5. I've monitored this list long enough to predict the most probable replies... Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] No forums?
GamblerZG wrote: Here's one you missed. Not to your liking? Pony up a few bucks, register a domain, get a host, and start a forum yourself. Do it nice enough, and maybe, just maybe, you can be 'official'. -- By-Tor.com ...it's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: No forums?
On Fri, 04 Nov 2005 22:09:01 -0500, GamblerZG wrote: > AFAIK, there are no "official" forums for PHP. Considering the fact that > PHP is a web development tool, such distaste for message boards is ironic > at the least. So why exactly there aren't any forums on php.net? I wonder why you use the term distaste i don't think that is why there is no mesage boards around. I believe you've answer your own question later in this email with your question: R: Synchronizing mail lists and forums is very difficult and nobody will do it. You only (incorrectly) answer the first part of the question but never address the second part. > ... > I've monitored this list long enough to predict the most probable > replies to this message. To save everybody some time, I will ansver them > here, without waiting someone to key them in. So what is the point of the sending your message? > ... > R: There is a web interface for this mailing list. > MR: You cant' post new messages there, and it's just another way of > showing emails anyway. It wasn't designed for an interface to reply to, hence the read only factor. > R: There is a newsgroup interface. > MR: Yeah, I'm using it right now. But it requires special software, and > is terribly slow, unless you have very good connection and moderately > powerful PC. Special software? Outlook, Thunderbird, mutt. yes the news server is slow. > > R: Forums suck, mailing lists rule. > MR: Not if you don't like receiving 200 messages + spam every day. The question isn't about forums sucking, i tend to belong to several mailing lists and have them all go in my proper folders or (gmail) labels. > > R: Synchronizing mail lists and forums is very difficult and nobody will > do it. > MR: There is no need to synchronize anything. I wouldn't say that it is difficult, it is a matter of anyone doing it. I'm half way at the point to enable posting via the web (see sig), but i don't think i will even go that route. At this point it sounds like you just want to get rid of the current ways of discussing topics and just use a web forum. It just comes down to it that the mailing list system isn't going to go away anytime soon nor is the news server. so someone will just have to take the time and write some sort of web forum like application. Besides, because php is a web development tool it doesn't mean that everything that php.net does has to be written in php. I hope you don't suggest to have a web only cvs interface to commit code. Curt. -- http://news.zirzow.dyndns.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] No forums?
Larry E. Ullman wrote: All that being said, I think everyone should send me $5. I've monitored this list long enough to predict the most probable replies... Bah, I've got 10 times the posts you do since 2002, just from this email address. 75% of that $5 goes to me. ;) -- By-Tor.com ...it's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] No forums?
Miles Thompson wrote: You missed the most important: This list works, why break it? Nope, I did not miss it. It's just not a proper reply to the message. I did not suggest to disable mailing lists or change them in any way, so the "break" factor does not apply. -- Best regards, Roman S.I. http://sf.net/projects/naturalgine/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] No forums?
On Sat, 2005-11-05 at 00:56, GamblerZG wrote: > Miles Thompson wrote: > > You missed the most important: This list works, why break it? > > Nope, I did not miss it. It's just not a proper reply to the message. I > did not suggest to disable mailing lists or change them in any way, so > the "break" factor does not apply. Then you suggest fragmenting the list into 3 factions, those who would continue to use the list, those who would use the forum, and those who would use both. By such a fragmentation of the list, solutions and advice would be spread across multiple locations thus diluting the efficacy of the list. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] match by relevancy
I'm using PHP Version 4.3.9 and MySQL 4.1.12. I recently upgraded from PHP 4.1.x and MySQL 4.0.x. Basically my SQL below now render empty set. It worked until my upgrade. Basically "ORDER BY relevancy DESC" no longer works, I think!? I got help building this $SQL here, so I'm hoping Sgt./Corporal what's his name, who answered my original question, is still around. Sorry to be off topic. I see no inpsiration in the relevant part of the Doc: http://dev.mysql.com/doc/refman/4.1/en/fulltext-search.html nor http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html Desperately looking for an answer. Any thoughts? SELECT *,MATCH (AU,ST,SD) AGAINST ('johnston' IN BOOLEAN MODE) AS relevancy FROM ccl.ccl_main WHERE MATCH (AU,ST,SD) AGAINST ('johnston' IN BOOLEAN MODE) ORDER BY relevancy DESC; John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] No forums?
Larry E. Ullman wrote: > One of the fallacies in your argument is that the lack of an official > forum on php.net implies "such distaste for message boards". I don't > have a big screen TV but I have anything but distaste for them! Well, let me give you a different example. I don't have a TV at all, even though I could buy one. Knowing this, would you assume that I don't like watching it? The same thing with forum. It's a usual feature, just like website is. Would you be surprised if PHP had no website? Would you ask why it doesn't? > Also, you should realize that your question could be rephrased as "Why > hasn't someone else done all this extra work (creating and managing a > forum) because I would prefer it?" Are you saying that I'm the only PHP user that might like discussing things on a forum? Again, forums are very common. Some people like them, other people like mailing lists. In case of PHP, I find the lack of forum weird, because it's a web development language. Besides, you're implying that maintaining forum is "extra work", while maintaining mailing lists isn't. Extra work for extra users you can live without, eh? > In any case, if you are sincerely interested in either a support Web > forum or a legitimate answer to your question, you may have better luck > if your inquiry were more "I would appreciate it if..." or "has an > official forum been considered?" and less "this system that you've been > using for years sucks and this is why I'm right". I do not see anything horrible in my message. It's not like I'm _demanding_ something, or suggesting to tear down mailing lists. Neither did I suggest that mailing lists suck. In case of php.internals they totally make sense. But I _do_ think that forum efficient in case of high-volume messaging. -- Best regards, Roman S.I. http://sf.net/projects/naturalgine/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] No forums?
Robert Cummings wrote: > On Sat, 2005-11-05 at 00:56, GamblerZG wrote: > >>Miles Thompson wrote: >> >>>You missed the most important: This list works, why break it? >> >>Nope, I did not miss it. It's just not a proper reply to the message. I >>did not suggest to disable mailing lists or change them in any way, so >>the "break" factor does not apply. > > > Then you suggest fragmenting the list into 3 factions, those who would > continue to use the list, those who would use the forum, and those who > would use both. By such a fragmentation of the list, solutions and > advice would be spread across multiple locations thus diluting the > efficacy of the list. I seriously doubt that giving people a choice over communication methods would reduce efficiency. It's like saying that having multiple OSes reduces efficiency of programming. -- Best regards, Roman S.I. http://sf.net/projects/naturalgine/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] No forums?
PS: Sorry for missing verbs and articles in my last message. I have a good excuse: it't 2:22 AM here. *smilie* -- Best regards, Roman S.I. http://sf.net/projects/naturalgine/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] No forums?
On Sat, 2005-11-05 at 02:17, GamblerZG wrote: > Robert Cummings wrote: > > On Sat, 2005-11-05 at 00:56, GamblerZG wrote: > > > >>Miles Thompson wrote: > >> > >>>You missed the most important: This list works, why break it? > >> > >>Nope, I did not miss it. It's just not a proper reply to the message. I > >>did not suggest to disable mailing lists or change them in any way, so > >>the "break" factor does not apply. > > > > > > Then you suggest fragmenting the list into 3 factions, those who would > > continue to use the list, those who would use the forum, and those who > > would use both. By such a fragmentation of the list, solutions and > > advice would be spread across multiple locations thus diluting the > > efficacy of the list. > > I seriously doubt that giving people a choice over communication methods > would reduce efficiency. It's like saying that having multiple OSes > reduces efficiency of programming. I didn't use the word efficiency, I used the word efficacy (feel free to look it up). Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: match by relevancy
John Taylor-Johnston wrote: I'm using PHP Version 4.3.9 and MySQL 4.1.12. I recently upgraded from PHP 4.1.x and MySQL 4.0.x. Basically my SQL below now render empty set. It worked until my upgrade. Basically "ORDER BY relevancy DESC" no longer works, I think!? I got help building this $SQL here, so I'm hoping Sgt./Corporal what's his name, who answered my original question, is still around. Sorry to be off topic. I see no inpsiration in the relevant part of the Doc: http://dev.mysql.com/doc/refman/4.1/en/fulltext-search.html nor http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html Desperately looking for an answer. Any thoughts? SELECT *,MATCH (AU,ST,SD) AGAINST ('johnston' IN BOOLEAN MODE) AS relevancy FROM ccl.ccl_main WHERE MATCH (AU,ST,SD) AGAINST ('johnston' IN BOOLEAN MODE) ORDER BY relevancy DESC; John Hm... You're using literal string 'johnston' for matching. Shouldn't quotes be replaced with backticks (`)? -- Best regards, Roman S.I. http://sf.net/projects/naturalgine/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] No forums?
Robert Cummings wrote: On Sat, 2005-11-05 at 02:17, GamblerZG wrote: Robert Cummings wrote: > On Sat, 2005-11-05 at 00:56, GamblerZG wrote: > >>Miles Thompson wrote: >> >>>You missed the most important: This list works, why break it? >> >>Nope, I did not miss it. It's just not a proper reply to the message. I >>did not suggest to disable mailing lists or change them in any way, so >>the "break" factor does not apply. > > > Then you suggest fragmenting the list into 3 factions, those who would > continue to use the list, those who would use the forum, and those who > would use both. By such a fragmentation of the list, solutions and > advice would be spread across multiple locations thus diluting the > efficacy of the list. I seriously doubt that giving people a choice over communication methods would reduce efficiency. It's like saying that having multiple OSes reduces efficiency of programming. I didn't use the word efficiency, I used the word efficacy (feel free to look it up). Cheers, Rob. They're synonyms, and I do not see a big difference in their meanings. Feel free to disambiguate. -- Best regards, Roman S.I. http://sf.net/projects/naturalgine/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dependable combo boxes with mysql database
Hello, Thanks for the reply. But I do not know how to integrate javascript with php and mysql. I mean javascript can be written using code and fetching data from mysql is using $query,$result and $mysql_fetch_array. I am confused how to integrate this in php page. If anybody can help on this i will highly appreciate it, otherwise if this is not the proper question for this list then i have to go for other options. Thanks and regards, Bhoomi --- "Pranav Negandhi (concept-I)" <[EMAIL PROTECTED]> wrote: > This might be slightly OT on this list, but here > goes nothing. > > 1. Submit the form when the user shifts focus from > D1 using Javascript's > onBlur event > 2. On the server side, use PHP to retrieve the > values for D2 and > generate the page again > 3. Repeat 1 & 2 when the value of D2 changes. > > HTH > Pranav > www.concept-i.co.in > > > Bhoomi Vora wrote: > > Hello All, > > > > I have a php page which contains three combo > boxes. > > The first one will have the value > > > > from the mysql database table on page load itself. > > > > Then depending upon the value selected in the > first > > combobox the second combo box > > > > should be populated with the respective values > from > > another mysql database table, and > > > > once again depending upon the value selected in > second > > combobox the third combobox > > > > should be populated with the respective values > from > > one more different database table. > > > > I have read through mailing list and also searched > in > > google and found that it can be > > > > done with javascript onblur function but nothing > is > > working. Here is the code: > .d similarly > > D3 should be populated on event like 'onblur' to > D2. > > > > Pl. give me the exact code or proper guideline how > > should I accomplish this on the same page. > > > > Appreciate your replies. > > > > Thanks and regards. > > > > BJV > > > > > > > > __ > > Yahoo! FareChase: Search multiple travel sites in > one click. > > http://farechase.yahoo.com > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > __ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] No forums?
On Sat, 2005-11-05 at 02:37, GamblerZG wrote: > Robert Cummings wrote: > > > > I didn't use the word efficiency, I used the word efficacy (feel free to > > look it up). > > They're synonyms, and I do not see a big difference in their meanings. > Feel free to disambiguate. Efficiency is about output versus input. Efficacy is about the ability to produce an effect regardless of input. While there is obviously a degree of overlap in their meaning, and while they can be considered synonyms due to that overlap, they are not the same. Just as gargantuan and large are synonyms, they are hardly the same thing in context. As any English teacher will tell you, rampantly replacing words in an essay with synonyms will quickly devolve the meaning into drivel. So now that I've cleared that up, the point I was making in a lot less words, is that by splitting the list into multiple places, one could expect less solutions to be in either place, and while the sum of the parts will probably be equal to the whole, the information would be dispersed and diluted thus reducing the effectiveness (not efficiency though I'm sure that would be reduced also) of both locations. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php