Re: [PHP] Re: Echo HTML code Verses breaking out of ?php ?
* Thus wrote tkwright ([EMAIL PROTECTED]): Just warming the timer This Is HTML ### # Total Time: 0.000114 seconds # # Start Time: 1069732578.575586 seconds # # Ending Time: 1069732578.575700 seconds # ### You need to do more than one iteration in your benchmark. There are many factors that go into benchmarking that can easily give false reports. And situations differ on their performance, for example: echo 'a'; vs. ?a?php The echo will simply add the char 'a' to the output stack, while the latter will have to break out of php add 'a' to the stack and re-enter php. begin 666 inspect.timer.2.php Attachments are strongly discourged on the list, if you wish to share them put them on the website and post the links to them here. Curt -- My PHP key is worn out PHP List stats since 1997: http://zirzow.dyndns.org/html/mlists/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $ of variables, php, mysql
On Tue, 2003-11-25 at 00:42, Joffrey Leevy wrote: Would appreciate in anyone can help me. Let's say I do a query in php, eg. $query = select shed from structure; With the mysql_fetch_array function and a loop I could see all the values stored in the column, shed, using the command: echo $shed; Let's say now that I am carrying over a variable from a form called $form where $form = shed. I can still say $query = select $form from structure; because $form = shed. The problem I have now is with the strings and how do I see my column values. Using echo $$value; or echo $($value); or echo \$$value; or echo $$value; does not give me the values stored in the column shed. Help anyone? thanks __ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I don't understand.. Why would you need a variable variable to retrive an item from the database? If you mean you don't know what column the data is going to come from once the form is submitted can't you just use mysql_fetch_row() instead. Then you don't need to worry much about what column it came from. If there's more then one column you'd need to know order. In the loop you can use something like for($i = 0; $results = mysql_fetch_row($query); $i++) { echo $results[0]; //$results[0] would always retrieve that column queried even if change. } This is off the top of my head. It should work with a little tweaking. -- I have a photographic memory. I just forgot the film --Unknown = Ryan Thompson [EMAIL PROTECTED] http://osgw.sourceforge.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $ of variables, php, mysql
On Mon, Nov 24, 2003 at 09:42:30PM -0800, Joffrey Leevy wrote: : : Would appreciate in anyone can help me. Some more code would be helpful. : Let's say I do a query in php, eg. $query = select : shed from structure; With the mysql_fetch_array : function and a loop I could see all the values stored : in the column, shed, using the command: echo $shed; $query = select shed from structure; $result = mysql_query($query); while (($row = mysql_fetch_array($result)) !== false) { echo $row['shed']; } : Let's say now that I am carrying over a variable from : a form called $form where $form = shed. I can still : say $query = select $form from structure; because : $form = shed. Try using more variables to make life a little easier to parse: $colname = $_FORM['form'] $query = select {$colname} from structure; $result = mysql_query($query); while (($row = mysql_fetch_array($result)) !== false) { echo $row[$colname]; } : The problem I have now is with the strings and how do : I see my column values. Use better variable names. And avoid register_globals. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP with Java extension
Hello options some of which ray has suggested. Others include soap or writing out objects using the XMLEncoder class (1.4+) and decoding them with a parser in your php. this is also a possible solution but the java system that does the processing is already written and tested, the only thing left to do is to read some values from a form and pass them to it. BEsides I have no clue about PHP and its syntax so I wouldn't want to delve too deep into it. I'd like to keep on researching the PHP to Java solution. Any more thoughts? __ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fw: [PHP] Re: Excel Table download it
header(Content-type: application/vnd.ms-excel); header(Content-Disposition: attachment; filename=report.xls); - Forwarded by Larry Li/APPLIED MATERIALS on 11/25/2003 03:40 PM - Phillip Jackson [EMAIL PROTECTED] 11/25/2003 02:30 PM To: [EMAIL PROTECTED] cc: Subject:[PHP] Re: Excel Table download it excel can read html tables with partial formatting through stylesheets output html tabletrtd tags and save the file as an *.xls file. i redirect back to the file after writing to it - ie doesn't display it, rather it prompts to download. ~phillip Leon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] hi~ I want generate an excel table download it as a file (not view in IE), what HTML mimetype should i use? leon [EMAIL PROTECTED] 2003-11-24 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PRINT QUESTION
Dale Hersh wrote: I know that in php there are a bunch of basic functions for opening a connection to a printer and then handling the printer queue and so forth. I would like to know how to take a string and echo that to the printer in php. The printer functions only work under Windows. From http://www.php.net/printer : These functions are only available under Windows 9.x, ME, NT4 and 2000. So if you are on windows, you can try running the printer_write() example ( http://www.php.net/printer-write ) If you are not on Windows, one way you can print is to try some output redirection and see what kind of results you get, eg : system(cat file.txt lpt1); were lpt1 is where your printer is connected. If your printer is connected directly to the computer, it is on lp1 (usually, lpt1 is the default printer port (parallel)). I think lpt1 stands for line printer terminal 1, but I'm not too sure about that. There are probably better ways to do the same on other systems, but this is the quick example I could think of. -- Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com --- Documentation is like sex: when it is good, it is very, very good; and when it is bad, it is better than nothing. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PRINT QUESTION
On Tue, 25 Nov 2003, Burhan Khalid wrote: Dale Hersh wrote: I know that in php there are a bunch of basic functions for opening a connection to a printer and then handling the printer queue and so forth. I would like to know how to take a string and echo that to the printer in php. The printer functions only work under Windows. From http://www.php.net/printer : These functions are only available under Windows 9.x, ME, NT4 and 2000. So if you are on windows, you can try running the printer_write() example ( http://www.php.net/printer-write ) If you are not on Windows, one way you can print is to try some output redirection and see what kind of results you get, eg : system(cat file.txt lpt1); were lpt1 is where your printer is connected. If your printer is connected directly to the computer, it is on lp1 (usually, lpt1 is the default printer port (parallel)). I think lpt1 stands for line printer terminal 1, but I'm not too sure about that. There are probably better ways to do the same on other systems, but this is the quick example I could think of. Hello, I have printed plenty and regularly under Linux through CUPS by issuing: exec(lpr -Pprinter_name file_to_print) or $ph = popen(lpr -Pprinter_name); fwrite($ph, $data_to_print); pclose($ph); If you need fancy printout, it might be a good idea to produce PDF that is printed out, then. If this is what you want, take a look at http://dataxi.sourceforge.net and download solib-version.tar.gz that contains sopdf.php -- or dataxi-version.tar.gz for higher level PDF classes. You need www.pdflib.com (free lite version available) in order to use sopdf.php or it's derivants. Cheers, -- --Jyry :-(C:-/C8-OC8-/C:-( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] when to use \n in forms
On Monday 24 November 2003 04:02, Nigel Jones wrote: Not to offend anyone BUT What the is DHTML and JS (and VB for that matter) meant to do, we can use PHP instead who needs onLoad=Gimmethedampopups() - not me anyway i http://www.kryogenix.org/code/browser/sorttable/ is a neat bit of JS (and posssibly DHTML) that alleviates DB engine hits when sorting data. JS is also useful for client-side validation. Don't rely on it, but it does provide a first-level of defence against users. As for DHTML - http://www.quirksmode.org/ is all I'll say :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $$vars and security
--- Phillip Jackson [EMAIL PROTECTED] wrote: i have developed my own register globals function that mimics the action of register globals, but only for $_POST... i do this to ensure that all incoming communication is escaped for use in scripts to account for, and to avoid, SQL injection. So, are you not worried about all of the other types of attacks? Personally, I think this is a bad approach, regardless of how well it is implemented. I think you will give yourself a false sense of security. In addition, I think it is impossible to create secure data filtering rules that can possibly apply to all types of data. It is much better to take the time to create a validation algorithm for each distinct type of data that you expect and to use a whitelist approach in your logic. If you don't care what I think and want to take this approach anyway, you might find this useful: http://linux.duke.edu/projects/mini/htmlfilter/ Remember that there are two potential victims when poor data filtering is applied: you and your users. Don't forget to protect one while worrying about the other. Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $$vars and security
Phillip Jackson wrote: function escape(){ while (list($key, $value) = each($_POST)) { $value = trim(mysql_escape_string($value)); global $$key; $$key = $value; } } 1. The function does not detect if magic_quotes_gpc are on, post vars would be double escaped then. 2. $value might be an array (input name=var[] ...), the array would be effectively destroyed. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $$vars and security
great point about the array; to make the script more portable i will most definitely detect magic quotes. Marek Kilimajer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Phillip Jackson wrote: function escape(){ while (list($key, $value) = each($_POST)) { $value = trim(mysql_escape_string($value)); global $$key; $$key = $value; } } 1. The function does not detect if magic_quotes_gpc are on, post vars would be double escaped then. 2. $value might be an array (input name=var[] ...), the array would be effectively destroyed. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $$vars and security
Personally, I think this is a bad approach, regardless of how well it is implemented. I think you will give yourself a false sense of security. what, then, do you yourself do in such an application requiring a response from the user to massage the data? reject all input that doesn't conform to your whitelist? i shall look into making this the vital part of the escape function. Hope that helps. most definitely - thank you for the quick response. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Time
Hi there, I have a RH Linux Web server running apache and PHP. I recently changed the system clock, the time zone and hardware clock. The time and date are showing up correctly in Webmin and in the O/S itself. But when I call a php function to display the date and time it shows it as one hour behind! How do I fix this? Regards Fernando -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $ of variables, php, mysql
Eugene Lee wrote: Try using more variables to make life a little easier to parse: $colname = $_FORM['form'] $query = select {$colname} from structure; $result = mysql_query($query); while (($row = mysql_fetch_array($result)) !== false) { echo $row[$colname]; } Very dangerous. $colname can be anything, e.g. mysql.user.password colname FROM mysql.user # -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Time
Fernando Melo wrote: Hi there, I have a RH Linux Web server running apache and PHP. I recently changed the system clock, the time zone and hardware clock. The time and date are showing up correctly in Webmin and in the O/S itself. But when I call a php function to display the date and time it shows it as one hour behind! How do I fix this? Regards Fernando Must be something with your locale settings. Probably your sytem clock is set to the GMT time, while you are in GMT+1 yourself. Not really sure how to fix this, but this might be something that helps you find the solution. Let me know ! Wouter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date format question
Thanks to all, it help me a lot manisha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Locking mysql tables with PHP
Hi bit confused! here's what I want to do: get a numeric value from a MySQL table, do a calculation, then on another PHPpage update the numeric value in the table. what I don't want is anyone else getting the same number from the table before I've updated it. what PHP would you use to do this? Sorry for what is probably a really basic question - I did look at the MySQL manual, but I'm not sure how exactly to issue an SQL query LOCK TABLES using PHP. TIA Tony -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Locking mysql tables with PHP
Tony Crockford wrote: Hi bit confused! here's what I want to do: get a numeric value from a MySQL table, do a calculation, then on another PHPpage update the numeric value in the table. what I don't want is anyone else getting the same number from the table before I've updated it. what PHP would you use to do this? Sorry for what is probably a really basic question - I did look at the MySQL manual, but I'm not sure how exactly to issue an SQL query LOCK TABLES using PHP. LOCK TABLES will not work because the lock is released when the first page is finished. You could use a file that will you will use as a lock, but this could lock your table for minutes and eventualy, if the user desides not to take any action, forever. I would suggest to use a temporary table to hold taken numbers. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Locking mysql tables with PHP
On Tue, 25 Nov 2003 13:50:36 +0100, Marek Kilimajer [EMAIL PROTECTED] wrote: Tony Crockford wrote: get a numeric value from a MySQL table, do a calculation, then on another PHPpage update the numeric value in the table. what I don't want is anyone else getting the same number from the table before I've updated it. what PHP would you use to do this? LOCK TABLES will not work because the lock is released when the first page is finished. You could use a file that will you will use as a lock, but this could lock your table for minutes and eventualy, if the user desides not to take any action, forever. I would suggest to use a temporary table to hold taken numbers. Oh, okay. is there a way I can get a number and increment it all in one query then? TIA Tony -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Locking mysql tables with PHP
[snip] is there a way I can get a number and increment it all in one query then? [/snip] UPDATE tblFoo SET value = (value+1) WHERE conditions -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Locking mysql tables with PHP
On way to do it would be to create a table called flags and update the value in that psuedo code update flags set locked =1 get value to calculate otheruesrs would check the page select locked from flags if NOT locked then do query on the update page update table set calculation = result update flags set locked = null hope it makes sense pete Tony Crockford wrote: Hi bit confused! here's what I want to do: get a numeric value from a MySQL table, do a calculation, then on another PHPpage update the numeric value in the table. what I don't want is anyone else getting the same number from the table before I've updated it. what PHP would you use to do this? Sorry for what is probably a really basic question - I did look at the MySQL manual, but I'm not sure how exactly to issue an SQL query LOCK TABLES using PHP. TIA Tony -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Locking mysql tables with PHP
Another idea would ne to use an application variable.. This is like a Session variable but is site wide http://0x00.org/php/phpApplication/ regards Pete Tony Crockford wrote: Hi bit confused! here's what I want to do: get a numeric value from a MySQL table, do a calculation, then on another PHPpage update the numeric value in the table. what I don't want is anyone else getting the same number from the table before I've updated it. what PHP would you use to do this? Sorry for what is probably a really basic question - I did look at the MySQL manual, but I'm not sure how exactly to issue an SQL query LOCK TABLES using PHP. TIA Tony -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Locking mysql tables with PHP
[snip] is there a way I can get a number and increment it all in one query then? UPDATE tblFoo SET value = (value+1) WHERE conditions [/snip] OR (forgot the PHP part) $sqlUpdate = UPDATE tblFoo SET value = (value + $variable) WHERE conditions ; if(!($dbUpdate = mysql_query($sqlUpdate, $connectionString))){ echo MySQL Error: . mysql_error() . \n; exit(); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Locking mysql tables with PHP
On Tue, 25 Nov 2003 07:15:10 -0600, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] is there a way I can get a number and increment it all in one query then? [/snip] UPDATE tblFoo SET value = (value+1) WHERE conditions Hmm.. my bad - I get that bit, but can I do: SELECT value WHERE conditions UPDATE tblfoo SET value= (value+1) Thanks Tony -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Locking mysql tables with PHP
UPDATE tblfoo SET value= (value+1) WHERE conditions Tony Crockford wrote: On Tue, 25 Nov 2003 07:15:10 -0600, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] is there a way I can get a number and increment it all in one query then? [/snip] UPDATE tblFoo SET value = (value+1) WHERE conditions Hmm.. my bad - I get that bit, but can I do: SELECT value WHERE conditions UPDATE tblfoo SET value= (value+1) Thanks Tony -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Locking mysql tables with PHP
[snip] [snip] is there a way I can get a number and increment it all in one query then? [/snip] UPDATE tblFoo SET value = (value+1) WHERE conditions Hmm.. my bad - I get that bit, but can I do: SELECT value WHERE conditions UPDATE tblfoo SET value= (value+1) [/snip] Essentially that is what the UPDATE statement is doing, you are selecting values to be updated with the where condition. Your way is two queries The SELECT (which locks, then releases) and the UPDATE (which locks, the releases). In the split second between the select and update the row is not locked, an undesirable conditions. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problems with a simple page
Hi php-fans... here's a simple question for you I have this HTML page in WIN (Busqueda.htm) the page contains a textfield (textfield3) and a button (submit1) which calls a php file Buscador.php in a Linux server (RED HAT 8) well, my php file which doesn't read anything when I write this echo ($textfield3) why can it be?...they seem to be disconnected but the php file works because I access a MySql table since it.. with no problems...
RE: [PHP] Problems with a simple page
[snip] Hi php-fans... here's a simple question for you I have this HTML page in WIN (Busqueda.htm) the page contains a textfield (textfield3) and a button (submit1) which calls a php file Buscador.php in a Linux server (RED HAT 8) well, my php file which doesn't read anything when I write this echo ($textfield3) why can it be?...they seem to be disconnected but the php file works because I access a MySql table since it.. with no problems... [/snip] Try echo $_POST['textfield3']; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problems with a simple page
Carlos A. Rodriguez wrote: Hi php-fans... here's a simple question for you I have this HTML page in WIN (Busqueda.htm) the page contains a textfield (textfield3) and a button (submit1) which calls a php file Buscador.php in a Linux server (RED HAT 8) well, my php file which doesn't read anything when I write this echo ($textfield3) why can it be?...they seem to be disconnected but the php file works because I access a MySql table since it.. with no problems... http://www.php.net/manual/en/language.variables.external.php -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP with Java extension
Hi, If i understand your project correctly all you need is for the php script to do some elementary processing and pass some parameters to a jsp or servlet. If so you do not need to delve too deeply into PHP at all and i am sure learning the few functions needed to achieve this is easier than a PHP/java integration. even if you did that you still need to learn a bit of PHP. Speaking as a sun certified java programmer, i can tell you that PHP is a hell of a lot better than JSP or Servlets :-)) best regards raditha Panos Konstantinidis wrote: Hello options some of which ray has suggested. Others include soap or writing out objects using the XMLEncoder class (1.4+) and decoding them with a parser in your php. this is also a possible solution but the java system that does the processing is already written and tested, the only thing left to do is to read some values from a form and pass them to it. BEsides I have no clue about PHP and its syntax so I wouldn't want to delve too deep into it. I'd like to keep on researching the PHP to Java solution. Any more thoughts? __ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Locking mysql tables with PHP
[snip] is there a way I can get a number and increment it all in one query then? UPDATE tblFoo SET value = (value+1) WHERE conditions Hmm.. my bad - I get that bit, but can I do: SELECT value WHERE conditions UPDATE tblfoo SET value= (value+1) [/snip] I see where the confusion may be now...where is that value you were looking for? Its in the conditions... UPDATE tblFoo SET value = (value + 1) WHERE value = 'blork' AND otherStuff = 'fark' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Locking mysql tables with PHP
On Tue, 25 Nov 2003 07:47:58 -0600, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] [snip] is there a way I can get a number and increment it all in one query then? [/snip] UPDATE tblFoo SET value = (value+1) WHERE conditions Hmm.. my bad - I get that bit, but can I do: SELECT value WHERE conditions UPDATE tblfoo SET value= (value+1) [/snip] Essentially that is what the UPDATE statement is doing, you are selecting values to be updated with the where condition. Your way is two queries The SELECT (which locks, then releases) and the UPDATE (which locks, the releases). In the split second between the select and update the row is not locked, an undesirable conditions. Ah. Sorry, I'm being particularly dense today. What I want to do is get the value from mysql for use in the PHP page, but update the value once i've got it. How do I give the rest of my PHP script the original value to use with an SQL update? e.g. get counter value increment counter value (so my number can't be used again) use original counter value as *part* of unique reference number to save user input details in a different table. TIA Tony -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] line breaks
Greetings! I'm writing a script that will take the contents of a text file that has several lines of user accounts and creates a shell script with chown commands for each user in that text file. My problem is that when it writes the shell script file it puts a line break after the colon in between $buffer and html. How do I prevent this from doing that? Thanks, Rod Code: --- $fhandle = fopen (/scripts/thescript.sh , a); $handle = fopen (/scripts/mail_list.txt, r); while (!feof ($handle)) { $buffer = fgets($handle, 1000); fwrite ($fhandle, chown $buffer:html /scripts/var/spool/mail/$buffer\n, 4096); } fclose ($handle); fclose ($fhandle); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] line breaks
Rodney Green wrote: Greetings! I'm writing a script that will take the contents of a text file that has several lines of user accounts and creates a shell script with chown commands for each user in that text file. My problem is that when it writes the shell script file it puts a line break after the colon in between $buffer and html. How do I prevent this from doing that? Thanks, Rod Code: --- $fhandle = fopen (/scripts/thescript.sh , a); $handle = fopen (/scripts/mail_list.txt, r); while (!feof ($handle)) { $buffer = fgets($handle, 1000); fwrite ($fhandle, chown $buffer:html /scripts/var/spool/mail/$buffer\n, 4096); } fclose ($handle); fclose ($fhandle); Chances are, $buffer has the line break on it when you read it in from the text file. Try striping off whitespace before you write... while (!feof ($handle)) { $buffer = rtrim ( fgets($handle, 1000) ); fwrite ($fhandle, chown $buffer:html http://www.php.net/manual/en/function.rtrim.php -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] line breaks
John Nichel wrote: Chances are, $buffer has the line break on it when you read it in from the text file. Try striping off whitespace before you write... while (!feof ($handle)) { $buffer = rtrim ( fgets($handle, 1000) ); fwrite ($fhandle, chown $buffer:html http://www.php.net/manual/en/function.rtrim.php Thanks John! That was the problem. Rod -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Time
Hi there, I have a RH Linux Web server running apache and PHP. I recently changed the system clock, the time zone and hardware clock. The time and date are showing up correctly in Webmin and in the O/S itself. But when I call a php function to display the date and time it shows it as one hour ahead (like it used to be)! How do I fix this? Regards Fernando
RE: [PHP] Time
I have done all those checks. Thanks for trying though. Anyone else have any suggestions please? :( -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 25 November 2003 16:06 To: [EMAIL PROTECTED] Subject: AW: [PHP] Time Hi Fernando, first try date and date -u in a shell. That's the local and UTC-time. Write a testscript to show time and timezone in PHP without calculations. Check /etc/timezone. It can be that you must create it. Sri, no more ideas on the fly. It's a little bit complex to manage all features. Hope some checks are good for your search... Greetings, Tobias -Ursprüngliche Nachricht- Von: Fernando Melo [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 25. November 2003 11:20 An: '[EMAIL PROTECTED]' Betreff: [PHP] Time Hi there, I have a RH Linux Web server running apache and PHP. I recently changed the system clock, the time zone and hardware clock. The time and date are showing up correctly in Webmin and in the O/S itself. But when I call a php function to display the date and time it shows it as one hour behind! How do I fix this? Regards Fernando -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problems with a simple page
Jay Blanchard wrote: [snip] Hi php-fans... here's a simple question for you I have this HTML page in WIN (Busqueda.htm) the page contains a textfield (textfield3) and a button (submit1) which calls a php file Buscador.php in a Linux server (RED HAT 8) well, my php file which doesn't read anything when I write this echo ($textfield3) why can it be?...they seem to be disconnected but the php file works because I access a MySql table since it.. with no problems... [/snip] Try echo $_POST['textfield3']; That should work, reason being your server probably has register globals turned off. G.Solomon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] line breaks
Rodney Green wrote: John Nichel wrote: Chances are, $buffer has the line break on it when you read it in from the text file. Try striping off whitespace before you write... while (!feof ($handle)) { $buffer = rtrim ( fgets($handle, 1000) ); fwrite ($fhandle, chown $buffer:html http://www.php.net/manual/en/function.rtrim.php Thanks John! That was the problem. Rod Now that I stop and think about it a bit, rtrim() may hurt you here. Since you're using a fread to read the text file, it will read the bytes you tell it (1000), then move on to the next line of code. So if you have a line as such in your text file... ./command --this=that and the fread() reaches the byte limit on the whitespace after command, it's going to remove that, and you'll end up with ./command--this=that You can tell rtim() what characters to strip by doing... rtrim ( $foo, \n ); but I've seen rtrim() strip blank spaces even when this is done. A better way may be to change the way you're reading in the source file; instead of using a fread, you can use file(), which will put each line in an array element...This way, it won't stop reading in the middle of a line $fhandle = fopen (/scripts/thescript.sh , a); $handle = file ( /scripts/mail_list.txt ); for ( $i = 0; $i sizeof ($handle); $i++ ) { $buffer = rtrim ( $handle[$i] ); fwrite ($fhandle, chown $buffer:html /scripts/var/spool/mail/$buffer\n, 4096); } fclose ($fhandle); -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] line breaks
John Nichel wrote: Rodney Green wrote: John Nichel wrote: Chances are, $buffer has the line break on it when you read it in from the text file. Try striping off whitespace before you write... while (!feof ($handle)) { $buffer = rtrim ( fgets($handle, 1000) ); fwrite ($fhandle, chown $buffer:html http://www.php.net/manual/en/function.rtrim.php Thanks John! That was the problem. Rod Now that I stop and think about it a bit, rtrim() may hurt you here. Since you're using a fread to read the text file, it will read the bytes you tell it (1000), then move on to the next line of code. So if you have a line as such in your text file... ./command --this=that and the fread() reaches the byte limit on the whitespace after command, it's going to remove that, and you'll end up with ./command--this=that You can tell rtim() what characters to strip by doing... rtrim ( $foo, \n ); but I've seen rtrim() strip blank spaces even when this is done. A better way may be to change the way you're reading in the source file; instead of using a fread, you can use file(), which will put each line in an array element...This way, it won't stop reading in the middle of a line $fhandle = fopen (/scripts/thescript.sh , a); $handle = file ( /scripts/mail_list.txt ); for ( $i = 0; $i sizeof ($handle); $i++ ) { $buffer = rtrim ( $handle[$i] ); fwrite ($fhandle, chown $buffer:html /scripts/var/spool/mail/$buffer\n, 4096); } fclose ($fhandle); Actually, I'm not having problems with that. The whitespace is still there in between the commands and arguments, etc. I'm using fgets , not fread. Not sure what the difference between the two is but I'll check it out. The problem I am having however is that at the end of the shell script that is created it puts an additional line. It writes the chown command line for all of the users then puts the following line with no user specified. chown :html /var/spool/mail/ The other lines show up as: chown rgreen:html /var/spool/mail/rgreen chown rgreen01:html /var/spool/mail/rgreen01 chown rod:html /var/spool/mail/rod Any ideas where that extra line is coming from? thanks again, Rod -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $$vars and security
--- Phillip Jackson [EMAIL PROTECTED] wrote: Personally, I think this is a bad approach, regardless of how well it is implemented. I think you will give yourself a false sense of security. what, then, do you yourself do in such an application requiring a response from the user to massage the data? reject all input that doesn't conform to your whitelist? Yes, that's it. I know this may sound like a huge hassle compared to a nice one-size-fits-all data filtering function, but I personally would never rely on myself to be able to predict all of the different types of attacks that people will come up with. There are many people who have as much creativity as malice, and they are sure to come up with ways to exploit holes in any blacklist approach I take. So, when the user is submitting a name, for example, my approach would be something like this: Good Stuff: Alphabetic characters, hyphens, apostrophes, and spaces. Bad Stuff: Everything else The first time I used this code, I would probably log all of the bad stuff, so that if I accidentally missed a valid character, I would add it to my list of allowed characters. Over time, I would get it right, and I would feel pretty confident that no bad guy could use a combination of these characters to launch any sort of attack on my application. Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $$vars and security
Chris Shiflett wrote: Yes, that's it. I know this may sound like a huge hassle compared to a nice one-size-fits-all data filtering function, but I personally would never rely on myself to be able to predict all of the different types of attacks that people will come up with. There are many people who have as much creativity as malice, and they are sure to come up with ways to exploit holes in any blacklist approach I take. So, when the user is submitting a name, for example, my approach would be something like this: Good Stuff: Alphabetic characters, hyphens, apostrophes, and spaces. Bad Stuff: Everything else The first time I used this code, I would probably log all of the bad stuff, so that if I accidentally missed a valid character, I would add it to my list of allowed characters. Over time, I would get it right, and I would feel pretty confident that no bad guy could use a combination of these characters to launch any sort of attack on my application. My personal opinion is not that strict. When you have a well defined way to keep your scripts secure from malicious input, you are safe. The well defined way is to escape and quote any string that is used in sql queries, and htmlspecialchars to output untrused input. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Locking mysql tables with PHP
Marek Kilimajer wrote: Tony Crockford wrote: Hi bit confused! here's what I want to do: get a numeric value from a MySQL table, do a calculation, then on another PHPpage update the numeric value in the table. what I don't want is anyone else getting the same number from the table before I've updated it. what PHP would you use to do this? Sorry for what is probably a really basic question - I did look at the MySQL manual, but I'm not sure how exactly to issue an SQL query LOCK TABLES using PHP. LOCK TABLES will not work because the lock is released when the first page is finished. You could use a file that will you will use as a lock, but this could lock your table for minutes and eventualy, if the user desides not to take any action, forever. I would suggest to use a temporary table to hold taken numbers. I may be wrong here, but doesn't PHP let MySQL retain the locks when you've connected with the mysql_pconnect(); function? (persistent connect, I would expect locks to get released on a disconnect, which usually happens on a page refresh (new mysql_connect() call). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] line breaks
Rodney Green wrote: snip Actually, I'm not having problems with that. The whitespace is still there in between the commands and arguments, etc. I'm using fgets , not fread. Not sure what the difference between the two is but I'll check it out. The problem I am having however is that at the end of the shell script that is created it puts an additional line. It writes the chown command line for all of the users then puts the following line with no user specified. chown :html /var/spool/mail/ The other lines show up as: chown rgreen:html /var/spool/mail/rgreen chown rgreen01:html /var/spool/mail/rgreen01 chown rod:html /var/spool/mail/rod Any ideas where that extra line is coming from? thanks again, Rod Is there a carriage return (new line) after the last entry in your text file? You can add an if test in there to stop this... $buffer = rtrim ( $handle[$i] ); if ( $buffer != ) { fwrite ($fhandle, chown $buffer:html /scripts/var/spool/mail/$buffer\n, 4096); } -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] line breaks
John Nichel wrote: Rodney Green wrote: snip Actually, I'm not having problems with that. The whitespace is still there in between the commands and arguments, etc. I'm using fgets , not fread. Not sure what the difference between the two is but I'll check it out. The problem I am having however is that at the end of the shell script that is created it puts an additional line. It writes the chown command line for all of the users then puts the following line with no user specified. chown :html /var/spool/mail/ The other lines show up as: chown rgreen:html /var/spool/mail/rgreen chown rgreen01:html /var/spool/mail/rgreen01 chown rod:html /var/spool/mail/rod Any ideas where that extra line is coming from? thanks again, Rod Is there a carriage return (new line) after the last entry in your text file? You can add an if test in there to stop this... $buffer = rtrim ( $handle[$i] ); if ( $buffer != ) { fwrite ($fhandle, chown $buffer:html /scripts/var/spool/mail/$buffer\n, 4096); } Thanks again, John. That was the problem and the if test fixed it. Rod -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Locking mysql tables with PHP
Wouter van Vliet wrote: I may be wrong here, but doesn't PHP let MySQL retain the locks when you've connected with the mysql_pconnect(); function? (persistent connect, I would expect locks to get released on a disconnect, which usually happens on a page refresh (new mysql_connect() call). That is only a side effect, more a bug than feature as it breaks temporary table functionality. And it cannot be relied upon as the persistent connection can end anytime. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] User/Pwd Management Package?
Hi, I'm interesting in finding a PHP package that implements functions for managing user names passwords controlling access to specific parts of a site. Of course, free is best. But cheap is good. And, even not-so-cheap is fine, as long as it provides good functionality. Any pointers appreciated. Check out patUser at http://www.php-tools.de/. There is also a three part tutorial for it over at http://www.devshed.com/Server_Side/PHP. I plan to test it soon, but haven't come around to it yet. I'm looking for this kind of stuff myself too. patUser seems to have what I want, except from one important thing - it only seems to be able to protect content, not directories or single pages. So, if anyone know about a package that also do dir/file protection, please let me know. /Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Windows Environment Variables
Hello, Is PHP able to access and use Windows Environment Variables? If so, is there a function or a reference you can point me to? Thanks, Rod -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] apache 2.0.47 apache2filter PHP 4.3.4 solaris linux
hi PHP folks, i have a slight problem on PHP 4.3.4 and apache2filters If i compile the apache2filter support into php all runs through an the module works. BUT ( hehe. this is what i get mad about ^_^ ) You cann put all kind of content in and any php code that is found is getting parsed. BUT if i try to use mod_cgi oder mod_jk. It doesn't work. The PHP code doesn't gets parsed anymore. Is this mabye because the apache2filter doesn't apply to .so modules ? or did i forget somethink important ? I have no real clue anymore where to go. This are the filter rules in my httpd.conf AddOutputFilter PHP html AddInputFilter PHP html AddOutputFilterByType PHP application/x-httpd-php Regards Daniel -- -- Pixelpark AG . . . . . . . . . . . . . . . . . . . . . . . . . Daniel Sand . Webmaster . http://www.pixelpark.com rotherstr. 8 . 10245 Berlin . Germany phone: + 49.30.505.8 - 1790 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP SESSION DURATION.....
Hi, How do I go about making a session last longer that the duration of the browser? Say I wanted to make a session last for 1 month, so that I could close the browser as often I wanted, and the session would still be there. I found the explanations of the session function on PHP.net quite confusing. G... Oh for good documentation!!! Should I use session_cache_expire? Well, php.net says: The cache expire is reset to the default value of 180 stored in session.cache_limiter at request startup time. What about session_set_cookie_params? But php.net says the effect of this function only lasts for the duration of the script? Are session variables stored server-side or does that apply to cookies only? And what about session cookies? Are session cookies stored with the client? Please help Many thanks Keith -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP SESSION DURATION.....
Correction: I meant to say: Are session variables stored server-side or client-side like cookies? Keith [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, How do I go about making a session last longer that the duration of the browser? Say I wanted to make a session last for 1 month, so that I could close the browser as often I wanted, and the session would still be there. I found the explanations of the session function on PHP.net quite confusing. G... Oh for good documentation!!! Should I use session_cache_expire? Well, php.net says: The cache expire is reset to the default value of 180 stored in session.cache_limiter at request startup time. What about session_set_cookie_params? But php.net says the effect of this function only lasts for the duration of the script? Are session variables stored server-side or does that apply to cookies only? And what about session cookies? Are session cookies stored with the client? Please help Many thanks Keith -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Add Reply-To to this list(s)
Hi, It would be nice if the moderator of this, and the other PHP-lists could fix so the listserver automatically add a Reply-To header to all the mails. When I hit Reply my message would then automatically reply to the list and not the author. Less hassle for me when replying and less risk of forgetting it. /T -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Add Reply-To to this list(s)
Thomas -- ...and then Thomas Svenson said... % % Hi, Hi! % % It would be nice if the moderator of this, and the other PHP-lists could fix % so the listserver automatically add a Reply-To header to all the mails. No it wouldn't. It would be a Bad Thing. This was just beaten to death [again] recently, as I recall, unless maybe that was munging the Subject: line instead. % % When I hit Reply my message would then automatically reply to the list and % not the author. Less hassle for me when replying and less risk of forgetting % it. Much better for you to Do It Right, perhaps including changing to a real mail program. See the archives for the full discussion. % % /T % % -- % PHP General Mailing List (http://www.php.net/) % To unsubscribe, visit: http://www.php.net/unsub.php HTH HAND now back to our regular PHP questions... :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP] Add Reply-To to this list(s)
And mly opinion is it's _really_ _very_ useful (I just sent my message to someone instead of the list! Gr Annoying!) Sophie Mattoug wrote: It's the way we do on [EMAIL PROTECTED], and everything is fine ! David T-G wrote: Thomas -- ...and then Thomas Svenson said... % % Hi, Hi! % % It would be nice if the moderator of this, and the other PHP-lists could fix % so the listserver automatically add a Reply-To header to all the mails. No it wouldn't. It would be a Bad Thing. This was just beaten to death [again] recently, as I recall, unless maybe that was munging the Subject: line instead. % % When I hit Reply my message would then automatically reply to the list and % not the author. Less hassle for me when replying and less risk of forgetting % it. Much better for you to Do It Right, perhaps including changing to a real mail program. See the archives for the full discussion. % % /T % % -- % PHP General Mailing List (http://www.php.net/) % To unsubscribe, visit: http://www.php.net/unsub.php HTH HAND now back to our regular PHP questions... :-D -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP SESSION DURATION.....
Correction: I meant to say: Are session variables stored server-side or client-side like cookies? The session data is stored on the server. The session cookie (if there is one) is stored in the browser. How do I go about making a session last longer that the duration of the browser? Set the expiration on the session cookie so that it's a month from now, using the set_session_cookie_params() function. Also, force the users to accept cookies (somehow). Then change the garbage collection so that it won't trash session data for at least a month. Considering how inefficient all of that is, you might be better off storing the data in a database instead of a session and then storing the database record ID in a cookie in the browser. There are some serious security considerations here but it will get your results and won't rely upon PHP's sessions. Again, this isn't ideal but it's a start... Hope that helps, Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Add Reply-To to this list(s)
On Nov 25, 2003, at 11:57 AM, Thomas Svenson wrote: Hi, It would be nice if the moderator of this, and the other PHP-lists could fix so the listserver automatically add a Reply-To header to all the mails. When I hit Reply my message would then automatically reply to the list and not the author. Less hassle for me when replying and less risk of forgetting it. Thomas, You might be interested in reading this document: http://www.unicom.com/pw/reply-to-harmful.html. -- Chris Garaffa [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Time
Hi, I found the problem. If you change the time zone on your Linux server running Apache and PHP, you need to Stop and then Start Apache else the PHP (or Apache) will still pick up the old time zone. Thanks anyway -Original Message- From: Wouter van Vliet [mailto:[EMAIL PROTECTED] Sent: 25 November 2003 13:13 To: 'Fernando Melo'; [EMAIL PROTECTED] Subject: RE: [PHP] Time Fernando Melo wrote: Hi there, I have a RH Linux Web server running apache and PHP. I recently changed the system clock, the time zone and hardware clock. The time and date are showing up correctly in Webmin and in the O/S itself. But when I call a php function to display the date and time it shows it as one hour behind! How do I fix this? Regards Fernando Must be something with your locale settings. Probably your sytem clock is set to the GMT time, while you are in GMT+1 yourself. Not really sure how to fix this, but this might be something that helps you find the solution. Let me know ! Wouter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Add Reply-To to this list(s)
--- Thomas Svenson [EMAIL PROTECTED] wrote: It would be nice if the moderator of this, and the other PHP-lists could fix so the listserver automatically add a Reply-To header to all the mails. When I hit Reply my message would then automatically reply to the list and not the author. Less hassle for me when replying and less risk of forgetting it. What you are suggesting is not adding a Reply-To header. As you can see in this email from me, there is already one there. What you are suggesting is mangling the Reply-To header, so that it is changed from being correct to being incorrect. This is every bit as bad as it sounds. In addition, if someone wants to reply to an email that I send, they should be able to select the Reply option in their mail client of choice. If they want to reply to the list, they can choose Reply List in their mail client of choice. If their mail client is too lame to recognize mailing list headers, they can choose Reply All to reply to the sender as well as any other recipients, such as a mailing list. Now, what happens when someone who is not subscribed to the list, or who is subscribed to the digest mode, asks a question? If we mangle the Reply-To header, those who choose Reply All will only reply to the list, thereby sending the answer to everyone except the person who asked it. This list is far too busy to be doing things the wrong way. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Add Reply-To to this list(s)
David T-G wrote: % % When I hit Reply my message would then automatically reply to the list and % not the author. Less hassle for me when replying and less risk of forgetting % it. Much better for you to Do It Right, perhaps including changing to a real mail program. See the archives for the full discussion. Use Reply All button. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Securing PHP code..
Video Populares Et Optimates wrote: Hi! I'm pondering on a problem here. Being a C/C++, Java and Visual Basic developer, the aspect of reverse engineering code from (compiled) programs, hasn't occupied my mind that much. Now, developing PHP scripts on large scale I have started to think otherwise. How do you all secure your code? I'd really appreciate if someone could give me the bare and gritty specifics on how it is possible to protect server side scripts such as PHP.. Thanks in advance, Video Populares et Optimates Have a look at Zend Encoder http://www.zend.com/store/products/zend-safeguard-suite.php There are others also. Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Add Reply-To to this list(s)
Sophie - ...and then Sophie Mattoug said... % % And mly opinion is it's _really_ _very_ useful (I just sent my message % to someone instead of the list! Gr Annoying!) Since it was apparently intended for the list, I'll reply to all what I sent to you: Just because it's done badly somewhere else, such as on php-france, doesn't make it a good thing. See the archives for lots of religious warring on the issue. I'm sorry for people out there who can't manage to reply properly, but let's not screw up a perfectly good list trying to take care of the lowest common denominator. It's bad enough already that many here don't know (or perhaps care) about message threading or decent quoting. HTH HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
[PHP] extensions
I wish to access native functionality in a native library from php. I believe writing a php extension is the way to go about it. (The lib I want to access is sufficiently complex that doing a system call to execute it isn't a viable solution) Can anyone point me to some useful guide? I've found the following links on the web: http://www.devnewz.com/2002/0909.html http://www.devarticles.com/art/1/170/4 http://www.geocrawler.com/mail/msg.php3?msg_id=2695523list=5 http://php.weblogs.com/discuss/msgReader$2403 http://www.php.net/manual/en/zend.php http://www.qandr.org/~quentinsf/phpmodule/ http://www.derickrethans.nl/ze-ext/talk.html http://www.zend.com/zend/api.php http://www.php.net/manual/en/zend.possibilities.builtin.php but maybe someone knows of a really useful resource for this that I've missed? thanks, alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Add Reply-To to this list(s)
Thomas Svenson said: Hi, It would be nice if the moderator of this, and the other PHP-lists could fix so the listserver automatically add a Reply-To header to all the mails. When I hit Reply my message would then automatically reply to the list and not the author. Less hassle for me when replying and less risk of forgetting it. Much better to just switch to a mail client that understands the list headers in the mail, and supports reply to list. KMail (KDE) and Squirrelmail (web) are two that spring to mind. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Add Reply-To to this list(s)
Hi, Much better to just switch to a mail client that understands the list headers in the mail, and supports reply to list. KMail (KDE) and Squirrelmail (web) are two that spring to mind. The only problem with that is not everyone has an option to switch clients. However, I think this is all a debate with no cause. The list owners seem adament in not changing the configuration of the list server. -Dan Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Add Reply-To to this list(s)
Dan, et al -- ...and then Dan Joseph said... % % Hi, Hiya! % % Much better to just switch to a mail client that understands the ... % % The only problem with that is not everyone has an option to switch clients. Yes, but that subset is very, very small. There is almost always a way. Of course, then you have to have someone motivated enough to want to try one of the many ways typically available; THAT is the real trick. % However, I think this is all a debate with no cause. The list owners seem % adament in not changing the configuration of the list server. And for that, List Owners, I thank you, wherever you are :-) % % -Dan Joseph HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
RE: [PHP] Add Reply-To to this list(s)
This is, I suppose, a completely off topic thread. However, I just read the web page http://www.unicom.com/pw/reply-to-harmful.html and I was completely unconvinced. In all the years that I have belonged to and run mailing lists, I have never experienced any difficulties. Period. Never. It has been easier and more convenient than this reply to the sender and not the list system, without a doubt. The complaints as outlined on the web page are somewhat silly. When saying that replying to the mail author is a big hassle on mailing systems with munging the web page author says that one has to write down the sender's email address and other steps which simply don't apply. I'm using Outlook, and I've always been able to just double click the original senders address and send that way. No writing down, or even copying and pasting required. There's even a privacy argument to be made that some people may prefer a list where their own address is not shown. What they post is for, and in context of, the list only, and not an invitation for private mail. In some situations, I think that would be fair. Coddling the Brain-Dead, Penalizing the Conscientious is just needlessly inflammatory and biased. If the over whelming majority of people expect a system to behave one way, that's not evidence that they are brain dead, but that it's very likely the expected behaviour is more natural for people, and systems should match humans, not vice versa. Freedom of choice is equally satisfied by automatically going to the list but being able to choose to send to the email author. It's the exact equivalent of automatically going to the author but being able to choose to send to the list. It Adds Nothing is absolutely false. Being able to automatically respond to the list adds more naturally expected behaviour. I could go on, point by point. But I have a feeling it would fall on deaf ears. If the overwhelming evidence that so many mailing lists and so many people on them function very well on email lists where the mail automatically goes to the list is not evidence enough, than I doubt anything ever will be. Telling people that they need to use proper email software and go about things in the way they don't expect is not a path to sensible human interfaces. Computers, machines, systems, should match us, not us to them. In any case, despite the difficulties, computers are much easier to change than people. I remain steadfast in my opinion that automatically replying to the list is a much more natural option. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Add Reply-To to this list(s)
On Tuesday 25 November 2003 09:51 am, Dave G wrote: snip Telling people that they need to use proper email software and go about things in the way they don't expect which they are you refering to? i expect my reply button to reply to the person who sent the initial message... not everyone subscribed to the list. so, luckily for me, does the admin of this list. Computers, machines, systems, should match us, not us to them. and by not messing with the reply-to header, in this case, the systems does match me. it's really just a difference of opinion, and I'm sure one that will always exist. In any case, despite the difficulties, computers are much easier to change than people. true. I remain steadfast in my opinion that automatically replying to the list is a much more natural option. and I remain steadfast in mine that automatically replying to the person who sent the message is a much more natural option. it's a no win situation, either way someone will be unhappy. gabe. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Windows PHP permissions question
Good Morning/Afternoon. I have a program that is trying to write to a directory on a Windows server and I don't know how to setup the permissions to read/write/delete just from this directory. I have it permissions set to 'Everyone' but that doesn't work. Help?!?! Robin 'Sparky' Kopetzky Black Mesa Computers/Internet Service Grants, NM 87020 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Add Reply-To to this list(s)
Dave, et al -- ...and then Dave G said... % % This is, I suppose, a completely off topic thread. However, I just It sure is. And this has come up many times before. It's all in the archives. The only reason I bother to answer when the problem rears its head again is to fight, tooth and nail, to prevent the idea from coming to fruition this time even if it hasn't the countless times in the past. % read the web page % http://www.unicom.com/pw/reply-to-harmful.html I'm glad you took the time to read it. That's more than some can bother to do. ... % The complaints as outlined on the web page are somewhat silly. When Heh. So is this argument, but we're here :-) % saying that replying to the mail author is a big hassle on mailing % systems with munging the web page author says that one has to write % down the sender's email address and other steps which simply don't Admitted, although these days copy-n-paste is often considered the equivalent of writing something down. I think, however, that the author means that having to specifically take note of the address is the painful thing. With a Reply-To: field in place you no longer have the choice of replying to the sender or to the list, so if you want to exercise a different choice you have to work around your obedient mail software to ignore such a header. % apply. I'm using Outlook, and I've always been able to just double click If you'll allow me to take the gloves off for a moment, it is Microsoft and Outlook which have made major damaging contributions to email and news communications. Outlook doesn't want to bother its users with such [supposed] frivolity as headers, and is busy autoformatting text and playing with fonts and colors and such, and as a result valuable information is lost or ignored and we have mile-long TOFU posts that just waste time and space. Internet email and news have been around a long longer than Outlook and were just fine before someone decided Hey, let's throw away these established working practices and do something entirely different. Lotus Notes did basically the same thing but it never really caught on and so we don't have the same plague from that, and now as I understand it Notes is much smarter about working with the Internet. ... % There's even a privacy argument to be made that some people may prefer % a list where their own address is not shown. What they post is for, and % in context of, the list only, and not an invitation for private mail. In % some situations, I think that would be fair. Phooey. Unless a list is an anonymous remailer the sender information is available no matter how the Reply-To: field is set. % Coddling the Brain-Dead, Penalizing the Conscientious is just % needlessly inflammatory and biased. If the over whelming majority of Call it what you will, but with an Outlook-ization of the 'net and the web a bunch of brain-dead users is basically what you have. % people expect a system to behave one way, that's not evidence that they % are brain dead, but that it's very likely the expected behaviour is But if that one way is a broken way then it is just such evidence! Perhaps a better definition is ignorant or miseducated but the point remains that those who know what they're doing don't do it the wrong way and won't willingly put up with a broken system. ... % Freedom of choice is equally satisfied by automatically going to the % list but being able to choose to send to the email author. It's the % exact equivalent of automatically going to the author but being able to % choose to send to the list. Equivalent, yes, but so was segregation -- separate but equal facilities. That didn't make segregation right, and it doesn't make a broken system right. % It Adds Nothing is absolutely false. Being able to automatically % respond to the list adds more naturally expected behaviour. See above for miseducated explanation. % I could go on, point by point. But I have a feeling it would fall on % deaf ears. If the overwhelming evidence that so many mailing lists and Mostly it would. At least I hope it would! % so many people on them function very well on email lists where the mail % automatically goes to the list is not evidence enough, than I doubt % anything ever will be. Just because does not appear obviously and painfully broken does not mean that it is being done right, especially when those suffering don't know that the suffering is needless and not normal! % Telling people that they need to use proper email software and go % about things in the way they don't expect is not a path to sensible % human interfaces. Computers, machines, systems, should match us, not us % to them. In any case, despite the difficulties, computers are much % easier to change than people. Yep. So change Microsoft's products' behavior, along with that of a few others, and let's fix this problem the right way from the root. % I remain steadfast in my opinion that
[PHP] Object aggregation/composition - Experimental..?
Hi! I'm sifting through the possibilities with PHP and naturally one of the first things I searched for was the possibility for OO development. Now, I found chapter LXXII in the PHP manual (file generated Sun Oct 05 02:13:52 2003), but it has quite an ugly warning clause in the top: Warning This extension is experimental [...] may change without notice in a future release of PHP. Use this extension at your own risk. In the chapter Classes and Objects (under Language Reference) I found no such warning however. Now, OO dev. is what I really want in order to make any good use of PHP in the future, so this made me a bit confused. Does anyone know whether this extension is/will be a part of the core language? Thanks for any input, and bare me with me as I'm pretty new (but learning fast ;-) ) in the PHP community... All the best, VPeO
[PHP] Intuitive Interfaces (was: Add Reply-To to this list(s))
--- Dave G [EMAIL PROTECTED] wrote: If the over whelming majority of people expect a system to behave one way, that's not evidence that they are brain dead, but that it's very likely the expected behaviour is more natural for people, and systems should match humans, not vice versa. I will try to make this my only comment, and at the same time I think that I can bring this topic back to Web development. :-) In my opinion, the overwhelming majority of people subscribed to a technical mailing list like this are going to be computer professionals of some sort. This doesn't mean we are all genuises, but it does mean that most of us know how things work much better than the average person. What is intuitive to us is that things work as expected. I have never (I do mean never) seen a mail client that does not have an option to reply to everyone, if that is your choice. Ignoring the fact that many mail clients have group options, you have at least two choices: 1. Reply 2. Reply All You are suggesting that this be changed to: 1. Reply All 2. Reply All This makes absolutely no sense. All you do is remove one option, and clicking Reply is not an easier task than clicking Reply All for any mail client that I have seen anyway, so nothing is gained in exchange for this loss of choice. It also breaks the Reply option, since it will still be misleadingly labeled as such. To bring this topic back to Web development (without losing the passion of the debate, I think), consider an HTML form where users enter a phone number in three separate text fields (assuming a US phone number). Now, those who are the least bit familiar with how the Web works will instinctively enter the first three numbers, hit tab, enter the next three numbers, tab again, and finally enter the last four numbers. Some Web sites I have visited think it is helpful to use some client-side scripting to move the focus from the first text field to the second after three numbers have been entered. So, when the user hits tab after entering the first three numbers, the second text field is skipped entirely. Isn't this a really terrible thing to do? It's an almost exact analogy to mangling mail headers. It has the same characteristics: 1. Adds no real value 2. Is counterintuitive for experienced users 3. Hurts those who get used to it when they use compliant systems So, if this debate continues, please debate on the merits of intuitive interfaces for the Web or something. I think the same two perspectives will exist, and hopefully I've explained mine pretty clearly. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Intuitive Interfaces
Chris Shiflett wrote: Some Web sites I have visited think it is helpful to use some client-side scripting to move the focus from the first text field to the second after three numbers have been entered. So, when the user hits tab after entering the first three numbers, the second text field is skipped entirely. Isn't this a really terrible thing to do? It's an almost exact analogy to mangling mail headers. It has the same characteristics: I think this is the worst thing to do. If they are going to this jump to the next field when this is full script why don't they put one field to start with? Can somebody explain why some developers do this? cesar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing vars w/refresh w/register globals off?
Well first off all it is possible to post and get at the same time. Dont know why you want to, but its kinda easy really : Example : form name=myform action=myscript.php?get1=aget2=b method=post input type=hidden name=jalla value=balla /form You can submit this form several ways, with ordinary submit button, or with javascrip submit. If you really want to keep serving variables that shouldnt be visble in the browser or in the html kode I guess the only way would be using cookies. But if the variables are defined by the users input / behavior there is surely the need of showing the variables one place or another. You mentioned that there were up to a 100 variables to be passed here. Was that pr user or in total? Sending like a 100 variables with GET would be a bad idea all together, since there are limits on how many caracters the URL can hold. Some years ago alot of browsers had a limit on 128 characters, this is imporved by the years but still the only way to feed long sets of data is through post. If all your variables can be stored on the server, assigning a unique ID to the session would make you able to store everything in the database as someone mentioned earlier. This wasy all you need is pass the ID within the browser. By checking the ID against the unique session on the server you will also eliminate tampering with the data. Webpages that has like a 100 hidden fields doesnt look very professional, but hey - it works. The other thing is that forms can also talk with eachother nicely, what I mean is that you can share the informastion with the help of javascript. Storing all the information you need for later in a form somewhere in the html page, then when you build the refresh url you just pick out the data you want to use from the different form elements (document.form.variable.value). I still havnt quite understood what you are accually asking for here, but hey, it seems like you dont know yourself, hehe -- Kim Steinhaug --- There are 10 types of people when it comes to binary numbers: those who understand them, and those who don't. --- Floyd Baker [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Fri, 18 Jan 2002 18:13:50 +0800, you wrote: On Friday 18 January 2002 04:11, Floyd Baker wrote: Yes. I was using the url to pass variables without a form. It looks like the javascript idea would cover that now that you remind me. I've used it before to refresh two frames at once. But even so I'd rather not go that way if at all possible. I'd like to stay within php's ability. Not being able to POST and GET is a 'limitation' of HTTP not PHP. Not knowing what I'm talking about for sure but is there no way of putting a variable into the 'post' status or condition, prior to being redirected, without actually using a form? Only be using a form will you be able to POST. Thanks for the idea though. It'll work if nothing else. :-) Up to now we (I?) still don't know exactly what you're trying to do. Maybe if you could tell us what you're doing and if appropriate post some code, then we could see if there is another solution to your problem. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* I am just a nice, clean-cut Mongolian boy. -- Yul Brynner, 1956 */ This should be fairly standard. Filling out a form and using a recursive call and if/then, to bring the variables around to a case switch for routing to desired pages according to form input data. if 'completed = y ( switch case get to go here case get go there ) else ( post to /this page form submit ) This draft does work but I don't like the visible url variables. Of course in addition we have all the fields passed by the form post that were used as required on switch case and receiving pages... Now we need to REQUEST every one. That's fine for the sake of the security but now it's beneficial to get into arrays, etc. to keep script shorter and easier to maintain. More learning. Always good. 4.1 is pushing me. :-) The solutions look more involved than my poor coding has been til now. We need to put more things into function form maybe, instead of passing between separate pages. I'm probably still out in left field with a lot of this *visualizing* but it's coming. And always good to talk it out. Can you tell me if it's possible to run 4.03 and 4.1 *both* on the same machine? I'm thinking the old script would be php3 and the new stuff php4. Is that something that could be done until the old scripts are upgraded? Floyd -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Change Date
Is it me or are everyone responding how to give a the date in here? The timestamp is still time() and not date() isnt it? Timestamp works in seconds, so 1 hour is : 60 seconds * 60 minutes. $hour = 60*60; $day = 24*$hour; timestamp for 125 days into the future would then be, $futuretimestamp = time() + ($day*125); time() returns the current timestamp, this very second. All you do is calculate all the seconds there is in 125 days and add it up. If you want to go back to the future, you subtract it from time(). Then, when you want the date to be entered for the screen or somthing use the date() command. -- Kim Steinhaug --- There are 10 types of people when it comes to binary numbers: those who understand them, and those who don't. --- Sadeq Naqashzade [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, How can I find time stamp for example 125 next days. or 03:30 hours next? Regards, S. Naqashzade PS: Sorry for my bad english :-( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Detecting Server API (CGI or Apache) at runtime?
Richard Cyganiak [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] is there a way to tell at runtime if PHP is running as an Apache module or through CGI? Replying to myself ... I found the answer, there's a function php_sapi_name() for this purpose, see http://php.net/php_sapi_name -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Intuitive Interfaces
Cesar Cordovez wrote: Chris Shiflett wrote: Some Web sites I have visited think it is helpful to use some client-side scripting to move the focus from the first text field to the second after three numbers have been entered. I think this is the worst thing to do. If they are going to this jump to the next field when this is full script why don't they put one field to start with? Can somebody explain why some developers do this? Some possible reasons why: 1. Some developers are preoccupied with creating a cool interface, rather than focusing on what the user finds usable. 2. Customary separtor punctuation, e.g., the dashes in a social security number (US), 123-45-6789, can be inserted between the input controls, thus subtly instructing the user that they don't have to enter the punctuation. Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Add Reply-To to this list(s)
On Tue, 2003-11-25 at 11:57, Thomas Svenson wrote: Hi, It would be nice if the moderator of this, and the other PHP-lists could fix so the listserver automatically add a Reply-To header to all the mails. When I hit Reply my message would then automatically reply to the list and not the author. Less hassle for me when replying and less risk of forgetting it. /T -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I have one thing to say just so I can feel important in a OT thread. Why change it if it's not broken? -- I have a photographic memory. I just forgot the film --Unknown = Ryan Thompson [EMAIL PROTECTED] http://osgw.sourceforge.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Regular expression help
I need someone to tell me exactly what this regular-expression means: if(ereg([^ \t\n],$val)) { // do the job here } I'm looking for an intermittent bug, and I need to understand this to make sure I have found the bug. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Intuitive Interfaces
On Tue, 2003-11-25 at 13:50, Chris Shiflett wrote: [snip] Some Web sites I have visited think it is helpful to use some client-side scripting to move the focus from the first text field to the second after three numbers have been entered. So, when the user hits tab after entering the first three numbers, the second text field is skipped entirely. [snip] I would think it would be a horribly bad thing for global companies. If you only have a north american market it would be annyoing for the users, but if you do it for a global company then you're losing a lot of possible customers. You make the unsafe assumption that everyone adding their phone number has a 3-3-4 style phone number. In Taiwan, for example, it's x-4-4. I think it's 3-4-4. They wouldn't be able to enter a phone number. If it's a required item then they couldn't regsiter, and the site lost a customer. Just my one cent. -- I have a photographic memory. I just forgot the film --Unknown = Ryan Thompson [EMAIL PROTECTED] http://osgw.sourceforge.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Regular expression help
This condition is true if there is no space, new line or tabulator in $val I need someone to tell me exactly what this regular-expression means: if(ereg([^ \t\n],$val)) { // do the job here } I'm looking for an intermittent bug, and I need to understand this to make sure I have found the bug. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php S pozdravem Bronislav Klucka =[ pro2-soft.com ]= Bronislav Klucka Pro2-Soft +420 605 582 922 [EMAIL PROTECTED] * Windows Web applications, Computer traininghttp://pro2-soft.com --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Add Reply-To to this list(s)
On Tue, Nov 25, 2003 at 04:57:41PM -, Thomas Svenson wrote: : : It would be nice if the moderator of this, and the other PHP-lists : could fix so the listserver automatically add a Reply-To header to all : the mails. : : When I hit Reply my message would then automatically reply to the list : and not the author. Less hassle for me when replying and less risk of : forgetting it. If you would stop using M$ Outlook and switch to a better mail client that supports mailing lists, your problem would be solved. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $ of variables, php, mysql
On Tue, Nov 25, 2003 at 11:38:27AM +0100, Marek Kilimajer wrote: : Eugene Lee wrote: : : Try using more variables to make life a little easier to parse: : : $colname = $_FORM['form'] : $query = select {$colname} from structure; : $result = mysql_query($query); : while (($row = mysql_fetch_array($result)) !== false) : { : echo $row[$colname]; : } : : : Very dangerous. $colname can be anything, e.g. mysql.user.password : colname FROM mysql.user # I wrote it out this way because: the other user provided no source code, I wanted to show working code, it was late and I didn't feel like adding anything to secure against intrusions like SQL injection attacks. For the sake of completeness, redo the first line above as: $colname = mysql_escape_string($_FORM['form']); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] array problems
Hello, consider the following code (content.txt is tab delimited). $city = Ipswitch; $content = fopen(content.txt, r); $city_found = 0; while (!feof($content) $city_found == 0) { $my_line = fgets($content, r); $content_array = explode(\t,$my_line); if ($content_array == $city) { print(Matched on $content_array[0]); $city_found = 1; } } print($content_array[0]br\n); Here's the trouble. inside the while loop $content_array is available to me. outside the loop $content_array is not available. What am I doing wrong? Thanks in advance. Curtis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Add Reply-To to this list(s)
Eugene Lee mailto:[EMAIL PROTECTED] on Tuesday, November 25, 2003 12:47 PM said: If you would stop using M$ Outlook and switch to a better mail client that supports mailing lists, your problem would be solved. The problem with your theory is that some of us are in corporate environments where personal email is not allowed and therefore a separate client would not work. And we especially cannot abandon Outlook because afaik there are no other email clients that can talk to Exchange as well as Outlook can. Chris. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Add Reply-To to this list(s)
From: Eugene Lee [mailto:[EMAIL PROTECTED] If you would stop using M$ Outlook and switch to a better mail client that supports mailing lists, your problem would be solved. Amusing--I've used Eudora.. I've used Mozilla.. I've used Netscape.. I don't see that behaviour in any of those. So, care to tell us which M$-Windows mail program supports this? Thanks, Glenn -- Glenn E. Sieb System Administrator Lumeta Corporation +1 732 357-3514 (V) +1 732 564-0731 (Fax) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Add Reply-To to this list(s)
I had the same problem here until, I installed Netscape to handle my personal mail (this list). Works great! Chris: Why don't you give it a try? Chris W. Parker wrote: The problem with your theory is that some of us are in corporate environments where personal email is not allowed and therefore a separate client would not work. And we especially cannot abandon Outlook because afaik there are no other email clients that can talk to Exchange as well as Outlook can. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Add Reply-To to this list(s)
On Wed, Nov 26, 2003 at 02:51:58AM +0900, Dave G wrote: : : Telling people that they need to use proper email software and go : about things in the way they don't expect is not a path to sensible : human interfaces. Computers, machines, systems, should match us, not : us to them. In any case, despite the difficulties, computers are much : easier to change than people. Composing email is a learned behavior. There is nothing intrinsically natural or sensible about it. If you learned something the wrong way, you can relearn it the right way. It's true that computer systems are designed around humanity's needs. But computers are still in their infancy and cannot tell the difference between a user making a wrong choice and a user purposefully making a choice that appears to be wrong. : I remain steadfast in my opinion that automatically replying to the : list is a much more natural option. Again, you're asking the computer to make a guess based on insufficient data. The headers from every php-general message contain information indicating that the email comes from a mailing list. When a mail client receives this email, it should be able to distinguish it as a list email instead of some other random email. If the mail client cannot perform this simple task, then it is up to the end user to do so, and to reply appropriately. If the user refuses to perform the task, the burden is on the user to properly configure the mail client or switch to a mail client that can do it. Don't tweak the content to work with your broken client software. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $ of variables, php, mysql
Hey thanks guys. Problem solved. --- Eugene Lee [EMAIL PROTECTED] wrote: On Tue, Nov 25, 2003 at 11:38:27AM +0100, Marek Kilimajer wrote: : Eugene Lee wrote: : : Try using more variables to make life a little easier to parse: : :$colname = $_FORM['form'] :$query = select {$colname} from structure; :$result = mysql_query($query); :while (($row = mysql_fetch_array($result)) !== false) :{ :echo $row[$colname]; :} : : : Very dangerous. $colname can be anything, e.g. mysql.user.password : colname FROM mysql.user # I wrote it out this way because: the other user provided no source code, I wanted to show working code, it was late and I didn't feel like adding anything to secure against intrusions like SQL injection attacks. For the sake of completeness, redo the first line above as: $colname = mysql_escape_string($_FORM['form']); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Add Reply-To to this list(s)
[snip] If you would stop using M$ Outlook and switch to a better mail client that supports mailing lists, your problem would be solved. [/snip] As has been said several times, not all can do this. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Add Reply-To to this list(s)
* Thus wrote Thomas Svenson ([EMAIL PROTECTED]): Hi, It would be nice if the moderator of this, and the other PHP-lists could fix so the listserver automatically add a Reply-To header to all the mails. When I hit Reply my message would then automatically reply to the list and not the author. Less hassle for me when replying and less risk of forgetting it. This is simply impossible. This list is propagated to places other than the mailing list (ie. news.php.net) Curt -- My PHP key is worn out PHP List stats since 1997: http://zirzow.dyndns.org/html/mlists/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regular expression help
Thanks Bronislav for your answer but this can't be it as the following test code passes validation: ?Php $val = \t test \n; if(ereg([^ \t\n],$val)) { echo 'In here!!'; } echo 'BR' . nl2br($val); ? Anyone has an idea? Bronislav kluèka [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] This condition is true if there is no space, new line or tabulator in $val I need someone to tell me exactly what this regular-expression means: if(ereg([^ \t\n],$val)) { // do the job here } I'm looking for an intermittent bug, and I need to understand this to make sure I have found the bug. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php S pozdravem Bronislav Klucka =[ pro2-soft.com ]= Bronislav Klucka Pro2-Soft +420 605 582 922 [EMAIL PROTECTED] * Windows Web applications, Computer training http://pro2-soft.com -- - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Add Reply-To to this list(s)
This is simply impossible. This list is propagated to places other than the mailing list (ie. news.php.net) So? What negative impact would a Reply-To: header have on a newsgroup? It doesn't affect followups... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regular expression help
Hi, ^ inside [] means not the following chars, so your expression means: if ($val contains no space , no tab \t and no newline \n) { //do the job ... } Regards, Matthias Ben wrote: I need someone to tell me exactly what this regular-expression means: if(ereg([^ \t\n],$val)) { // do the job here } I'm looking for an intermittent bug, and I need to understand this to make sure I have found the bug. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Add Reply-To to this list(s)
[EMAIL PROTECTED] Dave G: This is, I suppose, a completely off topic thread. However, I just read the web page http://www.unicom.com/pw/reply-to-harmful.html and I was completely unconvinced. Yes, I do use OE which is completely broken. And no I don't have to. Oh well. I still agree with that web page, and while I was partly convincedd that reply-to should be added that page really changed my mind. In OE, to break the reply-to rule - it's called reply-to. That means you're supposed to reply to that. - I must manually copy and paste the headers. Of course, I use the news server anyway so this doesn't apply to me. But even so. -- Comex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regular expression help
From: Bronislav Kluka [EMAIL PROTECTED] I need someone to tell me exactly what this regular-expression means: if(ereg([^ \t\n],$val)) { // do the job here This condition is true if there is no space, new line or tabulator in $val Actually, the regular expression will match anything that is NOT a space, tab, or newline. That's what the ^ character does (negates the matching). So, if $val has anything that is NOT a space, newline, or tab in it, then the ereg() function will return true. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] array problems
On Tue, Nov 25, 2003 at 03:45:11PM -0500, Curtis Maurand wrote: : : Hello, : consider the following code (content.txt is tab delimited). : : $city = Ipswitch; : $content = fopen(content.txt, r); : $city_found = 0; : while (!feof($content) $city_found == 0) : { : $my_line = fgets($content, r); : $content_array = explode(\t,$my_line); : if ($content_array == $city) : { : print(Matched on $content_array[0]); : $city_found = 1; : } : } : print($content_array[0]br\n); : : Here's the trouble. : : inside the while loop $content_array is available to me. : outside the loop $content_array is not available. What : am I doing wrong? Your if statement is wrong. You can't compare an array with a string. And your $content_array is not guaranteed to exist when it reaches your print() statement. You can test for existence with is_array(). But you already have this knowledge via your $city_found variable. Use it. Here's a revision (untested): $city = Ipswitch; $content = fopen(content.txt, r); $city_found = false; while (!feof($content)) { $my_line = fgets($content, r); $content_array = explode(\t,$my_line); if ($content_array[0] == $city) { print(Matched on $content_array[0]); $city_found = true; break; } } if ($city_found) { print($content_array[0]br\n); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regular expression help
That's it! Thank you very much, you have the answer. I wonder why the programmer did not write the following line instead: if (strlen(trim($val))) { // Do the job here } Anyways, you just proved that I did not fix the bug! Now I have to work even more! :-P Thanks Matthias Nothhaft [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, ^ inside [] means not the following chars, so your expression means: if ($val contains no space , no tab \t and no newline \n) { //do the job ... } Regards, Matthias Ben wrote: I need someone to tell me exactly what this regular-expression means: if(ereg([^ \t\n],$val)) { // do the job here } I'm looking for an intermittent bug, and I need to understand this to make sure I have found the bug. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Blessing an object
Hi Folks I was wondering (mostly because I came across some situations where I need it) if PHP supplies any methods to bless an array or object to become some other object. In perl, I can simply do: my $SomeInstance = bless { item = 'value', 'Item2' = 'value2' }, 'SomeObject'; And then if I decide that $SomeInstance should be an intance of some other object: bless $SomeInstance, 'OtherObject'; In PHP it would be extremely useful for for doing something like this: ?php Class Foo { Load() { ( .. ) } }; Class Bar extends Foo { } $Thing = new Foo(); $Thing-Load(); ? In Load the object data is loaded from the database, and now imagine one row to contain the subclass this instance of Foo should become. I then would want $Thing to become and thus behave like an instance of Bar (if my database row says so). Hope this message wasn't too confusing ;) Wouter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Add Reply-To to this list(s)
It Adds Nothing is absolutely false. Being able to automatically respond to the list adds more naturally expected behaviour. I remain steadfast in my opinion that automatically replying to the list is a much more natural option. My opinion is that this is a multi person discussion forum, not a person to person forum. I get the messages from the php-general list, not from any individuals here. I reply to the list, not to the individuals. If I post a message I expect replies to come from the list so everyone can read them and fill in their comments. I don't see the point of answering questions posted on the list privately since it then, IMHO, breaks the purpose of the list. I read and learn many things just following the discussions on the list. Many times it means I don't have to post a similar question since I already found the answer. Topics I know that will help me in the future I save so I don't have to add noise to the list. I have got several private replies to posts on the PHP lists that I am sure was intended to be posted to the list and not privately to me. If I need to follow up on it I post I back to the list, but then I have to quote most of the comments I got since no one else on the list have seen them. Another benefit by having the Reply-To rewritten to the list address is that I then wont have to get x number of auto replies from mail servers informing me that the receivers mailbox is full. Posting to this list generates about 3-5 such messages at the moment. When I posted to the install list I got 10++ such messages and other shit that I don't want. A properly configured list would easily filter this out and I would never see them. I am not demanding this to be changed. These lists are important enough for me to live with these problems. I would be very grateful though if the moderator(s) decided it would be a good idea to make this change. /T -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Add Reply-To to this list(s)
If you would stop using M$ Outlook and switch to a better mail client that supports mailing lists, your problem would be solved. I wouldn't mind that at all. What clients do you recommend for WindwosXP? I want a small client (note: I have to use Outlook for business purposes, but have the lists on a separate account). /T -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php