[PHP] IRC SOCKETS

2003-10-07 Thread Paulo Nunes
I am trying to implement a chat to my page. Using reloading is out of the question. I was indicated this technology, iFrame, wich i am liking (does anyone knows better?). But my problem is: how do i manage that everyone sees what user X just wrote and sent? I was checking socket functions, but i

Re: [PHP] IRC SOCKETS

2003-10-07 Thread Burhan Khalid
Paulo Nunes wrote: I am trying to implement a chat to my page. Using reloading is out of the question. I was indicated this technology, iFrame, wich i am liking (does anyone knows better?). But my problem is: how do i manage that everyone sees what user X just wrote and sent? I was checking

Re: [PHP] -OT- Software Fashion

2003-10-07 Thread RoyD
helo guys , where i get a private names server , for my domain name , in internet , where i registered and how much ?? Roy Daniel , ST , IT Application Support Development Engineer PT BERCA COMPUTEL - http://www.ilmukomputer.com/populer/roy-webservices.php [EMAIL

[PHP] Re: Name server question (was:[PHP] -OT- Software Fashion)

2003-10-07 Thread Paul van Schayck
Hello, [EMAIL PROTECTED] wrote helo guys , where i get a private names server , for my domain name , in internet , where i registered and how much ?? What do you mean with private name servers? Most of the time everything is just fine if you are hosted by a companny. They will set the DNS

Re: [PHP] -OT- Software Fashion

2003-10-07 Thread Becoming Digital
You need to get an additional IP address from your hosting provider (if you use one) and then configure the box to act as a nameserver. I did just this for becomingdigital.com, but strangely it had nothing to do with PHP. I'm not sure how it does in your case, either. ;) Edward Dudlik

[PHP] (native) linux-php-editor with some advanced features?

2003-10-07 Thread Thomas Seifert
Hey folks, I know this topic comes up again and again but I couldn't find any usefull php-editor for linux which is NOT written in java AND has some advanced features like a file navigation (listing all functions in a file with direct jump to them) or tooltips with the function definition or

RE: [PHP] IRC SOCKETS

2003-10-07 Thread Javier Tacon
Investigate about the pear module Net_SmartIRC, its easy to make things like you said. Javier Tacón. -Mensaje original- De: Paulo Nunes [mailto:[EMAIL PROTECTED] Enviado el: martes, 07 de octubre de 2003 9:19 Para: [EMAIL PROTECTED] Asunto: [PHP] IRC SOCKETS Importancia: Baja I am

[PHP] [Newbie Guide] For the benefit of new members

2003-10-07 Thread tech
= This message is for the benefit of new subscribers and those new to PHP. Those who do not want to be bothered just filter out the [Newbie Guide] mails. Please feel free to add more points and send to the list.

Re: [PHP] .htaccess - Still asking for login information although already sent through address bar

2003-10-07 Thread Jason Wong
On Tuesday 07 October 2003 03:44, PHP Webmaster wrote: [snip] $redirect_url = https://; . $username . : . $password . @ . $domain . :2083/frontend/x/index.html; header(Location: $redirect_url); The code looks OK. FWIW I've tried something like: ?php header(Location:

[PHP] remove spaces using php function

2003-10-07 Thread Uma Shankari T.
Hello, Is there any function which will remove extra spaces between each words..?? for example if the user typed asked his friend.. is there any function to remove the extra space between his and asked except one space ?? Regards, Uma -- PHP General Mailing List

RE: [PHP] remove spaces using php function

2003-10-07 Thread Javier Tacon
Well, you can make your own function to to that: ?php function repairString($input) { $string = NULL; $iTmp=explode( ,$input); foreach($iTmp as $word) { if($word!=) $string.=$word ; } return trim($string); } print repairString(this is atest ); // prints this is a test ? Javier

RE: [PHP] remove spaces using php function

2003-10-07 Thread Javier Tacon
Or this one works too :) ?php function repairString($input) { while(($ninput=ereg_replace( , ,$input))!=$input) { $input = $ninput; } return trim($ninput); } print repairString(this is atest ); // prints this is a test ? Javier Tacón. -Mensaje original- De: Javier Tacon

Re: [PHP] remove spaces using php function

2003-10-07 Thread Evan Nemerson
You mean something like ereg_replace(' +', ' ', 'asked his friend..'); or perhaps preg_replace('/ +/', ' ', 'asked his friend..'); ? Of course, if you're getting this data from a luser, those may not be spaces. They could be obscure, non-printing characters. Take a look at

Re: [PHP] remove spaces using php function

2003-10-07 Thread Evan Nemerson
FYI, preg_replace /should/ be the fastest of all these methods (including Javier's). On Tuesday 07 October 2003 02:25 am, Evan Nemerson wrote: You mean something like ereg_replace(' +', ' ', 'asked his friend..'); or perhaps preg_replace('/ +/', ' ', 'asked his

Re: [PHP] (native) linux-php-editor with some advanced features?

2003-10-07 Thread Becoming Digital
ActiveState Komodo is available for Linux. I only tried it briefly so I can't comment on how well it runs, but I'm quite happy with the Windows version. You can download a free evaluation from ActiveState and renew it as many times as you'd like. A link has been provided for you. :)

[PHP] Get an attached file from a POP3 mail

2003-10-07 Thread Javier Tacon
Hi, Anyone knows how to get an attached file from a POP3 mail? I can logon, read the headers and body with Net_POP3 pear module, but I don't know how to process the mail to extract attached files .. Exists libraries that can do that? Javier Tacón - Developer Private Media Group, Inc.

Re: [PHP] Get an attached file from a POP3 mail

2003-10-07 Thread Raditha Dissanayake
It might interest you to know that the php imap library works with pop as well. can't figure out for the life of me why people use pop3 though :-)) all the best Javier Tacon wrote: Hi, Anyone knows how to get an attached file from a POP3 mail? I can logon, read the headers and body with

Re: [PHP] (native) linux-php-editor with some advanced features?

2003-10-07 Thread Raditha Dissanayake
Quanta is not an IDE but it has excellent support for php. Thomas Seifert wrote: Hey folks, I know this topic comes up again and again but I couldn't find any usefull php-editor for linux which is NOT written in java AND has some advanced features like a file navigation (listing all functions

Re: [PHP] [Newbie Guide] For the benefit of new members

2003-10-07 Thread Christophe Chisogne
[EMAIL PROTECTED] wrote: Please feel free to add more points and send to the list. 2 ideas come to my mind. 1. Add a link to the PHP FAQ in newbie guide item 1 http://www.php.net/manual/faq.php Yes, it's part of the manual, but a frequent answer is Read the FAQ or less polite ones ;-)

Re: [PHP] (native) linux-php-editor with some advanced features?

2003-10-07 Thread Burhan Khalid
Thomas Seifert wrote: Hey folks, I know this topic comes up again and again but I couldn't find any usefull php-editor for linux which is NOT written in java AND has some advanced features like a file navigation (listing all functions in a file with direct jump to them) or tooltips with the

[PHP] set_time_limit() on Mac

2003-10-07 Thread Chris Kranz
i gotta wierd one, maybe it's just me being daft... i'm under the impression that max execution time / set_time_limit() is server specific, and completely independant of what computer is being served the pages? my server is apache 1.3 running php 4.3 on win 2k... when i run the script from a

[PHP] function call before declaration

2003-10-07 Thread Martin Hochstraßer
Hi! I got a problem with functions which I call before they're defined. I get the error message: Fatal error: Call to undefined function: view() in /daten/www/midgard/cache/62.php on line 470 The code snippet: 8- switch($argv[0]) { case 'view':

RE: [PHP] set_time_limit() on Mac

2003-10-07 Thread Jay Blanchard
[snip] i'm under the impression that max execution time / set_time_limit() is server specific, and completely independant of what computer is being served the pages? [/snip] Not server specific and overrides whatever you have set in php.ini and httpd.conf for the page in which the set_time_limit

[PHP] newbie:form problem

2003-10-07 Thread Sudheer Palaparambil
Hi, Is this is the way to write a form which insert data into a mysql DB ? Please note where I am keeping the mysql code. The problem with this code is that whenever I am issues a refresh, a row is inserted into the DB with previous field values! Even when the form field is empty. Pls help.

[PHP] Sessions

2003-10-07 Thread Webmaster
Hi! I started to use the php own session functions today. Now I am getting such lines in the address bar: /pages/news.php?option=1015PHPSESSID=PHPSESSID=d117dba208d4b205cd4e521f606b b44e#result Why do I get PHPSESSID=PHPSESSID= ? Thank you. Webmaster -- PHP General Mailing List

[PHP] New to PHP form attributes

2003-10-07 Thread Matthew Oatham
Hi, I am new to PHP and am more used to JSP. My question is - if I submit a form to a php3 page using action==? PHP_SELF ? for some processing all is well I can see that form data. After the processing the page is redisplayed - but the data originally sent persits (in the request) this can be

[PHP] Using pear packages, trouble with formbuilder.php

2003-10-07 Thread Enis Yoldas
Hello folks, i am newbie at this whole php thing :) Maybe this is not to place to ask this, if i am at the wrong place, please forgive me. I got an assignment that i have to do, i am stuck somewhere, and cant find out what the problem is, i have an idea, but dont know for sure. This is what i

[PHP] phpjavascript live-clock

2003-10-07 Thread Alex Ciurea
hello, is it possible to show the live-clock from the server machine, using php and javascript, without having to make refresh of that page? there are scripts in javascript to display a clock, but it's the clock from client machine, not from server... php can obtain the live clock of the

Re: [PHP] New to PHP form attributes

2003-10-07 Thread Marek Kilimajer
You should use post method for forms that change state on the server, that way the user gets a warning. And you should redirect after processing the form to another page. if($_GET['action']=='submit') { INSERT INTO table VALUES (NULL, '$_GET[input]' header('Location: ...'); }

[PHP] Going crazy-db3

2003-10-07 Thread Robert Covell
I have been trying for over a week to write to the sendmail aliases db3 file and have been unable to do so regardless of how I configure the arguments with the dba_open statement. It keeps telling me Invalid argument. It works fine within BerkeleyDB. I can read the file just fine but cannot

Re: [PHP] phpjavascript live-clock

2003-10-07 Thread Chris Hayes
At 15:48 7-10-03, you wrote: hello, is it possible to show the live-clock from the server machine, using php and javascript, without having to make refresh of that page? That would be a 99% javascript job. Find an existing javascript that works. When the page is loaded let PHP feed the

[PHP] Modifying OPTIONS header response

2003-10-07 Thread Oscar F
Hello all, I'm working on a php/dav server and I'm having a problem. When the client sends an OPTIONS request to see what methods are allowed, they only get Allow: GET, HEAD, POST, OPTIONS, TRACE back from apache. This seems to me a problem since it does not include PROPFIND, COPY, MOVE, LOCK,

Re: [PHP] phpjavascript live-clock

2003-10-07 Thread Eugene Lee
On Tue, Oct 07, 2003 at 03:48:27PM +0200, Alex Ciurea wrote: : : is it possible to show the live-clock from the server machine, using : php and javascript, without having to make refresh of that page? AFAIK, no. PHP scripts get their time information from the server. JavaScript can get its

Re: [PHP] Modifying OPTIONS header response

2003-10-07 Thread Marek Kilimajer
Just a wild guess, but try this in apache config: Script OPTIONS /options.php Oscar F wrote: Hello all, I'm working on a php/dav server and I'm having a problem. When the client sends an OPTIONS request to see what methods are allowed, they only get Allow: GET, HEAD, POST, OPTIONS, TRACE back

Re: [PHP] Modifying OPTIONS header response

2003-10-07 Thread Oscar F
Hey Marek, Thanks for the reply. Nope, doesn't do anything... O. On Tue, 2003-10-07 at 09:19, Marek Kilimajer wrote: Just a wild guess, but try this in apache config: Script OPTIONS /options.php Oscar F wrote: Hello all, I'm working on a php/dav server and I'm having a problem.

[PHP] Re: Sessions

2003-10-07 Thread Paul van Schayck
Hello, [EMAIL PROTECTED] (Webmaster) wrote Now I am getting such lines in the address bar: /pages/news.php?option=1015PHPSESSID=PHPSESSID=d117dba208d4b205cd4e521 f606b b44e#result Do you set them manual, does the server auto start a session? What are the settings for session in your ino

Re: [PHP] Modifying OPTIONS header response

2003-10-07 Thread Marek Kilimajer
Did you restart apache? It works for me. Before: Allow: GET, HEAD, OPTIONS, TRACE After: Allow: GET, HEAD, POST, OPTIONS, TRACE, PROPFIND, COPY, MOVE, LOCK options.php: ?php header('Allow: GET, HEAD, POST, OPTIONS, TRACE, PROPFIND, COPY, MOVE, LOCK'); ? Oscar F wrote: Hey Marek, Thanks for

[PHP] allowing access to php page by IP

2003-10-07 Thread Adam Williams
Hello, I want to allow access to a php page but am not sure how I should verify the IP once I get it. I want to allow 10.8.4.* and 10.8.5.* to access a certain webpage and keep everyone else out. I have written code to figure out what someone's IP is, but am not sure about how I should

Re: [PHP] allowing access to php page by IP

2003-10-07 Thread Tom Rogers
Hi, Wednesday, October 8, 2003, 12:23:16 AM, you wrote: AW Hello, AW I want to allow access to a php page but am not sure how I should verify AW the IP once I get it. I want to allow 10.8.4.* and 10.8.5.* to access a AW certain webpage and keep everyone else out. I have written code to

[PHP] Limits and php...

2003-10-07 Thread Payne
Hi, I have been trying to understand how to write a simple code that will let me limit the number of files view to 10 records, but I need to under how php can look at a number of records and then caculates how many pages it needs to show all records. Is there some sample code that shows how

[PHP] Re: allowing access to php page by IP

2003-10-07 Thread Paul van Schayck
Hello, [EMAIL PROTECTED] (Adam Williams) wrote I want to allow access to a php page but am not sure how I should verify the IP once I get it. I want to allow 10.8.4.* and 10.8.5.* to access a certain webpage and keep everyone else out. I have written code to figure out what someone's IP is,

Re: [PHP] allowing access to php page by IP

2003-10-07 Thread Chris Boget
certain webpage and keep everyone else out. I have written code to figure out what someone's IP is, but am not sure about how I should verify whether the IP is in the range of 10.8.4.* or 10.8.5.*. Any suggestions? $ipArray = explode( '.', $ipAddress ); if(( $ipArray[0] == 10 ) (

[PHP] Verry strange GET behaviour

2003-10-07 Thread Ben Edwards
Been having a problem accessing a variable that is passed on a URL. I've been developing PHP for years and this makes no seance. The variable I am trying to access in the script is $_section. I put the following code at the beginning (before anything else apart from ?) echo

Re: [PHP] Verry strange GET behaviour

2003-10-07 Thread Brad Pauly
Ben Edwards wrote: Been having a problem accessing a variable that is passed on a URL. I've been developing PHP for years and this makes no seance. The variable I am trying to access in the script is $_section. I put the following code at the beginning (before anything else apart from ?) echo

Re: [PHP] Verry strange GET behaviour

2003-10-07 Thread Paul van Schayck
Hello, [EMAIL PROTECTED] (Brad Pauly) wrote Probably because you have register_globals turned off. You can use $_GET['_section']. You can also turn it on. http://us3.php.net/register_globals Don't tell them about that option! People are forced to script safe that way. Ben, with register

Re: [PHP] Verry strange GET behaviour

2003-10-07 Thread Ben Edwards
Ben, with register globals off hackers can change variables you don't want to be changed theirself. Don't really have time to go through all our sites and change every variable option, then retest all the sites. Still dont understand why everything else works. Will probably start using $_GET

Re: [PHP] New to PHP form attributes

2003-10-07 Thread Chris Shiflett
--- Matthew Oatham [EMAIL PROTECTED] wrote: I am new to PHP and am more used to JSP. My question is - if I submit a form to a php3 page using action==? PHP_SELF ? for some processing all is well I can see that form data. After the processing the page is redisplayed - but the data originally

Re: [PHP] Verry strange GET behaviour

2003-10-07 Thread Chris Shiflett
--- Ben Edwards [EMAIL PROTECTED] wrote: Been having a problem accessing a variable that is passed on a URL. This question is asked several times a week. You have register_globals disabled, and if you are asking this question, you need to leave register_globals disabled. Use $_GET['_section']

Re: [PHP] Verry strange GET behaviour

2003-10-07 Thread Chris Shiflett
--- Paul van Schayck [EMAIL PROTECTED] wrote: Don't tell them about that option! People are forced to script safe that way. That is a bit of an exaggeration, don't you think? Leaving register_globals disabled certainly doesn't force people to script safe[ly]. It does, however, force them to

Re: [PHP] Verry strange GET behaviour

2003-10-07 Thread Brad Pauly
Ben Edwards wrote: On Tue, 2003-10-07 at 16:14, Brad Pauly wrote: Probably because you have register_globals turned off. You can use $_GET['_section']. You can also turn it on. But it works in hundreds of other places on the server. I don't really want to use $_GET because I sometimes switch

Re: [PHP] Verry strange GET behaviour

2003-10-07 Thread Leif K-Brooks
Chris Shiflett wrote: You have register_globals disabled, and if you are asking this question, you need to leave register_globals disabled. Use $_GET['_section'] to access your variable. But he says $REQUEST_URI works. -- The above message is encrypted with double rot13 encoding. Any

Re: [PHP] Verry strange GET behaviour

2003-10-07 Thread John Wilcox
On the topic of passing args, can someone please explain to me why I'm unable to use $_GET or $_POST if my php script is run as a .cgi? Basically, I have a simple html input form that has: form name=testform action=test.cgi method=GET input type=text name=textbox input type=submit value=Submit

Re: [PHP] Verry strange GET behaviour

2003-10-07 Thread Daniel Guerrier
you need to configure your webserver recognize .cgi as a file to run the php interpreter against. i.e do whatever you did to make .php work again for .cgi --- John Wilcox [EMAIL PROTECTED] wrote: On the topic of passing args, can someone please explain to me why I'm unable to use $_GET or

Re: [PHP] Verry strange GET behaviour

2003-10-07 Thread Ben Edwards
Do you have register_globals on or off? If it works in hundreds or other places, it should work fine. In /etc/php4/apache/php.ini 'register_globals = On'. This is my point, I understand about the global issue but dont have the time to change all my code. Also, you can use $_REQUEST if you

Re: [PHP] Verry strange GET behaviour

2003-10-07 Thread Chris Shiflett
--- John Wilcox [EMAIL PROTECTED] wrote: On the topic of passing args, can someone please explain to me why I'm unable to use $_GET or $_POST if my php script is run as a .cgi? I believe this is because you are using the #! method to define the interpreter, which means your Web server simply

Re: [PHP] Verry strange GET behaviour

2003-10-07 Thread Chris Shiflett
--- Ben Edwards [EMAIL PROTECTED] wrote: what I don't understand is if $_GET is being used people can just change the URL anyway so why is it an issue? It is only an issue in the sense that it hides the origin of data. An attacker can leverage this fact to exploit weaknesses in your

Re: [PHP] Verry strange GET behaviour

2003-10-07 Thread Marek Kilimajer
Ben Edwards wrote: what I don't understand is if $_GET is being used people can just change the URL anyway so why is it an issue? Ben All that it is about that if you have code like this: if($user=='admin' $pwd=='secretpassword') { $admin=true; } and register_globals on someone can pass

[PHP] GET globals REQUEST the plot thickens

2003-10-07 Thread Ben Edwards
From what I have $_REQUEST douse NOT work. As I said vars are being passed on the URL. My code: echo brsec=.$_REQUEST[_section].brreq=$REQUEST_URIbr; the output sec= req=/adultdyslexia.org/quiz.php?_menu=TOPissue=1_section=QUIZgen=Y if I change the request to GET it works fine! Ben --

Re: [PHP] Verry strange GET behaviour

2003-10-07 Thread Jason Wong
On Tuesday 07 October 2003 23:04, Ben Edwards wrote: Been having a problem accessing a variable that is passed on a URL. I've been developing PHP for years and this makes no seance. The variable I am trying to access in the script is $_section. I put the following code at the beginning

Re: [PHP] GET globals REQUEST the plot thickens

2003-10-07 Thread Marek Kilimajer
Has you mention what php version are you running? Superglobals are available only since 4.1.0 Ben Edwards wrote: From what I have $_REQUEST douse NOT work. As I said vars are being passed on the URL. My code: echo brsec=.$_REQUEST[_section].brreq=$REQUEST_URIbr; the output sec=

[PHP] Command line parameters

2003-10-07 Thread Willem Bison
Passing arguments to php bin like this used to work in older versions: # /usr/local/bin/php test.php 'arg=test' but now it doesn't: $arg has no value within test.php It's not in $GLOBALS either. How to pass parameters to the script (apart from argv/argc) ? # /usr/local/bin/php -v PHP 4.3.2

Re: [PHP] Verry strange GET behaviour

2003-10-07 Thread John Wilcox
--- Chris Shiflett [EMAIL PROTECTED] wrote: --- John Wilcox [EMAIL PROTECTED] wrote: On the topic of passing args, can someone please explain to me why I'm unable to use $_GET or $_POST if my php script is run as a .cgi? What you may want to do is to have the Web server interpret .cgi

Re: [PHP] GET globals REQUEST the plot thickens

2003-10-07 Thread Leif K-Brooks
Marek Kilimajer wrote: Has you mention what php version are you running? Superglobals are available only since 4.1.0 If $_GET works, then his PHP version must support superglobals. -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be

Re: [PHP] Verry strange GET behaviour

2003-10-07 Thread Robert Cummings
On Tue, 2003-10-07 at 12:53, John Wilcox wrote: P.S. If anyone has any other ideas of how to get a PHP script to run as a specific user/group under a Virtual Host, I'm all ears.. All I need is for the script to be able to mkdir as a specific user/group, but this is proving to be more than

[PHP] faxing from php

2003-10-07 Thread Nicolas Claus
Hi all, is there an easy way to send faxes from PHP? Please explain as you would have to explain it to your grandmother (I'm rather new with PHP, you know). Thanx in advance ! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] or return problem

2003-10-07 Thread Pat Carmody
Calling the following retor_test() function causes a Parse error: parse error, unexpected T_RETURN message when the script is run: function istrue() { return true; } function retor_test() { istrue() or return( False ); return True; } The problem is with the or return part. Any ideas

Re: [PHP] faxing from php

2003-10-07 Thread Robert Cummings
On Tue, 2003-10-07 at 12:59, Nicolas Claus wrote: Hi all, is there an easy way to send faxes from PHP? Please explain as you would have to explain it to your grandmother (I'm rather new with PHP, you know). Sorry grandmother, I just don't have the time to explain all this to you. Cheers.

Re: [PHP] faxing from php

2003-10-07 Thread Jason Wong
On Wednesday 08 October 2003 00:59, Nicolas Claus wrote: is there an easy way to send faxes from PHP? Short answer, no. Please explain as you would have to explain it to your grandmother (I'm rather new with PHP, you know). Longer answer, you need to install some kind of fax software

Re: [PHP] or return problem

2003-10-07 Thread Robert Cummings
On Tue, 2003-10-07 at 13:02, Pat Carmody wrote: Calling the following retor_test() function causes a Parse error: parse error, unexpected T_RETURN message when the script is run: function istrue() { return true; } function retor_test() { istrue() or return( False ); return

Re: [PHP] or return problem

2003-10-07 Thread Chris Sherwood
Well Unfortunately pat You are going to have to be an unlazy man and use an if statement Chris Calling the following retor_test() function causes a Parse error: parse error, unexpected T_RETURN message when the script is run: function istrue() { return true; } function retor_test() {

Re: [PHP] or return problem

2003-10-07 Thread Robert Cummings
Incidentally your post probably caused you more work than to have tested it yourself. So much for your laziness even being optimal laziness. *pt*. I thought making stupid posts was covered in the newbie guide!?! Rob. On Tue, 2003-10-07 at 13:06, Robert Cummings wrote: On Tue, 2003-10-07 at

Re: [PHP] or return problem

2003-10-07 Thread Pat Carmody
So far everyone is telling me that it won't work, but no one is telling me why. (btw I did search extensively for the answer to this question but so far have found nothing). Robert, could you be more specific in your reference to the http://www.php.net documentation? I see nothing on the basic

Re: [PHP] or return problem

2003-10-07 Thread Robert Cummings
I already said Your laziness is causing you problems, this refers back to your original statement about being lazy. You should be able to infer form your own wrods the root of your problem. Rob. On Tue, 2003-10-07 at 13:14, Pat Carmody wrote: So far everyone is telling me that it won't work,

Re: [PHP] or return problem

2003-10-07 Thread Eugene Lee
On Tue, Oct 07, 2003 at 01:02:36PM -0400, Pat Carmody wrote: : : Calling the following retor_test() function causes a Parse error: parse : error, unexpected T_RETURN message when the script is run: : : function istrue() { : return true; : } : function retor_test() { : istrue() or return(

RE: [PHP] Singleton Was: [PHP] OO parent/child relationship

2003-10-07 Thread Andy Crain
One quick thought: You might want to add the following to your if statement: else { $this-_cache[$key] = new $key; return $this-_cache[$key]; } Andy -Original Message- From: Gerard Samuel [mailto:[EMAIL PROTECTED] Sent: Monday, October 06, 2003 5:36 PM To: 'PHP

Re: [PHP] or return problem

2003-10-07 Thread Leif K-Brooks
Chris Sherwood wrote: Well Unfortunately pat You are going to have to be an unlazy man and use an if statement Why won't any of you give a good reason why it won't work? How come this works: function foo() { 2+2==4 or die(The world is ending, or at least your processor!); } But this

Re: [PHP] or return problem

2003-10-07 Thread Robert Cummings
Why won't any of you give a good reason why it won't work? How come this works: function foo() { 2+2==4 or die(The world is ending, or at least your processor!); } But this doesn't: function foo() { 2+2==4 or return(The world is ending, or at least your processor!); }

Re: [PHP] or return problem

2003-10-07 Thread Leif K-Brooks
Robert Cummings wrote: Directly from the docs: http://ca3.php.net/manual/en/function.return.php First line: If called from within a function, the return() statement immediately ends execution of the current function Important concept: IMMEDIATELY returns. Learn to read. What

[PHP] mysql_fetch_array() not working as expected

2003-10-07 Thread Chris W. Parker
Hey peeps. Let me make this simple. I've got the following sql query in a function: SELECT c.id , cc.id , cc.prod_id , p.name , cc.price , cc.qty FROM cart AS c INNER JOIN cart_contents AS cc ON cc.cart_id = c.id INNER JOIN products AS p

Re: [PHP] or return problem

2003-10-07 Thread Robert Cummings
On Tue, 2003-10-07 at 14:29, Leif K-Brooks wrote: Robert Cummings wrote: Directly from the docs: http://ca3.php.net/manual/en/function.return.php First line: If called from within a function, the return() statement immediately ends execution of the current function

Re: [PHP] or return problem

2003-10-07 Thread Leif K-Brooks
Robert Cummings wrote: How can you possibly test, in a conditional, the return value of the return statement itself when it has no value to return and even causes the current scope to exit IMMEDIATELY?? Ok, that explains it. Thanks. -- The above message is encrypted with double rot13

RE: [PHP] or return problem

2003-10-07 Thread Roger B.A. Klorese
How can you possibly test, in a conditional, the return value of the return statement itself when it has no value to return and even causes the current scope to exit IMMEDIATELY?? Per the logic, if it returns immediately, isn't the value irrelevant? That is, assuming that the truth of the

RE: [PHP] or return problem

2003-10-07 Thread Robert Cummings
On Tue, 2003-10-07 at 14:40, Roger B.A. Klorese wrote: How can you possibly test, in a conditional, the return value of the return statement itself when it has no value to return and even causes the current scope to exit IMMEDIATELY?? Per the logic, if it returns immediately, isn't the

Re: [PHP] or return problem

2003-10-07 Thread Chris Shiflett
--- Robert Cummings [EMAIL PROTECTED] wrote: Directly from the docs: http://ca3.php.net/manual/en/function.return.php First line: If called from within a function, the return() statement immediately ends execution of the current function Important concept:

Re: [PHP] or return problem

2003-10-07 Thread Robert Cummings
On Tue, 2003-10-07 at 14:45, Chris Shiflett wrote: --- Robert Cummings [EMAIL PROTECTED] wrote: Directly from the docs: http://ca3.php.net/manual/en/function.return.php First line: If called from within a function, the return() statement immediately ends

Re: [PHP] or return problem

2003-10-07 Thread Jason Wong
On Wednesday 08 October 2003 02:51, Robert Cummings wrote: The original post came from someone being lazy, that appears to be influencing my take on the thread :) Also given the above code, it's completely pointless since the first operand is true and so it is impossible for return( 'foo' )

Re: [PHP] or return problem

2003-10-07 Thread Robert Cummings
On Tue, 2003-10-07 at 14:51, Robert Cummings wrote: The original post came from someone being lazy, that appears to be influencing my take on the thread :) Also given the above code, it's completely pointless since the first operand is true and so it is impossible for return( 'foo' ) to ever

Re: [PHP] or return problem

2003-10-07 Thread Robert Cummings
On Tue, 2003-10-07 at 15:00, Jason Wong wrote: The example given by Leif does not even run. You get a parse error. So all the discussion about return exiting immediately and the left expression evaluating to whatever is (IMHO) moot. Apparently PHP does not allow you to use return like

Re: [PHP] or return problem

2003-10-07 Thread Chris Shiflett
--- Robert Cummings [EMAIL PROTECTED] wrote: The original post came from someone being lazy, that appears to be influencing my take on the thread :) Understandable. :-) Also given the above code, it's completely pointless since the first operand is true and so it is impossible for return(

RE: [PHP] or return problem

2003-10-07 Thread Roger B.A. Klorese
I would say the real issue at hand here is that the return statement is not a fucntion, but rather a language construct, thus it cannot be used as a function unless explicitly stated as so. The reason a parse error is occurring is because this particular construct has no support for being

Re: [PHP] or return problem

2003-10-07 Thread Chris Shiflett
--- Robert Cummings [EMAIL PROTECTED] wrote: Given that die() and exit() works just means they have been given support for this context. I think you now understand the original poster's question. From my interpretation, he simply wanted to know why return was not given the same support. :-)

RE: [PHP] or return problem

2003-10-07 Thread Robert Cummings
On Tue, 2003-10-07 at 15:05, Roger B.A. Klorese wrote: Sounds to me that if it looks like a function, quacks like a function, etc., only a broken language definition would treat it differently from a function... Generally it doesn't look like a function since you can do: return 'foo'

Re: [PHP] or return problem

2003-10-07 Thread Robert Cummings
On Tue, 2003-10-07 at 15:08, Chris Shiflett wrote: --- Robert Cummings [EMAIL PROTECTED] wrote: Given that die() and exit() works just means they have been given support for this context. I think you now understand the original poster's question. From my interpretation, he simply wanted

RE: [PHP] or return problem

2003-10-07 Thread Roger B.A. Klorese
Generally it doesn't look like a function since you can do: return 'foo' which has no parenthesis. True enough. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] mysql_fetch_array() not working as expected

2003-10-07 Thread Marek Kilimajer
Chris W. Parker wrote: Hey peeps. Let me make this simple. I've got the following sql query in a function: SELECT c.id , cc.id , cc.prod_id , p.name , cc.price , cc.qty FROM cart AS c INNER JOIN cart_contents AS cc ON cc.cart_id = c.id

RE: [PHP] Limits and php...

2003-10-07 Thread Jay Blanchard
[snip] I have been trying to understand how to write a simple code that will let me limit the number of files view to 10 records, but I need to under how php can look at a number of records and then caculates how many pages it needs to show all records. Is there some sample code that shows

Re: [PHP] or return problem

2003-10-07 Thread Leif K-Brooks
Robert Cummings wrote: Generally it doesn't look like a function since you can do: return 'foo' which has no parenthesis. The parenthesis are optional and only used to return the result of an expression. The same is true of exit/die. -- The above message is encrypted with double rot13

Re: [PHP] or return problem

2003-10-07 Thread Chris Shiflett
--- Leif K-Brooks [EMAIL PROTECTED] wrote: The same is true of exit/die. Right, Robert mentioned this earlier. :-) So, in summation, someone asked why return wasn't given the same support as exit (of which die is an alias), and a lot of discussion that didn't answer this question followed. :-)

Re: [PHP] or return problem

2003-10-07 Thread Robert Cummings
On Tue, 2003-10-07 at 15:35, Leif K-Brooks wrote: Robert Cummings wrote: Generally it doesn't look like a function since you can do: return 'foo' which has no parenthesis. The parenthesis are optional and only used to return the result of an expression. The same is true of

[PHP] HTML Printing problem.

2003-10-07 Thread php coder
Issue: HTML files are to large to print from the browser. We are creating reports that are ++5 mg in size. This is a real problem for the browser. We are on a network and can print directly from the server but this means we must convert the html to some printer friendly format. We are using

  1   2   >