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 "; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[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 er

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 r

[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 = mysql

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 = mysql_r

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 inv

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, $act_

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 any

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 do

[PHP] image manipulation with php

2006-08-29 Thread Ross
I have an saved images I output with this... 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 script (ii) comparing and reducing the fil

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... > > > > > > 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 script w

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: when I tried to use swiitch() it will give me only the first true case. if $result['col_1'] == 'value_1' is true 2nd case will never be executed? Does it mean I CANNOT use switch() in this case? -afan -- PHP General Mailing List (http://www.php.net/) To unsubscri

Re: [PHP] switch()

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

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 Administrato

[PHP] Re: image manipulation with php

2006-08-29 Thread zerof
Ross escreveu: I have an saved images I output with this... 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 script (ii) comparing and

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 Haug

[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 th

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 >

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 > >>

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 these

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 the

[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: /Peter -Original Message- From: Rafael Mora [mai

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

RE: [PHP] send a file or stream

2006-08-29 Thread Peter Lauri
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 or stream 1. A user sends a request to your server to get a compressed file 2. You com

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: 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 *S

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: 6, 'window' => 15, 'memory' => 9); $texto_original = "This is a test.\nThis is only a test.\nThis is not an important string.\n"; //echo "El texto original tiene

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 oc

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 outp

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-Enco