Re: [PHP] what vars should go in session vars?
Erik: If I could paraphrase your question, it'd be, is it better to leave info in session vars or use db calls - if that's right, I'd say db call for your particular need is faster/easier, as you'll be accessing the db anyway (getting their personal info). Just add a style sheet preference field to the db, and call it along with the other user info, and have the php write the correct css include call. From the sounds of it, with only 10 active users, you won't have any performance issues either way you work it out. Sean -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 23, 2002 10:30 AM To: PHP (E-mail) Subject: [PHP] what vars should go in session vars? Hello, I have a question about everyone's opinion on the topic of sessions: I am running the whole linux/mysql/php/apache thing and I love it. If I haven't mentioned it before, I'm teaching myself how to do all this with a web-based app (site) that combines a great deal of functionality, such as searching a database of images, requesting projects from my department, checking the status of those projects, and message boards (where the topic is a certain project -- each project has a message board). Blah blah blah. What I'm wondering is, what should I store in session variables? Originally, I was thinking that after login/authentication, only the userID number should be stored in the session, because this number can easily be used to consult MySQL and get any other information necessary for the user, to influence the way the site behaves. But I was thinking of adding ten pre-set style sheets (diff't colors, fonts, etc), and the user can choose one of them and store it in users.stylesheet or whatever. (A neat idea if I do say so myself.) But would this would mean yet ANOTHER query to the database for every single page in the site, as the userID is checked to find the user's stylesheet, which then causes the page to perform an include() on that particular style sheet, etc. Would it be more efficient to store another session variable for the style sheet preference, rather than pulling out of the DB on every page? That way it would be one less query to the database. The first way is simpler, but the second way seems more optimized. But then this could be taken farther -- where do you draw the line with user preferences that are pulled out of the database each time they are needed, or user preferences that are stored in a session to save database activity? Since I have never written a database application before, I have no idea what kinds of performance changes occur with making sitewide adjustments like this. In other words, do -most- database-driven web sites store a ton of info in the session variable, or do they depend on the database itself to serve up this information on a page-by-page basis? Note that this setup is being run on Pentium II, 256MB RAM with approx 50 users total (only ten or so would ever be accessing the thing simultaneously, I imagine). It's not a public web site. Thanks for your thoughts, Erik -- 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]
[PHP] Checking ps aux
I need to help makeing a script that will ps aux | grep and file to see if it is running -- if not start it up i have a pl file running in the back ground and i wanted to check it .. Thanks Alan -- 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]
[PHP] Question about 4.0.6-7 Mysql 4.0.1 and Redhat 7.2
I know, the base install installs 4.0.6-7. but my problem comes when i try upgrading to mysql 4.0.1. When I try installing 4.0.1 of mysql it has to uninstall the 3.23.41-1 version and then install 4.0.1 I get a conflict that says that libmysqlclient.so.10 is needed by php.mysql and a few other things. Well, the problem is, is that I cannot get any of the built-in mysql functions (mysql_fetch_ro(), mysql_connect(), ... ) to work at all. Throught the browser it returns the error, Fatal error: Call to undefined function: mysql_fetch_row() in /var/www/html/index.php on line 2 any help would be great. Jim Lucas -- 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 newbie help in solving logic problem
perhaps $[connit.$i] would to it? - Original Message - From: Larry Brown [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 18, 2002 20:24 Subject: [PHP] looking for newbie help in solving logic problem The following is an over simplified description. With additional items not included everything here works except for the last string. (hence the problem) _ #page 1 #pull info from several similar sections from a file stored in $array -- -- - $top = count($array); file://number of times needed to read info from file. for ($i=0; $i$top; $i++) { echo 'input type=text size=3 name=connlt', $i, ' value=;, $InfoFromExistingFile, ''; echo 'input type=hidden name=conncycle value=', $numbconn, ''; } #page 2 #take variables $connlt0, $connlt1, and $connlt2 and place them in a file for ($i=0;$i$limit;$i++) { fwrite($fw, bla bla-$connlt[$i] bla bla bla); } -- -- The string I'm attempting to send to the file should be the contents of $connlt0 on the first pass $connlt1 on the second, and so on. What I get as you experienced progammers probably already recognize is $connlt which has a value of 0 followed by [0] on the first pass and [1] on the second etc. I tried concatination $connlt.[$i] which resolves to 0 and $.connlt.[$i] which sends the actual string bla bla-$connlt1 bla bla bla. Can someone help show how to get the string after concatenation to take on the value carried over from the first page? I've verified using echo the contents of $connlt0 to be in existence. Thank you in advance, Larry -- 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] -- 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]
[PHP] (again)Writing new lines in txt- files?=)
hello again! =) I.m using fwrite() to write to the file. What I want is a new row i a textdocument after each strung I insert.. I've been told that \n should be the solution to the problem whith new rows i a text-document. But I am not sure that's want I wanted... =) I'll try to be more specific.. I want to write a new row in a text document, the meaning whith that is that I want to create a logfile. And It would be mutch easier to read it if each row is a new hit to the site. When I inserted \n in the end of the string, it didn't created a new row in the text file. It only created a new row when I printed out the file. But I want a new row IN the textfile.. =) =) I hope I didn't complicate this matter too mutch whith my bad english.. =) Thank's folk's //M. From: Jeff Sheltren [EMAIL PROTECTED] To: Mårten Andersson [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Re: [PHP] Writing new lines in txt- files? Date: Wed, 23 Jan 2002 09:55:28 -0800 I want to write to a textfile, but I want a row for each string I write to the file. As it is now when I write to the file it just starts writing where the last string ends.. What should I do? =) How are you writing to the file currently? Could you send some code? One way that would work if you are on *NIX would be as follows: $foo = foobar.txt; System(echo blahblahblah $foo); If you are doing it some other way, why not just echo a newline before each string you send? $s = string you want in file; $s2 = \n . $s; -- 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] -- Mårten Andersson Loddbygatan 2 60218 Norrköping URL: http://www.vanvett.net/marten email: [EMAIL PROTECTED] ICQ: 86515830 _ Hämta MSN Explorer kostnadsfritt på http://explorer.msn.se/intl.asp. -- 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] (again)Writing new lines in txt- files?=)
So sprach »Mårten Andersson« am 2002-01-23 um 19:27:04 + : hello again! =) I.m using fwrite() to write to the file. What I want is a new row i a textdocument after each strung I insert.. I've been told that \n should be the solution to the problem whith new rows i a text-document. But I am not sure that's want I wanted... =) I'll try to be more specific.. I want to write a new row in a text document, the meaning whith that is that I want to create a logfile. And It would be mutch easier to read it if each row is a new hit to the site. When I inserted \n in the end of the string, it didn't created a new row in the text file. It only created a new row when I printed out the file. But I want a new row IN the textfile.. =) =) I hope I didn't complicate this matter too mutch whith my bad english.. =) Uhm, so you want: Line 1 Line 2 Line 3 Is that correct? If it is, then \n is your answer - if you're on a Unix system, or if you're using a text editor which understands unix line endings. If you're on a Mac, you should use \r instead. And if you're so unlucky to use Windows, you've got to use \r\n. This means, $s=Line 1\r\nLine 2\r\nLine 3\r\n; will fill the variable $s with a string which consists of 3 lines when printed on a Windows system. Alexander Skwar -- How to quote: http://learn.to/quote (german) http://quote.6x.to (english) Homepage: http://www.iso-top.de | Jabber: [EMAIL PROTECTED] iso-top.de - Die günstige Art an Linux Distributionen zu kommen Uptime: 8 days 22 hours 0 minutes -- 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]
FW: [PHP] PHP 4.1.1 on iPlanet 6 sp1 on XP Home (I'm reaching here)..
Sorry to re-post this, but I'm really stuck with this one - does *anyone* out there use iPlanet on Windows? Have you encountered a problem like mine? Thanks, James -Original Message- From: James Hallam [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 22, 2002 2:48 PM To: [EMAIL PROTECTED] Subject: [PHP] PHP 4.1.1 on iPlanet 6 sp1 on XP Home (I'm reaching here).. We use iPlanet on Windows for a number of our servers, and have succesfully installed PHP 4.0.6 on NES 4 on NT, with the NSAPI install. There was one step that we had to do, which wasn't in the manual, however - which was making sure that the domain field in the server's TCP/IP Settings was filled in. That field wasn't necessary to make NES 4 run, just PHP. I'm now trying to put together a demonstration laptop, to take some of our products on the road, where an internet connection wouldn't be available, and I've got to do our install on a laptop running XP Home, for the moment. iPlanet 6 sp1 installed perfectly on XP, and the normal NSAPI configuration for iPlanet went smoothly, but it won't work. As before, with NES 4 before we added the domain info to the TCP/IP config, running a phpinfo() file would crash httpd.exe. The domain fixed this. Now, does anyone know why this crash happens, and would anyone have any suggestions how to stop it from happening on XP Home, which doesn't have the ability to specify a domain? James Hallam -- 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] -- 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 vars should go in session vars?
Nick, thanks for taking a moment to respond -- What I'm wondering is, what should I store in session variables? Whatever you need to. Thanks. for the user, to influence the way the site behaves. But I was thinking of adding ten pre-set style sheets (diff't colors, fonts, etc), and the user can choose one of them and store it in users.stylesheet or Or you could let them design their own styles and colors and save the choices in a cookie which is what most other sites do (or variations on the theme) I see. This is basically what I was asking in the first place -- in the face of sessions, I had completely forgotten that cookies could be used for the same purpose and save the server the load, and even do so over the long term. But then this could be taken farther -- where do you draw the line with user preferences that are pulled out of the database each time they are needed, or user preferences that are stored in a session to save database activity? What kind of site is this? Is all this prettifying *really* needed? A good point (it's not needed), but completely irrelevant to my question. I'm not asking for an answer about this one particular site per se, but rather so that I get a better sense of what other developers do when faced with the decision of storing a variable as a session variable or running database queries. The big picture, rather than this particular issue, if you will. Note that this setup is being run on Pentium II, 256MB RAM with approx 50 users total (only ten or so would ever be accessing the thing simultaneously, I imagine). It's not a public web site. Your joking? No offence intended (don't you hate it when people say that?) but what on earth are you worried about 'performance issues' for. 10 users at a time? Sheeesh. :=) I must have forgotten to mention that I've never done this before, so forgive my over-cautiousness. But I'll take them as encouraging words -- now I don't need to worry quite so much about server load! Thanks Nick Erik -- 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]
[PHP] Checking for daylight savings
A client of mine wants me to increase the accuracy of the daylight savings mechanism in his web application. It currently checks using the date() function and the I switch. Is there anything out there that takes into account the many special cases involved with daylight savings? I'm looking for something that checks based on country (or even city). Thanks, -Dan -- 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]
[PHP] newbie needs quick help with formatting dates
I'm pretty new to PHP, and I need to re-format some date data, but I can't figure out how to do it. This may be a doh! question, but I've looked through the manual, and I can't seem to find what I'm looking for. I have some dates formatted as mm/dd/yy that I need to convert to mmdd so I can store them correctly in a mysql db as a date-formatted field. Does anyone have some php code that can do this for me? thanks, Steven -- 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 needs quick help with formatting dates
http://www.php.net/manual/en/ref.datetime.php Valentin Petruchek (aki Zliy Pes) http://zliypes.com.ua mailto:[EMAIL PROTECTED] -- 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]
[PHP] More Fun With Sessions!
Well, I was having problems getting sessions working at all on my FreeBSD box, but they are now working... But that leads me to more problems... For any others that might have a problem w/ FreeBSD, try setting the referer_check to 0 'session.referer_check = 0' Once I changed that things seem to be working, ie. I can get a simple count script to run with no probs, but here is where I come across a new problem. This script works fine (it counts as I reload it): ?php session_start(); session_register('counter'); $counter++; echo(You have visited this page $counter times.); ? What I am wanting to run on the site is a shopping cart app (along with some other scripts that utilize sessions) that I wrote myself. Everything works fine on my home linux box, but doesn't seem to be working on the FreeBSD box. Maybe I am just not using sessions properly, but it is bugging me because it works on the linux box... Here's an example: test.php: ?php session_start(); session_register('counter'); $counter++; echo(You have visited this page $counter times.\n); ? a href=test2.phpclick here/a test2.php: ?php session_start(); session_register('counter'); $counter++; echo(You have visited this page $counter times.\n); ? a href=test.phpclick here/a Shouldn't this hold the same counter variable for both pages? It works fine on my linux box, but on the FreeBSD box, $counter is always 1. I think that if I could get something like this script working, then the shopping cart would also work. Sorry for the long message! Any help would be greatly appreciated. Jeff -- 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] More Fun With Sessions!
You only need to register the variable once when you initiate the session. Also as of php 4.1 I believe you do not have to register your session vars you can just acccess them like $_SESSION['counter']: http://www.php.net/manual/en/ref.session.php Basically what I see you're doing is reregistering the variable on each page which initializes it as 0 and so when you do $counter++ you're always going to get 1.. Hope this helps! Rick Dost thou love life? Then do not squander time; for that's the stuff life is made of. - Ben Franklin From: Jeff Sheltren [EMAIL PROTECTED] Date: Wed, 23 Jan 2002 12:31:49 -0800 To: [EMAIL PROTECTED] Subject: [PHP] More Fun With Sessions! Well, I was having problems getting sessions working at all on my FreeBSD box, but they are now working... But that leads me to more problems... For any others that might have a problem w/ FreeBSD, try setting the referer_check to 0 'session.referer_check = 0' Once I changed that things seem to be working, ie. I can get a simple count script to run with no probs, but here is where I come across a new problem. This script works fine (it counts as I reload it): ?php session_start(); session_register('counter'); $counter++; echo(You have visited this page $counter times.); ? What I am wanting to run on the site is a shopping cart app (along with some other scripts that utilize sessions) that I wrote myself. Everything works fine on my home linux box, but doesn't seem to be working on the FreeBSD box. Maybe I am just not using sessions properly, but it is bugging me because it works on the linux box... Here's an example: test.php: ?php session_start(); session_register('counter'); $counter++; echo(You have visited this page $counter times.\n); ? a href=test2.phpclick here/a test2.php: ?php session_start(); session_register('counter'); $counter++; echo(You have visited this page $counter times.\n); ? a href=test.phpclick here/a Shouldn't this hold the same counter variable for both pages? It works fine on my linux box, but on the FreeBSD box, $counter is always 1. I think that if I could get something like this script working, then the shopping cart would also work. Sorry for the long message! Any help would be greatly appreciated. Jeff -- 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] -- 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] Anyone know of way to convert the characters like linefeed, carrier return, etc.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Scott Fletcher blurted For example, replacing the line feed with a br, etc. The only problem is I can not tell what characters are in there because it is not readable by the web browser. I hope I explained it clear enough. Check out nl2br() in the manual for starters :) - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8TyHfHpvrrTa6L5oRAlQUAJ9I2MB+QdgSxlJifZvQLOv0TimVKACglCl4 dbEjHkhXVsIVVCsxOTXAUk4= =NPaP -END PGP SIGNATURE- -- 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]
[PHP] help on PHP from
Hi all, How can I get the whole string after submitting with Form? I don't see any variables and valuables in the address bar of the browser unless I manually create the link with ? and in form action column. Please help and explain. thanks, Wee -- 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 on PHP from
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Wee Chua blurted Hi all, How can I get the whole string after submitting with Form? I don't see any variables and valuables in the address bar of the browser unless I manually create the link with ? and in form action column. Please help and explain. You need to brush up on your html. // page 1 form method=post action=page2.php input type=text name=var /form //page 2 ? print($var) ? Probably buggered it up now I've told you to brush up :=) - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8TyiMHpvrrTa6L5oRAhYZAJ9+9OVghrq58riiG3hRuKORjX/RxgCgh+Y0 FLi7TucTIViBG+/a/xcadqQ= =TO5E -END PGP SIGNATURE- -- 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 on PHP from
You'll see all the variables if you post the form using GET instead of POST, but using POST it automatically sends those variables to the target page and you can access them directly using their same names. For example on your form you have a variable called $Name and it posts to form2.php you could echo the $Name variable on the form2.php page, by ?=$Name? this will show you that your variable was passed. Hope it helps! Rick When one door closes, another opens; but we often look so long and so regretfully upon the closed door that we do not see the one which has opened for us. - Alexander Graham Bell From: Wee Chua [EMAIL PROTECTED] Date: Wed, 23 Jan 2002 16:01:47 -0500 To: PHP (E-mail) [EMAIL PROTECTED] Subject: [PHP] help on PHP from Hi all, How can I get the whole string after submitting with Form? I don't see any variables and valuables in the address bar of the browser unless I manually create the link with ? and in form action column. Please help and explain. thanks, Wee -- 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] -- 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] Anyone know of way to convert the characters like linefeed, carrier return, etc.
This one work pretty well, so I'm using this one in addition to the recent posting! nl2br(htmlentities($ch)); Thanks, Scott Nick Wilson [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Scott Fletcher blurted For example, replacing the line feed with a br, etc. The only problem is I can not tell what characters are in there because it is not readable by the web browser. I hope I explained it clear enough. Check out nl2br() in the manual for starters :) - -- Nick Wilson Tel: +45 3325 0688 Fax: +45 3325 0677 Web: www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8TyHfHpvrrTa6L5oRAlQUAJ9I2MB+QdgSxlJifZvQLOv0TimVKACglCl4 dbEjHkhXVsIVVCsxOTXAUk4= =NPaP -END PGP SIGNATURE- -- 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] More Fun With Sessions!
Thanks, everyone for responding... after much headache I seem to have got it working. (not fixed, but working.) I was running php 4.0.6 on linux where the code worked. I just installed php 4.0.4pl1 on the freebsd box and now everything works great. It was probably not the best solution, but it works... and after this project php/apache will not be used on that server anyway, so I guess that having an older version is not the worst thing to do =) -Jeff Your code works fine on my FreeBSD box running php 4.0.4pl1 but not one running php 4.0.6 ... May explain your linux issues? i.e. versions of php ... -- 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] Anyone know of way to convert the characters like linefeed, carrier return, etc.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Scott Fletcher blurted nl2br(htmlentities($ch)); Neat! - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8Ty4xHpvrrTa6L5oRAs9uAJ9qtyEFzcZfZP0qMQAKfcNeRxEQrQCgrj2Y C2LMybM38IA9c49xmzfzGQM= =miPP -END PGP SIGNATURE- -- 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 on PHP from
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Rudi Ahlers blurted User Method=GET, and not METHOD=POST I think maybe I missunderstood her mail! - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8Ty52HpvrrTa6L5oRAn9NAJ40h8E+XToLn9CHCLYQA47/BwrLtwCfaC4H vqpDgBtqpk5cjrGDIbonZTQ= =T/CM -END PGP SIGNATURE- -- 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]
[PHP] What is going on here? list() = each()
? $var = this.that; list( $thisVal, $thatVal ) = each( explode( ., $var )); echo $thisVal, $thatVal ? What is getting echo'd out is: 0, this Why? What am I missing here? Chris -- 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 going on here? list() = each()
change to: ? $var = this.that; list( $thisVal, $thatVal ) = explode( ., $var ); echo $thisVal, $thatVal ? -Original Message- From: Chris Boget [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 23, 2002 3:43 PM To: PHP-General Subject: [PHP] What is going on here? list() = each() ? $var = this.that; list( $thisVal, $thatVal ) = each( explode( ., $var )); echo $thisVal, $thatVal ? What is getting echo'd out is: 0, this Why? What am I missing here? Chris -- 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] -- 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]
[PHP] How to make a line feed in HTML from LF?
Hi! How do I make a line feed in HTML from LF?? The data I got on each line is not evenly spread out. Thnaks, Scott -- 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 going on here? list() = each()
change to: ? $var = this.that; list( $thisVal, $thatVal ) = explode( ., $var ); echo $thisVal, $thatVal ? Silly me. Chris -all embarrassed now... :p -- 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: How should I cache database data for php?
Thanks Garth, - I put it aside until I could find enough clear time to spend reading it through. It makes for good reading - and your comment about caching being 'funny'/suiting different situations in different ways is definitely correct. I think you've helped me understand/clarify some mistaken assumptions! I think that was where the previous part of the conversation was going (and will be interested to hear how others respond - and why I've previously had a tendency to avoid adding such an extra 'level' (or indeed, levels) to any solution. In a 'newspaper' situation, the number of db entries/pages is small, in relation to the number of inbound (HTTP) requests, and that has an important bearing on the likelihood of success. Too many of the applications where I have considered cache had an expected ratio/hit rate too low to justify the extra costs and complexity, so it always seemed easier to look at the twin anathemas of bolstering the hardware and/or slimming down the ambitions behind the content... Thanks for taking the time, =dn - Original Message - From: Garth Dahlstrom [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: 23 January 2002 05:16 Subject: Re: [PHP] Re: How should I cache database data for php? DL, Since I have a willing audience I'll ramble on a bit... :) =were the page subcomponents formatted as HTML or simple text? The templates were an XML scripting language that got rendered through a Java App server into cached HTML. In place of the XML scripting, one could also use custom tags that hooked Java classes, but no one on our team knew Java well enough and I was able to demonstrate that the XML scripting stuff was good-enough(tm). The system for publishing is called Content Server by OpenMarket. The company I worked for is Toronto's biggest newspaper - http://www.thestar.com Some neat concepts, geared towards publishers, but they let you get inside an muck about with most of the code that drove the interface, and content controls - publish events (all done XML script)... =how was the fact that a particular page used certain subcomponents tracked? (eg to know what to update, when) This was done in a database, there were objects for pages (instances of templates), templates (page layout slots + base render code), articles, links, pictures, collections (lists of articles, links, pictures), and you could define your own object types and their relationships to the predefined ones. When a page was changed it was flagged for publish in another table and then the all of the subcompoents associated with that page were purged from the cache and they were re-rendered as pieces (by a calling them through a certain URL) and the the page-level caches were purged. (we hacked this part in ourselves) It's a combo of disk and memory caching handled by OpenMarket, I told my coworkers to stay away from publishing static content (3 years of that left us with over 200,000 pages of outdated stuff that no one knew what was important and what wasn't, course they weren't using a DB when I started there either but that's another story ;) ). =why did/do you think the newspaper made the decision to do the former, than to try this ADODB-type solution? Well, they had a custom-built in house solution that created those 200k pages I mentioned and a perl traller that used go through each one of them to update parts of it by seeking out special comments (I didn't write it, but that was FUNNY stuff). So they wanted a vendor product... quite understandable. Also, I didn't hear about ADODB till this year. =they both achieve the stated objective (reduce load on the db-server). Is one somewhat lesser/better than the other? The DB server takes only for handling session state (but there isn't much to that), all of the content is cached to disk or to memory (this was needed because NAS2.1 was *SO* slow to render the content in the first place). Where the system is not so good, Al is the dynamic content on each page view or per visitor, so for example personalsation was not really a possiblity because of the ridge cache setup. This is where an ADODB-cached data set solution would be my prefered choice because you could mirror some data out to the webservers (weather, scores, etc)... you still have to hit the DB for session stuff (unless you are fond of sticky bits holding your state to one web server in a multi web server env). Caching is a funny thing, the behaviour you want to use really depends on the nature of the content you deliver... You won't find a silver bullet method to do it perfectly for all content. We used to force the caches to purge when we published new stuff, but that worked because publishing was done in batches at certain times (Infinite TTL). But if you were publishing info every minute (i.e. stock quotes), then you might want to cache solely on a 1 minute TTL for
RE: [PHP] Correction
$newlines = nl2br($oldline); print $newlines; The $oldline would contain text which contains newline characters. -Original Message- From: Scott Fletcher [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 23, 2002 3:57 PM To: [EMAIL PROTECTED] Subject: [PHP] Correction I mean how to make the data in HTML to work like a Line Feed? That way, the data are all align! Thanks, Scott -- 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] -- 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: easy question
and I think, also, if it's the last command then you don't need to semi-colon (I put it in anyway for completeness, etc) found that out by accident... -Original Message- From: val petruchek [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 24, 2002 1:02 AM To: PHP Subject: Re: [PHP] Re: easy question Oh, I forgot the ; and there are no brackets: ?php include dbconnect.php; ? include works fine with brackets include (dbconnect.php); Valentin Petruchek (aki Zliy Pes) http://zliypes.com.ua mailto:[EMAIL PROTECTED] -- 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]
[PHP] Re: [PEAR-DEV] Re: [metabase-dev] RE: [PEAR-DEV] New MetabaseAniversary release
Hello, Tomas V.V.Cox wrote: El mar, 22-01-2002 a las 19:02, Manuel Lemos escribió: Hello Lukas, Lukas Smith wrote: FYI: there has been a lot of discussion about this project in the last couple months (especially december irrc) on the pear-dev mailinglist. So some questions might allready be answered there. From what I read lately I could not come to any conclusion. It seemed that most people were in favour except for Tomas that said he would not use it if I got him right. I'm not against, if you read my reply to Lukas I was the only one It was not clear whether you were accepting to add Metabase to PEAR independently of PEAR-DB or as a new implementation of PEAR-DB API. offering help to him in the task. What I also said was that I will continue supporting PEAR DB. If that project becomes a reality and provides at least the features PEAR DB has, the compatibility to the actual API is maintained, good features are added and this is finally adopted I would start to think in developing for it. But not before as PEAR DB has a good amount of users (and I include my self in it) who needs continue their work/projects. The same for Metabase and its users. My opinion is that you should hear a clear yes or no answer from somebody in charge of PEAR organization before you have a go, or else you may be wasting your time working on something based on expectations that may not exactly be what you think. You have heared the opinion of Stig and it is not so different of my position. In short for me: yes, please go ahead. Ok, Lukas will be working on making the proof of concept first. Regards, Manuel Lemos -- 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 anyone explain this error ?
It means you are trying to insert 22 values into 20 fields -Original Message- From: Matthew Darcy [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 23, 2002 4:11 PM To: PHP developers Subject: [PHP] can anyone explain this error ? I am doing an insert into a EMPTY mysql table. 1 field is an auto increment. here is the error I get when I do the insert Column count doesn't match value count at row 1 What does this mean ? Here is the php used to insert it. ?php include(../dbconnect.php); if ($submit == sign!) { $query = insert into account_details (account_number, account_type, account_name, account_address, account_addres1, account_address2, account_address3, account_address4, account_address5, account_contact, account_phone, account_fax, account_email, account_start_date, account_authorised_credit, account_pin, account_disabled_flag, metered_jobs, unmetered_jobs, account_pin_activate) values ('$account_number', '$account_type', '$account_name', '$account_house', '$account_street', '$account_street1', '$account_street2', '$account_town', '$account_city', '$account_postcode', '$account_country', '$account_contact', '$account_phone', '$account_fax', '$account_email', '$account_start', '$account_credit_authorised', '$account_pin', '$account_disabled_flag', '$metered_job_count', '$unmetered_job_count', '$account_pin_activated'); mysql_query($query) or die (mysql_error()); ? H2 Data Submitted /H2 H2 A HREF=view_test_records.php View the records /A/H2 ?php } else { include(datafillcommit.php); } ? ~ Thanks, Matt. -- 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] -- 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] That one doesn't work!
So you want to know how to justify text? This is not a PHP question. HTML documentation: http://www.idocs.com/tags/ -- Ben Sinclair [EMAIL PROTECTED] - Original Message - From: Scott Fletcher [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 23, 2002 4:11 PM Subject: [PHP] That one doesn't work! Hi! That one doesn't work! The new line does work, but the data doesn't work like a margin alignment or something. Like a type writer format where everything fit in nicely, not one line that are too short and the next line that are too long. Just that at the end of each line that is perfectly lined up with each other. Thanks, Scott -- 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] -- 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 anyone explain this error ?
Basically you're trying to add more values into the table than columns specified. You have 22 values and only 20 columns specified in your $query. Rick Finish each day and be done with it. You have done what you could; some blunders and absurdities have crept in; forget them as soon as you can. Tomorrow is a new day; you shall begin it serenely and with too high a spirit to be encumbered with your old nonsense. - Ralph Waldo Emerson From: Matthew Darcy [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Date: Wed, 23 Jan 2002 22:10:30 - To: PHP developers [EMAIL PROTECTED] Subject: [PHP] can anyone explain this error ? I am doing an insert into a EMPTY mysql table. 1 field is an auto increment. here is the error I get when I do the insert Column count doesn't match value count at row 1 What does this mean ? Here is the php used to insert it. ?php include(../dbconnect.php); if ($submit == sign!) { $query = insert into account_details (account_number, account_type, account_name, account_address, account_addres1, account_address2, account_address3, account_address4, account_address5, account_contact, account_phone, account_fax, account_email, account_start_date, account_authorised_credit, account_pin, account_disabled_flag, metered_jobs, unmetered_jobs, account_pin_activate) values ('$account_number', '$account_type', '$account_name', '$account_house', '$account_street', '$account_street1', '$account_street2', '$account_town', '$account_city', '$account_postcode', '$account_country', '$account_contact', '$account_phone', '$account_fax', '$account_email', '$account_start', '$account_credit_authorised', '$account_pin', '$account_disabled_flag', '$metered_job_count', '$unmetered_job_count', '$account_pin_activated'); mysql_query($query) or die (mysql_error()); ? H2 Data Submitted /H2 H2 A HREF=view_test_records.php View the records /A/H2 ?php } else { include(datafillcommit.php); } ? ~ Thanks, Matt. -- 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] -- 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 anyone explain this error ?
gents, thanks. I have been working hard on this php thing for a couple of days now from setup to starting development. Today a couple of glitches have slipped past me. I think I am tired and been working on this for too long with out a break. thanks for pointing out the errors. Out of interest does this error normally mean this error or did you gather this from counting the code. Thanks, Matt. -Original Message- From: Richard Baskett [mailto:[EMAIL PROTECTED]] Sent: 23 January 2002 22:22 To: [EMAIL PROTECTED]; PHP General Subject: Re: [PHP] can anyone explain this error ? Basically you're trying to add more values into the table than columns specified. You have 22 values and only 20 columns specified in your $query. Rick Finish each day and be done with it. You have done what you could; some blunders and absurdities have crept in; forget them as soon as you can. Tomorrow is a new day; you shall begin it serenely and with too high a spirit to be encumbered with your old nonsense. - Ralph Waldo Emerson From: Matthew Darcy [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Date: Wed, 23 Jan 2002 22:10:30 - To: PHP developers [EMAIL PROTECTED] Subject: [PHP] can anyone explain this error ? I am doing an insert into a EMPTY mysql table. 1 field is an auto increment. here is the error I get when I do the insert Column count doesn't match value count at row 1 What does this mean ? Here is the php used to insert it. ?php include(../dbconnect.php); if ($submit == sign!) { $query = insert into account_details (account_number, account_type, account_name, account_address, account_addres1, account_address2, account_address3, account_address4, account_address5, account_contact, account_phone, account_fax, account_email, account_start_date, account_authorised_credit, account_pin, account_disabled_flag, metered_jobs, unmetered_jobs, account_pin_activate) values ('$account_number', '$account_type', '$account_name', '$account_house', '$account_street', '$account_street1', '$account_street2', '$account_town', '$account_city', '$account_postcode', '$account_country', '$account_contact', '$account_phone', '$account_fax', '$account_email', '$account_start', '$account_credit_authorised', '$account_pin', '$account_disabled_flag', '$metered_job_count', '$unmetered_job_count', '$account_pin_activated'); mysql_query($query) or die (mysql_error()); ? H2 Data Submitted /H2 H2 A HREF=view_test_records.php View the records /A/H2 ?php } else { include(datafillcommit.php); } ? ~ Thanks, Matt. -- 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] -- 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]
[PHP] What do you mean?
What do you mean? There is a php function that can clean up the carriage return and line feed. There's a php function somewhere that will fix up the amount of spaces for each lines to make the end of each line to be all aligned. So, what would it be? Thank, Scott -- 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 do you mean?
Yes, there is a function that cleans up carriage returns and line feeds by changing them to BR's. There is no function to magically justifty text. Find some HTML documentation and output the HTML to justify your text. -- Ben Sinclair [EMAIL PROTECTED] - Original Message - From: Scott Fletcher [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 23, 2002 4:24 PM Subject: [PHP] What do you mean? What do you mean? There is a php function that can clean up the carriage return and line feed. There's a php function somewhere that will fix up the amount of spaces for each lines to make the end of each line to be all aligned. So, what would it be? Thank, Scott -- 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] -- 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 do you mean?
First, no such PHP function exists which will fix up the amount of spaces for each lines to make the end of each line to be all aligned. Second, you could verify that in section LXXXIII. String functions of the PHP manual before asking. Third, please keep the same subject line. It makes following the thread easier. -Original Message- From: Scott Fletcher [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 23, 2002 4:24 PM To: [EMAIL PROTECTED] Subject: [PHP] What do you mean? What do you mean? There is a php function that can clean up the carriage return and line feed. There's a php function somewhere that will fix up the amount of spaces for each lines to make the end of each line to be all aligned. So, what would it be? Thank, Scott -- 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] -- 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: while loop on an array
check out the foreach control structure it may be exactly waht you need. http://www.php.net/manual/en/control-structures.foreach.php On Wed, 2002-01-23 at 10:17, Joe Rice wrote: Hello, I would like to know how i can know when i'm at the end of an array during a while loop? reset($new_answers); while (list($new_qID,$new_aID) = each ($new_answers)) { $sql .= qID=\$new_qID\ || ; } $sql .= ) AND uID = \$uID\; i would like to know how to stop putting the || at the end of $sql in the middle of the while loop. any help would be appreciated. thanks, joe -- 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] -- Jeff Bearer, RHCE Webmaster PittsburghLIVE.com -- 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 opinion On sessions - Cookies mandatory?
At 09:35 AM 1/23/2002 +0100, Nick Wilson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Jason G. blurted If cookies do not work, then you must have a session_id appended to the URL. HTTP is a stateless protocol. So every time you make a request via HTTP, you must let PHP know what the session_id is either through cookies, or url query strings (or possibly posted with a form). Yep, now I'm with you. The amount of times you'd see that kind of ugly URL would be fairly minimal in most situations as most users these days aren't even aware they *can* disable cookies. disable cookies, but appending the session ID could be a security risk. Consider this: Someone is viewing a page and says oh cool, I want Joe to see this. He then copy/pastes the URL, sessionID and all, to Joe, who then loads up the page using his friend's SessionID. With cookies, this would not happen. Not a problem. The session is *destroyed* as soon as a user closes the browser. A session will only be *destroyed* if it uses a cookie. PHP never knows when you close the browser, but the browser will remove the cookie. Next time you fire up the browser, it will not send the cookie, and a different session will be started. Sure. But there is some kind of clean on the host machine right? You couldn't expect to continue a session a week later because you've bookmarked a URL containind a SID. I think this is controlled by something like a timeout var in the php.ini. Yeah, the sessions will time out and be cleaned up, but that applies just as much for cookie based sessions as url based sessions. In my personal experience, using cookies only has not proven to be a problem. Your call. I run several sites that have secure login's (Username and password). And i do require the members to have cookies enabled in order for them to login. If anyone has a problem with it, then they tell their browser to destroy the cookies when they close the browser, or only accept cookies from my sites. When you say using cookies only do you mean 'requiring' the user to have cookies enabled? - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -Jason Garber IonZoft.com -- 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] Checking ps aux
What is your question ? bvr. On Wed, 23 Jan 2002 11:30:58 -0500, Alan Todd wrote: I need to help makeing a script that will ps aux | grep and file to see if it is running -- if not start it up i have a pl file running in the back ground and i wanted to check it .. Thanks Alan -- 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] -- 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]
[PHP] Re: What do you mean?
[EMAIL PROTECTED] (Scott Fletcher) wrote in [EMAIL PROTECTED]:">news:[EMAIL PROTECTED]: What do you mean? There is a php function that can clean up the carriage return and line feed. There's a php function somewhere that will fix up the amount of spaces for each lines to make the end of each line to be all aligned. So, what would it be? There are a few good reasons why such a thing wouldn't work (but see the exception below). Recall that browsers generally ignore white space (spaces, tabs and new lines) and simply render a number of white space characters as one space. Then, what happens if you set your line to a lenght suitable for a particular resolution and font size, and your viewer is using different settings? One possible solution, although a bit clunky, would be to use a wordwrap function to output your text to a given width, and enclose the whole lot in PRE tags. White space will be rendered faithfully in PRE but normally the browser will default to a fixed font, unless the user has selected an alternate font and if that is a proportional font your output is screwed. The best way to handle it would be as someone has already suggested, use HTML and perhaps CSS to format your output. -- David Robley Temporary Kiwi! -- 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 opinion On sessions - Cookies mandatory?
as far as i've been able to figure, you don't _have_ to give session call a session name to regain the session data. if you don't supply a name, it looks for the previous session for that computer. or you could pass it one through your forms or what have you. regardless, you can compile your php engine to pass session ids transperantly. not sure if that is all versionss. works in 4+. anyway, in that case, no url with a SID to copy. and since the session is started by checking if the computer asking for the session data is the one that started the initial session, jonny doe can't send a url to his friend, have them paste it in and use the previous session. if the php engine is configured to not use cookies, then the session data gets stored in a file in the server system temp or otherwise defined temp directory. (life determined as mention earlier). hope i got that mostly right. :) --- Brian Schneider [EMAIL PROTECTED] || [EMAIL PROTECTED] WSU Mechanical Engineering --- May the gods give you that which you deserve. --- On Wed, 23 Jan 2002 at 5:56pm, Jason G. cried forth in a loud voice saying: At 09:35 AM 1/23/2002 +0100, Nick Wilson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Jason G. blurted If cookies do not work, then you must have a session_id appended to the URL. HTTP is a stateless protocol. So every time you make a request via HTTP, you must let PHP know what the session_id is either through cookies, or url query strings (or possibly posted with a form). Yep, now I'm with you. The amount of times you'd see that kind of ugly URL would be fairly minimal in most situations as most users these days aren't even aware they *can* disable cookies. disable cookies, but appending the session ID could be a security risk. Consider this: Someone is viewing a page and says oh cool, I want Joe to see this. He then copy/pastes the URL, sessionID and all, to Joe, who then loads up the page using his friend's SessionID. With cookies, this would not happen. Not a problem. The session is *destroyed* as soon as a user closes the browser. A session will only be *destroyed* if it uses a cookie. PHP never knows when you close the browser, but the browser will remove the cookie. Next time you fire up the browser, it will not send the cookie, and a different session will be started. Sure. But there is some kind of clean on the host machine right? You couldn't expect to continue a session a week later because you've bookmarked a URL containind a SID. I think this is controlled by something like a timeout var in the php.ini. Yeah, the sessions will time out and be cleaned up, but that applies just as much for cookie based sessions as url based sessions. In my personal experience, using cookies only has not proven to be a problem. Your call. I run several sites that have secure login's (Username and password). And i do require the members to have cookies enabled in order for them to login. If anyone has a problem with it, then they tell their browser to destroy the cookies when they close the browser, or only accept cookies from my sites. When you say using cookies only do you mean 'requiring' the user to have cookies enabled? - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -Jason Garber IonZoft.com -- 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] -- 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]
[PHP] PHP don't know 'localhost'
Hi, Today I met a very strange problem. My system had been working perfect since long time back when I setup mysql/php/apache on RH 7.1, until today I found that php could not connect mysql with the user from 'localhost'. But actually user@localhost can login to mysql from terminal. 'Locahost' just don't work for PHP! However, if don't use 'localhost' but use the system's nick name (my machine is called 'puma'), then the mysql-connect() success! I just have no idea how it happend. Any one out there have idea about this please help! Thanks in advance! Alex -- 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]
[PHP] Memory usage with Apache
Hello, I'm using PHP 4.0.4pl1 with Apache 1.3.14. I have a PHP script that accumulates data for insertion into a database. This script runs in peices and unset()'s variables that contain the data periodically in hopes of freeing memory for the next batch of records. Apparently it's not working that way. When I run top and run my PHP script, the httpd process runs up to 125M of memory usage, and segfaults. Is there a parameter somewhere that says that httpd can't grow to over 128M of memory usage, or that PHP can't grow to more then this amount that I can change to prevent my web server from crashing? Or perhaps a garbage cleanup routine in PHP that actually frees memory that is no longer being used (these arrays hold max 5X25 of small 10 char strings). I unset these arrays after they are placed in the database (and I free the result for the database), but memory just climbs and climbs until the script ends (if I run it with arguments that yield smaller results). Thanks, Tom -- 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 opinion On sessions - Cookies mandatory?
The idea of building a website is largely to accommodate as large a portion of your visitors as possible. I'm not worried about people bookmarking sessionID's, but what if someone copy/pastes the URL to a friend and they use the section. My friend gave me an excellent idea, and that is to check their IP and store the IP in the session. If the IP doesn't match, then start a new session. This would be perfect, because there's a double check. If someone disconnects to the internet but never closes their browser, I don't think they should be allowed to continue their session anyway, they should be required to login again. -Original Message- From: Nick Wilson [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 23, 2002 3:35 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Need opinion On sessions - Cookies mandatory? -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Jason G. blurted If cookies do not work, then you must have a session_id appended to the URL. HTTP is a stateless protocol. So every time you make a request via HTTP, you must let PHP know what the session_id is either through cookies, or url query strings (or possibly posted with a form). Yep, now I'm with you. The amount of times you'd see that kind of ugly URL would be fairly minimal in most situations as most users these days aren't even aware they *can* disable cookies. disable cookies, but appending the session ID could be a security risk. Consider this: Someone is viewing a page and says oh cool, I want Joe to see this. He then copy/pastes the URL, sessionID and all, to Joe, who then loads up the page using his friend's SessionID. With cookies, this would not happen. Not a problem. The session is *destroyed* as soon as a user closes the browser. A session will only be *destroyed* if it uses a cookie. PHP never knows when you close the browser, but the browser will remove the cookie. Next time you fire up the browser, it will not send the cookie, and a different session will be started. Sure. But there is some kind of clean on the host machine right? You couldn't expect to continue a session a week later because you've bookmarked a URL containind a SID. I think this is controlled by something like a timeout var in the php.ini. In my personal experience, using cookies only has not proven to be a problem. Your call. When you say using cookies only do you mean 'requiring' the user to have cookies enabled? - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8TnW3HpvrrTa6L5oRAthOAJ0WOpUWC5fFMokhYF2QsaQaQolp+wCfQWHL 03BrqRN2kLf+VWC/tzDSHho= =Gek0 -END PGP SIGNATURE- -- 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]
[PHP] Basic Authentication with IIS
With apache, you can easily match up a L/P to an htpasswd file. With IIS, the user has to be created as the windows level. I'm moving a site from an apache server to an IIS server, and need to figure out an easy way to do basic authentication. I guess putting a chunk of code at the top of every script to check headers would be appropriate, but that would be a lot of work for this site, plus I have PHP scripts that I didn't write and are very complex and trying to edit them in order to accomplish this would be hell. What other alternatives do I have for basic authentication on IIS? Is there a way maybe to make users on the O/S and just give them minimal permissions? If there's an article somewhere on this, just give me the link =) Thanks for your help!
[PHP] Re: Basic Authentication with IIS
Yeah basically on an IIS server you have a default www group that you can use because it has read only permissions, if you need to add a user just go to administrative tools on the server and then computer management if not in a domain or active directory users and groups if the server is a member of a domain. Once you are in the control panel for adding users and groups you will want to find the default www user which in 2000 i believe is named IIS and you can use that user or create new users with passwords and then add them to the IIS group which by default gives minimal privlidges to web users. I hope this helps, let me know if you get stuck or dont understand something k? Jas Spamsucks86 [EMAIL PROTECTED] wrote in message 000601c1a468$9c9c2f40$7f523944@cc1966780a">news:000601c1a468$9c9c2f40$7f523944@cc1966780a... With apache, you can easily match up a L/P to an htpasswd file. With IIS, the user has to be created as the windows level. I'm moving a site from an apache server to an IIS server, and need to figure out an easy way to do basic authentication. I guess putting a chunk of code at the top of every script to check headers would be appropriate, but that would be a lot of work for this site, plus I have PHP scripts that I didn't write and are very complex and trying to edit them in order to accomplish this would be hell. What other alternatives do I have for basic authentication on IIS? Is there a way maybe to make users on the O/S and just give them minimal permissions? If there's an article somewhere on this, just give me the link =) Thanks for your help! -- 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 vs Java reliability
Geoff Caplan wrote: Michael the Why PHP on zend.com is a great place to go for this sort of stuff... Honestly, it doesn't seem all that professional a resource paper... I would tend to agree - not something you could show to a hard-headed corporate purchasing committee with any confidence. I believe Java *can* be pretty stable and robust, but at a cost which far exceeds PHP's. This is something that seemed to be missing from that article - a cost/benefit analysis compared to other platforms . Yeah, Java/ASP/etc can have enormous benefits over PHP in some situations, but the price tag is often beyond what people initially imagine. I suspect that this is the vital point - for the right type of project PHP will be quicker to develop and cheaper to deploy. I think the Zend case would be more credible if they defined the niche for PHP more clearly - which is surely the small to mid-sized project. My own project is aimed at making fully customised e-commerce affordable for the smaller organisation, and this seems an ideal field for PHP. For end-to-end enterprise computing, PHP would need better namespaces, a proper object model, more rigorous error handling, a thriving market in high-quality components (and/or a robust interface to Java) and a fully featured IDE. Zend 2 should lay the foundations for this, but by then Java will be so far ahead that PHP may never catch up. But does this matter? The great majority of organisations and projects are small, and for them PHP is ideal. If I were Zend, I would be focusing on products and pricing that appeals to this market, but they rather give the impression that they are aiming for the enterprise... Geoff Caplan I aggree. It comes down to what you are doing. But I dont think java is needed unless you are doing one damn big e-com site. Php can handle a fair bit. And to use java costs you a hell of a lot more. First thing to work out is if you need to use java. To many places jump in, thinking yeah we need a $50,000 server and $100,000 worth of dev software, when they would of done fine with a $10,000 server and $0 software. -- 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]
[PHP] Re: [Kopia] [PHP] Re: Sessions problem with FreeBSD 4.3
Jeff Sheltren wrote: What happens if you set register_globals=Off and use $_SESSION? Thanks for the reply. I will try changing register_globals to Off. I am not quite sure I know what you mean by using $_SESSION though, could someone please explain how that is uesd? Session manaul pages are updated. There is enough explanation how to use $HTTP_SESSION_VARS/$_SESSION now :) -- Yasuo Ohgaki -- 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]
[PHP] Re: PHP Sessions
David Orn Johannsson wrote: I'm Trying to make a simple authentication for a news-system. I have a encrypted passwd in a db that i fetch and compare to the user input and if it compares ok then the user sees the catagories that he can select from. The thing is I'm not quite getting the thing with sessions I mean I start a session with session_start() and then register vars with session_register(), in this case I register uid = user_id and sid = session_id(). I recommend *NOT* to use session_register/unregister/is_registered(). Use $HTTP_SESSION_VARS/$_SESSION. If you really have to use session_register and others, *NEVER* use $HTTP_SESSION_VARS/$_SESSION in your script. BTW, you don't have to keep track session id. Then I print out a link lets say it is called just news and I want to pass the uid along I just print out a href=\news.php?uid=$uidsid=$sid\news/a or aint I requred to print it along? Can I just start a session on the news.php and check if $sid exists. If you use trans-sid, you don't need to add session ID to your php script (HTML part I mean) It also handles automatic fallback from cookie session to URI session. (Although, it sometimes fails to detect cookie for some browser. You need additional effort to make sure use cookie when cookie is available.) And one thing if I have a link like this one a href=\news.php?uid=$uidsid=$sid\news/a can people just type news.php?uid=2sid=something and get the page or am I just being silly? Any one can change session ID. It just only easier when session ID is in URI :) We have to live with that. -- Yasuo Ohgaki -- 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]
Fw: [PHP] PHP Equivalent of REXX x2c and c2x Functions
- Original Message - From: hugh danaher [EMAIL PROTECTED] To: David Drewa [EMAIL PROTECTED] Sent: Wednesday, January 23, 2002 4:36 PM Subject: Re: [PHP] PHP Equivalent of REXX x2c and c2x Functions RTFN http://www.php.net/manual-lookup.php?pattern=Hex - Original Message - From: David Drewa [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 23, 2002 3:46 PM Subject: [PHP] PHP Equivalent of REXX x2c and c2x Functions I'm trying to port an application from WinREXX to PHP. What is the PHP equivalent of the x2c() (hexadecimal to character) and c2x() (character to hexadecimal) functions? Is this hexdec() and dechex() functions? Or hex2bin()? Thanks! -- 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] -- 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]
[PHP] emulate a browser
Hi All Can I emulate the first request of a browser when it tries to connect to a distant server using a domain name and parse the answer from the remote server to know if there is a website located there or if there is no hosting (or even some kind of forwarding) configured for this domain name ? Is ther some http functions in PHP which permit to do this test ? Thanks in advance Frank -- 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: Templates: how to get that HTML outta my templates!
* and then Mikusch, Rita blurted Thank you for the reply. I'm trying to roll my own template system, but don't really know how to go about some of the details. My best bet would probably be to install phplib and dissect itsee how the experts did it! At the very least it should be a great learning experience :) Rita, Rita, Rita...:=) roll your own Why? What possible reason could there be? (other than to learn how) Well, yes I guess I would REALLY like to know more about setting up a large project like this, set up a DB abstration layer, etc etc. I'll spend some time dissecting PHPLIB, writing a lot of code, hopefully successfully debugging a lot of code . . . . . . then when I finally have time at work to move the website over to a real template system with the PHP separated from the html and the design, I'll be able to a) implement PHPLIB template system for the whole site very easily since I'll know enough about it to make whatever hacks are needed to adapt it to our website's needs. I've checkout out reviews on the net and haunted the mailing lists and this seems to be most people's favourite for PHP. b) and I'll have learned some new programming skills that I'll be able to adapt to other projects. The XML/XSL solution also sounds really interesting, but my company has a very small web department (one full time person -- me, the geek) and I'd like to keep the number of technologies they need to support to a minimum. You don't need to 'install' PHPLib, just get the template.inc file and include() it in your scripts. There are some good turorials listed on those articles I pointed out and it's s easy. Mail me offlist if you need more details. Thanks! Rita. -- 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]
[PHP] to evaluate ...
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sorry for bothering you, but I really didn't find answeres on dejanews and in the tutorial, or better, I did not see them. I need the following variables: $width1 $width2 $width3 . . . $widthn Because it is not shure, how many they are, I need to construct them. And because I need them in a form as name I could not use arrays (or did I miss something here???). So I tried the following, and it works: (just to look that it works...) [...] $tmp = bar$z_j; while ($z_i = $$tmp) { echo $$tmp\n; $z_i++; } [...] Ok, now the real problem starts: if ($z_bars $bars) { $z_i = 1; $rest = 100; while ($z_i = $z_bars) { $temp = width_bar$z_i; echo $$temp\n; [...] Guess what, yes!!, it is _not_ working. So i start to experiment around and also tried to use eval() but all I ever get was width_bar1, width_bar2, width_bar3 or even worse $width_bar1, $width_bar2 and not something like I wanted it: 30, 50, 20 because width_bar1 should be 30 for example and not to print out width_bar1 I bash I would do it this way: eval TEMP=\$width_bar$z_i any ideas? thorsten - -- Thorsten Wandersmann Phone: +49-911-8172249 Bonhoefferstr. 79Mobile: +49-179-6670562 90473 Nuremberg e-Mail: [EMAIL PROTECTED] Germany http://www.caipy.de -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: Weitere Infos: siehe http://www.gnupg.org iD8DBQE8T2A/QkW0pERqT24RApmEAJ96tIQlBdVrglRchK+QY/D/RZi2gACdEgl8 hBlTw6XUBE26hpsv5rG5/yA= =UCu8 -END PGP SIGNATURE- -- 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] to evaluate ...
try changing: echo $$temp\n; to echo $$temp.\n; or even echo ${$temp}.\n; does that work? -Original Message- From: Thorsten Wandersmann [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 24, 2002 12:16 PM To: [EMAIL PROTECTED] Subject: [PHP] to evaluate ... -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sorry for bothering you, but I really didn't find answeres on dejanews and in the tutorial, or better, I did not see them. I need the following variables: $width1 $width2 $width3 . . . $widthn Because it is not shure, how many they are, I need to construct them. And because I need them in a form as name I could not use arrays (or did I miss something here???). So I tried the following, and it works: (just to look that it works...) [...] $tmp = bar$z_j; while ($z_i = $$tmp) { echo $$tmp\n; $z_i++; } [...] Ok, now the real problem starts: if ($z_bars $bars) { $z_i = 1; $rest = 100; while ($z_i = $z_bars) { $temp = width_bar$z_i; echo $$temp\n; [...] Guess what, yes!!, it is _not_ working. So i start to experiment around and also tried to use eval() but all I ever get was width_bar1, width_bar2, width_bar3 or even worse $width_bar1, $width_bar2 and not something like I wanted it: 30, 50, 20 because width_bar1 should be 30 for example and not to print out width_bar1 I bash I would do it this way: eval TEMP=\$width_bar$z_i any ideas? thorsten - -- Thorsten Wandersmann Phone: +49-911-8172249 Bonhoefferstr. 79Mobile: +49-179-6670562 90473 Nuremberg e-Mail: [EMAIL PROTECTED] Germany http://www.caipy.de -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: Weitere Infos: siehe http://www.gnupg.org iD8DBQE8T2A/QkW0pERqT24RApmEAJ96tIQlBdVrglRchK+QY/D/RZi2gACdEgl8 hBlTw6XUBE26hpsv5rG5/yA= =UCu8 -END PGP SIGNATURE- -- 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] emulate a browser
At 01:45 AM 1/24/2002 +0100, Frank Benady wrote: Hi All Can I emulate the first request of a browser when it tries to connect to a distant server using a domain name and parse the answer from the remote server to know if there is a website located there or if there is no hosting (or even some kind of forwarding) configured for this domain name ? Is ther some http functions in PHP which permit to do this test ? You can use fsockopen() to open a socket connection to a remote host via port 80 (HTTP). If fsockopen() returns a valid file pointer then that means there is something listening on port 80 on the host (99% it will be a web server). You could then use fputs() to send a request to the server, such as: HEAD / HTTP/1.0\r\n\r\n Normally browsers use GET instead of HEAD, but in your case you are only interested in the servers response (the HTTP headers) and not the actual file/page itself. You could then use fgets() to read the response sent back from the server and parse it to get the information you wanted (for example, look for a Location: ... line in the headers to see if the page is trying to redirect the browser). I have a function that checks to see if a particular file is available via HTTP from a remote host. It takes a full URL and returns true if the page/file exists, and false if it doesn't. With some work you could modify this script to achieve what you want. I'm posting it below. Ask if you have any questions about it. Oh, BTW, I'm sure that I have (as usually) went totally overboard with this function and someone will now probably point out that PHP has something built in to do what I'm doing here...but I couldn't find it and I had fun writing this function anyway. :-) ? function http_file_exists ($url) { if (!preg_match(/^http:\/\/([^\/]+)\/.*$/i,$url,$matches)) { return Error - incorrect format; } else { $host = $matches[1]; $fp = fsockopen ($host, 80, $errno, $errstr, 30); if (!$fp) return Error - couldn't connect to host; else { fputs ($fp, HEAD $url HTTP/1.0\r\n\r\n); $response = fgets ($fp,128); fclose ($fp); return (eregi(^.+200 OK.+$,$response) ? true : false); } } } ? -- 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]
[PHP] Re: how to sum array items, vertically?
Unfortunately I have to change and meddle with dates and times, so I can't. Siggy Format: The code is basically: $everything [ $date ] = array(10, 20, 30, 40); where $date is simply a text string like 01/01/2001; Eg: array(4) { [07/01/2002]= array(3) { [6]= int(7200) [5]= int(17400) [1]= int(22500) } [14/01/2002]= array(4) { [1]= int(77400) [4]= int(83700) [5]= int(77400) [6]= int(144300) } [21/01/2002]= array(4) { [1]= int(63900) [4]= int(81900) [5]= int(105000) [6]= int(92400) } [23/01/2002]= array(4) { [1]= int(35100) [4]= int(18000) [5]= int(38100) [6]= int(55500) } } Siggy David Robley [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... [EMAIL PROTECTED] (Siggy) wrote in news:[EMAIL PROTECTED]: Yeah, sorry, was posting late at night :P I am getting time-durations from a database, aggregating them per week (with a few conditions), so that I go from data like this: 2001-10-01, 4:30, 2(ie, person 2 did a 4 hour, 30 min peice of work on a certain date). to this: date = hours work by person1, person2, person3, person4 2001-01-01 = 23, 45, 12, 45, 02, as in: The reason i'm doing it in this way, is because I need to do a bit of shifting around of hours when people worked over midnight etc. Anyway, when I get to the end; 2001-01-01 = 23, 45, 12, 45, 02 2001-01-08 = 3, 15, 2, 35, 8 etc etc ... I want to see the total (and the average, but thats easy) hours worked by each person. Siggy PS: Hey there New Zealander, hope you're in Wellington enjoying the positively fantastic weather :P Nah, I'm in Auckland enjoying the weather without the wind :-) But only a temporary Kiwi - Aussie underneath. Don't mention the cricket, OK? From the looks of things, you should be able to use some sort of summing and grouping, maybe a multiple query to pull the finished data out of your DB, rather than struggling with multidimensional arrays? -- David Robley Temporary Kiwi! -- 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]
[PHP] CGI PHP processing .shtml
i want to have php process .shtml files. i tried appending the following to .htaccess, but to no avail: AddType application/x-httpd-php .shtml is it because php is running as a cgi program? how would i go about getting this to work. its php 4.0.6 running on a sparc, if that matters. thanks all. __ Do You Yahoo!? Great stuff seeing new owners in Yahoo! Auctions! http://auctions.yahoo.com -- 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]
[PHP] Form Problem
Hi there, I have a problem here regarding the form table name variable (i.e input name=Process type text), when i used Href tags to send the variable in the next script it does'nt recognized the $Process variable. I've tried the the submit type but but im having problem with other $variable in the table which is not part of the form. Here's the script: Option1: Using Submit ?FORM ACTION=addlist.php method=get? print(BR); print(TABLE WIDTH= 90%); print(/TABLEHR WIDTH= 90%BR); print(tableTRTD ALIGN=RIGHT bgcolor=grayB8D #: /TDTD $Dno /TD/TR TRTD ALIGN=RIGHT bgcolor=grayBMODE OF FAILURE: /TDTDTEXTAREA NAME=Mode ROWS= 5 COLS=40 WRAP/TEXTAREA/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBPACKAGE:/TDTDinput name=Package type=text/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBPROCESS:/TDTDinput name=Process type=text/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBROOT CAUSE:/TDTDTEXTAREA NAME=Root ROWS=5 COLS=40 WRAP/TEXTAREA/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBCORRECTIVE ACTION:/TDTDTEXTAREA NAME=Corrective ROWS=5 COLS=40 WRAP/TEXTAREA/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBRESPONDENCE:/TDTDinput name=Respondence type=text/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBCOMMITMENT:/TDTDinput name=Commitment type=text/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBSTATUS:/TDTDTEXTAREA NAME=Status ROWS=5 COLS=40 WRAP/TEXTAREA/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBREMARKS:/TDTDTEXTAREA NAME=Remarks ROWS=5 COLS=40 WRAP/TEXTAREA/TD/TR /table); ?centerinput type = submit name= submit value=UPDATE? Im having problem with the $Dno. Submit would not recognize this in sending the form. I'd like submit to add a Dno=$Dno in submitting the form but how? Option 2: Using HREF print(BR); print(TABLE WIDTH= 90%); print(/TABLEHR WIDTH= 90%BR); print(tableTRTD ALIGN=RIGHT bgcolor=grayB8D #: /TD$Dno/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBMODE OF FAILURE: /TDTDTEXTAREA NAME=Mode ROWS= 5 COLS=40 WRAP/TEXTAREA/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBPACKAGE:/TDTDinput name=Package type=text/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBPROCESS:/TDTDinput name=Process type=text/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBROOT CAUSE:/TDTDTEXTAREA NAME=Root ROWS=5 COLS=40 WRAP/TEXTAREA/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBCORRECTIVE ACTION:/TDTDTEXTAREA NAME=Corrective ROWS=5 COLS=40 WRAP/TEXTAREA/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBRESPONDENCE:/TDTDinput name=Respondence type=text/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBCOMMITMENT:/TDTDinput name=Commitment type=text/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBSTATUS:/TDTDTEXTAREA NAME=Status ROWS=5 COLS=40 WRAP/TEXTAREA/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBREMARKS:/TDTDTEXTAREA NAME=Remarks ROWS=5 COLS=40 WRAP/TEXTAREA/TD/TR /table); print(A HREF=completelist.php?action=UpdateDno=$DnoMode=$ModePackage=$PackagePro cess=$ProcessRoot=$RootCorrective=$CorrectiveRespondence=$RespondenceCom mitment=$CommitmentStatus=$StatusRemarks=$Remarks[UPDATE]/A); Im having problem here in all the name string variable(ie. $Package, $Mode ...etc) except the $Dno. How could i make the Href tag recognize the name string variable in the table form? Any idea? Please help me regarding this im just a PHP newbie. Thanks in advance Regards, Mike -- 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] changing unix password in php?
I've tried several versions of this: $command = su root; $id = whoami; passthru($command, $result); passthru($id, $result2); echo $result; echo $result2; Jon Farmer [EMAIL PROTECTED] wrote in message news:00de01c1a42c$9401d970$[EMAIL PROTECTED]... Along this line, I have attempted to run a command as root from the server by using su. It never changed user. I tried using passthru to see if I could get the password prompt coming back with no luck. If I run passthru date, I get the time and date back. If I run passthru root, I get nothing back. I don't want to run apache as root and I would need to in order to access secured documents like passwd or some of the config files in etc. Can someone help with this? Can you post code? -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 PGP Key available, send email with subject: Send PGP Key -- 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] Form Problem
somewhere in the form put: input type=\hidden\ name=\Dno\ value=\$Dno\ -Original Message- From: Michael P. Carel [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 24, 2002 1:48 PM To: php Subject: [PHP] Form Problem Hi there, I have a problem here regarding the form table name variable (i.e input name=Process type text), when i used Href tags to send the variable in the next script it does'nt recognized the $Process variable. I've tried the the submit type but but im having problem with other $variable in the table which is not part of the form. Here's the script: Option1: Using Submit ?FORM ACTION=addlist.php method=get? print(BR); print(TABLE WIDTH= 90%); print(/TABLEHR WIDTH= 90%BR); print(tableTRTD ALIGN=RIGHT bgcolor=grayB8D #: /TDTD $Dno /TD/TR TRTD ALIGN=RIGHT bgcolor=grayBMODE OF FAILURE: /TDTDTEXTAREA NAME=Mode ROWS= 5 COLS=40 WRAP/TEXTAREA/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBPACKAGE:/TDTDinput name=Package type=text/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBPROCESS:/TDTDinput name=Process type=text/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBROOT CAUSE:/TDTDTEXTAREA NAME=Root ROWS=5 COLS=40 WRAP/TEXTAREA/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBCORRECTIVE ACTION:/TDTDTEXTAREA NAME=Corrective ROWS=5 COLS=40 WRAP/TEXTAREA/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBRESPONDENCE:/TDTDinput name=Respondence type=text/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBCOMMITMENT:/TDTDinput name=Commitment type=text/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBSTATUS:/TDTDTEXTAREA NAME=Status ROWS=5 COLS=40 WRAP/TEXTAREA/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBREMARKS:/TDTDTEXTAREA NAME=Remarks ROWS=5 COLS=40 WRAP/TEXTAREA/TD/TR /table); ?centerinput type = submit name= submit value=UPDATE? Im having problem with the $Dno. Submit would not recognize this in sending the form. I'd like submit to add a Dno=$Dno in submitting the form but how? Option 2: Using HREF print(BR); print(TABLE WIDTH= 90%); print(/TABLEHR WIDTH= 90%BR); print(tableTRTD ALIGN=RIGHT bgcolor=grayB8D #: /TD$Dno/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBMODE OF FAILURE: /TDTDTEXTAREA NAME=Mode ROWS= 5 COLS=40 WRAP/TEXTAREA/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBPACKAGE:/TDTDinput name=Package type=text/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBPROCESS:/TDTDinput name=Process type=text/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBROOT CAUSE:/TDTDTEXTAREA NAME=Root ROWS=5 COLS=40 WRAP/TEXTAREA/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBCORRECTIVE ACTION:/TDTDTEXTAREA NAME=Corrective ROWS=5 COLS=40 WRAP/TEXTAREA/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBRESPONDENCE:/TDTDinput name=Respondence type=text/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBCOMMITMENT:/TDTDinput name=Commitment type=text/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBSTATUS:/TDTDTEXTAREA NAME=Status ROWS=5 COLS=40 WRAP/TEXTAREA/TD/TR TRTD ALIGN=RIGHT bgcolor=grayBREMARKS:/TDTDTEXTAREA NAME=Remarks ROWS=5 COLS=40 WRAP/TEXTAREA/TD/TR /table); print(A HREF=completelist.php?action=UpdateDno=$DnoMode=$ModePackage=$PackagePro cess=$ProcessRoot=$RootCorrective=$CorrectiveRespondence=$RespondenceCom mitment=$CommitmentStatus=$StatusRemarks=$Remarks[UPDATE]/A); Im having problem here in all the name string variable(ie. $Package, $Mode ...etc) except the $Dno. How could i make the Href tag recognize the name string variable in the table form? Any idea? Please help me regarding this im just a PHP newbie. Thanks in advance Regards, Mike -- 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] Form Problem
On Thursday 24 January 2002 10:47, Michael P. Carel wrote: Hi there, I have a problem here regarding the form table name variable (i.e input name=Process type text), when i used Href tags to send the variable in the next script it does'nt recognized the $Process variable. I've tried the the submit type but but im having problem with other $variable in the table which is not part of the form. Here's the script: Correct me if I'm wrong, it seems like you're trying to set some values in a form AND trying to pass values through the URL. You cannot do both at the same time. Well actually you can if you use javascript. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Recursion is the root of computation since it trades description for time. */ -- 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]
[PHP] Viral Marketing PHP (was Re: [PHP] Computer Science and PHP)
Hello, Dl Neil wrote: One other dimension, the institutions can only offer classes in the languages (and techniques/technologies) that the trainers know and than they have the resources (hardware, compilers/interpreters) to cover. Maybe therein lies an answer to the 'marketing' side too. The best way to 'market' a new language, ie to cause it to spread virulently (?virus-like) is by offering classes in the schools! Certainly when my customers ask about 'which tool' my first question is always, what skill sets do the staff have?. One good point about what you said is that one budgetless what to promote PHP is to use 'viral marketing'. Viral marketing is a way to market something by using a technique that spreads by itself, ie, no additional effort or money needed to be spent by the originator to have the notice of what you want to market spread like crazy. There are some bad examples of viral marketing, like chain letters or selling address lists for unsolicited lists, but viral marketing can be used to market a good thing. For instance, Hotmail did not use marketing in the traditional media. They just added a footer in their users messages to notice that they were sent using Hotmail. The rest is history. Hotmail grown like crazy so much that even Microsoft bought it instead of developing a competitor service. Anybody can think of viral ideas to market PHP. You just need to focus your brainstorm on what is really viral to make sure that with a little effort and no budget you can make a serious impact promoting PHP. There are certain caracteristics that distinguish what may become and what will not become viral. Instead of detail that here I recommend Seth Godin (former Yahoo marketing director) book Unleashing the idea virus. Seth made the book available in full for free here to demonstrate the concept. Palm Pilot and PDF versions are available: http://www.ideavirus.com/01-getit.html The book does not tell you how to create viral ideas, but rather how to sort what ideas can become viral. With that topic in the mind, if you ever figure a viral idea to promote PHP, just share it here to prove the concept as well! :-) Regards, Manuel Lemos -- 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]
[PHP] PHP-GTK version 0.5.0 released
Greetings! I have released PHP-GTK version 0.5.0, also known as monday starts on saturday. The version number was bumped from 0.1.1 to this one to indicate that PHP-GTK is now a fairly mature and stable extension and can be used for a variety of applications (just look on Freshmeat). I would also like to take this opportunity and ask if you some of you would consider helping out with PHP-GTK documentation. It would be a great way to learn this exciting extension and also contribute to the project. The list of the major changes follows: Version 0.5.0 monday starts on saturday 24-Jan-2002 ~ - added new widgets with samples: GtkComboButton, GtkSPaned, GtkScrollPane and GtkPieMenu. (Markus) - implemented GtkFontSelection::set_filter(), GtkFontSelectionDialog::set_filter(), Gtk::button_box_get_child_ipadding_default(), Gtk::button_box_get_child_size_default() and GtkWidget::get_pointer(). (Markus) - implemented gdkpixbuf extension (loading and displaying images). (Andrei) - added GtkCTree methods find_by_row_data, find_all_by_row_data. (Andrei) - added gtkhtml extension which provides support for GtkHTML, an HTML rendering widget. (Alan Knowles) - added GtkClist methods find_row_from_data(), get_pixmap(). (Andrei) - added GtkList::remove_items() method. (Andrei) - added ability to build extensions as shared libraries and load them selectively. (Andrei) - made libglade work on Win32 platforms. (Frank) - added support for GtkSQPane widget. (Markus) - added GtkCList::get_pixtext(). (Andrei, Rich Payne) All the best! -Andrei -- 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]
[PHP] I lost the message...
I am embarrassed to say that I lost the anser to my question on the syntax to get a list of all of the files in a specified directory matching a sertain criteria. Anyone willing to give me another chance? Todd -- Todd Cary Ariste Software [EMAIL PROTECTED] -- 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]
[PHP] seems easy...
Hi, Really simple, but can't see which funtion to use in the manual. I want to take a user-inputted string $text, and IF it's length is more than $limit, trim it to the limited length, and then tack on some kind of ... text cut (too long) thing on the end. I'm only missing one bit (line4): 1 $limit = 5000; 2 if(strlen($text) $limit) 3{ 4cut $text down to $limit length 5$text .= ...sorry, text was too long; 6} Or is it hard than that? Justin French -- 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 lost the message...
$result = `ls foo*`; // :) :# ??? Martin -Original Message- From: Todd Cary [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 24, 2002 3:17 PM To: [EMAIL PROTECTED] Subject: [PHP] I lost the message... I am embarrassed to say that I lost the anser to my question on the syntax to get a list of all of the files in a specified directory matching a sertain criteria. Anyone willing to give me another chance? Todd -- Todd Cary Ariste Software [EMAIL PROTECTED] -- 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] seems easy...
1 $limit = 5000; 2 if(strlen($text) $limit) 3{ 4cut $text down to $limit length 5$text .= ...sorry, text was too long; 6} 4$text = substr($text, 0, $limit); 5$text .= ... (More); :) Jason -- 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] seems easy...
$limit = 5000; if(strlen($text) $limit) { $text = substr($text, 0, $limit); $text .= ...sorry, text was too long; } -Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 24, 2002 3:34 PM To: php Subject: [PHP] seems easy... Hi, Really simple, but can't see which funtion to use in the manual. I want to take a user-inputted string $text, and IF it's length is more than $limit, trim it to the limited length, and then tack on some kind of ... text cut (too long) thing on the end. I'm only missing one bit (line4): 1 $limit = 5000; 2 if(strlen($text) $limit) 3{ 4cut $text down to $limit length 5$text .= ...sorry, text was too long; 6} Or is it hard than that? Justin French -- 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]
[PHP] mail() question
Ive tried Reading The Fine Manual on this, and cant find an easy answer. Heres the headers for a message from the script, and the error Im getting on some mail it sends Return-Path: wwwrun Received: (from wwwrun@localhost) by arsenic.mth.com (8.11.6/8.11.3) id g0O4UCQ27546; Wed, 23 Jan 2002 21:30:12 -0700 Date: Wed, 23 Jan 2002 21:30:12 -0700 Message-Id: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Order Receipt From: [EMAIL PROTECTED] Reply-To: HYPERLINK mailto:[EMAIL PROTECTED][EMAIL PROTECTED] Some mail servers give this response: The original message was received at Wed, 23 Jan 2002 21:30:12 -0700 from wwwrun@localhost - The following addresses had permanent fatal errors - [EMAIL PROTECTED] (reason: 550 REQUESTED ACTION NOT TAKEN: DNS FAILURE) - Transcript of session follows - ... while talking to mx.somewhere.com.: MAIL From:[EMAIL PROTECTED] 550 REQUESTED ACTION NOT TAKEN: DNS FAILURE 554 5.0.0 Service unavailable Heres the line of PHP Im using to send the mail: mail($CustomerInfo[Email], Order Receipt, $text,From: $SiteInfo[Email]\nReturn-Path: $SiteInfo[Email]\nReply-To: $SiteInfo[Email]); arsenic.mth.com is the LAN name of my box. How can I get PHP to send mail as if it was from the DNS name for the box (mthmarketing.com)? Matthew Walker Ecommerce Project Manager Mountain Top Herbs --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.313 / Virus Database: 174 - Release Date: 1/2/2002 -- 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] UPDATE - MySQL having some trouble
hi, I can't the UPDATE command in MySQL to work properly. Here is my query $query = update table set lastname=$lastname, firstname=$firstname ^ replace table with table name where username=$username; ($lastname, $firstname, $username ) should be enclosed by quotes, if all the fields are character. Anything wrong with my syntax here? Goodluck! cheers, kishor Nilgiri Networks. -- 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]
[PHP] Printing JPEG images generated with ImageJPEG with IE/WIN
Hello I am creating images with ImageJPEG using information from a form. The image displays well in IE (Mac OS X), and IE and Netscape on Windows. However, when printing from IE / Windows all I get is a small red X. The image can be saved to disk, imported in MS Word and printed OK. It also prints OK from Netscape under Windows. Any thoughts? David Bourne -- 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 lost the message...
As I recall, I need to use the file function e.g. fopen(). Todd -- Todd Cary Ariste Software [EMAIL PROTECTED] -- 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 lost the message...
This seems to work. Is there a better way? chdir(/home/docvault); $dir = dir(.); $dir-rewind(); while ($file=$dir-read()) { if (($file != .) ($file != ..)) { $Filelist[] = $file; } } $dir-close(); Todd -- Todd Cary Ariste Software [EMAIL PROTECTED] -- 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]
[PHP] How can the Surfer download
What is the syntax to give the surfer an opportunity to download a file? Todd -- Todd Cary Ariste Software [EMAIL PROTECTED] -- 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 can the Surfer download
On Thursday 24 January 2002 13:27, Todd Cary wrote: What is the syntax to give the surfer an opportunity to download a file? Please elaborate. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Kitchen activity is highlighted. Butter up a friend. */ -- 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] to evaluate ...
If your heart is set upon using $width1... then write your variable like in the following: for ($i=1;$i=$some_end_number;$i++) { ${width.$i}=something width; } hugh - Original Message - From: Jason Wong [EMAIL PROTECTED] To: Thorsten Wandersmann [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, January 23, 2002 6:42 PM Subject: Re: [PHP] to evaluate ... On Thursday 24 January 2002 09:15, Thorsten Wandersmann wrote: Sorry for bothering you, but I really didn't find answeres on dejanews and in the tutorial, or better, I did not see them. I need the following variables: $width1 $width2 $width3 . . . $widthn Because it is not shure, how many they are, I need to construct them. And because I need them in a form as name I could not use arrays (or did I miss something here???). Yes, you're missing something :) You can use arrays in forms, just use names like width[0], width[1] etc. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Goto, n.: A programming tool that exists to allow structured programmers to complain about unstructured programmers. -- Ray Simard */ -- 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] -- 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]
[PHP] Displaying array of elements problem
Hi there, I have another problem out here. Im using the for loop to display an array of element in the checkbox form. My problem is how could i set the this if to an error message if their are a NULL selection. By default this will display blank for no selection which i whant to be avoided. I dont know what particular variable should i declare if there are NULL selection so that i can incorporate that in an error script. Please help me. Sample script: ? // check for $submit if (!$submit) { // and display form ? form action=test.php method=GET input type=checkbox name=artist[] value=Bon JoviBon Jovi input type=checkbox name=artist[] value=N'SyncN'Sync input type=checkbox name=artist[] value=BoyzoneBoyzone input type=checkbox name=artist[] value=Britney SpearsBritney Spears input type=checkbox name=artist[] value=Jethro TullJethro Tull input type=checkbox name=artist[] value=Crosby, Stills NashCrosby, Stills Nash br input type=submit name=submit value=Select /form ? } // or display the selected artists else { ? bAnd here are your selections:/b br ? -error script line should be here-- for($count = 0; $count sizeof($artist); $count++) { echo i$artist[$count]/ibr; } } ? Regards, Mike -- 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] Split files
Hi and thaks for your answer. ... Making any sense? Year, so I have to do it manually (thought someone could preveting me from reinvent the wheel... ;-) What are you really trying to achieve? I'm trying to split a large binary file (2 GB) into peaces of 700 MB to burn it on a cd. It's a part of a backup-mechanism I'm wirting in PHP. Martin -- 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] Split files
On Thursday 24 January 2002 15:34, Martin Thoma wrote: Hi and thaks for your answer. ... Making any sense? Year, so I have to do it manually (thought someone could preveting me from reinvent the wheel... ;-) What are you really trying to achieve? I'm trying to split a large binary file (2 GB) into peaces of 700 MB to burn it on a cd. It's a part of a backup-mechanism I'm wirting in PHP. Maybe you could find a program that will do the split for you then call that from within PHP. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Slurm, n.: The slime that accumulates on the underside of a soap bar when it sits in the dish too long. -- Rich Hall, Sniglets */ -- 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]
[PHP] Difference between i586 RPM and SRC.RPM?
Wanted to download PHP 4.1.1 RPM. What's the difference between i586 RPM and SRC.RPM? What sites provide non-FTP download for PHP4.1.1 RPM? Thanx ppl! _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- 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]
[PHP] Creating a pdf document
Hello, I was wondering if I could save the result of a query in a pdf document. I looked for any functions that might help, but I got confused because I could not see how/where exactly to insert the necessary .dll's. I'd like to do this (saving the output of a query) by using mysql installed on a Irix machine, and PHP4. If this is not possible, could I create a pdf document or a word document from a query from either Access database or mysql on a win2k system, PHP4.1? Any references that might help? Thanks for your help! Mihai -- 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]