Re: [PHP] Show output of program in realtime on website
On Wednesday 10 January 2001 00:08, Stefan Scherf wrote: > the program "main" produces x times an output with an delay of 1 second > between each output. > > I want to show this output in "realtime" on a website (this should > become a progress-bar). > Does anybody know how to realise this? Write a custom browser for this and tell all your visitors to use it. Seriously - you can't control how the browsers buffer the received data, when they render it etc. That said - make sure that PHP output buffering is off -- 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] Show output of program in realtime on website
On Wednesday 10 January 2001 13:11, Stefan Scherf wrote: > maybe the problem is in the c-programm "main": > > int main() { >int i; >for(i=0;i<10;i++) { > printf("Output: %i\n",i); The "\n" triggers a buffer flush if I'm not completely mistaken, so there shouldn't be a problem > sleep(1); >} >return; Your compiler should throw an error here - main is declared as "int" but doesn't return a value > } -- 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] looking for a PHP editor
On Wednesday 10 January 2001 15:50, Miles Thompson wrote: > you use because you know how it behaves. For a Windows environment I'll > endorse jeremy's recommendation of Ultraedit -- my hammer of choice. It seconded. > For Linx, etc.? I don't have a hammer yet. I feel obligated to use VIM, My personal favourite is fte. Its only problem is that it doesn't have real PHP highlighting, but I got used to switching between HTML and C mode... -- 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] MySQL SELECT performance suggestions
On Wednesday 10 January 2001 20:58, [EMAIL PROTECTED] wrote: > I have PHP perform SELECT queries on the table, and I need to display > the results in a format of: "viewing $top to ($top+$depth) of $numrows > found" > > I haven't found a way to determine $numrows without performing a second > SELECT in this format: look for mysql_num_rows () -- 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] PHP simulator
On Thursday 11 January 2001 00:08, Todd Cary wrote: > <<< > Did I completely miss the point? > > Yes and No. I have my Win 2K system in my office on which I do PHP > development. However, sometimes I am on the road with a "simple" > Notebook computer (450 MHz and 6 GHz drive). It would be nice to "play > around" with PHP and see if it will run. *simple* I have PHP running nicely on a Pentium 90 with 48MB RAM which also happens to be the file-/mail-/smb-/cvs-/... server in my house. So don't worry about your "simple" notebook being too slow :) (granted - that computer here runs on Linux without any GUI, but still...) -- 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] mixing HTML and PHP code
On Friday 12 January 2001 00:26, [EMAIL PROTECTED] wrote: > > echo ""; > > echo ""; > > echo "$title"; > > echo " if ($time_to_write_the_web_page) { > > // write the web page. > echo " > > > $title > "; One reason why I don't like the "echo" route: I lose the syntax highlighting for the HTML that way. String constants should be highlighted as, well, string constants normally, but when they contain HTML code that's just plain ugly. -- 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] Simple form not passing variables, Why??
On Saturday 13 January 2001 00:36, jeff fitzmyers wrote: > The code below does not work. What could be causing > Please enter user name here: > Pull out your favourite HTML documentation and read again through the discussion of the tag -- 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] filemtime or getlastmod
On Sunday 14 January 2001 17:54, Christian Binder wrote: > The only problem is, that my following script only shows one date (IMO: > of the first value (.)), and not create the date of each file. > // get unix-timestamp form each file in subdirectory > $unixdatum=getlastmod($datei[$i]); Read again through the getlastmod() docs. That function returns the modification time of the *currently executed PHP script*. Use filemtime() instead and it will work -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Install once, run forever. 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] regular expression
On Monday 15 January 2001 09:03, Fai wrote: > ^.+@.+\\..+$ This regular expression can check if the email address is > valid. But it cannot validate the email address with two "@", does I use this code: /* * Check whether the supplied string is a * (syntactically) valid email address * Only does a very rough check. Checking for complete * validity is nearly impossible. */ function pbIsMailAddress ($Address) { // strip comments while (preg_match ('/\([^()]*\)/', $Address)) $Address = preg_replace ('/\([^()]*\)/', '', $Address); // strip leading/trailing whitespace $Address = trim ($Address); // check for basic form return preg_match ('/^[^@]+@[\w-]+(\.[\w-]+)+$/', $Address); } -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Software is like sex: the best is for free" -- Linux 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] Check browsers image displaying
On Tuesday 16 January 2001 09:30, Vlad wrote: > Hi all! > How can I check (in PHP code) if the target browser supports image > displaying or not? PHP manual/misc. functions/get_browser() -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) What luck for the rulers that men do not think. - Adolf Hitler -- 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 handle multiple lines in PHP?
On Tuesday 16 January 2001 17:12, david klein wrote: > Does anyone know how to handle this? One idea is to convert the LINE CHAR> to "" before putting it into the database, but how can > we detect the in PHP? Or is there any other ways? Search the list archives. I already posted a solution for this (complete, working source code) some time ago. Here it is: Date: Fri, 5 Jan 2001 18:08:51 +0100 -- 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] Question concerning performance
On Wednesday 17 January 2001 11:37, jeremy wrote: > Example ONE: (in just parse mode) > [cut]--- > print "blah blah blah blah blah blah blah"; > print "" . $Var1 . "" . $Var2 . ""; > ?> > [/cut]-- > > Example TWO: (in html && parse mode) > [cut]--- > blah blah blah blah blah blah blah > > [/cut]-- > > Now, let me elaborate. I'm quite aware that the above 2 code segments > will both be fast enough for me not to care. BUT, within an > application that has 1000 lines of code per page (hypothetically), > everything begins to matter, and the more cpu-clicks I can save, the > happier I'll be. With big applications the *main* thing that matters is maintainability. In other words: Make it work, make it work well, make it maintainable and *then* make it as fast as possible while *keeping* it maintainable (and working of course) > The 2 examples will turn out the same results to the browser, but which > will do it faster? Don't care about it. The difference is most lileky in th 0.1% range. Look at bigger optimizations first, then benchmark and if it still is too slow (and only then) optimize further. -- 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] 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, "\\1", $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]
Re: [PHP] a text formating & cpu question
On Thursday 18 January 2001 23:05, Noel Akins wrote: > Question 2: > Is there a way for php to detect the cpu speed of a users computer? If you're on a Linux machine you can read /proc/cpuinfo and pick out the speed entry. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) ...to paraphrase Churchill, while representative democracy may be terrible, it's still the best system that large corporations can buy. - David Weinberger JOHO January 25, 2000 -- 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] 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. { > include "header,nav, fetch content,footer"; > else "?"; > } > ?> > > http://mysite.com/Yarns/"> Yarns 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] Splitting at word count
On Thursday 25 January 2001 21:06, H. Wade Minter wrote: > Does anyone have a good idea on how to split after a certain number of > words? Attached is code that semi-intelligently limits strings to a certain number of characters. Perhaps that helps you. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "use the source, luke." (obi-wan gnuobi) = ($MaxChars - $Threshold)) $Work = substr ($Work, 0, $Pos); $Work .= ' ...'; return $Work; } ?> -- 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] array size
On Friday 26 January 2001 22:35, Giancarlo wrote: > > how many elements i can insert in an array? > thank you! I'd say up to 2^31 or until your memory is full (which is likely to occur earlier) -- 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] updating time fields
On Friday 26 January 2001 05:42, Kurth Bemis wrote: > i am wondering if anyone has written a snippet to process the current > date or mktime into a mysql timestamp feild. $CurrentTime = time (); $Query = "INSERT INTO mytable (timestampfield) VALUES (FRON_UNIXTIME($CurrentTime))" => MySQL already provides functions for that. -- 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] system() PHP newbie!!
On Tuesday 20 February 2001 21:17, Kevin Connolly wrote: > just adding the line: system("C:/temp.exe")?? I have also tried > system("C:\temp.exe)!! This is probably a really silly question but I As you use double quotes here, PHP will interpret the "\t" in there as TAB character. Write "C:\\temp.exe" instead. > send me an example or tell me what I am doind wrong? Any assistance is > very much appreciated, Well, it would help if you'd tell us what goes wrong - error messages, things it should do but doesnt ... -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) What luck for the rulers that men do not think. - Adolf Hitler -- 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] Handling File Uploads : ASCII/Binary transfers
On Wednesday 21 February 2001 12:49, Jeff Gannaway wrote: > Here's the deal. My customer needs to upload an ASCII export file of > database info generated by MS Access on their PC. I've written a > script that allows them to upload their Access files then does a LOAD > DATA INFILE command to integrate it into the MySQL database on the web > server. HTTP uploads shouldn't mangle *anything*... > I ran into this problem before when I was manually FTPing export files > then using LOAD DATA INFILE. I fixed it by switcheing from Binary FTP > to ASCII FTP. How can this be done with a PHP script??? ... but apparently you *want* it to mangle the data (convert line ends). You server is a Unix machine? What error does Mysql give you on the "broken" files? -- 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] Displaying an image, that is pulled from a DB, inline
On Wednesday 21 February 2001 17:09, Chris Lee wrote: > dspimage.inc > index.php > echo " > > "; > ?> 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] I'm confused about Regular Expressions.
On Wednesday 21 February 2001 18:42, Kenneth R Zink II wrote: > > I was just reading at DevShed on how to use Regular Expressions, but > now I'm even more confused. > > Can someone please explain how I would use a REGEX to determine in and > uploaded file is a .gif or .jpg file? if (preg_match ('/\.(gif|jpg)$/i', $filename, $matches)) { echo "Congratulations, it's a " . $matches [1] . "!"; } else { echo "Wrong file type!"; } Explanation: /.../ are the "regular expression quotes", i.e. the real expression is between these slashes The "i" after them means "do a case insensitive match" (a "pattern modifier") \.(gif|jpg) means "match if the string contains a dot followed by either "gif" or "jpg"" The dot has to be escaped (prepended with a backslash) because a dot in a regexp has a special meaning: "match any char". The escaping makes it behave as a literal dot The "$" means "here has to be the end of the string" (an "anchor") => the entire pattern means "match if the string ends with a dot followed by either 'gif' or 'jpg', and ignore case for this" -- 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 ''; > > 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: <? readfile (""); ?> -- 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] help change filename.
On Thursday 22 February 2001 08:57, Jan Grafström wrote: > I am trying to change a filename this is my php: > change $filename = "yourfile.php3.xml"; > to $filename = "yourfile2.php3.xml"; > ?> > It doesn´t work do I need some more code to get it working, something > like fopen? Well, Use PHP instead of COBOL... Sorry, but read some basic tutorials on PHP. -- 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 Thursday 22 February 2001 12:14, PHPBeginner.com wrote: > if it is in html then do this: > > > > but if you are using PHP then echo '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] Generating percentages of numbers
On Thursday 22 February 2001 12:14, PHPBeginner.com wrote: > I have once requested a feature like this at PHP-DEV.. > > here's the code: > http://bugs.php.net/?id=7429 Well, I agree with the last comment on that page - Why should that be added to the language if it's implemented in PHP with only 4 lines? -- 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] size of directory
On Thursday 22 February 2001 12:28, Andris Jancevskis wrote: > how can I determine size of directory with subdirectories? if I see > at "ls -l" it returns directory size 4096. I want to know how large > is directory (with files into) without looping all files ... man du -- 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] String manipulation with ereg_replace
On Thursday 22 February 2001 23:42, Simon Garner wrote: > This should do the trick (untested!): > > $contents = " 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] Global variables - please explain me someone.
On Friday 23 February 2001 08:50, Dezider Góra wrote: Disclaimer: I have never touched ASP, so I'm likely to have gotten somethings wrong.. > function too ). But in asp, there were couple types or scopes. > Asp got "application" and "session". Application is something like a > virtual directory, and when first time hit, it inicialize itself and > actions like application.on_start fires. You can define your own > application variables, that are "global" for that application. At the > same time it starts a new session, where you can have your own session > vars. All sessions in application can freely access application > variables, which are good for storing connection strings, counter > variables, etc. Session vars are good for login infos, etc. > Now back to php. What I want to know is, if I declare variable global - > is it global for current session or all sessions? I know about It is global for the current invocation of the script (and all code included from it). To make variables global between all invocations/scripts in a given session, you need to use the session management functions of PHP4. Look at the manual and search phpbuilder.com for some intro on that. > And one thing more. What EXACTLY means php configuration value: > register_global? If set to "on", PHP automatically generates global vars from values passed via GET/POST requests and cookies. Example: calling http://foo.bar/test.php?answer=42 will call test.php with a global variable $answer set to "42" -- 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] 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]
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: RE: [PHP] special characters with perl,mysql,php
On Saturday 24 February 2001 07:49, Mitchell Hagerty wrote: > The special character I'm concerned with at the moment is the back tick > ` which mysql doesn't like on an insert. I was looking for a way not to > parse the entire file evertime I inserted or extracted them from the > database. Its simple enough todo in perl and php just seems like it > would burn alot of cpu time. > > I was actually hoping mysql would have a way to encode it on the way in > and decode on the way out. That way php or perl would be irrelevant. > Guess not :\ Well, as someone else already said, addslashes () is the tool of choice for the way in, and for he way out you don't need to do anything. -- 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] 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] isset()
On Sunday 25 February 2001 09:01, Mark Maggelet wrote: > >> if($var!='') > >> > >> will fix your all your worries without an intervention of a > >Except that it will throw a warning in PHP4 if $var is not set. > >=> isset () should be used. > > man, this is like the thread that will not die. isset() will return > true for an empty string, which is not what he wants. the right thing > to do is use > > if((isset($var))&&($var!="")) I never said *only* isset() should be used :) -- 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: > session_start(); > > if( !isset( $c)) { > session_register("c"); > $c = 1; > } > > echo $c . ""; > > ?> > reload > > 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 = "so 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] Another question about using shmop!
On Wednesday 28 February 2001 00:15, you wrote: > > Does it provide a faster performance, if I use these rather than > > store things in mysql DB, I know this might be stupid, but I have to > > make sure this. > > I belive shared memory is *much* faster than MySQL. Well, I'd say it depends. For only a bit of simple data it's fine. But for more the optimizations of a database (indices etc) may make the db faster (remember most of the DB will be in RAM as well). And a database is just *much* simpler and safer to use. > Shared memory is not for the faint of heart. > I can't think of any more, but that's mostly because I consider shared > memory "too tricky for me" and have never played with it... -- 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] File downloading?
On Wednesday 28 February 2001 01:06, you wrote: > > Great, thanks. > > I looked at the file(), but it sounded like is was just for > > local file use. > > oops, should've been include(). Sorry :) include () is surely wrong for that. fpassthru (as someone else mentioned), file() and (my personal favourite) readfile() are the functions of choice -- 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] Move a file from dir to another or delete file..?
On Wednesday 28 February 2001 06:51, you wrote: > Well I would like to move a file from one directoy to > another using php and a web browser. > I could just find a function to move an uploaded file > but not a normal file which is allready there in some > directory. look at the filesystem functions: rename () (or safer: copy()+unlink()) unlink() -- 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] what is wrong with this sniplet?
On Wednesday 28 February 2001 22:40, you wrote: > people, > I tried to write out email using sniplet below, the email will write > out the hyper link so that reciever can click on the link to go to the > page. What happen is that the reciever recieve the actual link instead > of the hyper link I made, so I wonder what did I do wrong. I have mad > sure that the email software I used to test can read html format ( I > use outlook express). > > $mailTo = "[EMAIL PROTECTED]"; > $mailSubject = "test"; > $mailBody= "Dear sir, \n\n"; > $mailBody= "Below is the link you can click on, \n\n"; > $mailBody .= "Please Click href=\"www.php.net\">Here to view the request > details"; $mailHeaders = "From: [EMAIL PROTECTED]\n"; > mail($mailTo, $mailSubject, $mailBody, $mailHeaders); Add a "Content-Type: text/html" to $mailHeaders (& add a http:// to the link) -- 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] 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] require on compressed files
On Wednesday 28 February 2001 22:58, you wrote: > I am trying to get the expected behavior of: > require("filename.gz"); > or > require("filename.bz2"); > to work properly. Why do you want to do that? If that file is just a normal include file, compression just adds unneccessary overhead. If it's some file you don't know the contents of, don't include it (that would mean executing arbitrary code on your server) -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) What luck for the rulers that men do not think. - Adolf Hitler -- 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] about include
On Thursday 01 March 2001 09:59, you wrote: > hi, >everytime i add include function to a script it will answer like: > Warning: Failed opening 'common.php' for inclusion > (include_path='/usr/local/apache/htdocs:/home/httpd/mydomain') in > /home/httpd/mydomain/h24h/foro/admin/index.php on line 23 > > and lines 22 and 25 have: >chdir("/home/httpd/mydomain/phorum/"); >include "common.php"; The chdir doesn't affect include () in any way. It looks for "common.php" in the include path, i.e. /usr/local/apache/htdocs/common.php or /home/httpd/mydomain/common.php Writing include ('phorum/common.php') will work in your setup -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) What luck for the rulers that men do not think. - Adolf Hitler -- 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] Javascript and Php
On Thursday 01 March 2001 13:19, you wrote: > I'd like to include an inc file once a button id cliked! You can only request a new page. Period. PHP runs on the server, button clicks are evaluated on the client (browser). -- 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] Bitwise solution?
On Thursday 01 March 2001 20:58, you wrote: > But that would give me a value of a variable variable. > And I need a numerical value so > > $var1 ="joe"; > $var2 = date( "U" ); > > echo "$var1$var2"; > > won't do me any good. Ahhh. You want to use the mcrypt functions or simply crypt() ? -- 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] Munging hidden/form variables
On Friday 02 March 2001 00:22, you wrote: > I can think of one way that you can take in an attempy to prevent > this. > It is not totally fool proof but it will make it more difficult > to send spoof data: > > 1) Check your HTTP refereer when the form is submitted. If the > referer is not from your host then don't process the form. > Of course this can be faked quite easily if this person knows > what (s)he doing. And it would prevent people who don't sent Referrer headers from using the form -- 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] php and javascript
On Friday 02 March 2001 06:21, you wrote: > Hello, > > Are there any good examples of producing embedded javascript code in a > php file? sglfjh s -- 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] Help - I can't create jpegs with GD
On Friday 02 March 2001 06:46, you wrote: > I can't create or manipulate jpegs, but pngs work fine. I am using a > hosting service. They installed GD 1.8.4 with jpeg support a few days > ago, but I'm thinking they did it wrong. I'm using code I know works > because it's straight out of the PHP Cookbook. What do I need to tell > them to correct the problem? Depends on what errors you get. "I can't create or manipulate jpegs" isn't particularly helpful... -- 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] whats the message count ?
On Thursday 01 March 2001 12:51, you wrote: > 2. i can order "old" mails from the script who managed this folder > right ? but i need to say what number i want.. like i want number > 499-550 .. so my question what number do we have actually ? (i suppose > it started with one, but where are we right now?) Look at the headers of one of the messages. They contain a line of the form X-From_: [EMAIL PROTECTED] The 42156 in there is the message number -- 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] last inserted record
On Saturday 03 March 2001 05:16, you wrote: > i'm having a little bit of problems with a little mysql table i'm > using. the table has no primary key nor index nor nothing. > > i was wondering if it's possible to select the last inserted record of > a table with this characteristics. Add a primary key. now. Accesses without that will be painfully slow. -- 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] Content-Type: image/gif and send the image in hex
On Sunday 04 February 2001 05:53, you wrote: > Hi all, > > I'm trying to make a demonstration script (using PHP) that demonstrates > the use of MIME types in HTTP headers. It should send the Content-Type > header and than sends an image to the browser in hex. What do you mean with "in hex"? Hex is a number system. It only exists to make handling binary data easier for humans. > I run the script in my browser and get the bare decimal values > displayed and not the GIF image: Aha. So you just want to "send the image". > I also tried to use: > header("Content-type: image/gif"); > But no success. > I don't want to use the header() function cause it doesn't help my > demostration script show the workings. Well, you *need* the header ("Content-type: image/gif"); to tell the browser that you're sending a gif. It can not determine that by itself. If you don't send the header the browser will try to interpret you gif image as HTML code, which usually gives, well, fascinating results :) > // 7x1 pixel GIF image data > $img = array ( > 0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x07, 0x00, 0x01, 0x00, 0xF7, > 0x00, 0x00, 0x00, 0x00, 0x00, > 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, > 0x80, 0x80, 0x00, 0x80, 0x00, [...] > ) ; > // Write content type to browser > echo "Content-Type: image/gif\n\n"; > > // Write GIF image data to browser > foreach ($img as $val){ > echo $val; > } Try echo pack ('c*', $img); Or if that doesn't work: foreach ($img as $val) { echo pack ('c', $val); } -- 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] PHP web based mailing list administrator
On Saturday 03 March 2001 13:59, you wrote: > Yes, they are about. Try hotscripts.com. And if you don't insist that the manager is written in PHP, try GNU Mailman. It comes with its own /very nice) web-based admin software. > > does there exist a web based mailing list administrator in PHP (Tying > > in with some open source mailing list software)? > > Ideally, something like egroups (now groups.yahoo.com). I just want > > to be able to easily administrate (or have other people administrate) > > mailing lists. I have access to my own server (linux, php4, ...) > > thanks! -- 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] NETSCAPE screws up query string : more problems!
On Sunday 04 March 2001 20:38, you wrote: > Julian, > i tried : > > href=\"pro_page1.php3?title=".urlencode($myrow[title])."\"> > > instead > > href=\"pro_page1.php3?title='".urlencode($myrow[title])."'\"> > > notice the single quote ' missing. And that WORKED!!! > It displayed the right value in the next PHP page. > Unfortunately there's another problem. it only > DISPLAYED the right value...but when it adds the value > in the database...it adds with the plus + sign. i.e., > it adds : Project+One instead of Project One. try rawurlencode instead of urlencode -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Very funny, Scotty! Now beam up my clothes... -- 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] input textfield value cat!
On Monday 05 March 2001 17:29, you wrote: > I'm using a variable! > > Well, you *still* need to have quotes around it: > >Make sure you have quotes around the value. > > > > -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) ...to paraphrase Churchill, while representative democracy may be terrible, it's still the best system that large corporations can buy. - David Weinberger JOHO January 25, 2000 -- 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 variable via url
On Monday 05 March 2001 17:43, you wrote: > using PHP 3.x on Linux, I've always been able to pass along a variable > like http://www.domain.com/index.php3?foo=bar > > and then I could print out this with something like > echo $foo; > would print out "bar" > > I've recently installed the latest PHP4 onto a Windows2000 server, I'm > trying the same thing here, a simple test, and > echo $foo; > > gives me nothing > > however including a PHPINFO() on the page displays this: > HTTP_GET_VARS["foo"] bar > > I'm I missing something here ? Check whether register_globals is set to "on" -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) ...to paraphrase Churchill, while representative democracy may be terrible, it's still the best system that large corporations can buy. - David Weinberger JOHO January 25, 2000 -- 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 text between
On Monday 05 March 2001 23:09, you wrote: > I need some help with a program, I need to get every > instance of text between GET TEXT HERE > and save the results in a variable. Does anyone > have some example code of how to do it along with how > to put the results into just one variable? Hmm, try preg_match_all ('/]+>([^<]+)<\/a>/', $Subject, $Matches); $Matches [0] [1], $Matches [1] [1], $Matches [2] [1] etc will contain the text afterwards. -- 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] speeding a site with lots of includes
On Monday 05 March 2001 23:20, you wrote: > An app I am currently developing has grown a lot. It currently > handles aproximately 12 includes, more or less 13 thousand lines > of code. > > By doing some benchmarks, i realized that the bottleneck is the > include() payload. Are you sure it's the include() ? Or is it the parsing time for the 13k LOC (much more likely)? > How can I optimize a program like this one ? Have a look at zend optimizer or apc cache (apc.communityconnect.(com|org|net)) Another way would be to clean up your code (if you haven't already done this). Often this can drastically cut down on code size (a cleanup I did recently roughly halved code size) while improving clarity and maintainability -- 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] Sites Using PHP - For a presentation
On Monday 05 March 2001 23:44, you wrote: > I am looking for some big name sites using PHP. > I will be doing a presentation next month and would like to show a list > of sites that are using PHP. Well, sourceforge.net is pretty big (and complex). http://www.securityspace.com/s_survey/data/index.html might also provide some info, and with http://uptime.netcraft.com/up/graph you can look at some popular sites yourself -- 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] exec timing out, want to leave process running in bg
On Wednesday 07 March 2001 06:37, you wrote: > Hi, > > Well there are many ways to run a process in the > background, my favorite way is detaching the process > or the program or process from within, so if it's a c > program pretty easy, but incase you dont have the > source, then you can use this: > > exec("mp3123 -y -Z --all 1>/dev/null/ 2>&1 &"); better add "nohup" to that: exec("nohup mp3123 -y -Z --all 1>/dev/null/ 2>&1 &"); > well that simply puts the stdout and stderr in the > same file /dev/null, and puts it into the background. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) What luck for the rulers that men do not think. - Adolf Hitler -- 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] last inserted record
On Thursday 08 March 2001 06:42, you wrote: > Assuming that you do have a primary key, how can you grab the last > record you inserted? Can you use @@IDENTITY, or something like that? For that I'd add another field - type "timestamp". In MySQL, timestamp fields are automatically set to NOW() on each insert and update *if* they are not set to something else in it (the insert or update) Or simply add some timestamp or datetime field that you "manually" set to NOW() on each insert (if you don't want the date to be changed on an UPDATE). > On Saturday 03 March 2001 05:16, you wrote: > > i'm having a little bit of problems with a little mysql table i'm > > using. the table has no primary key nor index nor nothing. > > > > i was wondering if it's possible to select the last inserted record > > of a table with this characteristics. > > Add a primary key. now. Accesses without that will be painfully slow. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Very funny, Scotty! Now beam up my clothes... -- 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 Masters: Please inspect this regex- Pulling urls out of page
On Thursday 08 March 2001 09:19, you wrote: > I'm putting together a regex to pull all of the urls out of a web page. > Not the href tag, but just the url part of that tag. > > Here's what I've come up with: > > preg_match_all('/<.*href\s*=\s*(\"|\')?(.*?)(\s|\"|\'|>)/i', $html, > $matches); > foreach($matches[2] as $m) print "$m\n"; > > All regex masters please tell me if I'm missing something. It's working > well, but I'm still learning about perl regex and I'd like any input if > at all possible. Pretty good. Some minor things: (1) "<.*href" will also match example of href="hello" (2) You're pretty lax on the tag syntax - you don't require quotes to match, don't require quotes at all etc I'd rewrite it to '/<\s*a\s*href\s*=\s*("|\')(.*?)\\1\s*>/i' > What's a good way to exclude things like javascript: urls and other non > URI info? I guess what I'm really looking for is all the http urls, no > ftp, mms etc... or anything like that. Use the following regexes on your result to get only the types you want: $HostName = '([a-zA-Z][\w-]*(\.[a-zA-Z][\w-]*)+)'; $HostIP = '(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})'; $Host = '(' . $HostName . '|' . $HostIP . ')'; $HTTPPath = '(([\w\.\/~\?%=\-]|&)+)'; $FTPPath = '(\/[^\/\s]*)*\/?'; $Port = '(:\d+)?'; $HTTPURL = 'http:\/\/' . $Host . $Port . $HTTPPath; $WWWAddress = 'www\.' . $HostName . $Port . $HTTPPath; $FTPURL = 'ftp:\/\/' . $Host . $FTPPath; -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Very funny, Scotty! Now beam up my clothes... -- 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] last inserted record
On Thursday 08 March 2001 10:31, you wrote: > > On Thursday 08 March 2001 06:42, you wrote: > > > Assuming that you do have a primary key, how can you grab the last > > > record you inserted? Can you use @@IDENTITY, or something like > > > that? > > > > For that I'd add another field - type "timestamp". > > In MySQL, timestamp fields are automatically set to NOW() on each > > insert and update *if* they are not set to something else in it (the > > insert or update) > > I would prefer using mysql_insert_id() if possible. > http://www.php.net/manual/en/function.mysql-insert-id.php Which however only works (1) with autoincrement keys and (2) for the last insert you did using the same mysql connection, i.e. if you do an insert in foo.php, mysql_insert_id () won't show anything in bar.php -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Very funny, Scotty! Now beam up my clothes... -- 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] Sessions Kill all
On Thursday 08 March 2001 03:45, you wrote: > Is there a way as a server admin to kill all sessions to a site. I > need a way to logout all members to a site. Well, usually you'd keep the session data in a database, so you can just empty the sessioninfo table. -- 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] need help w/ Split()
On Thursday 08 March 2001 18:43, you wrote: > I am attempting to take a line of text (a list) that has been entered > into a form and split it into the appropriate parts, placing them into > an array. I am splitting the input on commas, semi-colons, and spaces. > > Problem 1: Is with "white space". If the input has spaces after a > comma, it splits on the comma, but enters each "space" as a separate > element of the array. > > Problem 2: Is with "white space" also. If the input has just spaces > between the appropriate parts, then it will split on the first "space", > but enter the rest of the "spaces" as separate elements of the array. > > Here my code: > $course_list = preg_split("/[\,\;\s*]/", $input_list); You can't put the asterisk in the character class - it's taken as literal asterisk in there. try preg_split("/([\,\;]\s*)|(\s+)/", $input_list); i.e. "either (',' or ';' eventually followed by spaces) or (at least one space)" -- 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] weeks
On Thursday 08 March 2001 18:49, you wrote: > Anyone know offhand a way to organize the output from a query by week? > I'm writing a work log app and I want the admin to see everyone's work > ordered first by lastname, and then by date. But only want that week's > data to show up, and maybe a dropdown with previous weeks available. > Don't go thinking about an answer, cuz I'm doing that, but if anyone > already knows how to solve this problem or part of it, lemme know. > Thanks once again. for MySQL add a WHERE (WEEK(yourtimefield) = WEEK(NOW())) this will have the problem that it will show all of week X even if you're on 23:55 on the last day of that week WHERE ((yourtimefield >= NOW()) AND (yourtimefield <= DATE_ADD(NOW(), INTERVAL 1 WEEK)) might be better -- 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] Sessions Kill all
On Thursday 08 March 2001 07:17, you wrote: > Does anybody know where I could get more info on storing session data > in a database rather than the default way? Hmm, perhaps phpbuilder.com has an article on it. Alternatively I could send you some of my 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] Classes and Kernel CPU Load?
On Saturday 10 March 2001 16:24, you wrote: > I have Scripts that seem to cause imense Kernel (not user) CPU Load > under Solaris, > could this be caused by using classes? That would be very strange. I rely heavily on classes, and have absolutely no problems with them. > What else could cause an immense increase in Kernel CPU Load? Try removing more stuff to narrow things down a bit. -- 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] MySQL problem - stumped
On Saturday 10 March 2001 19:58, you wrote: > The following code is giving an me problems, I can't figure it out to > save my soul. The last line gives: > > Here is the code: > > $link = db_connect(); > $query = "UPDATE Users SET firstname='$firstname', lastname='$lastname' > WHERE username='$user' && password='$password'"; > $result = mysql_query($query, $link); > $err = mysql_error(); > echo "Errors:".$err; > $rows = mysql_affected_rows($result); > > And here is the output: > Errors: > Warning: Supplied argument is not a valid MySQL-Link resource in > //*//**..***/db.php on line 147 > > Line 147, is the last line in the above snippet. I cleared out the > path name for security, no offense intended :) This one? > $rows = mysql_affected_rows($result); Try $rows = mysql_affected_rows($link); -- 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] Variable dynamique
On Sunday 11 March 2001 16:58, you wrote: > I receive 2 variables, $var and $num > I need to make a variable out of these two like this > > $var2 where $num = 2 or > $var3 where $num = 3 > > How can I do that ? http://php.net/manual/en/language.variables.variable.php -- 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] Problems with string replacement
On Sunday 11 March 2001 18:45, you wrote: > Well, I'm having problems again. This time with string replacement. > I'd like people to be able to write notes on one of the site's I'm > helping with, and would like them to be able to use Bold, Italic, > Underline and tags. I tried using striptags(); but that would > strip anything within double quotes too. So I've gotten around it by huh? strip_tags works fine for me. echo strip_tags ('Hello http://foo/">bar "world"there', ' '); creates 'Hello http://foo/">bar "world"there' -- 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] Problems with string replacement
On Sunday 11 March 2001 23:44, you wrote: > >> Well, I'm having problems again. This time with string replacement. > >> I'd like people to be able to write notes on one of the site's I'm > >> helping with, and would like them to be able to use Bold, Italic, > >> Underline and tags. I tried using striptags(); but that > >> would strip anything within double quotes too. So I've gotten > >> around it by > > > > huh? strip_tags works fine for me. > > > > echo strip_tags ('Hello http://foo/">bar > > "world"there', ' '); > > > > creates > > > > 'Hello http://foo/">bar "world"there' > > True, but then it doesn't: > -Open the link in a new window ?? You have some tag like http://foo.bar/" target="_new">link and strip_tags() transforms this to http://foo.bar/">link ? Or what do you mean with that? > it does: > -remove all content between "and". No. Just plain no. See my example above. The stuff in quotes was kept without any problems. > Of course, I could replace quote marks with htmlspecialchars/entities > or using manual string replacement, but then it'd render all tags using > quote marks invalid. > > See the problem? ;) No ;) Perhaps if you could provide some example code... -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Error 032: Recursion error - see error 032 -- 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] header
On Monday 12 March 2001 08:33, you wrote: > Hello! > Why header under Windows do not work? Because you have some problem. That's all that can be said without telepathic skills. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Error 032: Recursion error - see error 032 -- 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: FW: [PHP] Classes and Kernel CPU Load?
On Monday 12 March 2001 18:28, you wrote: > I don't know much about OS design, but I may want to check out how long > the context switches are taking. That could be an issue? Definitely not under Solaris :) -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Install once, run forever. 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] Linux / PHP and passwords -( md5 function)
On Monday 12 March 2001 18:31, you wrote: > I am trying to generate a MD5 string equal to a known passwords MD5 > string , with no luck in order to make a new password file > > i have tried use php's : $value = md5($string); > and $value = crypt($string,$salt); > > the passwds in my systems /etc/shadow all start with $1 which i believe > is standard for MD5 passwords of 32 length The "$1$" is the start of a 12-char salt (as described in the manual entry for crypt ()). -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Install once, run forever. 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] Have you ever seen this?
On Monday 12 March 2001 19:21, you wrote: > Well There are some versions of some sites in two > languages and both of them work equally well even If > your system doesn't have fonts. > It uses some kindaa server font management I gues.. > > Has anyone of you all out there worked on some site > like that or have any idea on how it works. > > I can give you the URL: > > http://www.arabia.com Well, I guess they should invest some more work in it :) screen output [an error occurred while processing this directive] ---- /screen output -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Install once, run forever. 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] Escape slashes?
On Monday 12 March 2001 20:27, you wrote: > Hi! > > I am trying to do some fileuploading.. but I am running into a problem > with escaping spaces. > > Basically, I have this directory that includes spaces and I need to be > able to change the spaces to "\ " so for example.. > > my directory is: Fun Documents > I need to change it to: Fun\ Documents > > That way when I copy.. I wont get errors! Plus, there is always the > potential that the filename might have a space in it. Why would you get an error when copying? copy(), fopen() and all the rest should work fine with filenames-with-spaces. > So how do I escape these spaces? > > I have tried this.. and it doesnt work: > $copyto = strtr($copyto, " ", "\ "); strtr () is for "TRanslating" strings between character sets, i.e. it replaces single characters with single other characters strtr ($SomeString, "abc", "qwe"); will replace all "a" with "q", all "b" with "w" and all "c" with "e" > I am sorta clueless.. any ideas? Well, as I said above you shouldn't need this, and in fact this could become a quite unstable solution. You escape spaces - but what about filenames containing tabs, newlines etc? copy () takes care of that automatically. -- 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] Get next record
On Monday 12 March 2001 20:38, you wrote: > How can one get the next record to compare two fields... I want to > check if the date of the first record matches the date of the next > record with the least amount of code... SELECT First.id, Second.id from mytable First, mytable Second WHERE (First.id = $TheRecordYouWant) AND (First.DateField = Second.DateField) ? -- 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] Getting name of the main file from external included script..
On Tuesday 13 March 2001 00:14, you wrote: > I already asked this once before, but nobody seems to answer. That's > why I'm re-writing > my question. Well, you waited about two hours. That's not much, even for a mailinglist like php-general. -- 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] software localization with PHP
On Wednesday 14 March 2001 05:50, you wrote: > I have a question about localizing PHP scripts. I understand that for > basic localization one can have a "strings" file for each language, > which contains string variables and values such as: > $title = "Welcome!"; > $error = "An error occurred."; > ?> Have a look at the gettext extension for a (IMO more elegant) alternative. -- 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] [Q] session variables wouldn't keep contents.
On Wednesday 14 March 2001 09:33, you wrote: > I set "register_globals = Off" for many reasons. > Session may not work with "register_globals = On"?? Works fine here (php 4.0.4 / Linux / Apache) -- 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] Mysql Show SQL
On Wednesday 14 March 2001 14:41, you wrote: > > $result= mysql_query($query); > > while ($row = mysql_fetch_row($result)); > > { > > for ($i =1;$i > {echo $row[$i]; > > }} > > ?> > > 2 problems. > > 1. Delete the ';' after the while loop. With that there the for loop > will never run. It will. Once. First it fetches all matching rows from the database (each time overwriting previous results): > > while ($row = mysql_fetch_row($result)); Then it executes the code after the while: > > { > > for ($i =1;$i > {echo $row[$i]; > > }} -- 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] Day of Week??
On Wednesday 14 March 2001 14:53, you wrote: > Hi It's me again! > Bruno...From Brazil... > > Hi wanna know How can i take the day of week of aany date... Have you tried reading the manual? -- 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] Script returns an image?
On Wednesday 14 March 2001 16:04, you wrote: > I have been over that page, but did not know that it applied since I do > not want to modify an image, simply pass it on to the requestor. > Here;s my relevant code: > > > ...database stuff... > > Header("Content-type: image/jpg"); You tell the browser that you send an image... > ?> > and then send HTML code instead. do a instead of the tag -- 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] Executing a string with both html and php inside it..
On Wednesday 14 March 2001 12:50, you wrote: > My string contains HTML tags with PHP code inside(in '' > tags), not only PHP as eval() requires. > > Do you have any other suggestion? AFAIK there's no other way than using include(). Why do you need that anyway? > > > What should I do in order to execute the next string: > > > $str = "\n" > > > $str .= "blabla\n"; > > > $str .= " \n"; > > > $str .= "blabla\n"; > > > $str .= "\n"; > > > > > > When I tried using 'echo' with the string, but the php code didn't > > > work... -- 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] How upload files to protected directories?
On Thursday 15 March 2001 03:26, you wrote: > Hello Keith, thanks very much. Sorry because I forgot explain > following: picture files really are uploaded to host server, because I > check temp file and they are ok (I check $userfile_temp variable). My > problem is: I can't move, copy, rename or anything else other than > 'open and read' this file. Whenever I try exec copy commands I receive Well, you want to store them in the database anyway, so "open and read" is sufficient. And for retrieving them you don't need GD. So you should have no problems. -- 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]