Re: [PHP] multiple databases
On Wednesday 28 February 2001 09:42, you wrote: Is it a wise idea to have a PHP web application running on multiple databases? Everything I've done to date has run off one database, no If you get *really much* traffic, it's wise to split things up to 2 or 3 databases (each on a dedicated machine): * Normal data * Session data * evtl. Cached pages / parts each of which should be able to be backed up to a floppy. Not all If each part fits on a floppy, forget it. For these sizes it'n not worth the effort (and can, in fact, slow down things) -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) CPU not found. retry, abort, ignore? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How to insert time and date into mysql?
On Monday 28 February 2000 19:15, you wrote: How can I insert time and date into mysql table, if the table i have to insert has a field of type time, and a field of type date. Then how can I insert it in PHP, if I use time() function?? Look at the MySQL manual, function FROM_UNIXTIME() -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Never doubt that a small group of thoughtful, committed people can change the world... Indeed, it's the only thing that ever has." - Margaret Mead -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] My system don't store session data, anybody can help me!!
On Monday 26 February 2001 10:26, Securez wrote: ?php session_start(); if( !isset( $c)) { session_register("c"); $c = 1; } echo $c . "br"; ? a href="index.php"reload/A this example that works fine in other system with the same configuration, don't work in my machine, everytime he say 1. Well, you never change $c, so it of course always says 1 -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) ...1000100011010101101010110100111010113... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Printing long strings
On Monday 26 February 2001 14:38, PHPBeginner.com wrote: Yes, you could use stripslashes($string) on it's output, in this way it will be no different as it was inputted. -Original Message- From: Clayton Dukes [mailto:[EMAIL PROTECTED]] Sent: Monday, February 26, 2001 9:57 AM To: [EMAIL PROTECTED] Subject: [PHP] Printing long strings How can I get php to print a long string and ignore any of the characters in the string? ie: $string = "some'strin^g"; print $string; Hmm, perhaps he looks for a way to let the *browser* preserve the string (and not e.g. parse the "" as start of a tag). htmlentities () ist the function of choice then... -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "use the source, luke." (obi-wan gnuobi) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] isset()
On Monday 26 February 2001 18:07, Johnson, Kirk wrote: Wow, I hope you all will forgive me for one last go around on this thread :) Technically, what does "set" mean? It is not the same as "is registered" or "has a value", right? What is "is set"? Is it "introduced to the global namespace"? "introduced to the *current* namespace" -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "use the source, luke." (obi-wan gnuobi) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Class methods in PHP
On Saturday 24 February 2001 17:05, Kevin Beckford wrote: Is there class methods in php? Well, there are classes, classes can have methods, there are methods to handle classes, methods to inspect methods, methods to inspect classes and propably more. I have no idea what you mean with your question, but I hope that some part of the above answers it... -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "The number of Unix installations has grown to 10, with more expected." -- The Unix Programmer's Manual, 2nd Edition, June 1972 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] isset()
On Saturday 24 February 2001 17:18, PHPBeginner.com wrote: in my preceding email I've written: if($var!='') will fix your all your worries without an intervention of a strings function. Except that it will throw a warning in PHP4 if $var is not set. = isset () should be used. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "The number of Unix installations has grown to 10, with more expected." -- The Unix Programmer's Manual, 2nd Edition, June 1972 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Parsing a string
On Friday 23 February 2001 15:46, Hardy Merrill wrote: Look up the "split" and "explode" functions - they both do basically the same thing. $token_list = split(",", $string_to_parse); .. and if that doesn't suffice I can send you a nice'n'powerful CSV parser class :) -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) ...1000100011010101101010110100111010113... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MySQL execution order?
On Friday 23 February 2001 16:57, Don Johnson wrote: Yup, the data's correct. The new records all have the DownloadedDateTime as '-00-00 00:00:00' It works if you execute only the SELECT (without the UPDATE) ? SELECT * from db_table WHERE (DownloadedDateTime = '-00-00 00:00:00') UPDATE LOW_PRIORITY db_table SET DownloadedDateTime=CURRENT_TIMESTAMP WHERE (DownloadedDateTime = '-00-00 00:00:00') -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) ...1000100011010101101010110100111010113... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] array question
On Friday 23 February 2001 17:02, Jeff wrote: Is there better performance/speed instantiating an array with a specified size and then adding elements versus adding elements to an array with no size? Uh, you can't specify the size when instatiating an array ... -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) ...1000100011010101101010110100111010113... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP]
On Friday 23 February 2001 19:27, Don Johnson wrote: Yup. Go figure. Don Johnson It works if you execute only the SELECT (without the UPDATE) ? Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) On Friday 23 February 2001 16:57, Don Johnson wrote: Yup, the data's correct. The new records all have the DownloadedDateTime as '-00-00 00:00:00' SELECT * from db_table WHERE (DownloadedDateTime = '-00-00 00:00:00') UPDATE LOW_PRIORITY db_table SET DownloadedDateTime=CURRENT_TIMESTAMP WHERE (DownloadedDateTime = '-00-00 00:00:00') -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) ...1000100011010101101010110100111010113... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] no subject
Sorry for the other (empty) mail... On Friday 23 February 2001 19:27, Don Johnson wrote: Yup. Go figure. Don Johnson It works if you execute only the SELECT (without the UPDATE) ? Then are you 100% sure that you execute the SELECT first (echo something on each query and check the order)? Perhaps you can also post the actual code.. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) ...1000100011010101101010110100111010113... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] regex help
On Friday 23 February 2001 19:33, John Vanderbeck wrote: I need to take a string and remove everything from the first "" character to the end of the line. I'm pretty sure I could do this with an ereg_replace(), but I am horrible at regular expressions. Could anyone help me with this? Well, I prefer preg_* :) $mystring = preg_replace ('/.*/', '', $mystring); -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) ...1000100011010101101010110100111010113... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Displaying an image, that is pulled from a DB, inline
On Wednesday 21 February 2001 17:09, Chris Lee wrote: dspimage.inc ?php [...] index.php ?php echo " img src='include/dspimage.inc?product_id=123456' "; ? Note: better name that to dspimage.php, as webservers typically don't execute *.inc -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) I saw God - and she was black. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Warning: page expired and cache-control header
On Wednesday 21 February 2001 18:13, Janet Valade wrote: Previously on this list, there have been questions about the Warning: page has expired problem. When you submit a form, then press the back button, you get this message and have to press refresh before the page will redisplay. I have discovered that if you use the following header command, the problem does not occur. header("Cache-Control: public"); The back button takes you back to the form, without a warning message, and the form redisplays with the info you entered. Does anyone know a reason that the above header should not be used? Does it cause some sort of problem that I should be aware of? Yes. It allows cache proxies to cache the page. That means e.g. if Joe X (using ISP Y) fetches that page, *all* users of ISP Y will get the same page afterwards (including all his private data). Well, in practice proxies won't cache results of POST queries, but it's still a big security hole (never trust programs you don't admin yourself) -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) I saw God - and she was black. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Print in html ?
On Wednesday 21 February 2001 20:11, Hrishi wrote: On Thursday 22 February 2001 00:12, Brandon Orther wrote: Hello, I am trying to finish up a script with instructions on how to add my banner add script to someone's .phtml file. I need to print ? readfile(""); ? use : echo '? yaddayadda ?'; the single quotes ensure that php does not evaluate the contents of the string constant = it is sent as is, the browser sees a tag that's unknown to him and simply ignores it. I.e. that doesn't work. Use the proper HTML entities for the brackets: lt;? readfile (""); ?gt; -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) I saw God - and she was black. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Generating percentages of numbers
On Thursday 22 February 2001 00:04, Simon Garner wrote: I have a database of numbers: TOTAL HITS: 1000 PAGE 1: 500 PAGE 2: 250 PAGE 3: 250 How can I query these numbers and display back a percentage number? For instance with the numbers above: PAGE 1: 50% PAGE 2: 25% PAGE 3: 25% Or is their a process by which to store numbers for easily getting this to work? SELECT (hitcount / 1000) * 100 AS percentage FROM sometable Better (if it works): SELECT (hitcount / MAX(hitcount)) * 100 AS percentage FROM sometable -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) I saw God - and she was black. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] String manipulation with ereg_replace
On Thursday 22 February 2001 23:42, Simon Garner wrote: This should do the trick (untested!): ? $contents = "img src=ThisOneReallyNeedsToBeAllLowercase.gif alt=ThisOneReallyNeedsToBeAllLowercase.gif"; $contents = preg_replace("/([-_a-zA-Z0-9]+)\.gif/e", "strtolower('\\1') . '.gif'", $contents); ? simpler that "/([-_a-zA-Z0-9]+)\.gif/e" is "/([-\w]+)\.gif/e" -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Google results 1-10 of about 142,000,000 for e. Search took 0.18 seconds. - http://www.google.com/search?q=e -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Arrays -- How do I insert a pair of data into an array
On Thursday 22 February 2001 22:58, Scott Walter wrote: I am attempting to insert a set of data (actually a pair) into an array, without much success. I would like to insert the data set ("course number", "course title") into a numerically indexed array so that when I want to output the array I can reference it like so: echo("$array[$i]["course_num"] $array[$i]["course_title"]"); Change this to echo ("{$array[$i]['course_num']} {$array[$i]['course_title']}"); -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Google results 1-10 of about 142,000,000 for e. Search took 0.18 seconds. - http://www.google.com/search?q=e -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Deleting mySql records based on dates
On Wednesday 21 February 2001 14:00, Kevin Cawthorne wrote: Try something like: $time = time(); // unix time now $day_limit = 28; // how many days to allow $day = 86400; // how many seconds in 24 hours(1 day) $difference = bcmul($day_limit,$day); // multiply the seconds($day) by the day limit($day_limit) $limit = bcsub($time,$difference); $sql = mysql_query("delete from table where date='".$limit."'", $dbh); Eeeek. Have a look at the Mysql manual sometime soon! $sql = mysql_query("delete from table where datefield = DATE_SUB(NOW(), INTERVAL $days DAY)", $dbh); -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "These are the people who proudly call themselves "hackers" -- not as the term is now abused by journalists to mean a computer criminal, but in its true and original sense of an enthusiast, an artist, a tinkerer, a problem solver, an expert." - ESR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Libraries
On Monday 19 February 2001 22:42, Kath wrote: Why do a lot of people use libraries like PHPLib? I find it a lot better to write my own basic functions. Is it just the attitude "Someone else coded it already, why should I?" Well, if you take a library you can be pretty sure that someone invested quite some work into making it as powerful and bug-free as possible (that includes things like having really researched the RFCs for e.g. that popular mail class etc). -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Drink wet cement. Get stoned. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] system()
On Monday 19 February 2001 21:00, ..s.c.o.t.t.. wrote: i am not positive about this, but you could try making the amp process a background process by adding a " " to the end of the command line (at least if you're using *nix) That alone won't help - "nohup" is also needed. What he could do is write a small Perl/C wrapper for amp, which launches the program in the background and returns its process id. Then he can do a $AmpPID = system ("launchamp $Arg"); (the wrapper would have to execute "nohup amp $Args ") and add a 'stop' link a href="ampstop.php?pid=?= $AmpPID ?"Stop/a And ampstop.php can do a system ("kill -KILL $pid"); However, when they click Play, I want the same page to be reloaded again, with nothing selected, and their (previous) selection to start playing in the background. If they want to change their selection, they can go ahead and pick other songs, and click Play again - THIS is where the previous instance of the 'amp' program should be killed, and a new one started, with the new play list queued. And of course, it should also have a Stop button on the page somewhere. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) I saw God - and she was black. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] system()
On Monday 19 February 2001 22:47, ..s.c.o.t.t.. wrote: is there something with the PHP system command that makes it unable to spawn nohup background processes perl and PHP are closely related, so i cant really understand how an external perl program would be able to do things that PHP couldnt (at least in terms of this specific problem) would a PHP call to "system('nohup ... ')" fail, or are your reasons for suggesting an external program based on something else other than simple feasability? No, the reason for that wrapper program is that I know of no way in PHP to get the Process ID of the spawned program. simply calling something with "nohup" will work fine I'm sure. That alone won't help - "nohup" is also needed. What he could do is write a small Perl/C wrapper for amp, which launches the program in the background and returns its process id. Then he can do a $AmpPID = system ("launchamp $Arg"); (the wrapper would have to execute "nohup amp $Args ") and add a 'stop' link a href="ampstop.php?pid=?= $AmpPID ?"Stop/a And ampstop.php can do a system ("kill -KILL $pid"); -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) I saw God - and she was black. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How to determine the parameter is a 1 dimension array or not?
On Monday 19 February 2001 19:45, Zenith wrote: In a self defined function, a one dimension or two dimension array may be passed, How can I check that, the passed in array is a one dimension array or a two dimension array? Well, actually an array can be both 1-dimensional and 2-dimensional at the same time. Example: $WeirdDArray = array ('1dim' = 'Hello man', '2dim' = array ('Hello', 'man') '1d2' = 42); So it depends on what you mean with "2-dimensional"... -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) I saw God - and she was black. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] REGEX prob
On Sunday 18 February 2001 19:54, n e t b r a i n wrote: function change_sess($html_code){ if(eregi("flag=[0-9]{9}PHPSESSID=[[:alnum:]]{32}",$html_code)){ str_replace("flag=[0-9]{9}PHPSESSID=[[:alnum:]]{32}","?=append_ur l() ;?", $html_code); str_replace doesn't know about regular expressions, so it tries to find the literal string "flag=[0-9]{9}PHPSESSID=[[:alnum:]]{32}" in your URL - which it doesn't find. Use eregi_replace instead H, ok but with the eregi_replace the prob is the same ... :( no changes are made on my cache file ... Ah, yes. str_replace and eregi_replace don't modify the string - they return a modified string. That means you have to do a $html_code = eregi_replace (..., $html_code); -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) A - American Association Against Acronym Abuse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] array - too stupid
On Sunday 18 February 2001 21:26, [EMAIL PROTECTED] wrote: hi, how can i store an array in mysql ? what i do now ( works fine ) a) transform the array to a delimeted string // $tempItem is a dlimited stringexample: 4321117A12342WQ1243 b) $tempItem = serialize($tempItem); Just $tempitem = serialize($myarray); will work fine. c) store it in mysql-table and i get my array back with d) $myItems = explode("",unserialize($myValueFromDB)); $myItems = unserialize ($myValueFromDB); -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) I sat laughing snidely into my notebook until they showed me a PC running Linux. And oh! It was as though the heavens opened and God handed down a client-side OS so beautiful, so graceful, and so elegant that a million Microsoft developers couldn't have invented it even if they had a hundred years and a thousand crates of Jolt cola. - LAN Times -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Finding the? in $REQUEST_URI?page=blah
On Friday 16 February 2001 23:57, James, Yz wrote: OK, I've an error handling page. Basically, I want to split (that might even be one of the functions I'll have to use) this sort of url: error.php?/pages/login.php?username=name That will only cause trouble. URLs with parameters have the following format: scriptname?parameter1=value1[parameter2=val2[...]] Two '?' in an URL are strange at best. So change that to $ErrorURL = 'error.php?page=' . rawurlencode ('/pages/login.phpusername=name'); /pages/login.php $HTTP_GET_VARS['page'] -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Drink wet cement. Get stoned. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Can I select only the newest record?
On Saturday 17 February 2001 12:12, PHPBeginner.com wrote: I wonder, if LAST_INSERT_ID will work in here... I know it works when on the same file was an insertion.. but will it return you the last ever inserted id, say a week ago? It will you return the id that was used on the last INSERT that *this* process (i.e. this script while being executed right now) did. = it won't help. MySQL table. I have a datetime field and an Auto_incremented field. If you want the "newest" field, add a timestamp field and do a SELECT * from that_table ORDER BY thetimestamp DESC LIMIT 1 a timestamp field in MySQL is by default automatically set to NOW() at each INSERT and UPDATE if you don't set it yourself in the query. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Drink wet cement. Get stoned. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Stylesheets
On Saturday 17 February 2001 10:26, Michael Hall wrote: I'm building a PHP application which uses stylesheets. Stylesheets seem to be broken in a big way on my system - using Netscape 4 something on Red Hat 6.1. Is this Netscape or somehow something to do with PHP? Things work as Do you have javascript turned of? Netscape4 only interprets CSS if javascript is enabled. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Drink wet cement. Get stoned. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Removing Whitespace
On Saturday 17 February 2001 14:52, [EMAIL PROTECTED] wrote: I found it on DevShed, if anyone else is interested the code is $your_string = str_replace(" ","",$your_string); That only eliminates "space" characters and leaves tabs, newline etc untouched. Try $your_string = preg_replace('/\s/',"",$your_string); Hi, Does anyone know of the code to remove all whitespace from a string. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Software is like sex: the best is for free" -- Linus Torvalds -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] REGEX prob
On Saturday 17 February 2001 21:49, n e t b r a i n wrote: function change_sess($html_code){ if(eregi("flag=[0-9]{9}PHPSESSID=[[:alnum:]]{32}",$html_code)){ str_replace("flag=[0-9]{9}PHPSESSID=[[:alnum:]]{32}","?=append_url() ;?", $html_code); str_replace doesn't know about regular expressions, so it tries to find the literal string "flag=[0-9]{9}PHPSESSID=[[:alnum:]]{32}" in your URL - which it doesn't find. Use eregi_replace instead -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Software is like sex: the best is for free" -- Linus Torvalds -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How to transfer 2.2864849511949E+190 to a normal-human-readable number?
On Friday 16 February 2001 12:33, Ben Peter wrote: It should be %f instead of %d. However: '? $foo = 2.2864849511949E+190; settype($foo,"double"); printf("%f\n", $foo) ?' | php -q 2286484951194899000 Segmentation fault (core dumped) Well, I *can* understand that printf () isn't prepared to handle numbers with 190 digits :) 2.2864849511949E+190 How can I transfer this to normal-human-readable number? Well, I doubt that 228648495119489900 is more human-readable than 2.2864849511949E+190 Perhaps you want to change it to 2.2864849511949 * 10^190 But I'd say adding a note explaining the "E" notation is simpler... PS: The long number is, scientifically seen, also *less* correct than the 'E' form - the 'E' form states that it is a number with a precision of 16 digits, while the long one implies that it has a precision of 190 digits (which is definitely wrong). -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "World domination. Fast." (Linus Torvalds about Linux) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MySQL COUNT Won't Work
On Friday 16 February 2001 18:27, Jeff Oien wrote: I'm totally stuck on this code. I get the error "Couldn't execute query." so I know where it's failing but can't figure out what's wrong. I have a database with 'title' as one of the fields. Based on code in PHP Fast and Easy. $sql = "SELECT COUNT (title) FROM music"; I found that often MySQL doesn't like if there's a space between the function name and the opening bracket, i.e. try writing "COUNT(title)" instead of "COUNT (title)". -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "World domination. Fast." (Linus Torvalds about Linux) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Where is Regex List of Operators?
On Friday 16 February 2001 18:48, Ted Goranson wrote: Thanks so much for the URLs but they are hardly complete and not at all succinct. I supposed the POSIX REs because that's what I thought the PHP docs said. PCREs are good too? Sure seems like the PHP docs would include this don't you think? They do. See "Regular expression functions (Perl compatible)". Let me rephrase: --I interpreted the PHP manual to suggest POSIX over Perl. Minor comment. Hmm. Minor comment on this from me: I don't see any preference in the manual. --I believe the PHP docs should include a comprehensive, succinct list of regex expressions. Major comment. It was about this that I was saying "Sure seems like the PHP docs would include this don't you think?" Well, What I meant was: In the Perl-regexp section of the manual there is a detailed document on the Perl regexp syntax. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Nothing is more dangerous than an idea if it's the only one you have. - Emil-Auguste Chartier, "Propos sur la religion", 1938 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] need better solution
On Thursday 15 February 2001 02:49, Christian Dechery wrote: that's kinda what I have here... but the line of code isn't being shown... and that is the problem... I for one, think that in an error message the line of code is crucial. Check the manual for set_error_handler () well... that could help, but even than I'd have to call that error_handler everytime I execd a query and still would have to pass to it the __LINE__ of code... Read that section again. That error handler is called automatically every time an error occurs, and __LINE__ is also passed automatically to it. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) I saw God - and she was black. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Array question
On Thursday 15 February 2001 01:40, Chris wrote: How do I get the index,number of an array if reffering to an array via string? Ex: I have 100 arrays, and I want to know what # myarray["something"] is. That element doesn't have an index number such arrays are implemented as hashes or trees, which don't store data at "fixed positions" (that's a very bad explanation, but, well...) The "index" is the "key" in this case - in your example it's "something". -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) I saw God - and she was black. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] A little code here? :)
On Thursday 15 February 2001 04:31, Dallas Kropka wrote: I have a few text input boxes that I am using to allow the client to compose emails for a mailing list... does anyone have a little snippet that will take the "\n's" and turn them into BR's? I would attempt to write one myself but Im not the best at ereg or replace code... nl2br () is the simple solution (as others already mentioned). Attached is a more sophisticated one I use in my code. It detects paragraphs (empty lines), and highlights URLs and email adresses. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) I saw God - and she was black. ?php /* * $Id: text2html.php,v 1.7 2001/01/07 21:03:23 chris Exp $ */ function pbText2HTML ($Text, $LinkStyleClass = '', $LinkTarget = '') { $NewText = ""; $LastWasBlank = true; // (1) quote all HTML entities (assumes iso8859-1) $Text = htmlentities ($Text); // (2) Divide into paragraphs and // (3) Add markup for URLs foreach (explode ("\n", $Text) as $CLine) { $CLine = trim ($CLine); if ($CLine == '') { if ($LastWasBlank) { // ignore multiple blank lines continue; } else { $LastWasBlank = true; $NewText .= "/p\n"; } } else { if ($LastWasBlank) { $LastWasBlank = false; $NewText .= "p\n"; } $NewText .= pb_t2h_URLMarkup ($CLine, $LinkStyleClass, $LinkTarget); $NewText .= "\n"; } } return $NewText; } function pb_t2h_URLMarkup ($Text, $StyleClass = '', $Target = '') { if ($StyleClass != '') $ClassS = " class='$StyleClass'"; else $ClassS = ""; if ($Target != '') $TargetS = " target='$Target'"; else $TargetS = ''; $Patterns = array ('/([^"\'])(http:\/\/[\w\.\/~\-]+)/', '/([^"\'])(ftp:\/\/[\w\.\/~\-]+)/', '/([^"\'\w-\.\/])(www\.[\w\.\/~\-]+)/', '/^(www\.[\w\.\/~\-]+)/', '/([\w\.~\-=]+@[\w\.~\-]+)/'); $Replacements = array ("\\1a href='\\2'$ClassS$TargetS\\2/a", "\\1a href='\\2'$ClassS$TargetS\\2/a", "\\1a href='http://\\2'$ClassS$TargetS\\2/a", "a href='http://\\1'$ClassS$TargetS\\1/a", "a href='mailto:\\1'$ClassS\\1/a"); return preg_replace ($Patterns, $Replacements, $Text); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php vs perl
On Thursday 15 February 2001 08:03, Scott Mebberson wrote: When Jason says 'especially when your note using the cgi' he means the cgi version of PHP (I think) in preference to installing PHP as an apache module. ...just as using mod_perl is better than perl as CGI -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) I saw God - and she was black. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Oracle Web Php
On Wednesday 14 February 2001 11:44, kaab kaoutar wrote: is there a possiblily to use with in an Oracle Web server ? RTFM (look at the manual, topic "Oracle functions") -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Even idiots can handle computers, and many do. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] @ Scope
On Wednesday 14 February 2001 17:36, Karl J. Stubsjoen wrote: When you @ "at" a command (supress error messaging) within a function, is the scope of the @ within the function? Example: CloseODBC(1); # is error message supressed here too? function CloseODBC($connection_id) { # error messaging supressed @odbc_close($connection_id); } Huh? When you call CloseODBC (), the code in that function is executed - and there odbc_close() is called with the "@" - so it doesn't report an error. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Even idiots can handle computers, and many do. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Qoute problem
On Wednesday 14 February 2001 17:56, Tanya Brethour wrote: Hi! I was hoping that someone could help me out. I am not positive if I understand whats going on.. so let me try to explain. This is a process to modify news articles in a MySQL database. (From the point after picking the article to modify) PHP Script #1: I grab everything from the database and stick it into the HTML form (textarea, text, etc). I allow the user to modify whatever they want. (1) Be sure to run the data through htmlentities() before inserting it into the textarea. Otherwise stuff like "" signs, ampersands ("") etc will get munched. PHP Script #2: This script takes the new information and displays it to the user.. it is a preview of what it will look like with the changes. Do a if (get_magic_quotes_gpc()) { $TextFromForm = stripslashes ($TextFromForm); } That will un-escape the quotes ('some \"text\"' - 'some "text"'), i.e. give you the text as it should be. PHP Script #3: Updates the news article in the database. Now the problem I am having.. is that the description and content fields have qoutes in them. For example: Description: I like to run and walk. I love "smelly cheese." So.. when it tries to update the database. It will only store this as the description: I like to run and walk. I love\\ $Query = "UPDATE foo SET field1 = '" . addslashes ($TextFromForm) . "' WHERE ..."; The addslashes () here properly escapes the quotes in your string, so that the SQL parser can interpret it correctly. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Even idiots can handle computers, and many do. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] intput type=\file\ .....
On Wednesday 14 February 2001 18:13, Brandon Orther wrote: I am trying to get the value for a file input field to have a starting value I can't seem to get it to work when using Value=\"C:\test.gif\" Let me guess - You're printing this in some string enclosed with double quotes (print ("Value=\"C:\test.gif\"");) ? Then you need to escape the "\" before the "t" - "\t" is a TAB character, and chances are good that the browser won't like that in a filename. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Even idiots can handle computers, and many do. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Search replace text
On Monday 12 February 2001 01:22, David Robley wrote: while (!feof($file)) { $line = fgets($file, 255); if(eregi($oldemail, $line, $out)) { str_replace($oldemail, $newemail, $line); You need to assign the output of this function to a string: $new_line = str_replace($oldemail, $newemail, $line); Another little thing: You don't need the eregi() here - just do str_replace. If it doesn't find $oldemail it won't do anything. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Nothing is more dangerous than an idea if it's the only one you have. - Emil-Auguste Chartier, "Propos sur la religion", 1938 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] rewriting this SQL statement to remove subselect
On Monday 12 February 2001 01:31, Scott Mebberson wrote: I understand that as of version 3.24, MySQL will support subselects. But untill then (because 3.23 is the latest stable release) I need to convert this SQL satement into something that can be used with v3.2? - the version just before the latest release. $search = "SELECT count(search_table.word) as score, search_table.qid,page_data.contents FROM search_table,page_data WHERE page_data.pID = search_table.qid AND search_table.word IN($querywords) GROUP BY search_table.qid ORDER BY score DESC"; Uh, perhaps I'm blind and/or dumb, but I just can't find a subselect in that query. The query as written here should run fine in any MySQL version -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Nothing is more dangerous than an idea if it's the only one you have. - Emil-Auguste Chartier, "Propos sur la religion", 1938 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] money maths
On Monday 12 February 2001 11:34, Michael Hall wrote: this works fine except that 14.95 * 2 comes out as 29.9 not 29.90. In other words, how to add a zero so that there are always two decimal places. Any solution to this, including regex? I can't find anything look for number_format() and sprintf () -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Those who will not reason, are bigots, those who cannot, are fools, and those who dare not, are slaves. - George Gordon Noel Byron (1788-1824), [Lord Byron] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] comparisons
On Monday 12 February 2001 10:41, PHPBeginner.com wrote: I'm having a rather strange problem. I'm trying to compare two values. "01" and "1". The variables names that they are submitted under are pick1 and pick2. i use the following code [...] I still get the error. Anyone have any ideas? These two valuse mustbe evaluated as different. if (strcmp ($pick1, $pick2) == 0) echo "equal"; else echo "different"; -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Those who will not reason, are bigots, those who cannot, are fools, and those who dare not, are slaves. - George Gordon Noel Byron (1788-1824), [Lord Byron] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Problems with ! in mail();
On Monday 12 February 2001 22:27, Curtis, Lorenzo wrote: I am trying to process a form using text/html and mail(). The resulting email continues to have an ! inserted randomly into the email. Does anyone know how to avoid this?? Yes. Look through your code and find out where you're inserting that "!". Such things don't get in by accident - it's a bug in your code. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Those who will not reason, are bigots, those who cannot, are fools, and those who dare not, are slaves. - George Gordon Noel Byron (1788-1824), [Lord Byron] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Problems with ! in mail();
On Monday 12 February 2001 23:00, Curtis, Lorenzo wrote: I don't think it's a bug in my code... I have gone through it dozens of times and there are NO exclamation points... Well, somewhere it has to come from, and PHP doesn't have an "insert stuff into mails randomly" festure... On Monday 12 February 2001 22:27, Curtis, Lorenzo wrote: I am trying to process a form using text/html and mail(). The resulting email continues to have an ! inserted randomly into the email. Does anyone know how to avoid this?? Yes. Look through your code and find out where you're inserting that "!". Such things don't get in by accident - it's a bug in your code. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Those who will not reason, are bigots, those who cannot, are fools, and those who dare not, are slaves. - George Gordon Noel Byron (1788-1824), [Lord Byron] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] [newbie] Can I use regular expressions?
On Sunday 11 February 2001 13:09, zbynek wrote: I want to check if given username consists only of letters of English alphabet, numbers, or "_". Wouldn't it be simpler to use regular expressions? How would I do it? if (preg_match ('/^\w+$/', $Username)) echo "'$Username' is okbr"; else echo "'$Username' contains invalid chars" -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "use the source, luke." (obi-wan gnuobi) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] regex : Extracting parts of a string :-???
On Sunday 11 February 2001 17:21, akio wrote: $thestring = "\"Hello everyone\" bye"; What I want to extract is: Hello everyone. Instead I get: bye. I use this command ereg("([^\"\"]*)$",$thestring,$regs) and echo $regs[1]. How can I extract what's within double quotes? Hmm, I only know the preg syntax. With that it's preg_match ('/"([^"]*?)"/', $thestring, $matches); $InQuotes = $matches [1]; -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "use the source, luke." (obi-wan gnuobi) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Mail-Encryption
On Wednesday 07 February 2001 22:42, Rodolfo Gonzalez Gonzalez wrote: I found a pgp class and took parts of it to work with gpg, but it doesn't work in safe-mode. I'm using this pipe to pass the data to encrypt to gpg: $comm = "echo '$data' | $this-gpg-commmand"; $fd = popen("$comm","r"); This returns echoes the part after the | in safe-mode. echo only outputs something. it doesn't return anything. Write $comm = "$data | " . $this-gpg_command; and: $this-gpg-kommand is an illegal (no minus in identifiers!) -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Software is like sex: the best is for free" -- Linus Torvalds -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Arrays through URL
On Friday 09 February 2001 10:31, Jrg V. Bryne wrote: check out: serialize(); I'm trying to pass a multi dimensional array through a url link but I'm having a hard time doing this. Is it actually possible? from what It's possible (with serialize), but not desirable if the array can become big (which is easy with multidim. arrays). Better: $ArrayS = serialize ($TheArray); $AKey = md5 ($ArrayS); // insert into database (key: $AKey, value: $ArrayS) $Url = $baseurl . "?key=$AKey" plus the matching reading code -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Software is like sex: the best is for free" -- Linus Torvalds -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Arrays through URL
On Friday 09 February 2001 11:58, Jrg V. Bryne wrote: i would agree that serialize isn't good for huge arrays, yes, but if you're considering databases, why not use sessions? Well, if sessions are useful for you, go ahead and use them. If you only want to pass something on 1-5 links on your entire site, sessions are overkill, but otherwise they'd be my tool of choice. BTW - arrays don't have to be "huge" to generate unwieldy (and dangerous) URLs I'm trying to pass a multi dimensional array through a url link but I'm having a hard time doing this. Is it actually possible? from what -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Google results 1-10 of about 142,000,000 for e. Search took 0.18 seconds. - http://www.google.com/search?q=e -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How does one build a big chat system?
On Friday 09 February 2001 12:23, Jens Kisters wrote: The approaches i've so far using PHP is letting a script run (almost) infinitely and refresh the output every 500ms or so, but this will require a httpd-Process to run for every chatter, consuming several MB per User. Any other suggestions which will cause less server load? Grab one of the many java IRC applets from http://freshmeat.net and run an irc server on your box. http wasn't designed for this type of thing. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Google results 1-10 of about 142,000,000 for e. Search took 0.18 seconds. - http://www.google.com/search?q=e -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] good free/cheap IDE for PHP
On Friday 09 February 2001 19:04, Jeff Oien wrote: What does IDE stand for? Integrated Development Environment -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Google results 1-10 of about 142,000,000 for e. Search took 0.18 seconds. - http://www.google.com/search?q=e -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] [Newbie] PHP Variables
On Friday 09 February 2001 20:39, John Vanderbeck wrote: Why are you echoing it twice? Also, the first line, shouldn't it be: ?php echo $contents; ? Looks liek you dropped the semi colon The semicolon is optional if a closing PHP tag ("?") follows. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Google results 1-10 of about 142,000,000 for e. Search took 0.18 seconds. - http://www.google.com/search?q=e -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] reg-ex problem
On Thursday 08 February 2001 07:40, Michael Dearman wrote: And the | is using '\d' and 'prem'. It probably should be "/(div\d)|prem/ Unless those parens are part of the expression. Then And after a second look, yea the \d is tightly bound to the div. But in confirming this, besides matching something like 'div2' it will also match div23 - both returning div2. Well, it matches on "div2", no matter what's around that. just like "prem" also matches on "appremoval" Don't know the data, so it might not make any difference. Agreed -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence. - Edsger W. Dijkstra -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] splitting a class across separate files?
On Thursday 08 February 2001 17:13, Chris Lee wrote: Its called inheritance. rarley.php ?php class rarley_used { ? main_class.php ?php include_once('rarley.php'); class main_class extends rarley_used Other way round (rarely_used extends main_class) :) -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) This is JohnC IMHO, I compaired tri-word groupings here and in his plan and got a good match. - /. posting discussing the likelihood that an AC post that claimed to be posted by John Carmack during his honeymoon (and having the login info at home) was actually from him. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Passing files to a browser
On Thursday 08 February 2001 18:43, Rob Root wrote: ?php $fp = fopen("test.txt", "r"); header("content-type: text/plain"); fpassthru($fp); fclose($fp); ? And got: Hello, World br bWarning/b: 1 is not a valid File-Handle resource in b/home/robr/public_html/php/getpdf.php/b on line b5/bbr That most likely means the fopen () failed. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) This is JohnC IMHO, I compaired tri-word groupings here and in his plan and got a good match. - /. posting discussing the likelihood that an AC post that claimed to be posted by John Carmack during his honeymoon (and having the login info at home) was actually from him. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Passing an array as an argument.
On Tuesday 06 February 2001 18:18, April wrote: How do you pass an array as an argument to a function? Just as any other variable. Read on... function process_members($asker_rank, $email) { global $database_mysql; mysql_select_db($database_mysql); while (list ($key, $val) = each ($email)) { echo "$key = $valbr"; } } # Doing the same thing with the function here returns this error, though. // Warning: Variable passed to each() is not an array or object in lib.inc on line 447 process_members($asker_rank, $total_members, $email); Look at the definition of process_members() again. The function takes two values. The first is called $asker_rank and the second $email. Now you pass *three* values to it. #1, $asker_rank, is fine. But #2, $total_members, is passed in place of $email, so every time the function body accedded its "$email" parameter, it gets the value of $total_members - which is not an array. The third parameter is ignored. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Software is like sex: the best is for free" -- Linus Torvalds -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] binmode() in php?
On Tuesday 06 February 2001 20:03, Joel Alan Chornik wrote: is there an equivalent in PHP to Perls binmode() function? does anyone know? See the docs for fopen () --- The mode may contain the letter 'b'. This is useful only on systems which differentiate between binary and text files (i.e., it's useless on Unix). If not needed, this will be ignored --- -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Software is like sex: the best is for free" -- Linus Torvalds -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] parent constructor
On Wednesday 07 February 2001 05:14, Aaron Tuller wrote: ok, I == dumb. this works: $parentClass = get_parent_class($this); eval("$parentClass::$parentClass();"); still, I think I should be able to do what I wrote below. Um, you know the name of your parent class, so why do you use get_parent_class() at all? -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Software is like sex: the best is for free" -- Linus Torvalds -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] [newbie] easy question about fopen ($filename, r+)
On Wednesday 07 February 2001 09:42, SED wrote: If I load e.g. textfile.txt with the file pointer at the beginning of the file and write a line or two into it, does it always overwrite the first lines? Yes Is there any function that *always* moves the old lines down automatically? No. You'll have to code that yourself (read file - add lines - write file) -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Software is like sex: the best is for free" -- Linus Torvalds -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Com
On Wednesday 07 February 2001 11:52, Pavel Kalian wrote: COM of course comes with PHP (but is available on Win only), RTFM on calling COM support... Yes, but there ain't no class "COM". Read the manual section about COM support. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Software is like sex: the best is for free" -- Linus Torvalds -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Com
On Wednesday 07 February 2001 12:40, Pavel Kalian wrote: The COM construct was introduced in PHP4 as a replacement for com_* functions to provide something looking similar to MS's syntax AFAIK and it exists and works at least for me and many others. And it behaves more or less like a normal class. Hmm, it's at least not mentioned in the manual. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Software is like sex: the best is for free" -- Linus Torvalds -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] DSO security
On Wednesday 07 February 2001 19:13, Gabor Gludovatz wrote: how can I prohibit users to read arbitrary files on the system if run PHP as apache module? Read the chapter about Security in the manual as well as the description of the safe_mode and open_basedir options -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "These are the people who proudly call themselves "hackers" -- not as the term is now abused by journalists to mean a computer criminal, but in its true and original sense of an enthusiast, an artist, a tinkerer, a problem solver, an expert." - ESR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] reg-ex problem
On Wednesday 07 February 2001 21:50, Michael Dearman wrote: } elseif( preg_match( "/^\d+$/", $arg[$i], $matches ) ) Isn't this \d+ matching --^ { $value = $matches[0]; } elseif( preg_match( "/(div\d|prem)/", $arg[$i], $matches ) ) the \d in this-^^ No. the 1st expression is /^\d+$/ , i.e. match strings with at least one decimal number and nothing else (\d+) from their beginning (^) to their end ($) I.e. that one only catches strings consisting only of decimal digits. And the | is using '\d' and 'prem'. It probably should be "/(div\d)|prem/ Unless those parens are part of the expression. Then No, that's fine. (div\d|prem) means "match either 'div\d' or 'prem'" and memorize that part -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "These are the people who proudly call themselves "hackers" -- not as the term is now abused by journalists to mean a computer criminal, but in its true and original sense of an enthusiast, an artist, a tinkerer, a problem solver, an expert." - ESR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] APC install problems
On Thursday 08 February 2001 10:29, Joseph H Blythe wrote: Does anyone know what is going wrong here: phpize autoconf: Undefined macros: configure.in:43:AC_PROG_LIBTOOL /usr/local/bin/phpize: libtoolize: command not found There does not seem to be a libtoolize on my system? I also followed the INSTALL docs, and read the online FAQ, unfortunatly I know very little about php-modules and autoconf etc.. You'll have to install some packages: libtool, autoconf and automake I'd say. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Software is like sex: the best is for free" -- Linus Torvalds -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: [PHP-INST] Installation of PHP and Apache in RedHat 7.0
On Tuesday 06 February 2001 11:54, Sami Kristeri Maisniemi wrote: Then, do "/etc/rc.d/httpd stop;/etc/rc.d/httpd start" That is exactly the problem. RedHat 7.0 doesn't include program called 'apachectl' or otherwise I am just not able to find it. If you have RedHat7.0 and in your computer 'apachectl' operates just fine, please tell me where it is located at? I thought that 'httpd start' would do the same! Actually "/etc/rc.d/httpd start" usually calls apachectl to do the real work. Anyway, using "/etc/rc.d/httpd restart" is the recommended way to restart apache -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Even idiots can handle computers, and many do. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] attempt to use an empty IV with mcrypt
On Monday 05 February 2001 06:13, [EMAIL PROTECTED] wrote: I get the following warning when I turn on logging... Warning: attempt to use an empty IV, which is NOT recommend in /home/local/apache/htdocs/encrypt.php on line 21 Here is the code and which line is Nr. 21? $key = "testing"; $input = "Secret data"; $encrypted_data = mcrypt_ecb (MCRYPT_DES, $key, $input, MCRYPT_ENCRYPT); print "The CypherText in DES ECB is BR".bin2hex ($encrypted_data)."\nbr"; $encrypted_data = mcrypt_ecb (MCRYPT_TWOFISH, $key, $input, MCRYPT_ENCRYPT); print "The CypherText in TWOFISH ECB is BR".bin2hex ($encrypted_data)."\nbr"; $encrypted_data = mcrypt_cbc (MCRYPT_TWOFISH, $key, $input, MCRYPT_ENCRYPT); print "The CypherText in TWOFISH CBC is BR".bin2hex ($encrypted_data)."\nbr"; ? -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Pretty cool, the kind of power information technology puts in our hands these days. - Securityfocus on probing 3600 hosts for known problems in 3 weeks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] please help (network admin via web)
On Monday 05 February 2001 08:01, niraj shah wrote: I am a 20 year old student doing a research project and I would like to have network administration via web. That is I want to change IP address os the system via web, want to do dns settings and also would like to do proxy setting via web using PHP scripts. I am working on RedHat 6.2 using apache as my web server. Perhapy Webmin could help you? http://www.webmin.com/webmin/ -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Pretty cool, the kind of power information technology puts in our hands these days. - Securityfocus on probing 3600 hosts for known problems in 3 weeks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] manage number of rows displayed
On Monday 05 February 2001 21:23, [EMAIL PROTECTED] wrote: After I run a query, how do I set the number of rows returned to display as 3 or 4 columns in a page instead of one column as usual? Ok, I gather from this that you use some Utility X to query database Y (you don't do it in PHP), and now want to know how to change the settings of X. Correct? -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Pretty cool, the kind of power information technology puts in our hands these days. - Securityfocus on probing 3600 hosts for known problems in 3 weeks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Breaking up a line and using the text?
On Monday 05 February 2001 13:59, jaskirat wrote: $string = ereg_replace(" ","\n",$string) simpler and faster: str_replace(), explode() and split() Original line Hi my name is Sam Rose Which can then be broken down into Hi My Names is Sam Rose -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) The most exciting phrase to hear in science, the one that heralds new discoveries, is not "Eureka", but "That's funny..." - Isaac Asimov -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Making a object from one class available to all objects in the calling class
On Monday 05 February 2001 15:52, Stephen Maher wrote: Hi, Can someone advise on the following. class class_y { function test() { return "test"; } } class class_x { function x { $n = new $y; } function z { $n-test(); } } I need the object of class_y available to the other objects of classx but I cant figure out how I do this. Any ideas? class class_x { function x { $this-n = new $y; } function z { $this-n-test(); } var n; } -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) The most exciting phrase to hear in science, the one that heralds new discoveries, is not "Eureka", but "That's funny..." - Isaac Asimov -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] include files
On Monday 05 February 2001 18:15, David VanHorn wrote: I know this works, in footer.inc, to pull up nomenu. ? include("/home/dvh/public_html/footer-nomenu.inc")? However, is there a more "generic" way to specify the server root as the path? I'd rather not expose my directory structure in the PHP code. I tried various versions of ../ and ../../ without success. Set the include_patz in php.ini and include everything relative to that path -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) (A)bort (R)etry (P)retend this never happened ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] simple config. question
On Monday 05 February 2001 20:14, Shane McBride wrote: Unless I am mistaken, I am pretty sure you need to have sometype of .php extension. Unless you could put a line in the httpd.conf file like: AddType application/x-httpd-php .html Well, that's exactly the right way :) Perhaps a more "generous" setup would be even better though: AddType application/x-httpd-php .html .htm .php3 .php .phtml -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) (A)bort (R)etry (P)retend this never happened ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Automating tasks in PHP?
On Monday 05 February 2001 21:48, James, Yz wrote: Hi all. This is, what might turn out to be a stupid question But I'll ask it anyway ;) Is there any way of automating tasks in php scripts, WITHOUT having them open? Ie, having some method or other to send out an email automatically, once a week, as a newsletter, based on data / criteria from a database? Somehow this question comes up about once a day. Search the ML archives for "cron" -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) (A)bort (R)etry (P)retend this never happened ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Is this a missing feature?
On Sunday 04 February 2001 07:31, John Luxford wrote: function foo ($hash) { while (list ($k, $v) = each ($hash)) { echo "$k :: $vbr /\n"; } } // but what I want to say is something like this foo (["one" = "value", "two" = "value"]); foo () is declared to take a reference to a variable. This only works with "real" variables, not the temporary ones returned from array() etc. Modify it to function foo ($hash) { and it will work -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Never doubt that a small group of thoughtful, committed people can change the world... Indeed, it's the only thing that ever has." - Margaret Mead -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re:What version of Linux?
On Sunday 04 February 2001 05:03, John Hinsley wrote: Well, my home server is a wimpy P90 with 48MB RAM. It serves as web server (all my technical docs, php website testing, more), web cache [...] else :) Ah, yes. MySQL for my php stuff also runs on it. That's pretty impressive! Well, Linux makes it possible *cough* :) The only problem I have with its performance is that it's only connected to my other machines via 10 MBit ethernet (well, and the ram is a bit on the low side). The processor's limits aren't reached by a long shot. It'd be interesting to do some benchmarking on it. My guess (nothing more) is that the limitations are RAM, disk read/write speed and network speed in that order. disk r/w speed isn't really an issue. If it is, it's because the machine doesn't have enough RAM to buffer the stuff. Network speed should be at the top of that list for fileserving, but for PHP stuff 10MBit is completely sufficient. Processor performance *is* somehow a point for PHP - on my more complex pages I have script parsing times of 0.5-0.7 seconds, plus 1-1.5s for DB queries, output generation etc (yes, I do cache such heavy pages. just took that as example) -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Never doubt that a small group of thoughtful, committed people can change the world... Indeed, it's the only thing that ever has." - Margaret Mead -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP hosting - the final frontier.
On Sunday 04 February 2001 23:18, Robert Covell wrote: I understand your concerns, but with this type of logic this mailing list not not be around. Niether would Linux, Apache, MySql or anyother open source tool that so many people utilize today. We would all be on NT instead of Linux and using IIS with ASP instead of PHP. Do think Ramsus when he started out on PHP/FI was thinking I am only one person I shouldn't even try to make it because the big guys are more reliable. That's comparing apples to oranges. If all of Rasmus's computers fail while he's on holiday for 3 weeks, who cares? (Sorry Rasmus :) If some machine at a hosting company shows glitches while the only admin is sick, things will be very bad for the hosted people/companies. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) The most exciting phrase to hear in science, the one that heralds new discoveries, is not "Eureka", but "That's funny..." - Isaac Asimov -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re:What version of Linux?
On Saturday 03 February 2001 04:36, John Hinsley wrote: I want to install my personal server on a old Intel 486 machine, 36 Mb RAM, 2 Gb HardDisk, VGA, to develop in PHP. What version of Well, you'll have great trouble getting several 100k hits per day on a home server, so a small machine completely suffices :) Yes, yes. But you assume that our friend wants to use the 486 box as an Intranet server, to run cgi and php scripts on, and punt out HTML documents to the rest of his network, and pretty much that alone. I simply was _not_ prepared to make that assumption, which is why I asked for more detail :-0 Point taken :) If you're going to the hastle of building a home network, you might consider using the more powerful machine as an all singing, all dancing fileserver, application server and intranet server (pick your choice)! Well, my home server is a wimpy P90 with 48MB RAM. It serves as web server (all my technical docs, php website testing, more), web cache (WWWoffle), web filter (junkbuster), file server (nfs and samba), masquerading internet gateway, firewall, mail server (also processing my pretty big .procmailrc), print server and propably also something else :) Ah, yes. MySQL for my php stuff also runs on it. The only problem I have with its performance is that it's only connected to my other machines via 10 MBit ethernet (well, and the ram is a bit on the low side). The processor's limits aren't reached by a long shot. The 486 could be used as a Windows box connected to the server and/or as an X client (in which case 32Mb of RAM would be just fine). I'd say a combination of good text editor + browser requires more resources than a apache+PHP+mysql in such a scenario. And don't forget that you have to sit in front of the development (client) box all day and getting a decent graphics card for a 486 is *hard* -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) A - American Association Against Acronym Abuse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Querying MySQL using 'AND' / 'OR'
On Saturday 03 February 2001 15:02, James, Yz wrote: $sql = "SELECT * FROM table WHERE username = '$username' AND password = '$password' AND site = 'theirsite' OR site = 'all'"; So, without writing some if statements, is there any way of rewriting that $sql check so that it checks whether the user is an admin of either the individual subdirectory, or all of the sites? Like username: foo password: bar site: all or username: foo password: bar site: subdirectory Simply use brackets to specify the evaluation order: SELECT * FROM table WHERE (username = '$username' AND password = '$password') AND (site = 'theirsite' OR site = 'all') -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Never doubt that a small group of thoughtful, committed people can change the world... Indeed, it's the only thing that ever has." - Margaret Mead -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Problem compilieng PHP4
On Saturday 03 February 2001 19:45, Thomas Weber wrote: linux/limits.h: No such file or directory linux/errno.h: No such file or directory Both these files are in /usr/inclue/. Why does the make not find these files? You mean there are both /usr/include/linux/limits.h /usr/include/linux/errno.h If not, install the kernel-headers or kernel-source package -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Never doubt that a small group of thoughtful, committed people can change the world... Indeed, it's the only thing that ever has." - Margaret Mead -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Include quotes inside textbox
On Thursday 01 February 2001 19:07, Karl J. Stubsjoen wrote: I'm trying to pass back a link to the user in a textbox (so they can copy and paste it elsewhere), however my textbox is being parsed incorrectly by the browser because of the " quotes which happen in the link I'm passing - basically the HTML for the text box is getting parsed together with the HTML for the passed link and the results are messed up. I think you want to use htmlentities (): echo "textarea name='foo' rows='20' cols='50'" . htmlentities ($Content) . "/textarea"; -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) The most exciting phrase to hear in science, the one that heralds new discoveries, is not "Eureka", but "That's funny..." - Isaac Asimov -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re:What version of Linux?
On Friday 02 February 2001 05:32, John Hinsley wrote: I want to install my personal server on a old Intel 486 machine, 36 Mb RAM, 2 Gb HardDisk, VGA, to develop in PHP. What version of Linux do I need to install? But I'm unsure of what you "really" intend using this machine for. Do you really want a home network (in which case conventional wisdom suggests that the server should be the most powerful box on site) or Well, you'll have great trouble getting several 100k hits per day on a home server, so a small machine completely suffices :) The most important thing here should be to *not* install a GUI, simply because nobody will sit at that machine anyway and running GUIs consume too much of your precious RAM. SuSE, Debian or perhaps Red Hat should be fine for this. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Google results 1-10 of about 142,000,000 for e. Search took 0.18 seconds. - http://www.google.com/search?q=e -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] configuring headers in mail() ...
On Friday 02 February 2001 08:20, Maxim Maletsky wrote: FROM: "J-Door Newsletter" [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] (1) Better write "From:" , not "FROM:". It shouldn't matter, but some clients may assume the Firstletteriscap form (2) An email address may take one of the following forms: "Real name" [EMAIL PROTECTED] [EMAIL PROTECTED] (Real Name) [EMAIL PROTECTED] Nesting, as you do it, is not allowed. $from = '"' . $POSTED['from_name'] . '" ' . $POSTED['from_email'] . ''; Your problem here is that $POSTED['from_email'] is "[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]" instead of "[EMAIL PROTECTED]" Also note that "mailto:" is a HTML-ism and has no place in mail headers! -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Google results 1-10 of about 142,000,000 for e. Search took 0.18 seconds. - http://www.google.com/search?q=e -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Tab character
On Friday 02 February 2001 12:24, Martin A. Marques wrote: [\t is tab?] yes (depending) On what? It depends on the charset you use. No. the return value of ord('\t') may differ depending on the charset, but '\t' itself always is a tab character :) -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Google results 1-10 of about 142,000,000 for e. Search took 0.18 seconds. - http://www.google.com/search?q=e -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Future plans (4.1) ?
On Friday 02 February 2001 14:47, Rasmus Lerdorf wrote: So If possible I'd like to hear from the developers if they have a TODO that includes such things for a 4.X release? As for better OO. I think many of the things people ask for, like visibility (public,private,protected) class properties, aren't actually features that add functionality, but more just convenience features that could be implemented in user space. I disagree. Just as with strong typing (which I hope will be added to PHP5 (optional - see how it's planned for Perl6)), language-enforced OO visibility makes it possible that the *compiler* (interpreter) immediately catches a bug that could hide for ages otherwise. Errare humanum est - conventions can't prevent mistakes. For example, you could establish a convention that said that any class property that starts with an _underscore should be considered a private property, and one would hope that your UML tool could be configured to understand that. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Google results 1-10 of about 142,000,000 for e. Search took 0.18 seconds. - http://www.google.com/search?q=e -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Can you do this
On Wednesday 31 January 2001 16:03, Boget, Chris wrote: Now, say I have a function where one of the arguments is passed by reference and is modified within the function. I can call this function on one line myFunc( $modifiedVariable ); and print out the value (if any) of $modifiedVariable on the next echo $modifiedVariable. So what I am wondering is if you can turn those two statements into one? The function is going to get evaluated first we already know, but I am not certain how I could get the (new) value of $modifiedVariable. What about using normal pass-by-value and returning the result? function MyFunc ($SomeVal) { $SomeVal += 42; return $SomeVal; } echo MyFunc ($StrangeVal); Anyway - functions that get their parameters by reference and modify them can cause much trouble, so better be careful with that. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) I saw God - and she was black. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] What is foo?
On Wednesday 31 January 2001 19:35, SED wrote: Probably some of you are laughing while reading this :) But I have seen the word "foo" used so many time (in programming) from different Read http://www.tuxedo.org/~esr/jargon/html/entry/foo.html for a detailed explanation :) -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Those who will not reason, are bigots, those who cannot, are fools, and those who dare not, are slaves. - George Gordon Noel Byron (1788-1824), [Lord Byron] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Sending Download Header
On Sunday 28 January 2001 17:52, Natasha wrote: The filename is just the name, the content is what matters, and also wanted to know if echoing binary data is ok ? Yes. That's what application/octet-stream means: binary data. and what about images, can i send it through octect stream ? will they turn up right ? Usually yes, but you should use the proper MIME type for them (image/jpeg, image/png, image/gif etc) just to be sure -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "World domination. Fast." (Linus Torvalds about Linux) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] email headers!
On Tuesday 30 January 2001 12:06, kaab kaoutar wrote: how can i add Bcc Cc and others to my email? i use $headers="Bcc:[EMAIL PROTECTED]\nCc:[EMAIL PROTECTED]"; mail($email,$subject,$body,$headers)) but i receive it only once ? I guess your mail server is simply too intelligent - it recognizes that all addresses are the same and only sends it once :) Usually this is desired behavior -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "World domination. Fast." (Linus Torvalds about Linux) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Apache
On Sunday 28 January 2001 03:57, [ rswfire ] wrote: 1. Why does $PHP_SELF include /php/php.exe in the variable? How can I stop it from doing that? You're using PHP as CGI. Try using the shared module. 2. Same thing with $SCRIPT_NAME as $PHP_SELF except it does not include the filename. It does, except it does not?? 3. How can I turn on directory browsing? I am receiving a Forbidden error whenever there isn't a default document in a directory. search for "Options " in your apache configs and add an "Inexes" to it -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) This is JohnC IMHO, I compaired tri-word groupings here and in his plan and got a good match. - /. posting discussing the likelihood that an AC post that claimed to be posted by John Carmack during his honeymoon (and having the login info at home) was actually from him. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] phpinfo ?
On Friday 26 January 2001 23:54, John Guynn wrote: I've always used the echo and it does work under PHP4...just tested it on www.teamkaos.org before I made my post. Sure it works as well :) But look closely at the output - with echo phpinfo (); phpinfo prints out the, well, info, and *then* you echo the returnvalue of phpinfo () (an integer). So the output generated by your version will have some little number at the end. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) (A)bort (R)etry (P)retend this never happened ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Get rid of da Zero's
On Thursday 25 January 2001 23:27, Ethan Nelson wrote: It needs to quit shaving zero's when it hits the decimal point. 40.00 into 40 45.50 into 45.5 40.25 into 40.25 Hmm, $ValWithoutZ = (double) $ValWithZ; should work fine (i.e. interpreting the number as floating-point value instead of as string) -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "use the source, luke." (obi-wan gnuobi) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Newbie frustration!
On Tuesday 23 January 2001 22:03, Gerry wrote: All I need is to be able to learn how to load everything from a script and how to call the script with a URL to the directory. eg. ? if (Yarns/) { include "header,nav, fetch content,footer"; else "?"; } ? a href="http://mysite.com/Yarns/" Yarns/a Read http://www.phpbuilder.com/columns/tim19990117.php3 Basically you create "virtual directories", e.g. a PHP script named "Yarns" which simply include()s your one "real" script. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence. - Edsger W. Dijkstra -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] file or fopen to fetch a web page???
On Wednesday 24 January 2001 01:25, Richard Lynch wrote: I wonder myself, which method is better to fetch a web page: $file = fopen($url, "r"); $page = fread($file, 5); or $file = join('', file($url)); Probably about the same either way... Perhaps. In an earlier version of PHP I had a problem where the above code (fopen...) read *more* than the page length. I.e. the page was e.g. 20k big and the fread appended ~5k of junk to it. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence. - Edsger W. Dijkstra -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: WG: [PHP] Shared Memory with Yast-installed mod_php4 from SuSE.
On Wednesday 24 January 2001 09:55, Thomas Weber wrote: Thanks Stathis i tried it twice to compile it, ./configure , make, make install. but i don't get a new libphp4.so! I found only a libphp4.a wich is 9MB (the original libphp4.so is only 2.5MB . You forgot the --with-apxs switch to ./configure Also , try doing a strip --strip-unneeded libphp4.so afterwards -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence. - Edsger W. Dijkstra -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Search Engines and PHP
On Tuesday 23 January 2001 09:23, Kristofer Widholm wrote: If you want to be totally searchengine-safe, do not use variables on the url, do not rely on cookies and do not rely on POST variables for the pages you want to have the searchengine spider. How the heck do you build a dynamic site without URL variables, cookies, or POST variables? Search phpbuilder.com for an article called "Writing dynamic pages with search engines in mind" or so. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) This is JohnC IMHO, I compaired tri-word groupings here and in his plan and got a good match. - /. posting discussing the likelihood that an AC post that claimed to be posted by John Carmack during his honeymoon (and having the login info at home) was actually from him. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] preg_replace pain!
On Thursday 18 January 2001 07:40, Nicholas Pappas wrote: I was hoping someone could help me with this regular expression... $pattern = "/\[b\](.*)\[\/b\]/Ui"; $message = preg_replace($pattern, "B\\1/B", $message); The above works for: [b]bold text[/b] But does not work for: [b]bold text w/ newline[/b] add a "s" modifier to the expression and = $pattern = "/\[b\](.*)\[\/b\]/Uis"; -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "use the source, luke." (obi-wan gnuobi) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]