[PHP] Re: [PHP-DEV] Re: [PHP] RFE: $HTTP_POST_VARS = $_POST;

2002-01-24 Thread Lars Torben Wilson
On Thu, 2002-01-24 at 13:42, Rasmus Lerdorf wrote: I think the real answer here is to treat these as read-only arrays. ie. never use them on the left side of the '=' and you will never run into problems. Or if you do, be consistent and use the same array all the time. You are writing your

Re: [PHP] Feature requests for PHP development - where to post them?

2002-01-29 Thread Lars Torben Wilson
On Tue, 2002-01-29 at 06:53, Stefan Rusterholz wrote: Is there a place especially meant to make feature-requests to the php-development team? TIA stefan rusterholz http://bugs.php.net Select 'Feature/Change Request' as the bug type. Cheers, Torben -- Torben Wilson [EMAIL PROTECTED]

RE: [PHP] Swapping BR for \n... ?

2002-01-29 Thread Lars Torben Wilson
On Tue, 2002-01-29 at 20:19, Douglas Maclaine-cross wrote: Or an even simpler str_replace(\n, BR, $sourcestring); Which will also be much faster than the ereg_replace(), to boot. Cheers, Torben -Original Message- From: Jason Murray [mailto:[EMAIL PROTECTED]] Sent: Wednesday,

Re: [PHP] Could somebody PLEASE explain this one to me

2002-01-29 Thread Lars Torben Wilson
On Tue, 2002-01-29 at 07:25, Aric Caley wrote: Why, oh WHY doesnt this work. No panic, it's just a typo. :) I get the error: Fatal error: Call to a member function on a non-object in c:\home\digerati\www\classtest.php3 on line 23 If I try to make any assignments, anywhere, it

Re: [PHP] Function call stack

2002-01-30 Thread Lars Torben Wilson
On Wed, 2002-01-30 at 03:33, Christian Novak wrote: Has anyone an idea on how to get information from PHP on the function call stack. I need the line number and file calling a function for a custom error handler. This cannot be done in current versions of PHP. There are feature requests in

Re: [PHP] Re: Ereg/replace/i/ or something ??

2002-01-30 Thread Lars Torben Wilson
On Wed, 2002-01-30 at 08:16, liljim wrote: Hi Bart, I want to check the data from a form-field if it excists only of digits (0-9) and nothing else. How do I use the ereg()-function for this? Well, I prefer the preg_functions if (!preg_match(/^[0-9]{10}$/, $string)) { // contains

Re: [PHP] .

2002-01-30 Thread Lars Torben Wilson
On Wed, 2002-01-30 at 19:10, jtjohnston wrote: . ? -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: [PHP] variable function call (Re: [PHP] unset a function?)

2002-01-31 Thread Lars Torben Wilson
On Thu, 2002-01-31 at 02:55, Bas Jobsen wrote: Hello, Thanks all. I will rename the second function. Now if have: if($wat==naam)$temp=make_naam($this); else if($wat==anderenaam)$temp=make_anderenaam($this); //etc.. But i would prefer something like $temp=make_$wat($this); How

Re: [PHP] where is PHP_SELF?

2002-01-31 Thread Lars Torben Wilson
On Thu, 2002-01-31 at 14:57, Erik Price wrote: I have a file called index.php. This file includes another file, foot.inc. In the file foot.inc, amidst much HTML code, I have a simple line: ?php echo p$PHP_SELF/p ; ? The expected result is that pindex.php/p will appear in my web

Re: [PHP] suppressing division by zero errors

2002-01-31 Thread Lars Torben Wilson
On Thu, 2002-01-31 at 15:00, Martin Towell wrote: Is there a way to suppress division by zero errors? echo 5/0; // this give a warning - obviously!! @echo 5/0; // this gives a parse error echo @5/0; // this still comes up with a warning unless I turn error_reporting off before and

RE: [PHP] suppressing division by zero errors

2002-01-31 Thread Lars Torben Wilson
On Thu, 2002-01-31 at 15:26, Martin Towell wrote: I was thinking of writing a _very simple_ graphing program - enter an expression and php will generate an image with the graph on it, I didn't want to spend too much time parsing the expression up and seeing if there's a division or anything

Re: [PHP] suppressing division by zero errors

2002-01-31 Thread Lars Torben Wilson
On Thu, 2002-01-31 at 15:16, Christopher William Wesley wrote: You really need to do some error checking on the denominator. $num = 5; $den = 0; echo $den != 0 ? $num/$den : 0; A number divided by zero isn't defined, so you have to circumvent the situation by making sure it never

Re: [PHP] Re: Anyone Up?

2002-02-01 Thread Lars Torben Wilson
On Fri, 2002-02-01 at 01:20, hugh danaher wrote: Not familiar with anything but php and html. I know that in a type=text (obviously not a checkbox) if you don't use the escape backslashes, the value written into the box is 'Your' without the 'Name #' I am told this is because the browser

Re: [PHP] Anyone Up?

2002-02-01 Thread Lars Torben Wilson
On Thu, 2002-01-31 at 23:37, jtjohnston wrote: Niklas, Bingo. I wondered if it was somehting like that? Same thing in JS more or less. Thanks, John eval() will work here, but it's overkill--it's a very expensive operation. You should avoid it whenever you can. A better way is to put

Re: [PHP] Re: Anyone Up?

2002-02-01 Thread Lars Torben Wilson
On Fri, 2002-02-01 at 01:33, Brian Clark wrote: * hugh danaher ([EMAIL PROTECTED]) [Feb 01. 2002 04:21]: Not familiar with anything but php and html. XHTML isn't too different. There are different `rules' -- like tags and attributes must be lower case, values must be surrounded by

Re: [PHP] Connect() function

2002-02-01 Thread Lars Torben Wilson
On Fri, 2002-02-01 at 02:46, Jean-Arthur Silve wrote: Hi ! I m using PHP 4.0.5 and I try to create a function called connect : function connect() { ... } My problem is I get this : Fatal error: Cannot redeclare connect() in /opt2/htdocs/www.mydomain.com/html/connexion.php on

Re: [PHP] Re: Anyone Up?

2002-02-01 Thread Lars Torben Wilson
On Fri, 2002-02-01 at 10:48, Erik Price wrote: On Friday, February 1, 2002, at 05:07 AM, Lars Torben Wilson wrote: Everything is correct 'cept the 'double quotes' bit--XML accepts attribute values enclosed in either single or double quotes. Yes, and to extend on that: you need

Re: [PHP] Need eregi() help

2002-02-01 Thread Lars Torben Wilson
On Fri, 2002-02-01 at 13:28, Robby wrote: I am using this code below but it does not work (php in installed and working proplely): You should provide a bit more information than it's not working. It helps immensely to know exactly *how* it isn't working. That said, here's what sprang

Re: [PHP] Re: Anyone Up?

2002-02-01 Thread Lars Torben Wilson
On Fri, 2002-02-01 at 13:54, Erik Price wrote: Hm... I don't know why I thought otherwise. I checked with the spec (http://www.w3.org/TR/xhtml1/#h-4.4), and it really doesn't say yes or no to this. But I'm sure you're right, since some attributes contain quoted content, which is why you

Re: [PHP] file validation

2002-02-01 Thread Lars Torben Wilson
On Fri, 2002-02-01 at 14:02, toni baker wrote: I would like to prevent users from uploading a file that contains more than 4 pipes or less than 2 pipes. The code below prevents users from uploading a file containing more than 4 pipes, but not less than 2 pipes. Should I use awk, ereg, or

Re: [PHP] A weird problem / bug with concatenation operator in aclass

2002-02-01 Thread Lars Torben Wilson
On Fri, 2002-02-01 at 14:27, Administrator wrote: Yesterday I presented this problem to a local usergroup... // the following lines are contained in a class // although I am echoing the value of $age from within the class // this is only for testing during development. // $age will be

Re: [PHP] Re: Sending an e-mail to 1,000 people

2002-02-02 Thread Lars Torben Wilson
On Sat, 2002-02-02 at 13:46, Lars Wilhelmsen wrote: Ben Clumeck [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I would like to send an e-mail (the same e-mail) to 1,000 different people. I want each persons name to be in the To: field. Is there a way to

Re: [PHP] file validation

2002-02-03 Thread Lars Torben Wilson
a matter of opinion. In general, I've found while() to be 10-20% faster than foreach(), and the only reason foreach() makes any sense to me is because I've got a perl background. The style issue could be argued for days--go with what works for you. Torben Mike Frazer Lars Torben Wilson

Re: [PHP] file validation

2002-02-03 Thread Lars Torben Wilson
On Sun, 2002-02-03 at 12:12, Mike Frazer wrote: Your reply piqued my curiosity so I whipped together a script that times the execution of a foreach(), a while() and a for() loop executing the same commands. The results were rather surprising in some ways but not really overall. The

Re: [PHP] PHP's include_path

2002-02-04 Thread Lars Torben Wilson
On Mon, 2002-02-04 at 01:43, Neil Freeman wrote: Hi there, Am I correct in thinking that you can specify the PHP include_path line within an Apache .htaccess file? If so does anyone know the correct syntax of doing this? Something along the lines of: IfModule mod_php4.c AddType

RE: [PHP] ereg_replace help

2002-02-04 Thread Lars Torben Wilson
On Sun, 2002-02-03 at 21:34, Martin Towell wrote: is that a direct copy from your code? - if it is, there's two errors 1. you have a comma just before the closing backet 2. the function is : implode(string glue, array pieces) so that would be : $content = implode(\n, $lines); ie. the

Re: [PHP] Why does heredoc fail in this instance?

2002-02-04 Thread Lars Torben Wilson
On Mon, 2002-02-04 at 10:32, Peter J. Schoenster wrote: Hi If I use $snippet = ; and escape the quotes in the block then it works. But if I use it as is below, it fails with no useful error message. Why? Thanks, Peter This function cut-and-pasted? If so, then you may have fallen

RE: [PHP] trouble passing variables through a URL

2002-02-04 Thread Lars Torben Wilson
On Mon, 2002-02-04 at 11:49, James Hallam wrote: (try again - Sorry for the double) my config: PHP 4.1.1/NT/iPlanet 6.1 This is the URL in its A tag: A HREF=test_mediacoverage.php?locale=en_nasec=newssubsec=medianame=infowee k1Media Coverage Test Page/A Those variables are

Re: [PHP] file validation

2002-02-04 Thread Lars Torben Wilson
On Sun, 2002-02-03 at 14:06, Lars Torben Wilson wrote: On Sun, 2002-02-03 at 12:12, Mike Frazer wrote: Your reply piqued my curiosity so I whipped together a script that times the execution of a foreach(), a while() and a for() loop executing the same commands. The results were rather

Re: [PHP] Re: General question...

2002-02-04 Thread Lars Torben Wilson
On Mon, 2002-02-04 at 13:52, Philip Hallstrom wrote: Something along the lines of: if( ereg(/confirm.php, $_SERVER['HTTP_REFERER']) ) { Header(Location: thanks.php); exit; }else { Header(Location: index.php); exit; } You might want to do some additional

Re: [PHP] strtotime problem

2002-02-04 Thread Lars Torben Wilson
On Mon, 2002-02-04 at 13:40, toni baker wrote: $date1 = 10/12/2002; $date1 = date(D M j Y, strtotime($date1)); $date2 = date(D M j Y); $date3 = date(D M j Y, $date1); print $date1.br; print $date2.br; print $date3.br; The code above gives me the following output: Fri Oct 11 2002

Re: [PHP] strtotime problem

2002-02-04 Thread Lars Torben Wilson
On Tue, 2002-02-05 at 14:11, DL Neil wrote: toni, $date1 = 10/12/2002; $date1 = date(D M j Y, strtotime($date1)); $date2 = date(D M j Y); $date3 = date(D M j Y, $date1); print $date1.br; print $date2.br; print $date3.br; The code above gives me the following output:

Re: [PHP] uksort wisdom

2002-02-04 Thread Lars Torben Wilson
On Mon, 2002-02-04 at 20:52, Sondra Russell wrote: Hi Guys! I'm looking to get a *deeper understanding* of uksort. My quandry: $array[listing1][name] = listing 1; $array[listing1][premiere] = ; $array[listing2][name] = listing 2; $array[listing2][premiere] = ; $array[listing3][name] =

Re: [PHP] strtotime problem

2002-02-04 Thread Lars Torben Wilson
On Mon, 2002-02-04 at 15:05, DL Neil wrote: Torben, No offense, but in TFM (which you have of course R), follow the 'Date Input Formats' link to: http://www.gnu.org/manual/tar-1.12/html_chapter/tar_7.html You will find this sentence: The construct 'month/day/year', popular

Re: [PHP] breaking out of two loops

2002-02-04 Thread Lars Torben Wilson
On Mon, 2002-02-04 at 15:54, Erik Price wrote: Short and sweet: If I have an if statement inside a switch statement, how can I break out of both blocks that I am in? Will one break end everything? Or should I use one for each level deep that I am? Erik From the manual: break

Re: [PHP] Grabing Meta Tag information.

2002-02-04 Thread Lars Torben Wilson
On Mon, 2002-02-04 at 19:21, Philip J. Newman wrote: Is someone able to point me into the right direction. I have a disire to make a database of hyperlinks. At the moment the process is, some what slow, as I have to input all the data by hand. I would like some way that I can just put the

Re: [PHP] Templating

2002-02-04 Thread Lars Torben Wilson
On Mon, 2002-02-04 at 18:20, Trent Gillespie wrote: I have a template file that I would like to add the content to no write over it. I want the string $content to be added to my template instead of writing over it. Here is my current script $tutorial = template.php; $fp =

Re: [PHP] Reading log files.

2002-02-04 Thread Lars Torben Wilson
On Mon, 2002-02-04 at 19:22, Jared wrote: I am creating a script that reads Radius log files and prints them to the browser. I want the User to be able to specify the Number of lines they want to see beginning at the end of the file and going up instead of reading the lines at the beginning

Re: [PHP] PHP script for command line

2002-02-05 Thread Lars Torben Wilson
On Tue, 2002-02-05 at 00:36, Alex Shi wrote: I am now trying to use php script from command line. Everything is Ok except only one thing: it will always send out header msg. How can stop it from sending header? Alex Shi There are full instructions in the manual. Essentially, you are

Re: [PHP] whic OS is under?

2002-02-05 Thread Lars Torben Wilson
On Mon, 2002-02-04 at 05:45, Ivo Stoykov wrote: Hi group: Is there a way to guess which OS the script is running? I couldn't find anything in the manual about this. Thank you Ivo The constant PHP_OS will tell you. For a list of all currently defined constants, try

Re: [PHP] MySQL selecting the maximum value from a column

2002-02-05 Thread Lars Torben Wilson
On Tue, 2002-02-05 at 15:12, Melanie Gann wrote: Thank you all you listeners out there. I'll try to be respectful of your time and patience, and apoligize in advance for my greeness - I am 2 weeks into PHP/MySQL. I am trying to select the higest value from the column Thought_Num below. But

Re: [PHP] Dynamic Dropdown menu question.

2002-02-05 Thread Lars Torben Wilson
On Tue, 2002-02-05 at 16:23, Michael O'Neal wrote: Hi. I'm working on an edit page where the pull down menu is populated from a database. I can't figure out how to print selected when that particular record is the one associated with the current ID. Can anyone help? Here's my current

Re: [PHP] Convert 24hr to 12hr

2002-02-05 Thread Lars Torben Wilson
On Tue, 2002-02-05 at 18:44, Gary wrote: Hello All, Can someone please RTFM me so I can convert MySQL 24 hour time to 12 hour time. TIA gary Use MySQL's date_format() function with the %r specifier in your query: shanna% mysql Reading table information for completion of table and

Re: [PHP] breaking out of two loops

2002-02-05 Thread Lars Torben Wilson
On Mon, 2002-02-04 at 20:19, Daniel Grace wrote: Lars Torben Wilson [EMAIL PROTECTED] wrote in message From the manual: break accepts an optional numeric argument which tells it how many nested enclosing structures are to be broken out of You can find this at http

Re: [PHP] mktime() Algorithm

2002-02-06 Thread Lars Torben Wilson
On Wed, 2002-02-06 at 11:28, David A Dickson wrote: I need to create a function in another programming language that takes the same input as the php mktime() function and produces the exact same output as the php mktime() function. Does anybody out there know what the algorithm is? --

Re: [PHP] in_array algorithm

2002-02-06 Thread Lars Torben Wilson
On Wed, 2002-02-06 at 08:26, John Fulton wrote: Does anyone know which algorithm in_array() uses? For example, if I say in_array(foo, $arr) Does in_array() do an unordered sequential serach of $arr for foo which takes up to n comparisons [where n = count($arr)], or does it do a

Re: [PHP] Re: Newbie: Question about filesize()

2002-02-06 Thread Lars Torben Wilson
On Wed, 2002-02-06 at 07:27, Ben Crawford wrote: You also seem to have an extra equals. Your loop should read: while (false != ($file=readdir($handle))){ It should come up as an error, but I'm not sure. Ben No, that's the 'identical' operator, which returns true when its operands are

Re: [PHP] Re: Newbie: Question about filesize()

2002-02-06 Thread Lars Torben Wilson
On Wed, 2002-02-06 at 15:33, Jeff Sheltren wrote: At 10:27 AM 2/6/2002 -0500, Ben Crawford wrote: You also seem to have an extra equals. Your loop should read: while (false != ($file=readdir($handle))){ I think you could eliminate the false != in the while condition... It should be

Re: [PHP] secure form handling

2002-02-06 Thread Lars Torben Wilson
On Wed, 2002-02-06 at 17:36, wm wrote: hi, i'm fairly new to this. what i want to do is use a form so the user can specify a few different choices of things they want to buy. maybe a few radio buttons with dollar amounts and then possibly a couple of quantity fields for items. this

Re: [PHP] secure form handling

2002-02-06 Thread Lars Torben Wilson
done. Torben Lars Torben Wilson wrote: On Wed, 2002-02-06 at 17:36, wm wrote: hi, i'm fairly new to this. what i want to do is use a form so the user can specify a few different choices of things they want to buy. maybe a few radio buttons with dollar amounts

RE: [PHP] Formatting a MYSQL time

2002-02-07 Thread Lars Torben Wilson
On Thu, 2002-02-07 at 10:47, Kevin Stone wrote: Unless the $eventdate coming being pulled from your database a bonified Unix timestamp the date() function will not work. I don't like MySQL functions so I've always used $timestamp = mktime() to create the timestamp. Then plug that value

Re: [PHP] ODBC_EXECUTE has a DANGEROUS 'feature'!!!

2002-02-08 Thread Lars Torben Wilson
On Fri, 2002-02-08 at 04:43, * RzE: wrote: Hi folks, I don't know if everyone ever knew this, but I haven't been able to find anything about this, anywhere... odbc_execute has a very dangerous 'feature'. I would like to call it a bug, because someone has implemented it on purpose I

Re: [PHP] mysql_select_db() problem

2002-02-09 Thread Lars Torben Wilson
On Sat, 2002-02-09 at 12:24, Nick Wilson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, I just can't see what could possibly be wrong with my php here: $sel_db=mysql_select_db(mydb) or die (could not get the bugger); exit; I can 'USE mydb'

Re: [PHP] Parameters via Link

2002-02-09 Thread Lars Torben Wilson
On Sat, 2002-02-09 at 15:39, Manuel Ritsch wrote: Still doesnt' work, any ither suggestions? Sounds like you don't have register_globals turned on. (Don't turn it on! globals are eevviill! ;) Try: if ($_REQUEST['link'] == 'home') { . . . } Or, if using an older (pre-4.1.0) version of

Re: [PHP] Nested functions

2002-02-09 Thread Lars Torben Wilson
On Sat, 2002-02-09 at 15:40, DL Neil wrote: Hi, Have been experimenting with the array_walk function and a little array debug print facility, but ran into a problem with nested functions. The code can be written with nested functions and successfully executed once; but when repeatedly

Re: [PHP] Parameters via Link

2002-02-09 Thread Lars Torben Wilson
On Sat, 2002-02-09 at 15:54, Manuel Ritsch wrote: I have PHP Version 4.0.5 and register_globals turned on but it doesnt' work =( Is it inside a function? If not, can you send me a copy of the script? Torben Lars Torben Wilson [EMAIL PROTECTED] schrieb im Newsbeitrag 1013298469.9790.13

Re: [PHP] my math stinks

2002-02-10 Thread Lars Torben Wilson
On Sun, 2002-02-10 at 11:05, Gary wrote: Hi All, This is the first time I have had to deal with math. I have gone through the manual and a few books and I think I am worse off then when I started. Can someone give me an example of the simple math below. I think If I see some in code I

RE: [PHP] ODBC_EXECUTE has a DANGEROUS 'feature'!!!

2002-02-12 Thread Lars Torben Wilson
On Mon, 2002-02-11 at 06:46, Jerry Verhoef (UGBI) wrote: I think you all are missing the point that *RzE is making. The software you use/create should be bugfree and free from undocumented features. Otherwise security risks could occur. And ofcourse all other In a perfect world, yes.

Re: [PHP] ereg-digits only...

2002-02-12 Thread Lars Torben Wilson
On Tue, 2002-02-12 at 03:04, B. Verbeek wrote: How do I check a string for it to only contain numbers? if(!ereg(([0-9]+),$string)){ print It contains characters other than numbers; }else{ print Only numbers; } Can anyone give some feedback...

Re: [PHP] PHP not parsed in HTML

2002-02-12 Thread Lars Torben Wilson
On Tue, 2002-02-12 at 12:36, SpyProductions Support Team wrote: Hhere's another humdinger of a question: I am with a hosting company that doesn't want to parse PHP in HTML files because they are afraid it will slow down their server(s) too much. So. I really like them and don't

Re: [PHP] getting $PHP_SELF's basename

2002-02-12 Thread Lars Torben Wilson
On Tue, 2002-02-12 at 13:16, Erik Price wrote: Is there already a built-in function that gets the basename of the current file? I wrote this: function get_current_page_name() { $current_page_name = explode(/, $_SERVER['PHP_SELF']); $current_page_name =

Re: [PHP] getting $PHP_SELF's basename

2002-02-12 Thread Lars Torben Wilson
On Tue, 2002-02-12 at 13:32, Erik Price wrote: On Tuesday, February 12, 2002, at 04:26 PM, Lars Torben Wilson wrote: echo basename($_SERVER['PHP_SELF']); http://www.php.net/basename Thank you Torben. Reading through the annotations on this manual entry, it looks like I'd

Re: [PHP] How to obtain the script's path?

2002-02-12 Thread Lars Torben Wilson
On Tue, 2002-02-12 at 13:44, Alex Shi wrote: Hi, I have a script need to be launched from terminal, and I want it to report the script's path. Because this script is required to be launched from command line, so those Apache env vars have not effect work, even $PHP_SELF don't work. Can

Re: [PHP] Convert a string to an array w/o spliting or exploding

2002-02-13 Thread Lars Torben Wilson
On Wed, 2002-02-13 at 07:19, brendan conroy wrote: Hi, thanks for reading this novice question, I'd be grateful if someone could email me and tell me if its possible to convert a string to an array whithout using the split[] or explode[] function, as these aren't appropriate for the task.

Re: [PHP] Convert a string to an array w/o spliting or exploding

2002-02-13 Thread Lars Torben Wilson
On Wed, 2002-02-13 at 09:06, Erik Price wrote: On Wednesday, February 13, 2002, at 10:19 AM, brendan conroy wrote: Hi, thanks for reading this novice question, I'd be grateful if someone could email me and tell me if its possible to convert a string to an array whithout using the

RE: [PHP] Php is serversided????

2002-02-13 Thread Lars Torben Wilson
On Wed, 2002-02-13 at 11:56, Rick Emery wrote: The if-statements are based upon values read from session variables, cookies, values from databases, and values for the form that was just submitted. So, no, there are no if-statements executed on data the user has not submitted. Say what?

Re: [PHP] querystrings passed in header(Location: n) ?

2002-02-13 Thread Lars Torben Wilson
On Wed, 2002-02-13 at 07:34, Erik Price wrote: On Wednesday, February 13, 2002, at 09:53 AM, Rick Emery wrote: try: header(Location: domain.com/errorpage.php?errorcode=.urlencode($errorcode)); First to the original question: yes, querys are allowed in Location headers, according to

Re: [PHP] trouble with headers

2002-02-13 Thread Lars Torben Wilson
On Tue, 2002-02-12 at 17:57, Erik Price wrote: Sorry, I debugged it myself. Don't add extra whitespace lines after you jump out of PHP mode (for instance, at the end of an include file, don't have any extra lines after the '? PHP-jump-out mark'. The extra lines at the bottom of the

Re: [PHP] Filling Forms with $variables

2002-02-13 Thread Lars Torben Wilson
On Wed, 2002-02-13 at 13:56, Steven Walker wrote: Hi, I'm having trouble setting the value of form elements using variable values. For example: ?$name = Steven Walker? form name=form1 method=post action=infocollect.php input type=text name=name value=?echo $name;? /form In

Re: [PHP] ODBC_EXECUTE has a DANGEROUS 'feature'!!!

2002-02-13 Thread Lars Torben Wilson
On Mon, 2002-02-11 at 00:21, * RzE: wrote: I understand you try to 'protect' your own product, but you have to stay a bit realistic about some things. Ofcourse I check the input. But you know... there's absolutely nothing wrong with allowing quotes to be stored in the database. It's just

Re: [PHP] Browse and Upload file

2002-02-13 Thread Lars Torben Wilson
On Wed, 2002-02-13 at 17:38, Reuben D Budiardja wrote: Hi, Does anyone know how to upload file using Web Browser as the interface? I want to do a web page, where you can click on a button, and then you can browse the local directories of the person who are browsing the page, and upload

Re: [PHP] Browse and Upload file

2002-02-13 Thread Lars Torben Wilson
On Wed, 2002-02-13 at 18:26, Reuben D Budiardja wrote: Thanks. I follow the manual. I changed my php.ini: upload_tmp_dir = '/home/web/' which is writable by web (the user running apache/php) and restart apache. However, after I upload the file, I can't find it. When I do

Re: [PHP] Browse and Upload file

2002-02-13 Thread Lars Torben Wilson
On Wed, 2002-02-13 at 18:53, Reuben D Budiardja wrote: Sorry, I meant to include those information. Here is from php.ini ; File Uploads ; file_uploads = On; Whether to allow HTTP file uploads upload_tmp_dir = /home/web upload_max_filesize = 2M

Re: [PHP] Browse and Upload file

2002-02-13 Thread Lars Torben Wilson
On Wed, 2002-02-13 at 19:18, Reuben D Budiardja wrote: Yes, I have. I follow the example exactly from http://www.php.net/manual/en/features.file-upload.php. Well, that's the problem then. The example in the manual is buggy. :) This was fixed in cvs earlier today, actually, but the online

Re: [PHP] how a function 'return' statement works

2002-02-14 Thread Lars Torben Wilson
On Thu, 2002-02-14 at 07:32, Erik Price wrote: Hm... I tried quite a few variations on this. I can't seem to get any displayable value out of this function. function get_current_page_name() { $current_page_name = explode(/, $_SERVER['PHP_SELF']); $current_page_name =

Re: [PHP] good practice

2002-02-14 Thread Lars Torben Wilson
On Thu, 2002-02-14 at 11:09, James Taylor wrote: Can someone recommend a better method for doing something like the following? All of my programs are written like this, but it's really poor form considering I'm not predeclaring my variables, etc. Only thing I can really think of is to

Re: [PHP] Sorting an array of arrays....

2002-02-14 Thread Lars Torben Wilson
On Thu, 2002-02-14 at 08:26, Fifield, Mike wrote: What I am trying to do is sort a array of arrays but I want to sort by one of the pieces of data stored in the arrays inside the array. For example; $data[blue] = array(name, age, time, 3); $data[green] = array(name, age, time, 7); $data[red]

Re: [PHP] More about sessions.

2002-02-14 Thread Lars Torben Wilson
On Thu, 2002-02-14 at 11:40, Morten Nielsen wrote: Hi again, I have read about sessions in the PHP manual and as far as I understand session needs the user to allow cookies. Is my understanding correct so far? But if it is required to accept cookies why not just pass all the required

Re: [PHP] really weird problem

2002-02-14 Thread Lars Torben Wilson
On Thu, 2002-02-14 at 11:15, Jaxon wrote: hi folks, can someone shed some light here? i've got a file called index.php with the following contents: ?php echo debug output: index.php loadedbr; if (is_null($page_name)) $page_name=about; echo debug: page name = $page_namebr;

Re: [PHP] Anyway to open a PHP file and view its code in thebrowser?

2002-02-14 Thread Lars Torben Wilson
On Thu, 2002-02-14 at 12:26, Kevin Stone wrote: How can I open a local PHP script and view its code to the browser? The Readfile() method appears to parse and execute the code. The Fopen() method appears to parse and then not execute the code, leaving a blank screen, or at the very least

RE: [PHP] Anyway to open a PHP file and view its code in thebrowser?

2002-02-14 Thread Lars Torben Wilson
?script=http://www.mydomain/myscript.php;View Source for Myscript.php/a Thanks for your help. It's always the little things that'll get ya. :) -- Kevin Stone [EMAIL PROTECTED] -Original Message- From: Lars Torben Wilson [mailto:[EMAIL PROTECTED]] On Behalf Of Lars Torben

Re: [PHP] fopen

2002-02-14 Thread Lars Torben Wilson
On Thu, 2002-02-14 at 17:34, John Smythe wrote: i wanna know if there is a way of opening a file in a certian mode so when i write to a txt file it writes at the top of the file, and doesnt overwrite whats at the start of the file No, not with fopen(). What you can do is create a temporary

RE: [PHP] fopen

2002-02-15 Thread Lars Torben Wilson
that, since while you're writing data to the temp file, processes just keep using the original. Once you're done, the rename happens atomically, preventing the race condition. Torben -Original Message- From: Lars Torben Wilson [mailto:[EMAIL PROTECTED]] Sent: Friday, February 15, 2002 1

Re: [PHP] writing / reading from text files

2002-02-15 Thread Lars Torben Wilson
On Fri, 2002-02-15 at 10:36, cyberskydive wrote: thanks guys, there is just one more question I dont see an answer for anywhere I've looked. will fseek read past \n's and if so how do I move the filepointer to a newline, or should I just put all the data on one line? (not unreasonable n

Re: [PHP] The ASP application object in PHP?

2002-02-15 Thread Lars Torben Wilson
On Fri, 2002-02-15 at 05:43, Bendik Simonsen wrote: I've recently started to learn ASP (*ducks the hurled flowerpots and vases*) because my school requires it, but of course I prefer PHP for my own scripting needs. I have however, noticed one feature that ASP has that I have not found an

Re: [PHP] What Do You Think?

2002-02-15 Thread Lars Torben Wilson
On Fri, 2002-02-15 at 11:40, Richard Crawford wrote: I'd be much more interested in microbreweries, though. Most commercial breweries like Anheuser Busch and Coors don't brew beer. Send some of their product to a lab, and the results will say something like, Your horse has diabetes. Hmm.

Re: [PHP] LINUX distrib of PHP different to windows?

2002-02-16 Thread Lars Torben Wilson
On Sat, 2002-02-16 at 05:55, Andy wrote: Hi there, I just installed my first linux box and I have problems on configuring php for my needs. It does not matter what I do to php.ini, nothing is changing. And yes, I did restart apache. I thought php4.1.1 comes with gd2.0 build in, like on

Re: [PHP] Re: Where To Find Resources About Programming Style (mybleedin' code is so darn ugly)

2002-02-17 Thread Lars Torben Wilson
On Sun, 2002-02-17 at 11:05, Christian Blichmann wrote: Hi there! [snip] if (condition) one_statement(); if (condition) one_statement(); else other_statement(); if (condition)

Re: [PHP] Re: Polymorphism in PHP

2002-02-18 Thread Lars Torben Wilson
On Mon, 2002-02-18 at 12:12, Richard Fox wrote: That's right, the difference between C++ pure virtual and virtual is that a virtual function has an implementation but pure virtual only defines an interface. But can we get back to my original PHP question: Can I do something like the

Re: [PHP] Shared Memory Error.

2002-02-18 Thread Lars Torben Wilson
On Sun, 2002-02-17 at 23:34, Paul J. Stevens wrote: I am using PHP Version 4.0.4pl1 with an Embedded Linux (PeeWee Linux, which is based on Red Hat 6.2 w/ a 2.2.18 Kernel). I have tried using shmop_open(), shm_open() shm_attach(). All of these give an error message of function not

Re: [PHP] Unique Numbers

2002-02-18 Thread Lars Torben Wilson
On Mon, 2002-02-18 at 13:14, Steven Walker wrote: Is it safe to use time() to generate a unique id number? My thinking is that the call to the server will take enough time that no two users will get the same time stamp (although they may be very close). Even though the likelyhood of two

Re: [PHP] NULL Apache environment variables

2002-02-18 Thread Lars Torben Wilson
On Mon, 2002-02-18 at 08:56, Narvaez, Teresa wrote: Hello, I'm running PHP version 4.1.1. When I invoke this function, ?php phpinfo()?, all variables are set. However, when I try to retrieve a value of a certain variable like this: ?php echo $HTTP_USER_AGENT; ? It

Re: [PHP] NULL Apache environment variables

2002-02-18 Thread Lars Torben Wilson
On Mon, 2002-02-18 at 14:58, Erik Price wrote: On Monday, February 18, 2002, at 05:44 PM, Lars Torben Wilson wrote: On Mon, 2002-02-18 at 08:56, Narvaez, Teresa wrote: Hello, I'm running PHP version 4.1.1. When I invoke this function, ?php phpinfo()?, all variables are set

Re: [PHP] PHP_SELF Undefined

2002-02-18 Thread Lars Torben Wilson
On Mon, 2002-02-18 at 15:02, Erik Price wrote: On Monday, February 18, 2002, at 05:50 PM, Narvaez, Teresa wrote: When I execute the code below, why is PHP_SELF undefined? I will appretiate any help on this. I can get its value by: echo $_SERVER[PHP_SELF];Thanks in advance!

Re: [PHP] PHP_SELF Undefined

2002-02-18 Thread Lars Torben Wilson
On Mon, 2002-02-18 at 15:29, Matt wrote: $foo = This page is $_SERVER[PHP_SELF]; Or, better: $foo = This page is {$_SERVER['PHP_SELF']}; You do have to concat to do this in single-quoted (noninterpolated) strings, though.

RE: [PHP] PHP_SELF Undefined

2002-02-19 Thread Lars Torben Wilson
On Tue, 2002-02-19 at 05:14, Ford, Mike [LSS] wrote: -Original Message- From: Matt [mailto:[EMAIL PROTECTED]] Sent: 18 February 2002 23:30 To: Lars Torben Wilson $foo = This page is $_SERVER[PHP_SELF]; [snip] Can you expand on why the first option isn't generally

Re: [PHP] getenv $REMOTE_ADDR

2002-02-20 Thread Lars Torben Wilson
On Wed, 2002-02-20 at 12:26, Analysis and Solutions wrote: Hi Steven: Steven Walker wrote: Does anybody know why the predefined variable $REMOTE_ADDR would be null, while getenv(REMOTE_ADDR) works fine? Put register_globals on via your php.ini or .htaccess file. In php.ini, change

Re: [PHP] getenv $REMOTE_ADDR

2002-02-20 Thread Lars Torben Wilson
On Wed, 2002-02-20 at 12:42, Steven Walker wrote: What is the difference between $_SERVER and getenv()? Why should one be more reliable/better than the other? Better: avoid globals and use $_SERVER['REMOTE_ADDR']. Sorry, if I'm asking you to repeat yourself... the documentation doesn't

Re: [PHP] change request for function highlight_string

2002-02-20 Thread Lars Torben Wilson
On Wed, 2002-02-20 at 14:13, Rein Velt wrote: At this moment (php4.1.1) the function highlight_string has the following syntax: [quote] bool highlight_string ( string str) This function prints out a syntax highlighted version of str using the colors defined in the built-in syntax

[PHP] Re: [PHP-DEV] Help on PHP vs JAVA

2002-02-21 Thread Lars Torben Wilson
On Thu, 2002-02-21 at 01:07, Berlina wrote: Hello to everybody, I need some help for writting a comparison of PHP vs JAVA, and of course, I need that PHP wins ;-D Wins what? For what task? This is quite a nebulous question. And if you've decided which will win before you've done the

  1   2   3   4   >