Re: [PHP] $_FILES doesn't work but $_POST works

2006-05-30 Thread Chris
kartikay malhotra wrote: Hi All, I'm using Mbuni MMS gateway, which provides me the facility to upload .mms files. Now with my little exposure to PHP, to upload files (say from the browser), I use $_POST, namely: if($_FILES['userfile']['size'] > 0) { $fileName = $_FILES['userfile']['name'];

Re: [PHP] Using 'header' as redirect

2006-05-30 Thread Richard Lynch
On Tue, May 30, 2006 1:21 pm, Philip Thompson wrote: > On May 30, 2006, at 12:52 PM, Stut wrote: > >> Philip Thompson wrote: >>> Ok, I have modified my code a little bit. Stut, yes, output >>> buffering was on by default (4096). I *think* this will work. It >>> appears to be the same as before - st

Re: [PHP] More about converting text strings

2006-05-30 Thread Paul Scott
On Wed, 2006-05-31 at 00:27 -0500, Richard Lynch wrote: > Show us the first 2 lines of index3.php > > Cuz line 1 has something in it to print out data/content. Probably whitespace outside of --Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/un

Re: [PHP] $_FILES doesn't work but $_POST works

2006-05-30 Thread Richard Lynch
Did you put the enctype="multipart/form-data" into the FORM tag? What you describe matches not doing that. On Wed, May 31, 2006 12:25 am, kartikay malhotra wrote: > Hi All, > > I'm using Mbuni MMS gateway, which provides me the facility to upload > .mms > files. > > Now with my little exposure t

Re: [PHP] More about converting text strings

2006-05-30 Thread Richard Lynch
On Tue, May 30, 2006 4:11 am, Jonas Rosling wrote: > While I'm using UTF-8 as char set in my documents JavaScript messages > works > correct with none international characters. But not the PHP code with > session_start(). I get the following error message: > > Warning: session_start(): Cannot send

[PHP] $_FILES doesn't work but $_POST works

2006-05-30 Thread kartikay malhotra
Hi All, I'm using Mbuni MMS gateway, which provides me the facility to upload .mms files. Now with my little exposure to PHP, to upload files (say from the browser), I use $_POST, namely: if($_FILES['userfile']['size'] > 0) { $fileName = $_FILES['userfile']['name']; $tmpName = $_FILES['userf

RE: [PHP] how include works?

2006-05-30 Thread Richard Lynch
On Tue, May 30, 2006 2:02 am, Peter Lauri wrote: > I understand the difference well enough, but I've never really > understood > the reason for having both. Is it to help find errors in sloppy > coding, or > is there a case where including a file more than once is desirable > (and > won't cause an

Re: [PHP] Executing functions or scripts in parallel

2006-05-30 Thread Richard Lynch
On Tue, May 30, 2006 9:55 am, Phil Martin wrote: > I've made a very basic and small function to suit my needs in > monitoring some hosts services. I've noticed that the script is a > little bit > slow because of the number of hosts and services to monitor. Is there > a way > to execute my fun

Re: [PHP] Using 'header' as redirect

2006-05-30 Thread Richard Lynch
Your theory is wrong. The correct answer is that somebody turned output_buffering "ON" in php.ini (or .htaccess) so the output is not really sent until the script finishes (up to 4096 chars). On Tue, May 30, 2006 11:08 am, Philip Thompson wrote: > Hi all. > > I have a site where I include pages w

Re: [PHP] sending mail via php and unix box-clients thinks it's spam

2006-05-30 Thread Richard Lynch
On Tue, May 30, 2006 12:45 pm, blackwater dev wrote: > I have a site running on a linux box. If I use my mail server via an > email > client, the email works fine but if I send email through the mail > function, > clients mark it as spam. I see the line in php.ini for SMTP but that > says > windo

Re: [PHP] Addtime is for 4.1, what can i use for 3.23? (pretty much 0T)

2006-05-30 Thread Richard Lynch
http://dev.mysql.com/ On Tue, May 30, 2006 6:53 pm, Ryan A wrote: > Hey, > To simplify this lets say my table looks like this: > > a time default NULL, > b time default NULL > > This is what i run: > INSERT INTO test2 VALUES (Curtime( ) , > ADDTIME(Curtime( ) , "00:01:00")) > > since the db is

Re: [PHP] mysql_num_rows

2006-05-30 Thread Richard Lynch
INSERT queries and num_rows just don't go together. And whatever you've done with mysql_affected_rows() is just some kind of silly mistake on your part, almost for sure... On Tue, May 30, 2006 11:28 pm, John Taylor-Johnston wrote: > How can I get an integer value for mysql_affected_rows()? I g

[PHP] mysql_num_rows

2006-05-30 Thread John Taylor-Johnston
How can I get an integer value for mysql_affected_rows()? I get text: " n Database Transfer(s)". I would like to create my own error flag and exit; if the number of affected rows is <= 0. The example for mysql-num-rows in the manual does not work. I have MySQL - 4.1.12. $num_rows = mysql_n

[PHP] Re: PHP, Javascript, and Forms

2006-05-30 Thread Manuel Lemos
Hello, on 05/30/2006 11:03 PM Beauford said the following: > I have a form with about 20 fields in it and have two drop down menus in > which the second one changes depending on the previous one. This is done > with a javascript which reloads the page. > > The problem with this is that everything

Re: [PHP] PHP, Javascript, and Forms

2006-05-30 Thread tedd
At 10:03 PM -0400 5/30/06, Beauford wrote: >Hi, > >I have a form with about 20 fields in it and have two drop down menus in >which the second one changes depending on the previous one. This is done >with a javascript which reloads the page. > >The problem with this is that everything the user has p

Re: [PHP] PHP, Javascript, and Forms

2006-05-30 Thread David Tulloh
Beauford wrote: > Hi, > > I have a form with about 20 fields in it and have two drop down menus in > which the second one changes depending on the previous one. This is done > with a javascript which reloads the page. > > The problem with this is that everything the user has put in so far gets >

Re: [PHP] PHP, Javascript, and Forms

2006-05-30 Thread Minuk Choi
I think a better way for you to go(it may be a little bit more difficult, but it won't have any annoying "flickering" from the reloading of page) is to use AJAX. But if you insist on going on a PHP form + Javascript validation -> submit form ->PHP form + Javascript validation, that can be done

Re: [PHP] Addtime is for 4.1, what can i use for 3.23? (pretty much 0T)

2006-05-30 Thread Chris
Ryan A wrote: Hey Chris, ... SELECT curtime( ) + INTERVAL 60 minute is giving me null, has anybody else faced this? if so how did you solve this? ... What does select curtime(); give you? It gives me the correct time, eg: 03:23:01 Make sure that's valid before trying to add to

[PHP] Long one here, but hopefully someone took their Adderall

2006-05-30 Thread Pavleck, Jeremy D.
I also have a strong suspicion this webmail will be sending this HTML formatted, so I apologize in advance. Anyway, here it goes! Greetings All! I'm trying to build a webpage that will pull out server information using snmpget and snmpwalkoid, among other things. Most of the things I poll are f

[PHP] PHP, Javascript, and Forms

2006-05-30 Thread Beauford
Hi, I have a form with about 20 fields in it and have two drop down menus in which the second one changes depending on the previous one. This is done with a javascript which reloads the page. The problem with this is that everything the user has put in so far gets erased when the page reloads. I

Re: [PHP] Addtime is for 4.1, what can i use for 3.23? (pretty much 0T)

2006-05-30 Thread Ryan A
Hey Chris, ... > > SELECT curtime( ) + INTERVAL 60 minute > > > > is giving me null, has anybody else faced this? if > so > > how did you solve this? ... > What does > select curtime(); > give you? It gives me the correct time, eg: 03:23:01 > Make sure that's valid before trying to add

Re: [PHP] Addtime is for 4.1, what can i use for 3.23? (pretty much 0T)

2006-05-30 Thread Chris
Ryan A wrote: Hey, To simplify this lets say my table looks like this: a time default NULL, b time default NULL This is what i run: INSERT INTO test2 VALUES (Curtime( ) , ADDTIME(Curtime( ) , "00:01:00")) since the db is version 3.23 (I cant ask the client to upgrade) instead of 4.1, th

Re: [PHP] sending mail via php and unix box-clients thinks it's spam

2006-05-30 Thread Chris
blackwater dev wrote: I have a site running on a linux box. If I use my mail server via an email client, the email works fine but if I send email through the mail function, clients mark it as spam. I see the line in php.ini for SMTP but that says windows only. How do I tell php to use my mail

Re: [PHP] how include works?

2006-05-30 Thread Chris
Arno Kuhl wrote: On 5/30/06, Arno Kuhl <[EMAIL PROTECTED]> wrote: I understand the difference well enough, but I've never really understood the reason for having both. Is it to help find errors in sloppy coding, or is there a case where including a file more than once is desirable (and won't cau

[PHP] Addtime is for 4.1, what can i use for 3.23? (pretty much 0T)

2006-05-30 Thread Ryan A
Hey, To simplify this lets say my table looks like this: a time default NULL, b time default NULL This is what i run: INSERT INTO test2 VALUES (Curtime( ) , ADDTIME(Curtime( ) , "00:01:00")) since the db is version 3.23 (I cant ask the client to upgrade) instead of 4.1, the above SQL is no

Re: [PHP] number_format

2006-05-30 Thread Jo�o C�ndido de Souza Neto
I´m sorry. My head´s crazy todar. Thanks a lot. "Stut" <[EMAIL PROTECTED]> escreveu na mensagem news:[EMAIL PROTECTED] > João Cândido de Souza Neto wrote: >> If you look at carefuly, you´ll see that i´ve two problems in the same >> function. >> >> 1 - This function add blank spaces at th

Re: [PHP] number_format

2006-05-30 Thread Stut
João Cândido de Souza Neto wrote: If you look at carefuly, you´ll see that i´ve two problems in the same function. 1 - This function add blank spaces at the beginning of the string. 2 - This function rounds the $var value and it can causes meny troubles. Ok, I've already checked that number_f

Re: [PHP] Executing functions or scripts in parallel

2006-05-30 Thread Adam Zey
Phil Martin wrote: Many parts of this script were found at the following site: http://www.sitepoint.com/article/udp-portscanning-php This script isn't totally mine. I've just adapted it to my needs and it is working quite well, telling me when a service is up or down ... read the article for fur

Re: [PHP] Executing functions or scripts in parallel

2006-05-30 Thread Phil Martin
Many parts of this script were found at the following site: http://www.sitepoint.com/article/udp-portscanning-php This script isn't totally mine. I've just adapted it to my needs and it is working quite well, telling me when a service is up or down ... read the article for further details. Anywa

Re: [PHP] Using 'header' as redirect

2006-05-30 Thread Stut
Philip Thompson wrote: I was under the impression that if ob_end_flush() was not called, then there would be a memory leak. Is this not the case? No, it's not. All output buffers are flushed in the reverse order of opening when the script ends. From http://us3.php.net/ob_start : "Output bu

Re: [PHP] Using 'header' as redirect

2006-05-30 Thread Adam Zey
Philip Thompson wrote: On May 30, 2006, at 12:52 PM, Stut wrote: Philip Thompson wrote: Ok, I have modified my code a little bit. Stut, yes, output buffering was on by default (4096). I *think* this will work. It appears to be the same as before - still redirecting appropriately: ...

Re: [PHP] Executing functions or scripts in parallel

2006-05-30 Thread Jochem Maas
Phil Martin wrote: Sure, sorry about that. I have a function that tells me if the host is DOWN or UP. I want to run this function in parallel for each host I monitor. The function is the following: function servstatus($remote_ip, $remote_ip_port, $remote_ip_proto) { if ($remote_ip_proto == "tcp

Re: [PHP] Using 'header' as redirect

2006-05-30 Thread Philip Thompson
On May 30, 2006, at 12:52 PM, Stut wrote: Philip Thompson wrote: Ok, I have modified my code a little bit. Stut, yes, output buffering was on by default (4096). I *think* this will work. It appears to be the same as before - still redirecting appropriately: ... The subpage does not

Re: [PHP] number_format

2006-05-30 Thread Stut
João Cândido de Souza Neto wrote: I´m having some troubles with the number_format function. When i run a number_format("3000",2,",",".") if returns correctly, but when i try to run number_format("300",2,",",".") it returns the value formatted but with two spaces before. Anyone knows how can

Re: [PHP] Using 'header' as redirect

2006-05-30 Thread Stut
Philip Thompson wrote: Ok, I have modified my code a little bit. Stut, yes, output buffering was on by default (4096). I *think* this will work. It appears to be the same as before - still redirecting appropriately: ... The subpage does not change any, only index.php. I am basically "h

[PHP] number_format

2006-05-30 Thread Jo�o C�ndido de Souza Neto
Hi. I´m using the number_format function to format my currency numbers. i.g.: number_format($var,2,",",".") Anyone´ll knew to tell me if this function rounds the number according of decimals? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.n

[PHP] sending mail via php and unix box-clients thinks it's spam

2006-05-30 Thread blackwater dev
I have a site running on a linux box. If I use my mail server via an email client, the email works fine but if I send email through the mail function, clients mark it as spam. I see the line in php.ini for SMTP but that says windows only. How do I tell php to use my mail server? Thanks!

Re: [PHP] Using 'header' as redirect

2006-05-30 Thread Chris Boget
As you can see, by the time that index.php includes the subpage, it has already outputted HTML. According to using the header() function, you are not allowed to output any HTML *before* using header(). However, I am doing this and it is redirecting fine. You can also always use the old trie

Re: [PHP] Using 'header' as redirect

2006-05-30 Thread Philip Thompson
Ok, I have modified my code a little bit. Stut, yes, output buffering was on by default (4096). I *think* this will work. It appears to be the same as before - still redirecting appropriately: ... The subpage does not change any, only index.php. I am basically "holding off" on displa

Re: [PHP] Using 'header' as redirect

2006-05-30 Thread Stut
Philip Thompson wrote: As you can see, by the time that index.php includes the subpage, it has already outputted HTML. According to using the header() function, you are not allowed to output any HTML *before* using header(). However, I am doing this and it is redirecting fine. I have hypo

Re: [PHP] Using 'header' as redirect

2006-05-30 Thread Philip Thompson
Yes, I do tests to make sure that the file actually exists and what not. I have just simplified my code for this example ~PT On May 30, 2006, at 11:27 AM, Martin Alterisio wrote: 2006/5/30, Philip Thompson <[EMAIL PROTECTED]>: Are you checking what the user is sending inside $_GET['pa

Re: [PHP] Using 'header' as redirect

2006-05-30 Thread Martin Alterisio
2006/5/30, Philip Thompson <[EMAIL PROTECTED]>: Are you checking what the user is sending inside $_GET['page']? If not, your system is vulnerable to a remote file injection.

Re: [PHP] how include works?

2006-05-30 Thread Stut
Arno Kuhl wrote: Well I certainly don't come close to knowing all there is to know about PHP and I'm always keen to learn something new - can you show me an example of a file being included more than once, and why it's required more than once during the same request? I can obviously include stra

[PHP] Using 'header' as redirect

2006-05-30 Thread Philip Thompson
Hi all. I have a site where I include pages within pages. Well, for some of the pages I want the user to be logged in, while others I don't care. I'm doing something that I thought was not allowed by the header() function. ... As you can see, by the time that index.php includes

Re: [PHP] Executing functions or scripts in parallel

2006-05-30 Thread Phil Martin
Sure, sorry about that. I have a function that tells me if the host is DOWN or UP. I want to run this function in parallel for each host I monitor. The function is the following: function servstatus($remote_ip, $remote_ip_port, $remote_ip_proto) { if ($remote_ip_proto == "tcp") { $socket

Re: [PHP] Executing functions or scripts in parallel

2006-05-30 Thread Dave Goodchild
On 30/05/06, Phil Martin <[EMAIL PROTECTED]> wrote: Hi everyone, I've made a very basic and small function to suit my needs in monitoring some hosts services. I've noticed that the script is a little bit slow because of the number of hosts and services to monitor. Is there a way to execut

[PHP] Executing functions or scripts in parallel

2006-05-30 Thread Phil Martin
Hi everyone, I've made a very basic and small function to suit my needs in monitoring some hosts services. I've noticed that the script is a little bit slow because of the number of hosts and services to monitor. Is there a way to execute my function servstatus(); in parallel with every hos

[PHP] Re: storing single and double quote in MySQL

2006-05-30 Thread Michelle Konzack
Please can you STOP hijacking my thread? Such things makes me very angree! Greetings Michelle Konzack -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ # Debian GNU/Linux Consultant # Michelle Konzack Apt. 917 ICQ

[PHP] Executing functions or scripts in parallel

2006-05-30 Thread Phil Martin
Hi everyone, I've made a very basic and small function to suit my needs in monitoring some hosts services. I've noticed that the script is a little bit slow because of the number of hosts and services to monitor. Is there a way to execute my function servstatus(); in parallel with every hos

Re: [PHP] how include works?

2006-05-30 Thread Stut
Arno Kuhl wrote: We really are talking across each other. If you read my post properly you would have noticed that I was asking why the include/require doesn't work like the _once by default, not why there is a _once (which is obviously the way you understood it). The application I work on has m

Re: [PHP] how include works?

2006-05-30 Thread Stut
Arno Kuhl wrote: I wasn't talking about the difference between require and include but rather the difference between require and require_once (or include and include_once). Why doesn't require just work the same way as require_once, because I can't see the need for require -ing the same file mor

RE: [PHP] how include works?

2006-05-30 Thread Arno Kuhl
>On 5/30/06, Arno Kuhl <[EMAIL PROTECTED]> wrote: > > I understand the difference well enough, but I've never really understood > the reason for having both. Is it to help find errors in sloppy coding, or > is there a case where including a file more than once is desirable (and > won't cause an err

Re: [PHP] Monitoring Remote Server Services using php !

2006-05-30 Thread Phil Martin
I did the following, I've followed your advice and wrote my own, that is listed below. It's a function that has 3 entry arguments, IP, Port and Protocol. It returns if the Service is UP or DOWN. Take a Look, and see if we can enhance it's speed. function servstatus($remote_ip, $remote_ip_port, $

RE: [PHP] pop-up window in php???

2006-05-30 Thread Jay Blanchard
[snip] Toolbars? No, I'm not that clever. I was only referring to disabling links and form fields within the HTML page itself. The best I could do using this technique wouldn't exactly mimic a modal dialog, just approximate one. [/snip] Incredibly enough I just found this particular way of

SV: [PHP] Converting text strings [out of topic a bit]

2006-05-30 Thread Jonas Rosling
-Ursprungligt meddelande- Från: tedd [mailto:[EMAIL PROTECTED] Skickat: den 30 maj 2006 15:10 Till: Jonas Rosling; PHP List Ämne: Re: [PHP] Converting text strings [out of topic a bit] At 10:17 AM +0200 5/30/06, Jonas Rosling wrote: >Hi all, >when my documents are using iso-8859-1 (Latin

[PHP] Re: More about converting text strings

2006-05-30 Thread M. Sokolewicz
Are you sure you're not including the BOM? (byte-order-mark) If you are, PHP doesn't understand it, and thus just outputs it. Thus creating output, thus creating problems with headers for you. (so don't use BOM) - tul Jonas Rosling wrote: While I'm using UTF-8 as char set in my documents Ja

RE: [PHP] pop-up window in php???

2006-05-30 Thread Jef Sullivan
The code would be quicker and fewer lines if you did this with Javascript, but you could do it with PHP. Use an iframe for the yes / no options, create a form, then capture the response and display the results as you wish. Jef -Original Message- From: Adam Zey [mailto:[EMAIL PROTECTE

Re: [PHP] Converting text strings [out of topic a bit]

2006-05-30 Thread tedd
At 10:17 AM +0200 5/30/06, Jonas Rosling wrote: Hi all, when my documents are using iso-8859-1 (Latin 1) as char set I have some problems with displaying my JS dialogs correct with none international characters (å, ä and ö). Allthough this hasen't got anything to do with PHP, does anyone have any

Re: [PHP] how include works?

2006-05-30 Thread Stut
Richard Lynch wrote: On Tue, May 23, 2006 6:19 pm, Mindaugas L wrote: can anybody explain how require works, and what's the difference between _once and regular? What's going on when php file is processed? In manual is written just, that it's readed once if include_once. What does to mean "r

Re: [PHP] how include works?

2006-05-30 Thread chris smith
On 5/30/06, Arno Kuhl <[EMAIL PROTECTED]> wrote: -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: 30 May 2006 06:11 To: Mindaugas L Cc: php-general@lists.php.net Subject: Re: [PHP] how include works? On Tue, May 23, 2006 6:19 pm, Mindaugas L wrote: > can anybody ex

RE: [PHP] how include works?

2006-05-30 Thread Peter Lauri
Arno wrote: I understand the difference well enough, but I've never really understood the reason for having both. Is it to help find errors in sloppy coding, or is there a case where including a file more than once is desirable (and won't cause an error)? Arno -- There

RE: [PHP] how include works?

2006-05-30 Thread Arno Kuhl
-Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: 30 May 2006 06:11 To: Mindaugas L Cc: php-general@lists.php.net Subject: Re: [PHP] how include works? On Tue, May 23, 2006 6:19 pm, Mindaugas L wrote: > can anybody explain how require works, and what's the difference

[PHP] More about converting text strings

2006-05-30 Thread Jonas Rosling
While I'm using UTF-8 as char set in my documents JavaScript messages works correct with none international characters. But not the PHP code with session_start(). I get the following error message: Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /v

Re: [PHP] anti SQL injection method in php manual.

2006-05-30 Thread Dotan Cohen
On 5/30/06, Richard Lynch <[EMAIL PROTECTED]> wrote: On Fri, May 26, 2006 10:39 am, Dotan Cohen wrote: > What is the purpose of the sprintf? If it were using %d on integers I > could see the point, but as we're talking about %s strings, what is > the advantage to using sprintf? None, really. >

[PHP] Converting text strings [out of topic a bit]

2006-05-30 Thread Jonas Rosling
Hi all, when my documents are using iso-8859-1 (Latin 1) as char set I have some problems with displaying my JS dialogs correct with none international characters (å, ä and ö). Allthough this hasen't got anything to do with PHP, does anyone have any good idéas on how to solve this? Normaly I use U