Re: [PHP] how to return strings from functions?

2001-04-05 Thread Toby Butzon
? Keep in mind that a typecast may be hidden - you don't have to explicitly typecast { $var = (int)$var } to get this effect. It could be implicit with a function call, etc. --Toby Butzon David Robley wrote: On Wed, 4 Apr 2001 15:44, Vlad wrote: Hi all script example: function smth

[PHP] String indexing with braces

2001-03-07 Thread Toby Butzon
version did this first appear? Thanks, --Toby Butzon -- 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]

Re: [PHP] Asking Sth about PHP

2001-02-22 Thread Toby Butzon
You can also use PHP for shell scripting - just add #!/path/to/php -q as the first line of your script. Note: You will still need to enclose all PHP scripting in ?php ... ? tags. Here's an example: file: phpinfo.phpshell ? phpinfo() ? The preceding information was returned by PHP info.

Re: [PHP] /n for PC Unix

2001-02-18 Thread Toby Butzon
Just use \n. Both OS's understand this to be a linefeed and will behave accordingly. With the exception of a class that performs POP3 queries, I've never had to use \r\n in my code. Regards, Toby Butzon Todd Cary wrote: When I write to a file with PHP, I get double line spacing when read

Re: [PHP] Quick hellp, How do I stip new lines?

2001-02-17 Thread Toby Butzon
Trim should do exactly what you're looking for without needing ereg_replace, etc. Trim trims all whitespace before the first non-whitespace character and after the last non-whitespace character. I've included an example and its output below. File: test.php ?php header("Content-type:

Re: [PHP] undefined functions question

2001-02-16 Thread Toby Butzon
Try include_once() for your includes instead of simply include(). --toby Matt Williams wrote: This has been an ongoing problem, when I include a file which contains a call to a function I get undefined function errors but when I try to include the file containing the function I get

Re: [PHP] multiple select

2001-02-16 Thread Toby Butzon
Change the name of your select to "test[]" instead of "test", then access it like an array: foreach($test as $current) { echo "$current was selectedbr\n"; } --toby Pablo Martin De Natale wrote: Hello, I'm trying to make a multiple select... I've this code... select name="test"

Re: [PHP] True || False ?

2001-02-15 Thread Toby Butzon
Yes, you can return false. As for "true booleans", PHP doesn't really have a boolean type - it does have a sense of "true" and "not true" though. You can return false (a case-insensitive constant with the value 0) or true (whose value is probably 1 but could really be anything other than 0 or

[PHP] Short tags - proper name?

2001-02-13 Thread Toby Butzon
Greetings, I was just wondering if there's a "proper" name for what I've been calling the "short equals tag" ( ?= ). I'm just curious to see if there's actually a name for it or (if not) if somebody has a more descriptive name for it. --Toby Butzon -- PHP Genera

Re: [PHP] is the list still up?

2001-02-13 Thread Toby Butzon
Check out php.net/round and it's relatives --Toby LDL Enterprise wrote: I am having trouble getting this peice of code to only show 2 decimal places. echo $cart-cart_total($table, $scid) * .0625; The class returns 100.50 and the above code returns 6.28125 Any help taking the 125

Re: [PHP] How to make PHP work in all sub-directories?

2001-02-08 Thread Toby Butzon
You might find more help on php-windows, but here's what I suspect... Take a look at your IIS management console and see if the subdirectory might've been configured differently from the root directory. Or, try changing the script mappings a little in the root and let them override the

Re: [PHP] Generic cloner?

2001-02-08 Thread Toby Butzon
Umm, not sure I understand the question completely... but following the code below, why not just assign the object to a new variable? That'd give you an exact copy with a lot less code... --toby Richard Lynch wrote: I'm wondering if there is an easy way to code a generic cloner at top

Re: [PHP] Events in HTML with PHP

2001-02-08 Thread Toby Butzon
Nope, this won't work. PHP is stricly server side; only JavaScript and other client side languages are capable of being called based on an event (as opposed to an HTTP request). --toby Francesco Rossi wrote: Hi, How i can use the event OnChange of a tag Select for run a php script ? Es.

Re: [PHP] Parse error on blank line...

2001-02-06 Thread Toby Butzon
I gotta agree here. It happens every once in a while and it usually turns out to be something like that... also check to see if you have any here-docs in there that aren't terminated correctly (the ending signal must appear at the first column of a line and be followed by a semicolon). I don't

Re: [PHP] [newbie] Array form values.

2001-02-06 Thread Toby Butzon
Or you might try a foreach($array as $element)... about the same but it doesn't give you they key - just the value (as $element). foreach ($email as $current) { // process this email addr } // move on to the next one until the whole arr of them has been proc'd Good luck- --Toby David Robley

Re: [PHP] Learning MySQL

2001-02-04 Thread Toby Butzon
I agree. It's a great reference learning guide, but you _have_ to be patient and not skip around too much with it or it'll be quite intimidating. --Toby [EMAIL PROTECTED] wrote: On Sun, Feb 04, 2001 at 05:06:02PM -0600, Jeff Oien wrote: What would your advice be for learning MySQL with

[PHP] Win2000 TCP/IP failure

2001-02-01 Thread Toby Butzon
umped. I haven't changed anything as far as the scripting on the page goes. I've tried rebooting (seems a likely solution for windows, but it didn't work :/), I upgraded to the latest PHP (I had been running 403), and even using the ISAPI module instead of the CGI... My apologies if it's obvious and I'

Re: [PHP] C++ integration with PHP

2001-02-01 Thread Toby Butzon
Yes, system() waits for the called program to terminate before PHP execution continues, so that should work. However, you may also want to look into building a custom module for PHP so you can call your C functions directly from PHP. Info on the Zend API, building PHP modules in C, etc., is

Re: [PHP] mail( ) question

2001-01-29 Thread Toby Butzon
This isn't going to work the way it's set up now. Javascript is processed by the visitor's browser, while PHP is processed by the server before the page is ever sent. So in essence, PHP doesn't care one bit what anything outside of the ?php ? tags does. Therefore, you're instructing PHP to do

Re: [PHP] Server VS Client script validation

2001-01-29 Thread Toby Butzon
Make the form page post to itself and use default values of ?php echo $HTTP_POST_VARS['field_name'] ?. The initial form will be blank, but subsequent failing attempts will have the values the visitor already entered. You can also add red text to the form to show what exactly was wrong, etc.

Re: [PHP] Why the Change in Ver 4?

2001-01-27 Thread Toby Butzon
Yea, it's true. There was a post a couple of weeks ago from Rasmus (IIRC) that explained the reasoning: the [] form is used on strings and arrays, so PHP has to figure out which one it's dealing with before it can return a result. If $myAr[] and $myStr{} are seperate, the interpretter will know

Re: [PHP] where is - and in the manual

2001-01-26 Thread Toby Butzon
The - operator is used with class objects. See the manual section on classes objects ;) The is used with here-doc strings. I believe you'll find it in the strings section of the manual. Examples: $myObj = new myClass; $myObj-somevar = "This is some var"; $str = END_STRING This is my string.

Re: [PHP] mail()

2001-01-26 Thread Toby Butzon
You may need to check your mail server's error logs and see if something's happening there. Assuming PHP _is_ finding the mail server and attempting to send the message, there must be some problem at the mail server (ie, no relay access for the IP where your script is running, etc.). --Toby

Re: [PHP] if ... else ...

2001-01-26 Thread Toby Butzon
I'm not sure if I'm understanding correctly, but you might take a look at this modification... Notice: all lines with a in front of them have remained unchanged. Lines that can safely be deleted are preceeded by single-line comments (//), and lines without a are newly added lines.

[PHP] PHP Editors summary page (was Re: Re: [PHP] PHP Editors)

2001-01-24 Thread Toby Butzon
Just when this thread seems to die it comes back... Perhaps the PHP page should have a page of editors with feature lists/ups downs to each editor... a little research a public page by one person (and maybe intermittent updates; moderated feedback might also be good) would save us from even

Re: [PHP] Funny php://stdout behaviour

2001-01-24 Thread Toby Butzon
One thing that occurs to me -- stdout starts off by being the browser, so it's kinda funky to open it -- You've already got it open... I *think* it really only makes sense to fopen() stdout from the command line. At least, I'm not clear on what it would mean to open it from a HTTP

Re: [PHP] Cookie semi-security.

2001-01-24 Thread Toby Butzon
Enable track_vars in php's config and use $PHP_COOKIE_VARS['cookie_id'] to get the value of the cookie. --Toby - Original Message - From: "April" [EMAIL PROTECTED] To: "PHP General" [EMAIL PROTECTED] Sent: Wednesday, January 24, 2001 5:06 PM Subject: [PHP] Cookie semi-security.

Re: [PHP] Processing PHP within a string variable

2001-01-24 Thread Toby Butzon
Hmm... that may work for what you're trying to do and it may not... if your string contains something like this: $str = END_STRING bThis is some HTML/bbr iPowered by PHP ?php echo phpversion() ?/i END_STRING; You're going to have a bit of a problem processing that with eval. I'm not completely

Re: [PHP] What PHP Stands For....

2001-01-22 Thread Toby Butzon
That's the truth. PHP started out as a set of "Personal Home Page tools" (1st version), then PHP/FI (PHP + form interpretter [or something similar - I'm not sure 'form interpretter' is completely correct, but that was basically the functionality of the FI portion])... anyway, then sometime during

Re: [PHP] file storage/downloader...

2001-01-21 Thread Toby Butzon
Do just what you said and create a directory outside of your Apache doc root. Just make sure the user PHP is running as has permissions to access the directory ;) Then use PHP's fpassthru, etc., to send the content of the file back. You will need to send a mime-type header; take a look around -

Re: [PHP] I love/hate FrontPage - need another HTML editor.

2001-01-18 Thread Toby Butzon
Plus if you're just looking for soemthing to get your layout started, you can start in FrontPage and just never open PHP files in it once you start adding PHP ;) --Toby - Original Message - From: "Ignacio Vazquez-Abrams" [EMAIL PROTECTED] To: "Murph" [EMAIL PROTECTED] Cc: [EMAIL

Re: [PHP] Question concerning performance

2001-01-17 Thread Toby Butzon
Example ONE: (in just parse mode) [cut]--- ? print "html-tagblah blah blah blah blah blah blah/html-tag"; print "html-tag" . $Var1 . "/html-tagb-tag" . $Var2 . "/b-tag"; ? [/cut]-- Ran a pretty rough benchmark: 10040 lines of code (5020 repetitions

Re: [PHP] Matching irregular cases

2001-01-17 Thread Toby Butzon
displayed, I want to change the search query so it stands out in the result list. I'm just using... ereg_replace($search_query, "b$search_query/b", $row[6]); ...at the moment, but it wont match results where the case doesn't match. Try eregi_replace... php.net/eregi_replace --Toby --

Re: [PHP] Functions

2001-01-17 Thread Toby Butzon
echo foo(dog);// outputs "This is a dog" This is an example of using a "bareword" - PHP doesn't recognize _dog_ as any sort of reserved word or constant, so it sends it like a quoted string. I don't recommend using this because it's ambiguous whether you mean "dog" or if _dog_ is a

Re: [PHP] Change the session timeout within a php-script

2001-01-17 Thread Toby Butzon
set_time_limit($seconds) --Toby - Original Message - From: "Jens Rehphler" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 17, 2001 9:02 AM Subject: [PHP] Change the session timeout within a php-script Hi, is it possible to change the session timeout from within a

Re: [PHP] I love/hate FrontPage - need another HTML editor.

2001-01-17 Thread Toby Butzon
Nope. EditPlus is Windows-only. --Toby - Original Message - From: "Scott Gerhardt" [EMAIL PROTECTED] To: [EMAIL PROTECTED]; "Php-General-Digest" [EMAIL PROTECTED]; "Chris Aitken" [EMAIL PROTECTED] Sent: Wednesday, January 17, 2001 11:54 AM Subject: RE: [PHP] I love/hate FrontPage - need

Re: [PHP] include statement

2001-01-17 Thread Toby Butzon
This all depends on your include_path set in the PHP config files; see the manual section on config for more info. About the security hole... yes it would be dangerous on a system where accounts are given to untrusted users (ie, customers), but there are ways to make PHP secure for multi-account

Re: [PHP] Question concerning performance

2001-01-17 Thread Toby Butzon
Phil 1:21 www.ganooz.com Car pour moi, la vie c'est le Christ, et la mort est un gain. -Original Message- From: Toby Butzon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 17, 2001 16:55 To: jeremy; [EMAIL PROTECTED] Subject: Re: [PHP] Question

Re: [PHP] ? PHP vs. ?

2001-01-17 Thread Toby Butzon
Is PHP the implied script, so that it is okay to begin PHP code like this ? vs. like this ?php When is it not implied? You should use ?php. In future versions the open short tag would be dropped or your administrator can disable the open short tag. Are there in fact plans to drop the

Re: [PHP] Change the session timeout within a php-script

2001-01-17 Thread Toby Butzon
- From: "Jens Rehphler" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: "Toby Butzon" [EMAIL PROTECTED] Sent: Wednesday, January 17, 2001 1:05 PM Subject: Re: [PHP] Change the session timeout within a php-script I think you understood me wrong. I don't want to change (or limit)

Re: [PHP] phpwebhosting.com

2001-01-17 Thread Toby Butzon
125 users at $10 per month, is a maximum revenue of $1,250 per month per server. From that meager revenue, they are able to provide their customers with an OC-12. I would like to meet the genius who is able to pull that financial rabbit out of a hat! ...and one machine is chewing up a

Re: [PHP] is 1 a Variable...Discoverd it just now...

2001-01-16 Thread Toby Butzon
Works for me... what version of PHP are you using? --Toby - Original Message - From: "Dhaval Desai" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 16, 2001 7:56 AM Subject: [PHP] is 1 a Variable...Discoverd it just now... HI! When I run the foillowing code:

Re: [PHP] regexps

2001-01-16 Thread Toby Butzon
You could loop it with foreach (which I think is the same way Perl handles the ex you gave). foreach ($myArr as $myStr) { $myStr = ereg_replace($regexp, $myStr); } Note quite "one statement", but if you really wanted to shorted it (and in the opinion of most sacrafice readability), you

Re: [PHP] I love/hate FrontPage - need another HTML editor.

2001-01-16 Thread Toby Butzon
A sincere "thank you" to James ;) I completely agree. I thought about saying something but I'm so sick of the editor wars I decided not to... --Toby - Original Message - From: "James McLaughlin" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 16, 2001 10:53 PM Subject:

Re: [PHP] problem that has been really annoying me...

2001-01-15 Thread Toby Butzon
First of all check this: print(stripslashes("$num[sub]")); ... should be... print(stripslashes($num['sub'])); That will change the result, but I don't know if it's the result you're going for... One other note of interest... why is your variable named $num? If it was supposed to be a

Re: [PHP] hello

2001-01-15 Thread Toby Butzon
My fault for missing the original post... but if this is the discussion I think it is... I'd say if you've already got one language under your belt you can probably learn PHP without too much trouble just by reading the first few chapters of the manual and using the function reference beyond

Re: [PHP] Searching a MySQL database?

2001-01-14 Thread Toby Butzon
You've basically got it... the advantage of LIKE is that you can add wildcards to specify what can be different... towns = '$town' ...and... towns LIKE '$town' ...are essentially the same without the % wildcard character. Thus, towns = '$town' ...is much different than... towns LIKE '%$town%'

Re: [PHP] Searching a MySQL database?

2001-01-14 Thread Toby Butzon
that can be used to represent any character (or any set of any character). For instance, on many operating systems the * wildcard represents what you could call "anything". So * is anything from the empty string ('') to anything ('Toby Butzon'). '*zon', however, would match only strings endi

Re: [PHP] Use ?= instead of %=

2001-01-14 Thread Toby Butzon
I like this one and I think I'll comment on it... can people give me opinions as to why ?= is so bad? a. PHP4 specific b. Many do not know what it is / what it does c. Will not work when short_tags are disabled d. Does not follow PEAR standards (ed. guess) e. Looks funny /

Re: [PHP] transforming an HTML Comment in a HTML TAG

2001-01-14 Thread Toby Butzon
I think the ! might have an effect on the regexp interpretter... it's easy enough to escape it (\!) though. --Toby - Original Message - From: "Jason Murray" [EMAIL PROTECTED] To: "'Romulo Roberto Pereira'" [EMAIL PROTECTED]; "php-general" [EMAIL PROTECTED] Sent: Sunday, January 14, 2001

Re: [PHP] Use ?= instead of %=

2001-01-13 Thread Toby Butzon
Take a look at http://www.php.net/manual/en/language.basic-syntax.php. Regarding the use of ?= and %=... Basically, they're a shorthand version for ? echo 'something' ?. (The ?= equivelent would be ?= 'something' ?.) The use of %= is discouraged (as is %) because it was only added to make

[PHP] Re: [PHP-DEV] comments in php

2001-01-13 Thread Toby Butzon
Please note that php-dev is for the developers of PHP, not scripting in PHP. With that said, you have posed a good question. To keep my description brief, comments do not hinder source code processing time enough to be considered detrimental. My limited explaination: They save enough time

Re: [PHP] constants inside of a string

2001-01-10 Thread Toby Butzon
This reminded me of an issue I've kind of been contemplating for a couple of weeks now... I got sick of having to connect, query, check for errors, etc. every time I wanted to query a mysql database, so I wrote a function to do all of it for me... something like: function query_db($queryString,

Re: [PHP] looking for a PHP editor

2001-01-10 Thread Toby Butzon
Come on... mixing PHP and HTML in the same file isn't bad style... in fact it can make things easier to read, if you do it right. This is one of PHP's biggest features... otherwise we'd just have another Perl... ...my .02... --Toby - Original Message - From: "Alexander Wagner" [EMAIL

Re: [PHP] 2d array?

2001-01-10 Thread Toby Butzon
$file should be the name of the file - there is a PHP variable for this but I'm drawing a blank right now. How about __FILE__ ? ;) Note: it's a constant, so make sure you don't try to use a $ before it --Toby - Original Message - From: "Joe Stump" [EMAIL PROTECTED] To: "Kurth Bemis"

Re: [PHP] Re-engineering print()

2001-01-10 Thread Toby Butzon
Look into output buffering (ob_* functions). You wouldn't want to do that with your whole script; but there is an example (if not in the manual it's on zend I believe) so you can assign the results (what would've been outputted to the browser without the buffering) to a variable. --Toby -

Re: [PHP] Passing a query result

2001-01-09 Thread Toby Butzon
Working with what sort of database? Toby Butzon [ criticism spurs improvement ] - Original Message - From: "Todd Cary" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 09, 2001 10:47 PM Subject: [PHP] Passing a query result : I need to pass a qu