Re: [PHP] POLL: To add the final ?> or not...

2010-01-11 Thread Olav
Paul M Foster wrote: > I leave it off. I don't want to have to worry about which editor I'm > using or whether I accidentally left some whitespace where it shouldn't > be. I also use different editors in different situations, both terminal based and GUI. For instance I find Midnight Commander's

[PHP] Re: Can I get the IP address from a visitor?

2009-12-01 Thread Olav
Lars Kristiansson wrote: [..] > My goal is to create purchase-orders written on unique files, and to > separate them my idea was to baptize files with the IP addresses, which > would ive each visitor an unique purchase-order... > > Any hints to a newbie? Yes. Do NOT use IP adresses as identifie

Re: [PHP] Wiki recommendation?

2009-11-26 Thread Olav
Jonathan Tapicer wrote: > I also recommend dokuwiki (with a k, not c :) ): > http://www.dokuwiki.org/ I will add just my 2 cts to that. I have used several wikis but I always come back to DokuWiki. Among other things that I like about it, like plugins, is the fact that it is file based. It can

Re: [PHP] dbase_get_record_with_names; Very slow search!!!

2009-11-24 Thread Olav
Rahul S. Johari wrote: > Quite right. > > Unfortunately there doesn't seem to be any available ODBC Drivers for > FoxPro available for Mac OS X either!! I'm hitting a brick wall no > matter what direction I take. Convert to SQLite and don't look back ;) Unless your DBF files are still in use in

Re: [PHP] dbase_get_record_with_names; Very slow search!!!

2009-11-24 Thread Olav
Ashley Sheridan wrote: > I would assume that any indexes created on any tables would be > referenced automatically by the dbms and wouldn't need to be explicitly > referenced from within PHP. This is dBase (.dbf) he is asking about. There is no such thing as a DBMS in dBase. The program / driver

[PHP] crc check for JPEG file exists

2008-02-26 Thread Olav Mørkrid
hello is crc32() an acceptable way of managing whether a JPEG file exists (in a database or similar collection)? i mean doing a crc32() on the binary data of the JPEG file, and then check the database if there is already another entry with the same CRC. the database has relatively few images (so

Re: [PHP] utf-8 in $_POST

2008-01-16 Thread Olav Mørkrid
1/2008, Per Jessen <[EMAIL PROTECTED]> wrote: > Olav Mørkrid wrote: > > > i specify iso-8859-1 in both header and body: > > > > > accept-charset="iso-8859-1"> > > Have you checked 1) what the webserver sends in the header and 2) what > the br

Re: [PHP] utf-8 in $_POST

2008-01-07 Thread Olav Mørkrid
i specify iso-8859-1 in both header and body: if two different people post the norwegian phrase "Godt nytt år" (happy new year), it may appear in the following variations: [CONTENT_TYPE] => application/x-www-form-urlencoded;charset=iso-8859-1 $_POST["input"] = "Godt nytt år" [CONTENT_TYPE] =>

[PHP] utf-8 in $_POST

2008-01-07 Thread Olav Mørkrid
hello does php have any built-in functions to convert post data from whatever format it arrives in to whatever format i wish? example: i use iso-8859-1 internally, and even specify accept-charset=iso-8859-1 in my html, but some browsers (phones) send utf-8 anyway. do i have to manually check if

Re: [PHP] Re: how do i get a printout of original multipart post data

2007-12-01 Thread Olav Mørkrid
thanks, but that won't work. i need to see post data from other people out there, not my own data. still a mystery to me why php doesn't let developers see incoming raw data. On 01/12/2007, Dan <[EMAIL PROTECTED]> wrote: > ""Olav Mørkrid"" <[EMAIL

Re: [PHP] how do i get a printout of original multipart post data

2007-11-28 Thread Olav Mørkrid
what is the thought behind php not providing access to original post data? this removes any chance of analyzing corrupt upload data, which is often the case with mobile browsers. can future versions of php please include a way of viewing raw server requests in full? On 26/11/2007, [EMAIL PROTECTED

[PHP] partial upload & no file errors

2007-11-28 Thread Olav Mørkrid
hello under what EXACT circumstances does UPLOAD_ERR_PARTIAL and UPLOAD_ERR_NO_FILE occur? ...NO_FILE, does it happen ONLY if the user submits a form without choose a file to upload, or can this one also cover corrupt file data that php could not parse? ...PARTIAL, does it happen if the user pre

[PHP] how do i get a printout of original multipart post data

2007-11-26 Thread Olav Mørkrid
hello how can i get a raw and untouched printout of a multipart/form-data POST? i need this to analyze what certain user agents do wrong when uploading files. what happens is that php just fails to put files into $_FILES, and gives no way of seeing the original posting and exactly what is wrong

Re: [PHP] what is my dns ip address

2007-09-03 Thread Olav Mørkrid
yeah but i assume this assumes you are on a unix machine and have administrator rights. it would be nice to be able to look up ip addresses swiftly and automatically on any machine and any operating system running php. On 03/09/07, Per Jessen <[EMAIL PROTECTED]> wrote: > Olav Mørk

Re: [PHP] what is my dns ip address

2007-09-02 Thread Olav Mørkrid
the source of the problem is gethostbyaddr(). it seems to have a 4,5 second timeout, so some lookups time out after 4,5 seconds, while most of them are resolved in < 0.1 second; a radically performance difference. the user written gethostbyaddr_timeout() on the gethostbyaddr man page overcomes thi

[PHP] what is my dns ip address

2007-09-01 Thread Olav Mørkrid
is there a function in php that will return the ip address of the dns server on the system? eg. $dns_ip = get_dns_ip_address(); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: isset($a->b) even if $a->b = null

2007-08-17 Thread Olav Mørkrid
/us.php.net/manual/en/function.property-exists.php > > class a { > var $b; > } > > if (property_exists('a','b')) { > print "yes\n"; > } > > > On 8/17/07, Olav Mørkrid <[EMAIL PROTECTED]> wrote: > > the test i need should

Re: [PHP] Re: isset($a->b) even if $a->b = null

2007-08-17 Thread Olav Mørkrid
the solution has been found. array_key_exists() can actually be used on objects, and yields the correct result. http://no.php.net/array_key_exists thanks to dordea cosmin for pointing this out. On 17/08/07, Olav Mørkrid <[EMAIL PROTECTED]> wrote: > the test i need should give the

Re: [PHP] Re: isset($a->b) even if $a->b = null

2007-08-17 Thread Olav Mørkrid
e else? On 17/08/07, Colin Guthrie <[EMAIL PROTECTED]> wrote: > Olav Mørkrid wrote: > > how do i test if a property of a stdclass object is set, even if its > > value is null, similar to how array_key_exists() works for arrays. > > > > the following method f

[PHP] isset($a->b) even if $a->b = null

2007-08-17 Thread Olav Mørkrid
how do i test if a property of a stdclass object is set, even if its value is null, similar to how array_key_exists() works for arrays. the following method fails: $a->b = null; if(isset($a->b)) echo "yes"; and property_exists() seems only to work for defined objects. hope someone can h

Re: [PHP] double output from trigger_error from command line

2007-07-18 Thread Olav Mørkrid
sorry. still get it twice. c:\>php -r "error_reporting(E_ALL ^ E_NOTICE); trigger_error(\"hello\", E_USER_ERROR);" PHP Fatal error: hello in Command line code on line 1 Fatal error: hello in Command line code on line 1 - if i do error_reporting(0) then i get NO lines at all. and if i do error_r

Re: [PHP] repetition of tedious references

2007-07-18 Thread Olav Mørkrid
i didn't know about empty. thanks! do you have a link to this new php 6 ? : convention? it would be great if php 6 could have a solution for this. php is sweet when it's compact! On 18/07/07, Arpad Ray <[EMAIL PROTECTED]> wrote: You can use empty() to take one of them out, since "0" is presum

Re: [PHP] repetition of tedious references

2007-07-18 Thread Olav Mørkrid
rob, yes i thought of this, you could possible even do function magic($array, $name, $default=null ) { return isset($array[$name]) && $array[$name] ? $array[$name] : $default; } $string = magic($_SERVER, "HTTP_ACCEPT_LANGUAGE", "*") however i wish php would have some built-in support to solve

Re: [PHP] repetition of tedious references

2007-07-18 Thread Olav Mørkrid
if the string is not set, you will get an "undefined index" error when calling isused(). that's just the problem. you can't reference an unset string without doing isset first, so putting isset inside the function is simply too late. On 18/07/07, C.R.Vegelin <[EMAIL PROT

[PHP] repetition of tedious references

2007-07-18 Thread Olav Mørkrid
consider the following statement: $language = isset($_SERVER["HTTP_ACCEPT_LANGUAGE"]) && $_SERVER["HTTP_ACCEPT_LANGUAGE"] != "" ? $_SERVER["HTTP_ACCEPT_LANGUAGE"] : "*"; when using strings in arrays that may be non-existing or empty, you have to repeat the reference *three* times, which gets ex

[PHP] double output from trigger_error from command line

2007-07-17 Thread Olav Mørkrid
if i do a trigger_error() when running php scripts from the command line, each error is echoed twice. this is annoying. does anyone know how to make each error display only once? c:\>php -r "trigger_error(\"hello\");" PHP Notice: hello in Command line code on line 1 Notice: hello in Command li

Re: [PHP] getting the "next" element of an associative array

2007-07-12 Thread Olav Mørkrid
yep, a for loop is the fallback i use now. any reason why there isn't a built-in function for this? any plans for it in future versions of php? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] getting the "next" element of an associative array

2007-07-12 Thread Olav Mørkrid
like: array_set_internal_pointer($array, $index); On 12/07/07, Chris <[EMAIL PROTECTED]> wrote: Olav Mørkrid wrote: > let's say we have the following associative array: > > $array = array( > "red" => "ferrari", > "yellow" => "volk

[PHP] getting the "next" element of an associative array

2007-07-11 Thread Olav Mørkrid
let's say we have the following associative array: $array = array( "red" => "ferrari", "yellow" => "volkswagen", "green" => "mercedes", "blue" => "volvo" ); then we have a current index into the array: $index = "yellow"; $current = $array[$index]; now: how do i get the key of the next arra

Re: [PHP] duration of mp3 file

2007-07-11 Thread Olav Mørkrid
http://arrozcru.no-ip.org/ffmpeg_builds/ On 11/07/07, Andrei <[EMAIL PROTECTED]> wrote: Or you could use ffmpeg executable to get details about the media file. You will have to parse the response of the executable. The only thing is that you must have exec function or an execution function avai

Re: [PHP] getting timestamp for first day of current week

2007-07-07 Thread Olav Mørkrid
uot;Y-m-d"); // if today if monday, just give today's date else $from = date("Y-m-d", strtotime("last monday")); // when asking on tuesday thru sunday it would be nice if strtotime understood the form "monday this week". On 04/07/07, Robert Cummings <[EMA

Re: [PHP] getting timestamp for first day of current week

2007-07-04 Thread Olav Mørkrid
On 03/07/07, Robert Cummings <[EMAIL PROTECTED]> wrote: If that's ALWAYS the case then it sounds like you have all the information you need to get the Monday you want :) what do you mean? php clearly makes a mistake in giving monday of the current week. -- PHP General Mailing List (http://ww

[PHP] getting timestamp for first day of current week

2007-07-03 Thread Olav Mørkrid
hello how do i get the TIMESTAMP for the FIRST DAY of the CURRENT WEEK (ie. monday 00:00:00)? i tried using strtotime("monday"), but: - when i use it on a monday, i get monday THIS WEEK - when i use it on tuesday thru sunday, i get monday NEXT WEEK i tried "last monday", "monday this week", "t

[PHP] Header Location redirection parameters fail to redirect

2005-05-10 Thread Olav Drageset
as far as I know the parameters should be redirected??!!) Thanks Olav -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Header location, redirection loses parameters,

2005-05-09 Thread Olav Draageset
I have several URLs that I want to point to the same site with a different parameter. I try to do this by redirecting all to the same location, by http://mysite.com/index.php?var1=value1&var2=value2";); exit; ?> The redirection is done properly, but variables are not sent. Can anyone say what

[PHP] Content Management System in php

2002-06-18 Thread Olav Bringedal
gn/theme that fits a strict and "ready-set" design. -Ability to incorporate existing web-modules/pages/sites I would very much like to hear your thoughts of this... Olav Bringedal jaggu.org __ Do You Yahoo!? Everything you'll ever

Re: [PHP] PhP 4.2.1 (and various)

2002-05-15 Thread Olav Bringedal
--- Analysis & Solutions <[EMAIL PROTECTED]> wrote: > Olav: > Perhaps because you're ignoring what I said. > This will generate an error message if there's no > player variable in the > request string and you have error reporting set high > enough.

Re: [PHP] PhP 4.2.1 (and various)

2002-05-15 Thread Olav Bringedal
--- Analysis & Solutions <[EMAIL PROTECTED]> wrote: > Olav: > > On Wed, May 15, 2002 at 11:53:06AM +0100, Olav > Bringedal wrote: > > > $user=$Session["user"]; > > > > if(!$Authorized) > > { > > header ("Location: http

Re: [PHP] Newbie - Spot the error

2002-05-15 Thread Olav Bringedal
echo "after:".$timespread[22]."" ; } else { echo "time is not 21" ; } Then you can at least establish where things go wrong. = Olav Bringedal jaggu.org __ Do You Yahoo!? Everything you'll

Re: [PHP] PhP 4.2.1 (and various)

2002-05-15 Thread Olav Bringedal
r ("Location: http://jaggu.org";); } To actually get the redirect. On http://jaggu.org/info.php, you can see that display_errors = off In any case, I think you are onto something. I will try to narrow down logging, to see if that might be the problem. Thanks for helping! Olav Bringedal

[PHP] More 4.2.1 (Note to myself:think before pressing send!)

2002-05-14 Thread Olav Bringedal
//jaggu.org/info.php I tried to search both my config files and via google for freetype.dll, but could not find anything of slightest enlightenment. Thanks in advance! Olav Bringedal Jaggu.org = Raistlin M041999031 __ Do You Yahoo!? Everything

[PHP] PhP 4.2.1 (and various)

2002-05-14 Thread Olav Bringedal
o use. So my question is, why has that changed, and what do we do now to authenticate users and redirect them to anothe page? And what the hell is this "@" thingy, i cant see to find anything on it in the manual, and search doesnt work for chars like that. I hope you guys can clarify this

[PHP] Time calculation after UNIX

2002-01-16 Thread Olav Drageset
Hi I have a database that is supposed to last more than 30 years Could someone advice me how to calculate (add and subtract) time in a maner that willl be correct after 2030 when Unix Time stop working? ragards [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To uns

[PHP] query works in mysql, but not from php

2001-11-19 Thread Olav Drageset
1 Issuing the command SELECT user FROM persons WHERE user = 'fred' AND domain = 'company.net' ; in mysql give a proper result. Can anyone explain what might be causing the error??? regards Olav -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mai

[PHP] How to get mysql-result into a php variable

2001-11-17 Thread Olav Drageset
IF ($result > 0) {return 'match' ;} ELSE {return 'nomatch';} } I get error message that funcion mysql_stor_result() is not defined How shall I use thees two funcions? Thank you Olav -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAI

[PHP] Transfer variable to next web-page

2001-11-17 Thread Olav Drageset
hat should be done Neither books, php-manual nor HTML-specification does tel me. Olav -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]

[PHP] bscub() under tru64 UNIX (64bit)

2001-05-18 Thread Olav Hjertaker
I get : "Fatal error: Call to undefined function: bcsub() in .." when using bcsub(). Could there be a problem running PHP on a 64-bit system? Cheers, Olav -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-ma