[PHP] QUARANTINED: Mail System Error - Returned Mail

2006-08-29 Thread WorkgroupMail Content Filter
The message Mail System Error - Returned Mail from , sent on 8/29/2006 06:01 was quarantined because it contained either an executable file, a batch file or a screen saver file. All of these types of attachments are considered security risks. Please consult your mail administrator who can

Re: [PHP] Comparing strings... need advice. :)

2006-08-29 Thread Ivo F.A.C. Fokkema
On Mon, 28 Aug 2006 19:39:49 -0400, Robert Cummings wrote: On Mon, 2006-08-28 at 16:50 +0200, Ivo F.A.C. Fokkema wrote: On Mon, 28 Aug 2006 09:47:02 +0100, Stut wrote: Micky Hulse wrote: I am looking for the most secure/efficient way to compare these two strings:

[PHP] help - outputting a jpeg

2006-08-29 Thread Ross
I just get all the binary data output ? include(includes/config.php); $link = mysql_connect($host, $user, $password) or die ('somethng went wrong:' .mysql_error() ); mysql_select_db($dbname, $link) or die ('somethng went wrong, DB error:' .mysql_error() ); $query = SELECT DISTINCT gallery

[PHP] Re: help - outputting a jpeg

2006-08-29 Thread Ivo F.A.C. Fokkema
On Tue, 29 Aug 2006 09:52:20 +0100, Ross wrote: I just get all the binary data output ? include(includes/config.php); $link = mysql_connect($host, $user, $password) or die ('somethng went wrong:' .mysql_error() ); mysql_select_db($dbname, $link) or die ('somethng went wrong, DB error:'

Re: [PHP] Comparing strings... need advice. :)

2006-08-29 Thread Micky Hulse
Ivo F.A.C. Fokkema wrote: Ah, thanks. Misunderstood the question, then. Thought just checking if it's a file in that directory was what's needed. You were right. :) I did not plan on looking-in anything other than one or two hard-coded folder locations. But, it is good to know the details.

[PHP] character set when sending emails with PHP

2006-08-29 Thread Angelo Zanetti
Hi all, I have various PHP CRONTAB scripts that run and send automated emails to people, the subject often contains the TM character: ™, in most of the email clients the character shows correctly but in some webmail applications the character is replaced with a square, it obviously doesnt

[PHP] file type and recode

2006-08-29 Thread Martin Marques
Simple question: Is there a built-in function in PHP to get the charset of a file, so that I can pass the right parameters to recode_file()? -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués

[PHP] replace single and double quotes

2006-08-29 Thread Reinhart Viane
This is the code is use to insert/update text into a database field: $sqledit=update activities set act_extra='$_POST[editextra]', act_extra_fr='$_POST[editextrafr]' where act_id=$_POST[editid]; Now both $_POST[editextra] and $_POST[editextrafr] can contain single or double quotes. So the query

Re: [PHP] replace single and double quotes

2006-08-29 Thread afan
since I had something similar as a problem, let m etry to anser ang see did I get it correct :) first, and most important: never store in DB row submitted string $act_extra = mysql_real_escape_string($_POST[editextra]); $act_extra_fr = mysql_real_escape_string($_POST[editextrafr]) $act_id =

Re: [PHP] replace single and double quotes

2006-08-29 Thread Jochem Maas
[EMAIL PROTECTED] wrote: since I had something similar as a problem, let m etry to anser ang see did I get it correct :) seems ok ... first, and most important: never store in DB row submitted string $act_extra = mysql_real_escape_string($_POST[editextra]); $act_extra_fr =

Re: [PHP] replace single and double quotes

2006-08-29 Thread Jochem Maas
Reinhart Viane wrote: This is the code is use to insert/update text into a database field: $sqledit=update activities set act_extra='$_POST[editextra]', act_extra_fr='$_POST[editextrafr]' where act_id=$_POST[editid]; this indicates 'bad' database design ... because adding a language involves

RE: [PHP] replace single and double quotes

2006-08-29 Thread Peter Lauri
Assumning $act_id is integer: $act_extra = mysql_real_escape_string($_POST[editextra]); $act_extra_fr = mysql_real_escape_string($_POST[editextrafr]) $act_id = $_POST[editid]; $sql = sprint(UPDATE activities SET act_extra='%s', act_extra_fr='%s' WHERE act_id=%d, $act_extra, $act_extra_fr,

RE: [PHP] replace single and double quotes

2006-08-29 Thread Reinhart Viane
About the language remark: I believe you try to say I need to find a way that the client can add 25 languages without me having to change the database layout or the coding? Well I can assure you this will not be the fact. The client only needs these two languages but maybe I should look into it

RE: [PHP] replace single and double quotes

2006-08-29 Thread Reinhart Viane
Ok 'ill give this a shot together with the guidelines from jochen. Thx afan. -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Verzonden: dinsdag 29 augustus 2006 15:28 Aan: [EMAIL PROTECTED] CC: php-general@lists.php.net Onderwerp: Re: [PHP] replace single and

[PHP] image manipulation with php

2006-08-29 Thread Ross
I have an saved images I output with this... img src=includes/viewphoto.php?id=?=$photo? I want to use getimagesize() to get the height and width of the image and if it is above a certain size then scale/ reduce it. The problems are (i) using getimage() without a url just my viewphoto.php

Re: [PHP] replace single and double quotes

2006-08-29 Thread Jochem Maas
Reinhart Viane wrote: About the language remark: I believe you try to say I need to find a way that the client can add 25 languages without me having to change the database layout or the coding? Well I can assure you this will not be the fact. The client only needs these two languages but

Re: [PHP] image manipulation with php

2006-08-29 Thread Jochem Maas
Ross wrote: I have an saved images I output with this... img src=includes/viewphoto.php?id=?=$photo? I want to use getimagesize() to get the height and width of the image and if it is above a certain size then scale/ reduce it. The problems are (i) using getimage() without a url

RE: [PHP] replace single and double quotes

2006-08-29 Thread Peter Lauri
It might be bad database design yes, however, it all depends on what he is trying to do. I do it your way Jochem (normalizing the database), but in some cases the budget to do that might not be big enough. If the client gives you a task and an budget, normalizing the database might be a waste of

[PHP] switch()

2006-08-29 Thread afan
I have something like this: ?php $query = mysql_query( SELECT col_1, col_2 FROM table ); $result = mysql_fetch_array($query); if ($result['col_1'] == 'value_1') { // do something } if ($result['col_2'] == 'value_2') { // do something } ?

Re: [PHP] switch()

2006-08-29 Thread Ray Hauge
On Tuesday 29 August 2006 13:31, [EMAIL PROTECTED] wrote: I have something like this: ?php $query = mysql_query( SELECT col_1, col_2 FROM table ); $result = mysql_fetch_array($query); if ($result['col_1'] == 'value_1') { // do something } if

Re: [PHP] switch()

2006-08-29 Thread Ray Hauge
On Tuesday 29 August 2006 13:44, Ray Hauge wrote: Using a switch like this is more equivalent of if(something){ // true } else { // false } Actually, it's more like an if/elseif/else (if you use default:) or if/elseif (without default:) -- Ray Hauge Programmer/Systems Administrator

[PHP] Re: image manipulation with php

2006-08-29 Thread zerof
Ross escreveu: I have an saved images I output with this... img src=includes/viewphoto.php?id=?=$photo? I want to use getimagesize() to get the height and width of the image and if it is above a certain size then scale/ reduce it. The problems are (i) using getimage() without a url just

Re: [PHP] switch()

2006-08-29 Thread afan
Means, my first solution was the only solution. Thanks. -afan Using a switch like this is more equivalent of if(something){ // true } else { // false } You're doing : if(something1){ // true 1 } if(something2){ // true2 } hope that helps. -- Ray Hauge Programmer/Systems

[PHP] Re: character set when sending emails with PHP

2006-08-29 Thread Manuel Lemos
Hello, on 08/29/2006 09:04 AM Angelo Zanetti said the following: I have various PHP CRONTAB scripts that run and send automated emails to people, the subject often contains the TM character: ™, in most of the email clients the character shows correctly but in some webmail applications the

Re: [PHP] switch()

2006-08-29 Thread afan
No. They are two if statements because they are indepedent. On Tuesday 29 August 2006 13:44, Ray Hauge wrote: Using a switch like this is more equivalent of if(something){ // true } else { // false } Actually, it's more like an if/elseif/else (if you use default:) or if/elseif

Re: [PHP] switch()

2006-08-29 Thread Ray Hauge
On Tuesday 29 August 2006 14:12, [EMAIL PROTECTED] wrote: No. They are two if statements because they are indepedent. On Tuesday 29 August 2006 13:44, Ray Hauge wrote: Using a switch like this is more equivalent of if(something){ // true } else { // false } Actually, it's

Re: [PHP] switch()

2006-08-29 Thread afan
What you're saying in that case is either col_1 evaluates to value1 or col_2 evaluates to value2. Correct. To be more specific (it was better I did from begining :)) After an order is submitted, the code is checking are there any coments about tax charges (col_1) and/or billing charges (col_2).

[PHP] send a file or stream

2006-08-29 Thread Rafael Mora
Hi! i want to send a file or output stream in a .php, but first compress it, I tryed the example to compress files but how do i do to send as answer to the http request?? Rafa

RE: [PHP] replace single and double quotes

2006-08-29 Thread tedd
At 5:04 PM +0200 8/29/06, Reinhart Viane wrote: About the language remark: I believe you try to say I need to find a way that the client can add 25 languages without me having to change the database layout or the coding? Well I can assure you this will not be the fact. The client only needs

Re: [PHP] replace single and double quotes

2006-08-29 Thread Rafael Mora
Hi! i want to send a file or output stream in a .php, but first compress it, I tryed the example to compress files but how do i do to send as answer to the http request?? Rafa

[PHP] Strange situation when saving a file

2006-08-29 Thread Miguel Guirao
Hi all, I'm using ob_start() in order to save the content of a web page into a variable string and then save it into a file in the file system. Every thing is done OK. The only workaround I'm doing is adding a .doc file extension when saving the file, in order to open the file in Word. Once

[PHP] Test!

2006-08-29 Thread Rafael Mora
Hello! this is a test, can anyone tell me if u are getting my emails?? Thank you

Re: [PHP] Test!

2006-08-29 Thread Robert Cummings
On Tue, 2006-08-29 at 23:00 -0400, Rafael Mora wrote: Hello! this is a test, can anyone tell me if u are getting my emails?? I'm not getting them :/ Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com |

RE: [PHP] send a file or stream

2006-08-29 Thread Peter Lauri
Do you mean the following: 1. A user sends a request to your server to get a compressed file 2. You compress the file on the server 3. You want to send back to compressed file to the server It is number 3 you asking for? In that case: ?php header(Content-Type: application/octet-stream);

Fwd: [PHP] send a file or stream

2006-08-29 Thread Rafael Mora
-- Forwarded message -- From: Rafael Mora [EMAIL PROTECTED] Date: Aug 29, 2006 11:09 PM Subject: Re: [PHP] send a file or stream To: Peter Lauri [EMAIL PROTECTED] 1. A user sends a request to your server to get a compressed file 2. You compress the file on the server 3. I want to

RE: [PHP] send a file or stream

2006-08-29 Thread Peter Lauri
?php header(Content-Type: application/octet-stream); readfile(path_to_compressed_file); ? Should do it then. if you know the path to the file :) _ From: Rafael Mora [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 30, 2006 10:10 AM To: Peter Lauri Subject: Re: [PHP] send a file

Re: [PHP] send a file or stream

2006-08-29 Thread Rafael Mora
ok thank you Im going to test it!! =) On 8/29/06, Peter Lauri [EMAIL PROTECTED] wrote: ?php header(Content-Type: application/octet-stream); readfile(path_to_compressed_file); ? Should do it then… if you know the path to the file :) -- *From:* Rafael Mora

Re: [PHP] send a file or stream

2006-08-29 Thread Rafael Mora
I test it and gave me this: xœ ÉÈ,V¢D…'Ôâ=(r)(??/§C0/¿D!1O!3· ¿¨$1¯D¡¸¤(3/] LÖ so the user should read that?? this is my code: ?php $params = array('level' = 6, 'window' = 15, 'memory' = 9); $texto_original = This is a test.\nThis is only a test.\nThis is not an important string.\n;

RE: [PHP] send a file or stream

2006-08-29 Thread Peter Lauri
You need to make sure that you are not outputting ANYTHING before you do this. I might guess that you have a whitespace in the top of the script. As soon as you output, the server can not send any more header information, and the browser will think it is just text instead of treating it as an

Re: [PHP] send a file or stream

2006-08-29 Thread Rafael Mora
Ok it works, but it returns me the same .php file, not the one I am creating On 8/29/06, Peter Lauri [EMAIL PROTECTED] wrote: You need to make sure that you are not outputting ANYTHING before you do this. I might guess that you have a whitespace in the top of the script. As soon as you

RE: [PHP] send a file or stream

2006-08-29 Thread Peter Lauri
Try this: header(Pragma: public); header(Expires: 0); // set expiration time header(Cache-Control: must-revalidate, post-check=0, pre-check=0); header(Content-Type: application/octet-stream); header('Content-Disposition: attachment; filename=stations.gzip'); header(Content-Transfer-Encoding: