Re: [PHP] Re: Protect PHP coding
'Just wanted to make a few comments... I got my job because of PHP. All of my company's projects were coded in PHP. (Old ones that were not are soon to be converted.) Zend? I convinced my boss to buy the encoder--I didn't have to pay for it... Thanks! Thanks to Zend! Thanks to the PHP community! Thanks to those who made the manual! Thanks to the (over) 600 as well! Thanks to the mailing lists, etc! - E - $B85$N%a%C%;!<%8(B - $BAw?.(B : RE: [PHP] Re: Protect PHP coding I know I shouldn't do more to keep this going but I'll make this one, and only, post. this all started when rasmus had a problem with the "click" in my original post From what I read, Rasmus made a correction to your opinion. You are entitled to your opinion, but perhaps you should learn that just because it _is_ your opinion it is neither automatically right nor going to be accepted by anyone else. and i think i proved that if you are a member of the php development you better not stray from what the php gods think or else you will get hanged in public or even banned or ignored. I'm guessing that this is in reference to how you think you've been treated. As far as I can see, you've not been hanged in public, you've not been banned and, unfortunately, you've not been ignored either. I'd also suggest that there's a difference between having a differing opinion and trying to shove it down everyone elses throat. then i suggested that zend isn't really doing much to "develop" an encoder or accelerator since one guy has been able to do the same thing Ummm, I really don't see your point here. Zend is doing what Zend chooses to do. Last I checked it's, largely, a free world and Zend is a commercial entity. They have written their particular tools and, by virtue of the fact that they wrote them they can decide how they want to market them. That they've decided to give part of it away for free (Zend engine in PHP) is their choice. I, for one, am glad they did. That they decided to retain control over another part of it (IDE, Optimiser etc) and sell that is also their choice. The price they set for it is also their choice since they created it in the first place. It is not my place, nor yours for that matter, to criticise Zend for what they may or may not do in the commercial market place. Why _should_ Zend do anything in particular to "develop" a php market? So you can get a job programming in PHP? Why is that their problem? and rasmus is like of course not silly if microsoft sold their products for what they cost it would be $0.02. I'm not even sure what your point is here... so fine zend is ripping people off, what's the point? Are they? Were you forced to buy something from Zend? Was I? It's your free choice to spend money with Zend. If you don't then they haven't ripped you off. If you do, one presumes that you have because you see value in doing so. If _NOBODY_ purchases product from Zend then they are free to go broke or review their pricing - that's a commercial reality. it has been damaging to php is my point. Really? Why is Zend to blame for this 'damage' to PHP? Because they aren't spending money advertising it? How do you know they aren't? I'd expect that Zend, like every other commercial entity, has an advertising budget. I'd expect that they spend money advertising themselves and their products. Are they also expected to spend money promoting php itself? Why? no one knows what php is and no one will pay you to do php. Really? I've been paid to do php for clients. You point, I believe, was about number of job listings. I've honestly not looked - and I'm not in your part of the world anyway. Consider that a lack of job listings does not necessarily equate to a lack of paid work. Consider that a good many people earn money programming in PHP. Or are you bitter because you feel that you've wasted time learning to program in PHP and now can't get a job? If so, I can only suggest that you get more skills - the more multi-skilled you are the better your chances of employment. Either that or you could apply for jobs that want, for example, ASP and then sell them on the idea of doing the stuff in php instead. Isn't it your 'duty' to do this? If you don't aren't you just 'damaging' php? no matter what rasmus says that 600 people have access to the cvs, php is zend and zend is php. I neither claim to be an expert on php nor zend but it was my understanding that zend has contributed a reasonably significant key component of PHP. Even so, they are not the only source of php development. Many people contribute. Each of those people have some say in what happens. after that is when all the little minions started acting tough so that the cool kids would like them better. Ummm, ok, whatever... here's the original post that i
Re: [PHP] Linux PHP editor
I use vim most of the time... but how 'bout some bluefish? http://bluefish.openoffice.nl/ Or, try using your fav editor with wine... http://www.winehq.com/ (I wouldn't want to do that though...) - E How 'bout I just switched over to Red Hat Linux from Win2k... Only to find my fav editor only works on windows systems... could someone suggest a good replacement? -- JJ Harrison [EMAIL PROTECTED] www.tececo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B$-$C$H8+$D$+$k$"$J$?$N?75o!!ITF0;:>pJs$O(B MSN $B=;Bp$G(B http://house.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Linux PHP editor
I think there's a way how to fix that. But don't bother to ask--I couldn't do it and I forgot... BTW, if you know any that can convert from (Japanese) euc-jp to sjis and vice versa, I'll be happy to learn about it. TIA - E On Friday 09 August 2002 20:34, [EMAIL PROTECTED] wrote: I use vim most of the time... but how 'bout some bluefish? http://bluefish.openoffice.nl/ Last time I tried it (about a month ago) the syntax highlighting was atrocious. I've always favoured quanta over bluefish but Redhat 7.3 seriously broke quanta. That only leaves vim (nedit is good, but has problems integrating with the KDE clipboard which renders it impotent). -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* The end of the human race will be that it will eventually die of civilization. -- Ralph Waldo Emerson */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B%-%c%j%"%"%C%W$rL\;X$9$"$J$?$N%J%S%2!<%?!<(B MSN $B="?&!>?&(B http://career.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Linux PHP editor
I'd like to use it but I don't use KDE (perhaps the libraries needed are not installed). Besides, an earlier post said that it's broken (?) in Redhat 7.3... BTW, can it do search and replace in multiple open files? Does it have FTP capabilities? If yes, well, perhaps it's time to start using it... - E PS I hope it has good support of Japanese as well... I am using Quanta 2.0 and loving it. http://quanta.sourceforge.net Oh My Gosh they have a new verison out.. 3.0 Time to upgrade. Paul @ Edwin wrote: I use vim most of the time... but how 'bout some bluefish? http://bluefish.openoffice.nl/ Or, try using your fav editor with wine... http://www.winehq.com/ (I wouldn't want to do that though...) - E How 'bout I just switched over to Red Hat Linux from Win2k... Only to find my fav editor only works on windows systems... could someone suggest a good replacement? -- JJ Harrison [EMAIL PROTECTED] www.tececo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ MSN ??? http://house.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B2q0wEPO?$OL5NA!&=<<B$7$?=PIJ%"%$%F%`$J$i(B MSN $B%*!<%/%7%g%s(B http://auction.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Linux PHP editor
I'll try... Anyway, next time, I'll try using KDE as well... Regards, - E hmm, can't answer those questions...I hope you can find such answers on their web site. warmly, paul At 03:40 PM 8/9/2002, you wrote: I'd like to use it but I don't use KDE (perhaps the libraries needed are not installed). Besides, an earlier post said that it's broken (?) in Redhat 7.3... BTW, can it do search and replace in multiple open files? Does it have FTP capabilities? If yes, well, perhaps it's time to start using it... - E PS I hope it has good support of Japanese as well... I am using Quanta 2.0 and loving it. http://quanta.sourceforge.net Oh My Gosh they have a new verison out.. 3.0 Time to upgrade. Paul @ Edwin wrote: I use vim most of the time... but how 'bout some bluefish? http://bluefish.openoffice.nl/ Or, try using your fav editor with wine... http://www.winehq.com/ (I wouldn't want to do that though...) - E How 'bout I just switched over to Red Hat Linux from Win2k... Only to find my fav editor only works on windows systems... could someone suggest a good replacement? -- JJ Harrison [EMAIL PROTECTED] www.tececo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ MSN ??? http://house.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B2q0wEPO?$OL5NA!=B$7$?=PIJ%"%$%F%`$J$i(B MSN $B%*!%/%7%g%s(B http://auction.msn.co.jp/ _ $B:G?7$N%U%!%$%J%s%9>pJs$H%i%$%U%W%i%s$N%"%I%P%$%9(B MSN $B%^%M!<(B http://money.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Linux PHP editor
I'm sure you can also use vim or jedit or Zend's mentioned earlier. Or, visit this site for more: http://php.weblogs.com/editors - E Is there a php editor for Win2k ? _ $B%&%#%k%9%a!<%k!"LBOG%a!<%kBP:v$J$i(B MSN Hotmail http://www.hotmail.com/JA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Making PHP faster?
Andrew, It's true that "the time you use in coding and figuring out ways to make PHP faster would be greater than..." The task mentioned might be a "one-off thing" NOW. However, the techniques that we can learn can also be applied in future task, so, I'm still interested in the answer to the original question... - E I don't know any good ways of making PHP go faster, but may I suggest that the time you use in coding and figuring out ways to make PHP faster would be greater than the time you have saved by using such features... If this is a one of thing I think 30minutes is better than 15minutes plus 60minutes of code changes/tweaks.. Just my 2c Andrew - Original Message - From: "Jean-Christian Imbeault" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 13, 2002 4:39 AM Subject: [PHP] Making PHP faster? I'm using PHP to load data into a PostgresQL database. The script works fine but it is a bit slow. It's taking about 30 minutes to load about 15,000 items. This is mainly because of all the error checking and many redundant queries I am running. This program is a one-off thing. Are there any simple ways for me to make PHP run faster? I'm already using persistent DB connections. I was thinking along the lines increasing it's memory usage, turning off error checking, getting it to optimize the code on the fly, etc ...? Thanks! Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B:G?7$N%U%!%$%J%s%9>pJs$H%i%$%U%W%i%s$N%"%I%P%$%9(B MSN $B%^%M!<(B http://money.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] N6: PHP files can't show source
I might be wrong but I think the only (easy) way you can view the source is to "Save as..." the page first into xxx.html then open that file and view the source... In other words: 1. Using N6, go to the page where you can't "view source" 2. Click on "File" - "Save as..." 3. Save it to desired name using ".html" as an extension. (Of course, you can use others like ".txt", etc...) 4. Open the file using your fav editor HTH, - E I'm using Netscape 6.2 and whenever I load one of my .php files I can't get Netscape to "show source". I don't have that problem with IE. Can anyone tell me how to configure Netscape so that I can view the HTML output of my PHP files? Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B%&%#%k%9%a!<%k!"LBOG%a!<%kBP:v$J$i(B MSN Hotmail http://www.hotmail.com/JA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] upgrading error
Just a thought... If you have downloaded 10 packages perhaps you need to upgrade ALL of them AT THE SAME TIME. So, instead of doing: rpm -Uvh php-4.1.2-7.i386.rpm. Try this: 1. Put all packages in the same folder 2. rpm -Fvh *.rpm The "F" (instead of "U") updates all INSTALLED packages only. I didn't really check but it might work. If not, perhaps, you need to have more packages other than the ones you've already downloaded... - E I have PHP 4.0.4p11 on RH Linux 7.1. Today I downloaded PHP 4.1.2-7 rpm packages (10 packages) from RH web site. These packages are come with RH Linux 7.3. I don't want to upgrade Linux but just upgrade PHP so I tried rpm -Uvh php-4.1.2-7.i386.rpm. I got following error message: error: failed dependencies: libcrypto.so.2 is needed by php-4.1.2-7 libcurl.so.2 is needed by php-4.1.2-7 libdb-3.3.so is needed by php-4.1.2-7 libltdl.so.3 is needed by php-4.1.2-7 libmm.so.11 is needed by php-4.1.2-7 libpspell.so.4 is needed by php-4.1.2-7 libssl.so.2 is needed by php-4.1.2-7 libxml2.so.2 is needed by php-4.1.2-7 php = 4.0.4pl1-9 is needed by php-imap-4.0.4pl1-9 php = 4.0.4pl1-9 is needed by php-ldap-4.0.4pl1-9 php = 4.0.4pl1-9 is needed by php-mysql-4.0.4pl1-9 php = 4.0.4pl1-9 is needed by php-pgsql-4.0.4pl1-9 php = 4.0.4pl1-9 is needed by php-manual-4.0.4pl1-9 Any idea? Seems like it is impossible to directly upgrade from 4.0.4 to 4.1.2-7Please advice. Thanks in advace! Alex -- --- TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B%&%#%k%9%a!<%k!"LBOG%a!<%kBP:v$J$i(B MSN Hotmail http://www.hotmail.com/JA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql error
Looks like you're updating your table so instead of "INSERT INTO...", try: "UPDATE malibu_data SET ..." HTH, - E I get this error: Error submiting paragraph.You have an error in your SQL syntax near 'WHERE page_name='features' AND par_id='13' ' at line 1 But my code, I think is fine: // Insert the form information into the database mysql_query("INSERT INTO malibu_data SET heading='$heading', paragraph='$paragraph' WHERE page_name='$page_name' AND par_id='$par_id' ") or die ('Error submiting paragraph.'. mysql_error()); - Vic __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B%O%$%;%s%9$J>$r5$7Z$K9XF~(B MSN $B%7%g%C%T%s%0(B http://shopping.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie PHP/HTML pull down menu problem
Something like this should work: after mysql_connect() and mysql_select_db() ... $sql = "SELECT color_id,color FROM mytable"; $result = mysql_query($sql); echo 'form blah,blah,blah'; echo 'select name="color_id"'; while ($row = mysql_fetch_array($result)){ printf("option value=\"%s\"",$row["color_id"]); printf("%s/option",$row["color"]); } echo '/select'; echo '/form'; HTH, - E PS Check the manual for printf() if you're not sure how it works... http://www.php.net/manual/en/function.printf.php Hi, I want to pull information out of my mySQL database and use it as a pull down menu ona web page. There are two sets of information that I need, one is a color, and the other is the color_id, so I want to use it in the way below but without having to physically enter all the data. I'd like to use color_id as the value and the actual color name as the text in the pull down button. Can someone please help me on how to pass the info into a useable way to get the info out of PHP and into HTML? I've haad no problems going from HTML to PHP, but can't seem to grasp going the other way, especially with a list of things. I've been banging my head against this for two days, but something tells me it's extremely easy. Thanks, Brian form name="tester" action="script.php" method="get" select name="color" option value="1"red option value="2"blue option value="3"black option value="4"ice option value="5"purple /select /form -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B$-$C$H8+$D$+$k$"$J$?$N?75o!!ITF0;:>pJs$O(B MSN $B=;Bp$G(B http://house.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] wanto uninstall php manual
I haven't use up2date but perhaps this will work anyway. Open a terminal and execute this: rpm -ql php-manual The 'l' will tell you where the package was installed. While, rpm -e php-manual will uninstall the package... HTH - E Hi, I upgraded php from 4.0.4p11 to 4.0.6 with up2date (a RedHat Update Agent). The new php includes a huge manual but I cannot find where is it after installed, and I don't know how can access it. And more, my free disk space is only 120M. So I am thinking to uninstall this manual. Any one know how can do uninstallation? Thanks in advance! Alex P.S. thank @ Edwin for your suggestion for upgrading. You're welcome! -- --- TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B%-%c%j%"%"%C%W$rL\;X$9$"$J$?$N%J%S%2!<%?!<(B MSN $B="?&!>?&(B http://career.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Seemingly simple header problem, isn't!
Well, then, in that case, your original problem about the header() has nothing to do with an earlier post (about IIS). Perhaps, you can try installing the latest Apache + the latest PHP and everything might just work. I've ask a friend to try it on his Win2K(sp2)+Apache2+php4.2.2 and the code was working perfectly fine--without doing anything special in httpd.conf... - E Hi, Edwin. Of course... thanks! Apache version 1.3.23. Definitely not IIS. Robert Orenstein Perforce Software Try running ?php phpinfo(); ? and I'm sure you'll find out something about the Apache version. (If, indeed, you're running Apache... Could it be that you're running IIS and Apache is down? Of course, I could be wrong...) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B2q0wEPO?$OL5NA!&=<<B$7$?=PIJ%"%$%F%`$J$i(B MSN $B%*!<%/%7%g%s(B http://auction.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Shared network server failing to include files
And still, if this doesn't work, why not install PHP as well--with Apache... (Perhaps, there must really be some good reason why not...) I'm not sure what was meant by A Windows 2000 takes care of our network internet connectivity but if a router is present, why not just map HTTP request to the linux server? Just wondering, - E Hi, I don't think this is a PHP question, but the line Alias /cs/ //192.168.0.253/apachedir/ try Alias /cs/ \\192.168.0.253/apachedir/ Because //isn't valid for UNCs, but \\ is.. If this doesn't work, then with dos map \\192.168.0.253/apachedir/ to a network drive and point apache at that Andrew - Original Message - From: "Julio Nobrega" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 14, 2002 4:58 PM Subject: [PHP] Shared network server failing to include files Hi all, I am not 100% sure if this is a PHP problem, so I apologize in advance if it is an off-topic problem. I have a Linux server where I develop my websites. A Windows 2000 takes care of our network internet connectivity. I need to show to a client the progress of our work, so I've shared through Samba a directory from Linux, and installed Apache on the Windows 2000 and used the Alias option to point to this Linux share: Alias /cs/ //192.168.0.253/apachedir/ When I access my development website locally, or use a browser and input the IP address, everything goes fine. But when I am on the Windows 2000 and type: http://localhost/cs/ An include error occurs: Fatal error: Failed opening required 'gerador.inc.php' (include_path='') in //192.168.0.253\apachedir\index.php on line 3 Anyone knows the fix? Perhaps I should ask what basically I have in mind since the beggining: How can I server webpages from a networked Linux through the Windows 2000 that is connected to the Internet? Any help is sincerely appreciated. Thanks, -- Julio Nobrega -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B$-$C$H8+$D$+$k$"$J$?$N?75o!!ITF0;:>pJs$O(B MSN $B=;Bp$G(B http://house.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] frames and variables
I think one of the (if not THE) best implementation of frames with PHP/Javascript (HTML,CSS...) is phpmyadmin... http://www.phpmyadmin.net/ Of course, there could be a lot of others... - E The only way to talk to multiple frames is with javascript. yuk. Justin French on 15/08/02 2:37 PM, [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote: Has anyone here designed php sites that use a combination of php pages and html pages? What I want to know is how to pass a variable from nav_frame.php (at the top) to itself, AND to the data.php frame (lower frame, main body) I can pass variables to itself, (with the "?page_name=content.htm" thingie attached to links, but I don't know how to make this accessible to both frames at the same time. Help appreciated, yes, I'm asking a lot of questions since this is a project for college and my due data is in 2 ... ooops 1 DAY! WhooHOO! - Vic __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B%O%$%;%s%9$J>$r5$7Z$K9XF~(B MSN $B%7%g%C%T%s%0(B http://shopping.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SQL Injection/Data Balidation
Yeah, I'm scared... Please excuse me but may I say that it seems like you've sent some wrong info to the wrong mailing list? I use PHP NOT ASP, I use MySQL or PostgreSQL or Oracle but NOT M$ SQL Server. And IIS? Of course, some people use it (perhaps) because of some unavoidable circumstances but I don't--I use Apache NOT IIS. Of course, there's nothing bad about being cautious... However, please send some links (or documents) that are more relevant... Thanks anyway, now *I* have something to scare my friends... ;) - E Please CC me as I'm on digest: -- Are there any libraries for data validation available? If one reads papers like these: http://www.nextgenss.com/papers/advanced_sql_injection.pdf http://www.nextgenss.com/papers/more_advanced_sql_injection.pdf It becomes apparent that sites using databases are incredibly open to attack because of the ingenuity of the attackers. I think there should be a PHPGuardLib or something. After reading those articles, I plan on filtering ALL input for semi-cololons and 'chr(' character strings. In the cases where I want to accept apostrophes, I'm going to be very careful. Also, are there any attacks to email programs on linux that can be done through input forms? PS, for those who think escaping user input only on apostrophes, THINK AGAIN! And read the aticles above. -- If You want to buy computer parts, see the reviews at: http://www.cnet.com/ **OR EVEN BETTER COMPILATIONS**!! http://sysopt.earthweb.com/userreviews/products/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ MSN Hotmail è il provider email più grande al mondo cosa aspetti a farti un account? http://www.hotmail.it -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SQL Injection/Data Balidation
Actually, I DID read the articles before I replied. If you read it again, the basic problem is not about any extended SQLServer functionality--it's about how ASP works AND how the database server was configured AND how Window$ works. Sorry, but the attacks mentioned CANNOT be done on any of the database servers that I've used. And with PHP, Apache, Linux combination, they just don't apply. Hey, don't get me wrong. I really appreciate any security info but personally I don't think they apply here... - E HINT: PHP doesn't use another ' (single quote) character to escape another single quote character--it's just basically stupid to do so. HINT 2: Configure your database server to have, for example, (1) a database username/password that can only SELECT -- enough for dynamically generated pages (2) a username/password that can only do INSERT or UPDATE, etc. Why would I make a username/password for my web pages that can delete important table or the entire database itself? If you'll thoroughly read the articles, most of those attacks that don't involve the use of extended SQLServer functionality, CAN be done on other RDBMS's. And if nothing else, you'll see the ingenuity of the attackers. Hey, take what you liked, and leave the rest lay. -- If You want to buy computer parts, see the reviews at: http://www.cnet.com/ **OR EVEN BETTER COMPILATIONS**!! http://sysopt.earthweb.com/userreviews/products/ _ Charle con sus amigos online usando MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SQL Injection/Data Balidation
Oops! Sorry! I meant to say apostrophe and not single quotes... And sorry 'bout this additional post... Regards, - E Actually, I DID read the articles before I replied. If you read it again, the basic problem is not about any extended SQLServer functionality--it's about how ASP works AND how the database server was configured AND how Window$ works. Sorry, but the attacks mentioned CANNOT be done on any of the database servers that I've used. And with PHP, Apache, Linux combination, they just don't apply. Hey, don't get me wrong. I really appreciate any security info but personally I don't think they apply here... - E HINT: PHP doesn't use another ' (single quote) character to escape another single quote character--it's just basically stupid to do so. HINT 2: Configure your database server to have, for example, (1) a database username/password that can only SELECT -- enough for dynamically generated pages (2) a username/password that can only do INSERT or UPDATE, etc. Why would I make a username/password for my web pages that can delete important table or the entire database itself? If you'll thoroughly read the articles, most of those attacks that don't involve the use of extended SQLServer functionality, CAN be done on other RDBMS's. And if nothing else, you'll see the ingenuity of the attackers. Hey, take what you liked, and leave the rest lay. -- If You want to buy computer parts, see the reviews at: http://www.cnet.com/ **OR EVEN BETTER COMPILATIONS**!! http://sysopt.earthweb.com/userreviews/products/ _ Charle con sus amigos online usando MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Charle con sus amigos online usando MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Secure connection with MySQL database
Well, I'm not sure if this is what you're looking for but... if you name the file with a .php extension (instead of .txt or .inc) then your password is protected. For example, you have a password declared like this: $my_db_username = 'MyUserName'; $my_db_password = 'MyPassWord'; And it's inside a file named myfile.inc.php, then, even if somebody try to access the file using their browser like this: http://aaa.bbb.ccc/myfile.inc.php Nothing will appear... - E How can I protect my username and password for my connection with a mysql server. I can't place a file outside the root by the provider I use. Thankx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Charle con sus amigos online usando MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Secure connection with MySQL database
True. But I think you missed the point of the original question--there's no "non-web directory"... - E To take it to another level, place the PHP file you are including in a non-web directory. That way, just in case the web server mucks up, there's no chance of PHP outputting the contents of the script, since the directory you place it in would not be readable by the web server. --- "Edwin @" [EMAIL PROTECTED] wrote: Well, I'm not sure if this is what you're looking for but... if you name the file with a .php extension (instead of .txt or .inc) then your password is "protected". For example, you have a password declared like this: $my_db_username = 'MyUserName'; $my_db_password = 'MyPassWord'; And it's inside a file named "myfile.inc.php", then, even if somebody try to access the file using their browser like this: http://aaa.bbb.ccc/myfile.inc.php Nothing will appear... - E How can I protect my username and password for my connection with a mysql server. I can't place a file outside the root by the provider I use. Thankx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Charle con sus amigos online usando MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com _ $B:G?7$N%U%!%$%J%s%9>pJs$H%i%$%U%W%i%s$N%"%I%P%$%9(B MSN $B%^%M!<(B http://money.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail and attachments
Also, somebody has already posted (2 weeks ago?) a similar or related question. I think, the answers given also apply to this question as well. - E If you mean that you want to add attachments to emails it is possible of course... Try Phpmailer... I recommend you to print out a copy of this script and its helper class SMTP so that you can read it and modify (it is not required, guys have done everything well enough) and reuse it. You can do more than attach things into the mail... http://phpmailer.sourceforge.net/ Have a nice day... Vehbi Sinan Tunalioglu Pafo wrote: i got a script that the user signs up on and send a profile to the owners email address but i want to implement a file upland and that the uploaded file should be submitted with the mail.. is this possible in php? i know its possible in cg.. regards patrick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B%-%c%j%"%"%C%W$rL\;X$9$"$J$?$N%J%S%2!<%?!<(B MSN $B="?&!>?&(B http://career.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache 2.0 and PHP
Would I be able to install it along side 1.3 and run it on a separate port? I know some who installed two 1.3s in two different folders, run two different daemons, in two different ports. I think it should work with 1.3 and 2.0 as well... - E Cheers John Wards SportNetwork.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B2q0wEPO?$OL5NA!&=<
RE: [PHP] Old PHP files not working
It seems like if you "turn on" register_globals in php.ini, everything might just work... but, it's strange because you said that if you type everything exactly as they were in the new server everything works! Strange... Anyway, why not try it this way. Don't turn register_globals on (you shouldn't anyway). Then, edit your scripts to comply with the "new way of doing things". For example, instead of if ($var){ } You'll write if ($_GET['var']){ } or, if ($_POST['var']){ } Well, if I think that's how it should be--if I'm not mistaken... - E Here is the code since it doesn't look like attachments work here... ?php include ("header.php"); include ("config.php"); if ($search) { // process form if ($sort == ""){ $sort = "lname"; } do { if ($fname == '' $lname == '' $dept_pulldown == '') { echo "H2centerYou must enter a last name, first name or select a departmentbrbr a href=\"/\"Home/a/center/H2"; include ("footer.php"); exit; } //end if if ($fname != '' $lname == '' $dept_pulldown != '' $dept_pulldown != 'all') { // First name only query $sql = "Select * from emp_numbers where fname = '$fname' dept = '$dept_pulldown' order by $sort"; // with dept break; } elseif ($fname != '' $lname == '' $dept_pulldown == '') { $sql = "Select * from emp_numbers where fname = '$fname' order by $sort"; // without dept break; } elseif ($fname != '' $lname == '' $dept_pulldown == 'all') { $sql = "Select * from emp_numbers where fname = '$fname' order by $sort"; // with all depts break; } // end if if ($fname == '' $lname != '' $dept_pulldown != '' $dept_pulldown != 'all') { // Last name only query $sql = "Select * from emp_numbers where lname = '$lname' dept = '$dept_pulldown' order by $sort"; // with dept break; } elseif ($fname == '' $lname != '' $dept_pulldown == '') { $sql = "Select * from emp_numbers where lname = '$lname' order by $sort"; // without dept break; } elseif ($fname == '' $lname != '' $dept_pulldown == 'all') { $sql = "Select * from emp_numbers where lname = '$lname' order by $sort"; // with all depts break; } // end if if ($fname != '' $lname != '' $dept_pulldown != '' $dept_pulldown != 'all') { // Both names query $sql = "Select * from emp_numbers where fname = '$fname' lname = '$lname' dept = '$dept_pulldown' order by $sort"; // with dept break; } elseif ($fname != '' $lname != '' $dept_pulldown == '') { $sql = "Select * from emp_numbers where fname = '$fname' lname = '$lname' order by $sort"; // without dept break; } elseif ($fname != '' $lname != '' $dept_pulldown == 'all') { $sql = "Select * from emp_numbers where fname = '$fname' lname = '$lname' order by $sort"; // with all depts break; } // end if if ($fname == '' $lname == '' $dept_pulldown != '' $dept_pulldown != 'all') { // Deptartment only query $sql = "Select * from emp_numbers where dept = '$dept_pulldown' order by $sort"; break; } // end if if ($fname == '' $lname == '' $dept_pulldown == 'all') { $sql = "Select * from emp_numbers order by $sort"; // Query everyone break; } //end if } while(0); // Query results $db = mysql_connect($dbhost, $dbuname, $dbpass) or die("Can't connect to server."); mysql_select_db("$dbname", $db) or die("Can't select database."); $result = mysql_query($sql) or die("Bad SQL Statement!brbr$sql"); $nrows = mysql_num_rows($result); if ($nrows == 0) { echo "centerfont size=+2Sorry, no records found.brbra href=\"/\"Home/a/font/center"; } else{ // Display results echo "table width=100% border=0 cellspacing=1 cellpadding=3tr td width=50%Total Found: $nrows/td td width=50% align=\"right\"a href=\"/\"Home/a/td /table table border=0 cellspacing=0 cellpadding=0 width=100% bgcolor=00trtd table width=100% border=0 cellspacing=1 cellpadding=3 tr td colspan=1 bgcolor=CCName/td td bgcolor=CCWork/td td bgcolor=CCHome/td td bgcolor=CCCell/td td bgcolor=CCPager/td td bgcolor=CCDepartment/td /tr tr align=\"left\" valign=\"top\""; while ($myrow = mysql_fetch_row($result)) { if ($sort == "lname" || $sort == "dept"){ printf("td bgcolor=FFdiv align=\"left\"%s, %s/div/td td bgcolor=FF%s/td td bgcolor=FF%s/td td bgcolor=FF%s/td td bgcolor=FF%s/td td bgcolor=FF%s/td /tr\n", $myrow[2], $myrow[3], $myrow[4], $myrow[5], $myrow[6], $myrow[7], $myrow[1]); } else { printf("td bgcolor=FFdiv align=\"left\"%s %s/div/td td bgcolor=FF%s/td td bgcolor=FF%s/td td bgcolor=FF%s/td td bgcolor=FF%s/td td bgcolor=FF%s/td
Re: [PHP] phpMyAdmin
All depends on your host and how phpMyAdmin was configured. It's better to ask them directly... - E Is it possible to use phpMyAdmin to add new databases (not tables whole databases) to my website? I ask because currently my host has provided me with one database and I don't want to mix database tables when adding new features (such as shopping carts and bulletin boards)? I am new to MySQL and PHP so would like some advice, is the way I describe (databases for each website function) a good way to design or should I have all my functions in one large database? Steve Jackson Web Developer Viola Systems Ltd. http://www.violasystems.com [EMAIL PROTECTED] Mobile +358 50 343 5159 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B%-%c%j%"%"%C%W$rL\;X$9$"$J$?$N%J%S%2!<%?!<(B MSN $B="?&!>?&(B http://career.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Site Mirror
Try this Jay, http://us.php.net/mirrors.php (A mirror PLUS a list of mirrors...) - E Can someone give me a URL for a php.net mirror? I am having trouble with access... Thanks! Jay *** * Texas PHP Developers Conf Spring 2003 * * T Bar M Resort Conference Center * * New Braunfels, Texas* * San Antonio Area PHP Developers Group * * Interested? Contact [EMAIL PROTECTED] * *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B:G?7$N%U%!%$%J%s%9>pJs$H%i%$%U%W%i%s$N%"%I%P%$%9(B MSN $B%^%M!<(B http://money.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Call to undefined function mysql_connect()
Help! I am getting the following error message for : ? $link=mysql_connect("localhost","$user","$pass"); // line 34 ? Fatal error: Call to undefined function: mysql_connect() in /home/www/test.somename.org/aux/db-mod.php on line 34 I have used this call successfully on php v4.0.6, and am now trying it on a new install (which someone else did, as I haven't a clue in setting up a server) which is v4.1.1. Is mysql_connect a defunct command, or do I need to do something to enable its use? Perhaps, if you check the manual you'll see if a certain function is already "defunct". Checking mysql_connect() here, http://www.php.net/manual/en/function.mysql-connect.php shows that it's even "better" than before. So, most probably, when the person who set up the server didn't include mysql support in php. It'd be better to ask the person to enable it. BTW, you can do phpinfo() and see if mysql support is enabled or not. (Of course, you also need to check IF MySQL is even installed...) - E Thanks for any help. Hugh _ $B2q0wEPO?$OL5NA!&=<
Re: [PHP] Re: Can someone - anyone see my error?
Just curious... Have you tried it with POSTed variables? As in the case mentioned? Just wondering... Anyway, I'll try it myself later... - E using register_globals=on and trying to echo out the $5400 errors as expected, but php sees the correct entry in the $_GET superglobal array as it should. running a simple foreach($_GET as $key = $val) returns a key of 5400 and a value of 1000 on a page with the querystring of page.php?5400=1000, so you should be able to pull that info into another variable correctly. Jason Reid [EMAIL PROTECTED] -- AC Host Canada www.achost.ca - Original Message - From: "Eric Pignot" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, August 25, 2002 7:24 PM Subject: [PHP] Re: Can someone - anyone see my error? form enctype="multipart/form-data" action="postbit.php" method="post" input type="hidden" name="5400" value="1000" Send this file: input name="userfile" type="file" input type="submit" value="Send File" /form I am not really replying to your question, but just as a remark, in php, a variable needs to start with a letter or and underscire. (must be detailed in the doc) So I have absolutely no idea how PHP will interpret this line : input type="hidden" name="5400" value="1000" (and I would be curious to know how it actually does ! can you tell me ? ) bye Eric -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B%O%$%;%s%9$J>$r5$7Z$K9XF~(B MSN $B%7%g%C%T%s%0(B http://shopping.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Base64 and MS Word cutting and pasting.
I see. It seems like, asking the users to copy from Word to Notepad then to the textarea is not really an option so I guess you really need to find a way how to fix it. How about Manuel Lemos' advice posted earlier? BTW, I was just wondering if you've also considered that the problem might be on the mail client side itself. Because you said that "not all mail clients..." so at least on some it worked. When you said that with Notepad there's no problem, did you mean that ALL mail clients worked as you expected? Also, I wonder what these "pasted text" are. Perhaps, you can give some samples? I don't really think that I can be of so much help but I'm just curious... - E PS Just in case you haven't seen it. I think, there's a related topic discussed in phpbuilder.com. Here's the address: http://www.phpbuilder.com/columns/kartic2807.php3 I've isolated the problem with MS Word and MS Wordpad; The problem does not occur when pasting from Notepad. I want to make sure that all the text is ASCII before converting to MIME encoding. This shoul alleviate the problems that are occuring. Thanks, /dkm - Original Message - From: "@ Edwin" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Saturday, August 24, 2002 6:37 PM Subject: Re: [PHP] Base64 and MS Word cutting and pasting. Just some ideas. First, to check if it's really the pasted text from MS Word that is really causing the problem, paste the text from MS Word to a text editor like "notepad" THEN from "notepad" copy and paste to the textarea and see if the problem is still there. If it's still there, well, that means it's a different problem. Perhaps, it's about the "quotes and apostrophes" that you've mention so it'd be better to check the manual. See addslashes() or stripslashes(). Or, the problem could be something else. But, I don't really think it's because the pasted text is from MS Word... (Pasted text to the textarea should have been already converted...) - E I have an application which uses the textarea tag for users to input data. This works fine. However, some users are using MS Word to generate the text and then cutting and pasting into the textarea. This works fine as well. However, I am encountering a problem when the application mails the submitted content. Everything is viewed fine throught the web. We are MIME encoding the message using base64 functions. The problem is that not all email clients are decoding the MS Word pasted content properly. Quotes and apostrophes are not being decoded properly. I assume the problem is that the MS Word pasted content is not ASCII. I need to convert this content to ASCII before we encode the MIME message. Do you have any ideas? /dkm _ $B%&%#%k%9%a!<%k!"LBOG%a!<%kBP:v$J$i(B MSN Hotmail http://www.hotmail.com/JA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B$+$o$$$/$FL{2w$J%$%i%9%HK~:\(B MSN $B%-%c%i%/%?!<(B http://character.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problems with the safe mode...
I'm not sure but... Check your httpd.conf and see if you're running Apache as "Group -1". Change this to "nobody" or better yet make a new user/group (like apache/apache for example) for your Apache and change the lines- User nobody Group -1 to User apache Group apache Then, restart Apache after making the changes. Also, try chmod(ing) 777 "data.txt" and see what happens... (You can even try changing the owner of "data.txt" itself...) - E Hi everyone... I have some problem with the safe mode of php. i get this errors when i try to access the file. -- PHP Warning: SAFE MODE Restriction in effect. The script whose uid/gid is -1/-1 is not allowed to access data.txt owned by uid/gid 0/0 in /var/www/htdocs/ntfs/cap10/handlefile.php on line 7 PHP Warning: fopen("data.txt", "a+") - No such file or directory in /var/www/htdocs/ntfs/cap10/handlefile.php on line 7 - I don$B%((Bt know why uid-gid = -1/-1 ??. i che the user and permissions more than once and everything is ok. It$B%((Bs seems like php not recognize the permissions of the script but yes recognize well the permissions of the data.txt. Hi read that php 4.2.2 have alpha support for apache 2.0.39/40. is that it? In my winXP configuration (apache 2.0.40 php 4.2.2) have the same problem but, when i switch from isapi mode and run php in the normal mode, recognize the correct file user/group permissions. But in my slack 8.1 conf (apache 2.0.39 php 4.2.2) i dont know what to do... Any Ideas ??? Thanks for your help... Sebastian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B%O%$%;%s%9$J>$r5$7Z$K9XF~(B MSN $B%7%g%C%T%s%0(B http://shopping.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie... - undefined var
Or, perhaps, you should do: (if register_globals off) if (!isset($_GET['vw'])){ echo "variable is not set"; } Of course, you can also do: (if you want to--for some reason) if ($_GET['vw'] == ""){ write this code } - E PS Do all vars in PHP have to be defined first? No. Matt Zur wrote: BUT on the index.php I want to write this if statement: if ($vw == "") { write this code } If you really mean to see if the variable has been set, try this instead: if (!isset($vw)) { echo "variable is not set"; } Happy hacking. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B:G?7$N%U%!%$%J%s%9>pJs$H%i%$%U%W%i%s$N%"%I%P%$%9(B MSN $B%^%M!<(B http://money.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Blank db entry??
I think you can use this: http://www.php.net/manual/en/function.mysql-num-rows.php - E Forgot to add one thing - I don't need to add the new number after detection to the db but rather just print it out "Johnp" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Ok I have a script done but it does not work - If there is no info in the db row I need the script to detect that and enter a number - the problem I am having is that if the row is empty it will return nothing - is there a function or something else that you can use to return true if a db row is completly empty?? Thanks - JohnP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B%&%#%k%9%a!<%k!"LBOG%a!<%kBP:v$J$i(B MSN Hotmail http://www.hotmail.com/JA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP: User Authentication Script
You can insert the line at the very end of your httpd.conf file... I'm sure you can find more info here... http://www.php.net/manual/en/install.windows.php - E Thank you for the reply Farianto. Exactly where in the httpd.conf file should I insert that line? If you could copy and paste the line *above* and *below* in the httpd.conf file that already exists so I know the location I would appreciate it. Thanks again. TR for example: # blahblah1 Load Module PHP4_Module c:/Apache/php/sapi/php4apache.dll // insert this line # blahblah2 .. - Original Message - From: Farianto Kurniawan [EMAIL PROTECTED] To: Anthony Ritter [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, August 26, 2002 10:36 PM Subject: Re: [PHP] PHP: User Authentication Script ...hello .. Mr.Anthony Ritter .. Actually I have faced the same problem with you but right now I can fix it . What you must do is : 1. Turn off your Apache Web Server 2. Edit your httpd.conf file from folder conf under Apache folder. 3. Please add this sentence -- LoadModule php4_module c:/Apache/php/sapi/php4apache.dll -- in it. (the important thing that php4apache.dll is in that directory , if itsn't change it to the right position. 4. Save it 5. Turn Your Apache Web Server on. I hope it can work know... Regards, Farianto.K PT.Yosibara Inti Corpora Phone: 62-21-5267645/46 Indonesia -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B2q0wEPO?$OL5NA!&=<
Re: [PHP] move_uploaded_file problem
There could be a lot of different reasons why. Check the manual again (esp. the user's comments). I'm sure you'll find a lot of ideas. http://www.php.net/manual/en/features.file-upload.php Also, this has been discussed many times recently. I'm sure you'll find a lot too in the archives. :) - E I'm trying to enable my site users to upload pictures (using the move_uploaded_file function) This works fine on my home development machine but 'not' on the deployment server. This is a shared server with 'safe mode' enabled. (The php manual seems to suggest that it should still work despite safe mode but maybe I am misunderstanding something). Any thoughts gratefully received. David Rothe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B:G?7$N%U%!%$%J%s%9>pJs$H%i%$%U%W%i%s$N%"%I%P%$%9(B MSN $B%^%M!<(B http://money.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] using variable ..help
I want my tr bgcolor display with one by one like this below tr bgcolor="#E8D0E8" td/td /tr tr bgcolor="#F8EFF8" td/td /tr Try this: /* -- from here -- */ ?php $mycolor = array("#E8D0E8", "#F8EFF8"); echo "table\n"; foreach ($mycolor as $value) { echo "tr bgcolor=\"$value\"\ntd/td\n/tr\n"; } echo "/table\n"; ? /* -- 'til here -- */ - E PS See: http://www.php.net/manual/en/control-structures.foreach.php I wanna do with my TR bgcolor trough my array ?$mycolor = array("#E8D0E8", "#F8EFF8");? table ?php while ($row=mysql_fetch_array($result)){? tr bgcolor="?for($i=0;$i=count($mycolor[$i]);++$i){ echo ("$mycolor[$i]"); } ?" tdblablabbaba/td /tr ? } ? /table I have look my view source output my TR bgcolor , and i found this below tr bgcolor="#E8D0E8#F8EFF8"" I want my tr bgcolor display with one by one like this below tr bgcolor="#E8D0E8" td/td /tr tr bgcolor="#F8EFF8" td/td /tr etc help please. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B$-$C$H8+$D$+$k$"$J$?$N?75o!!ITF0;:>pJs$O(B MSN $B=;Bp$G(B http://house.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: No Localhost with apache?
Actually, the same thing happens if the ServerName directive was not set. But anyway, even if the default page doesn't show up, http://localhost/some.php would still work... - E --- "Ryan A" [EMAIL PROTECTED] wrote in message 000e01c24e7f$b7bd8820$61d396c1@l2zcaxu7emppqh">news:000e01c24e7f$b7bd8820$61d396c1@l2zcaxu7emppqh... Anyway, I installed PHPTriad first but since the version of php is 4.0.0 I uninstalled it and installed SpaceServer...the problem I noticed with both was I could not get the default page from apache with http://localhost/ I have to use http://127.0.0.1 or it gives me a page not found errorAny idea why? I have tried using it with the port numbers of :80 and :8080 without any luck..I need it to display the pages using "localhost" as some programs are configured that way... --- What is the value of "ServerName" in your httpd.conf file? I'm guessing that it's "127.0.0.1". If so, just change it to "localhost" and restart Apache. --- Seairth Jacobs [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B:G?7$N%U%!%$%J%s%9>pJs$H%i%$%U%W%i%s$N%"%I%P%$%9(B MSN $B%^%M!<(B http://money.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: No Localhost with apache?
First, my mistake: "localhost" still works even if ServerName directive wasn't set... (More below) Hey, Thank you for replying... You're welcome :) I checked the httpd.conf file and this is what I saw ServerName localhost ServerName 212.92.**.*** Perhaps you can try taking one out and restart Apache then test again? (The stars are numbers of course but I put them there to protect myself from evil genus's on the list :-) ) If there are "evil genus's" on the list, I'm sure they can find out what those stars mean : I have no idea what the second line is forapache still only responds to 127.0.0.1 Any new ideas? Maybe you should ask the Apache ml... Cheers, -Ryan - Original Message - From: "@ Edwin" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, August 28, 2002 7:00 PM Subject: Re: [PHP] Re: No Localhost with apache? Actually, the same thing happens if the ServerName directive was not set. But anyway, even if the default page doesn't show up, http://localhost/some.php would still work... - E --- "Ryan A" [EMAIL PROTECTED] wrote in message 000e01c24e7f$b7bd8820$61d396c1@l2zcaxu7emppqh">news:000e01c24e7f$b7bd8820$61d396c1@l2zcaxu7emppqh... Anyway, I installed PHPTriad first but since the version of php is 4.0.0 I uninstalled it and installed SpaceServer...the problem I noticed with both was I could not get the default page from apache with http://localhost/ I have to use http://127.0.0.1 or it gives me a page not found errorAny idea why? I have tried using it with the port numbers of :80 and :8080 without any luck..I need it to display the pages using "localhost" as some programs are configured that way... --- What is the value of "ServerName" in your httpd.conf file? I'm guessing that it's "127.0.0.1". If so, just change it to "localhost" and restart Apache. --- Seairth Jacobs [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B:G?7$N%U%!%$%J%s%9>pJs$H%i%$%U%W%i%s$N%"%I%P%$%9(B MSN $B%^%M!<(B http://money.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B$+$o$$$/$FL{2w$J%$%i%9%HK~:\(B MSN $B%-%c%i%/%?!<(B http://character.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Building a query on multiple variables, how to test for which variable
There must be a better way how to do it but this is what I would do: (Not tested--just the "idea"...) Instead of $var1, $var2... I'd use an array for the drop downs thus, $var[] $var[] $var[] $var[] Then, check if any is set, then... anyway, this is how it goes: // from here $query = "SELECT foo "; $query .= "FROM bar"; if (isset($_POST['var']){ // if POSTed $its_set = 1; // my super "switch" foreach ($var as $key = $value){ if ($its_set == 1){ $query .= " WHERE thus = '" . $value . "'"; $its_set = 2; // just to make sure "WHERE" is only added once } else { $query .= " AND thus = '" . $value . "'"; } } } HTH, -E So these 4 variables walk into a bar :^] I have a form with 4 drop downs. Each of these drop downs might have a value and there is no order in which they might have a value. A query needs to built (the WHERE and AND portions) that takes into account which ever variables have been set. A user may choose a variable that would not be in the first location. $var1 = is not set $var2 = is set $var3 = is set $var4 = is not set (or any other combination) The query, of course, needs to be in order taking into account the above example; $query = "SELECT foo "; $query .= "FROM bar "; $query .= "WHERE thus = '" . $var2 . "' "; $query .= "AND thus = '" . $var3 . "' "; If three of the variables are set then there would need to be an additional AND statement, etc. It would be foolhardy to construct an if or case statement that would take into account each possible combination. I have been thinking this through for an hour or so, but I am not seeing a clear, elegant, and efficient piece of code. Has anyone done anything like this, or does anyone have an idea of how this might be done? TIA! Jay * * Texas PHP Developers Conf Spring 2003* * T Bar M Resort Conference Center* * New Braunfels, Texas * * Contact [EMAIL PROTECTED] * * * * Want to present a paper or workshop? Contact now! * * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B%&%#%k%9%a!<%k!"LBOG%a!<%kBP:v$J$i(B MSN Hotmail http://www.hotmail.com/JA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sprintf() question
Experiment a bit and I'm sure you'll find it easy. One example, change this portion $formatted = sprintf("%01.2f", $money); to $formatted = sprintf("%01.3f", $money); then see how it works... ?php $money1 = 68.75; $money2 = 54.35; $money = $money1 + $money2; echo "This is money: $money"; $formatted = sprintf("%01.3f", $money); echo "This is formatted: $formatted"; ? HTH, - E I read the manual page on sprintf, but I still don't understand exactly how the format string works. $money1 = 68.75; $money2 = 54.35; $money = $money1 + $money2; // echo $money will output "123.1"; $formatted = sprintf("%01.2f", $money); // echo $formatted will output "123.10" How does that work? What part of the string corresponds to what? Thanks for any and all help! _ $B%-%c%j%"%"%C%W$rL\;X$9$"$J$?$N%J%S%2!<%?!<(B MSN $B="?&!>?&(B http://career.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Print page
Hi, I'm using PHP to generate some report for printing. But when I print report from IE 5.0 browser, in the bottom of page IE prints URL of page. Can I remove it ? Yes. Click on "File" - "Page settings..." then find "Footer" and you'll see something like this: ubd Take away the "u", print again (or preview) and see what happens. Check help F1 for more info... - E Thanks, Rosen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B%&%#%k%9%a!<%k!"LBOG%a!<%kBP:v$J$i(B MSN Hotmail http://www.hotmail.com/JA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Building a query on multiple variables, how to test for which variable
Does this fit your idea of a "more elegant solution"? This is just an enhanced and tested version of the one I posted earlier (somehow I had time and was curious about it). ?php if (isset($_POST['var'])){ // if POSTed // initial query // make sure "WHERE" not included when none is selected $qpon = "SELECT BillDate, StateInd, BAN, Type, PON, Phrase,"; $qpon .= " PhraseLine1, USOC, Description, RateZone, Rate"; $qpon .= " FROM tblUSOCChargesDetail"; $its_set = 1; // my super "switch" foreach ($_POST['var'] as $key = $value){ // walk if ($value != 0){ // make sure the "--- Select ---" is not included if ($its_set == 1){ $qpon .= " WHERE USOC = '" . $value . "'"; $its_set = 2; // just to make sure "WHERE" is only added once } else { $qpon .= " AND USOC = '" . $value . "'"; } } } // end of foreach } $qpon .= " ORDER BY BillDate"; echo "$qpon"; // Check the generated query ? And this is what I used for testing: // html headers here form action="testpulldown.php" method="post" First option select name="var[]" option value="0"--- Select ---/option option value="1a"1a/option option value="1b"1b/option option value="1c"1c/option /select br / Second option select name="var[]" option value="0"--- Select ---/option option value="2a"2a/option option value="2b"2b/option option value="2c"2c/option /select br / Third option select name="var[]" option value="0"--- Select ---/option option value="3a"3a/option option value="3b"3b/option option value="3c"3c/option /select br / Fourth option select name="var[]" option value="0"--- Select ---/option option value="4a"4a/option option value="4b"4b/option option value="4c"4c/option /select br / input type="submit" name="submit" value="Submit" / /form // end of html Put them in the same file and name the file "testpulldown.php". (Of course, you know...) The "beauty", I thought is, the query would still work even though none of the "pull-downs" were selected--of course, I don't how much data will be shown... NOTE: You can even have MORE pull-downs with this kind of approach. (...and less code...) BTW, who is "Todd"? I didn't see his post... Just curious... - E Todd came in with a good suggestion which I had started towards, so this is what I have arrived at for the moment. I will be looking to make this more elegant soon, but since they are screaming for the report now this is what I did; ?php if($usoc1 "--- Select ---"){ $usoc[] = $usoc1; } if($usoc2 "--- Select ---"){ $usoc[] = $usoc2; } if($usoc3 "--- Select ---"){ $usoc[] = $usoc3; } if($usoc4 "--- Select ---"){ $usoc[] = $usoc4; } $usoc_count = count($usoc); // query details $qpon = "SELECT BillDate, StateInd, BAN, Type, PON, Phrase, PhraseLine1, USOC, Description, RateZone, Rate "; $qpon .= "FROM tblUSOCChargesDetail WHERE "; $first = 0; for($i = 0; $i $usoc_count; $i++){ if($first == 0){ $qpon .= "USOC = '" . $usoc[$i] . "' "; $first = 1; } else { $qpon .= "AND USOC = '" . $usoc[$i] . "' "; } } $qpon .= "ORDER BY BillDate "; if(!($dbpon = mysql_query($qpon, $dbconnect))){ print("MySQL reports: " . mysql_error() . "\n"); exit(); } ? I am sure that there is a more elegant solution, if I find it I will let you know. Thanks! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B$+$o$$$/$FL{2w$J%$%i%9%HK~:\(B MSN $B%-%c%i%/%?!<(B http://character.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] subject in big5 characters of an email can't be read in Lotus Notes
I'm not sure if this will help but using mb_send_mail() instead of mail() solved the problems I had with Japanese characters... However, it might be the mail client itself. Check if they had no problem before (when they received similar e-mails from other sources). - E I have sent an email using mail function in which the subject and email body have charset=big5. Customers with outlook express can read the big5 chinese characters without any trouble. However, people who read their emails from Lotus Notes complain that they cannot read the subject. But, they can read the email body because I have set charset in the header: $mailHeader="From: [EMAIL PROTECTED]\r\nContent-type: text/plain; charset=big5\r\n" ; My mail statement looks like the following: mail($mailTo, $mailSubject, $mailBody, $mailHeader) ; where $mailSubject and $mailBody are both big5 char. Is there a way I can set $mailSubject charset=big5? Thanks for your help Ellen __ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B$-$C$H8+$D$+$k$"$J$?$N?75o!!ITF0;:>pJs$O(B MSN $B=;Bp$G(B http://house.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Average Number For Math Functions
I am still very new to PHP so things are still a little foreign to me - what exactly is the SUM finction - I tried to locate one on both the PHP and MySQL site but found nothing! http://www.mysql.com/doc/en/Group_by_functions.html#IDX1364 Well, it's close to "nothing" but if you study how the others are use, you'll get the idea how to use it as well... - E _ $B:G?7$N%U%!%$%J%s%9>pJs$H%i%$%U%W%i%s$N%"%I%P%$%9(B MSN $B%^%M!<(B http://money.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Reading from a file using fgets()
Or, is it? :) http://www.php.net/manual/en/function.file.php - E Interesting. It's not documented. On Thu, 2002-08-29 at 14:44, Dallas Thunder wrote: Well, this is exactly what function file() does. "David Christensen" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... When PHP reads from a file using fgets(), does it do it in order? Meaning, when reading STDIN from a file, does it read line1, then line2, line3, and so on until EOF? My purpose is to read each line of file and push it into an array. Thanks for your help, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B:G?7$N%U%!%$%J%s%9>pJs$H%i%$%U%W%i%s$N%"%I%P%$%9(B MSN $B%^%M!<(B http://money.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Reading from a file using fgets()
I see what you mean. But, personally, if the documentation didn't explicitly say anything about it, I'd assume that it's from top to bottom and that there's no option--of course, I could be wrong you know, there must be something hidden... - E Ok, file() is docuemted, but it doesn't say anything about whether or not it reads data sequentially from top to bottom or if there's an option to read bottom to top or anything in between. Dave On Thu, 2002-08-29 at 22:37, @ Edwin wrote: Or, is it? :) http://www.php.net/manual/en/function.file.php - E Interesting. It's not documented. On Thu, 2002-08-29 at 14:44, Dallas Thunder wrote: Well, this is exactly what function file() does. "David Christensen" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... When PHP reads from a file using fgets(), does it do it in order? Meaning, when reading STDIN from a file, does it read line1, then line2, line3, and so on until EOF? My purpose is to read each line of file and push it into an array. Thanks for your help, Dave _ $B%-%c%j%"%"%C%W$rL\;X$9$"$J$?$N%J%S%2!<%?!<(B MSN $B="?&!>?&(B http://career.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dumb Question
My "dumb" answer :) Try Google. Type: "procedural code" You might want to check, "object-oriented" as well... I'm sure, you'll find helpful explanations... - E And I feel foolish asking... What is meant by 'procedural code' ??? -- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B2q0wEPO?$OL5NA!&=<
Re: [PHP] alter switch variable inside case?
Actually, you can--just don't "break;". Try it. - E I'd like to be able to modify the switch variable inside a case statement, like this: switch ($foo) { case 'step2': do_step2(); if ($error) $foo='step1'; //repeat step1 break; case 'step1': do_step1(); break; case 'a_third_thing': do_something_else(); break; } Can you modify the variable ($foo) inside a case statement and have it evaluated for subsequent 'case's like this? If not, I will have to revert to a series of if statements, in which this can be done: if ($foo=='step2') { do_step2(); if ($error) $foo='step1'; } if ($foo=='step1') { do_step1(); } etc. Switch-case seems cleaner, and I'd prefer to stick with it. __ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B$+$o$$$/$FL{2w$J%$%i%9%HK~:\(B MSN $B%-%c%i%/%?!<(B http://character.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] alter switch variable inside case?
Well, you don't have to take away all the "break;". :) For example, only here: switch ($foo) { case 'step2': do_step2(); if ($error) $foo='step1'; //repeat step1 break; - E If you don't break, it continues to execute all the code until the end of the switch, ignoring any subsequent case statements. In my example, eliminating the break after step2 would cause execution of do_step1(), but also do_something_else(), which is not desired. --- "@ Edwin" [EMAIL PROTECTED] wrote: Actually, you can--just don't "break;". Try it. - E I'd like to be able to modify the switch variable inside a case statement, like this: switch ($foo) { case 'step2': do_step2(); if ($error) $foo='step1'; //repeat step1 break; case 'step1': do_step1(); break; case 'a_third_thing': do_something_else(); break; } Can you modify the variable ($foo) inside a case statement and have it evaluated for subsequent 'case's like this? If not, I will have to revert to a series of if statements, in which this can be done: if ($foo=='step2') { do_step2(); if ($error) $foo='step1'; } if ($foo=='step1') { do_step1(); } etc. Switch-case seems cleaner, and I'd prefer to stick with it. __ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B!"%)!"!&!"!"%C!"%K%U{v(B#58759;$B%O!&!"!'%1!&%M%R(B#63730;$B%3%o(B MSN $B!&%e!'r'%C!&%=!#%7(B http://character.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B2q0wEPO?$OL5NA!&=<<B$7$?=PIJ%"%$%F%`$J$i(B MSN $B%*!<%/%7%g%s(B http://auction.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dumb Question
Google didn't have much to offer. Sorry 'bout that. Actually, if you have an idea of what OO ("object-oriented") is, I think I can say that "procedural" is just the opposite of it. I tried Google myself and this came out on top: "Writing Procedural Code in Non-Procedural SQL" There's a short explanation but I think it's enough to give you some hint about "procedural code". - E But if I should also check 'object-oriented' then I believe it deals with classes. I thought it was something else. Just trying to figure out if phpdoc is for me, which it seems like its not :( Thanks :) @ Edwin wrote: My "dumb" answer :) Try Google. Type: "procedural code" You might want to check, "object-oriented" as well... I'm sure, you'll find helpful explanations... - E And I feel foolish asking... What is meant by 'procedural code' ??? -- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B2q0wEPO?$OL5NA!&=<<B$7$?=PIJ%"%$%F%`$J$i(B MSN $B%*!<%/%7%g%s(B http://auction.msn.co.jp/ -- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/ _ $B$+$o$$$/$FL{2w$J%$%i%9%HK~:\(B MSN $B%-%c%i%/%?!<(B http://character.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] alter switch variable inside case?
It seems like you can do something like this: switch ($foo) { case 'a': if (do_a()) echo "a was done"; else print_menu(); // changes here break; case 'b': if (do_b()) echo "b was done"; else print_menu(); // changes here break; case 'menu': print_menu(); break; case 'logout': do_logout(); break; } Or, if for some reason you can't do that (or you don't want to)... Here's another way: (I'm not sure if this will work.) switch ($foo) { case 'a': if (do_a()) echo "a was done"; else $foo='menu'; case 'menu': print_menu(); break; case 'b': if (do_b()) echo "b was done"; else $foo='menu'; case 'menu': print_menu(); break; case 'logout': do_logout(); break; } It doesn't look "clean" but it might just work... BTW, I know this is just an example, but I expect you're doing your if(){ } else { } properly in your real code... - E Regardless of how many break statements you take away (even if only 1), case statements appear to be ignored after the first match is made. I need a way to make the switch statement continue evaluating case-matches, even after the first case match is made. Further, it should allow one case segment to alter the switch variable and have such alteration taken into account for subsequent matches. Here's a more illustrative example of my situation: switch ($foo) { case 'a': if (do_a()) echo "a was done"; else $foo='menu'; break; case 'b': if (do_b()) echo "b was done"; else $foo='menu'; break; case 'menu': print_menu(); break; case 'logout': do_logout(); break; } that code will not print_menu if do_a fails, since it exits the switch statement upon seeing a break. if I remove the break after do_a, it will execute do_a and do_b -- bad. what we really want is for it to execute do_a and if do_a returns false, print_menu. Joe --- "@ Edwin" [EMAIL PROTECTED] wrote: Well, you don't have to take away all the "break;". :) For example, only here: switch ($foo) { case 'step2': do_step2(); if ($error) $foo='step1'; //repeat step1 break; - E If you don't break, it continues to execute all the code until the end of the switch, ignoring any subsequent case statements. In my example, eliminating the break after step2 would cause execution of do_step1(), but also do_something_else(), which is not desired. --- "@ Edwin" [EMAIL PROTECTED] wrote: Actually, you can--just don't "break;". Try it. - E I'd like to be able to modify the switch variable inside a case statement, like this: switch ($foo) { case 'step2': do_step2(); if ($error) $foo='step1'; //repeat step1 break; case 'step1': do_step1(); break; case 'a_third_thing': do_something_else(); break; } Can you modify the variable ($foo) inside a case statement and have it evaluated for subsequent 'case's like this? If not, I will have to revert to a series of if statements, in which this can be done: if ($foo=='step2') { do_step2(); if ($error) $foo='step1'; } if ($foo=='step1') { do_step1(); } etc. Switch-case seems cleaner, and I'd prefer to stick with it. __ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B!#!V!&%%!#!V!#%r!#!V!#!V!&%F!#!V!&%R!&%f|\(B#58759;$B!&%^!#%r!#!V!#%r(B#57822;$B!&%"!#%r!&%X!&%a(B#63730;$B!&%&!&!&(B MSN $B!#%r!#%rl)(B#57822;$B!&%F!#%r!&%9!#!W!&%-(B http://character.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B%$(B#57643;#58792;$B%_%^%=!"%^%U%*%[%A!#%r%9%7%7%D!"%-!"%=%9%_%N%O!&!V!&!"!&%K!&`&%O!"!&(BMSN $B!&%'!#%7!&%C!&%-!'!&(B http://auction.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: alter switch variable inside case?
I'm not sure if you've already tried the idea I posted earlier. Anyway, I tried it myself and it works! (At least with this simple example...) !-- whatevername.php -- ?php echo 'myvar BEFORE the switch : ' . $_GET['myvar']; echo 'hr /'; switch ($_GET['myvar']){ case 1: $_GET['myvar'] = 2; case 2: echo "Hello!br /"; break; case 3: $_GET['myvar'] = 4; case 4: echo "Hello again!br /"; break; } echo 'hr /'; echo 'myvar AFTER the switch : ' . $_GET['myvar']; ? !-- end of whatevername.php -- Try it. For example, http://www.your_domain_name.com/whatevername.php?myvar=1 will change myvar to 2 and will echo "Hello!" (without executing the other "cases"). Then, http://www.your_domain_name.com/whatevername.php?myvar=3 will change myvar to 4 and will echo "Hello again!". As you can see, the key is using "break" ONLY in places you want to "break"... So, setting the variable in the first (or third) case CAN "cause execution of the second [or fourth] case segment". - E Could you elaborate? In the example I posted, setting foo=step1 in the first case segment does NOT cause execution of the second case segment, as would be the case if it was actually re-evaluating the match upon subsequent case statements. --- CHAILLAN Nicolas [EMAIL PROTECTED] wrote: Yes you can. -- Merci de nous avoir choisi. - Thanks you for your choice. Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] [EMAIL PROTECTED] www.GroupAKT.com - H$BqC(Bergement Group. www.WorldAKT.com - H$BqC(Bergement de sites Internet "Joe Janitor" [EMAIL PROTECTED] a $BqD(Brit dans le message de news: [EMAIL PROTECTED] I'd like to be able to modify the switch variable inside a case statement, like this: switch ($foo) { case 'step2': do_step2(); if ($error) $foo='step1'; //repeat step1 break; case 'step1': do_step1(); break; case 'a_third_thing': do_something_else(); break; } Can you modify the variable ($foo) inside a case statement and have it evaluated for subsequent 'case's like this? If not, I will have to revert to a series of if statements, in which this can be done: if ($foo=='step2') { do_step2(); if ($error) $foo='step1'; } if ($foo=='step1') { do_step1(); } etc. Switch-case seems cleaner, and I'd prefer to stick with it. __ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B%O%$%;%s%9$J>$r5$7Z$K9XF~(B MSN $B%7%g%C%T%s%0(B http://shopping.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Safe mode? newbie alert!
Try the "mothership" again and type php and "safe mode" Click "Search". The first two results: http://www.dynamic-webpages.de/php/features.safe-mode.php http://info.ccone.at/INFO/PHP4/features.safe-mode.html You can read only ONE so as not to get more confused... :) - E PS Of course, you can the info here as well: http://www.php.net/manual/en/features.safe-mode.php Hi Everyone, I have a small question and just need some general direction, tried the mothership(google) but got too many results and got more confused. What is safe mode? If you have any URL or file that can explain it kindly give it to me... cheers and thanks again, -Ryan. _ $B$+$o$$$/$FL{2w$J%$%i%9%HK~:\(B MSN $B%-%c%i%/%?!<(B http://character.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] contact list re-ordering (php/mySQL CMS design)
I'm not sure if what you mean is something like this: Say, you have a table with 2 columns (1) id and (2) contact. And your table is populated in this way: id contact 1 a 2 b 3 c 4 d 5 e And, let's say that your id is auto_incremented. Also, the contacts are shown ORDER BY id DESC. So, each time you add a new one, it shows up on the top of the list. So, what if you want a contact to show up between id 3 and 4? Well, what I'd do is (1) NOT auto_increment the id field and (2) manually increment the id by, say, 10 or 100. In other words, my table would probably look something like this: id contact 100 a 200 b 300 c 400 d 500 e So, if I want to make one contact show up between 300 and 400, I'll just add the contact with an id of, say, 350. This way, I wouldn't even need a show_pos field. Besides, I wouldn't even bother changing the show_pos for the other records. :) Of course, there must be a more elegant way of doing this. (Actually, I'm not really sure if I really understand your problem... Still, HTH...) - E Dear guru's, Hit a problem while developing a CMS with php/mySQL. Part of this is a contact list and this works ok (add/edit/delete with insert/update/delete queries). Now the client has requested a new feature: ability to change the order in which the contacts are being presented in the public part of this CMS (don't ask me why). I've added a field 'show_pos' to the contacts table and am able to change its value when I edit an existing record or add a new one. What I can't wrap my head around at the moment is how one deals with updating 'show_pos' for the OTHER records (while editing/deleting present record (WHERE id='$id')? Could anyone give me some pointers as to how this could be done in php and/or SQL (preferable). I sure hope anyone understands what I mean ... Cheers! newbie@a_loss -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: file include relative file addressing.
??? I thought you said "my.inc.php" but you're including "my.php". This one should work: include_once "../include/blah/my.inc.php"; // filename is my.inc.php - E "Nelr" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... From the root of a website: / I had a file called /my.php which included a file /include/blah/my.inc.php In my.php if I put the include_once( "./include/blah/my.inc.php" ); it works fine when my.php is in the root of the site. If I move /my.php to /blah/my.php, no matter how I address ../include/blah/my.php or /include/blah/my.php I keep getting path errors. How do I get around this problem using only relative paths (no absolute or placing in an include path) Neil. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: file include relative file addressing.
??? I thought you said "my.inc.php" but you're including "my.php". This one should work: include_once "../include/blah/my.inc.php"; // filename is my.inc.php - E "Nelr" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... From the root of a website: / I had a file called /my.php which included a file /include/blah/my.inc.php In my.php if I put the include_once( "./include/blah/my.inc.php" ); it works fine when my.php is in the root of the site. If I move /my.php to /blah/my.php, no matter how I address ../include/blah/my.php or /include/blah/my.php I keep getting path errors. How do I get around this problem using only relative paths (no absolute or placing in an include path) Neil. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: file include relative file addressing.
??? I thought you said "my.inc.php" but you're including "my.php". This one should work: include_once "../include/blah/my.inc.php"; // filename is my.inc.php - E "Nelr" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... From the root of a website: / I had a file called /my.php which included a file /include/blah/my.inc.php In my.php if I put the include_once( "./include/blah/my.inc.php" ); it works fine when my.php is in the root of the site. If I move /my.php to /blah/my.php, no matter how I address ../include/blah/my.php or /include/blah/my.php I keep getting path errors. How do I get around this problem using only relative paths (no absolute or placing in an include path) Neil. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: POST form variables not being sent to destination page
Hi there, I don't really see any "serious" problem in your code except that your opening body tag is in the wrong place :). Since I don't have php/apache running on my XP I cannot really tell if this is an installation problem. Anyway, I have php/apache (4.2.2/1.3.26) on Linux and (4.2.2/2.0.40) on Windows 2000 Pro. Your code works whether it's GET or POST. So, one thing that you might want to try is to install the latest version of PHP. Esp., as the php.net site says that the latest version (4.2.3) is "recommended update for all users of PHP, and Windows users in particular ". Also, you may want to check previous posts regarding 4.2.2/2.0.40 combination--doesn't look so stable on XP(?)... - E "Howard Roscoe" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi all, I'm assuming this is an installation error, hence the posting to this group. I've got an html form but when I use the POST method the form variables don't make it to the destination page, when I use the GET method, there's no problem. I've uploaded the test pages to our web servers and the POST and GET methods both work fine, therefore I'm assuming it's a problem with my installation, which is; PHP 4.2.2 Apache 2.0.40 on Windows XP Pro with as many MS patches as I can find !!. I've tried this with and without the register_globals, I've also tried setting the "always_populate_raw_post_data" to on by way of a stab in the dark. The only thing I can think of is something to do with the Apache configuration, but I can't find anythnin in there re this. The test PHP is; Form Page: html head titleUntitled Document/title meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /head form action="b.php" method=post name="bb" input name="aa" type="text" value="12" size="10"br input name="a1" type="submit" /form body /body /html Target Page: html head titleUntitled Document/title meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /head ?php echo "POSTED :".$_POST["aa"]."br"; echo "GET :".$_GET["aa"]."br"; ? body /body /html Any help / pointers will be much appreciated as this is starting to drive me nuts. Thanks, Howard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] POST form variables not being sent to destination page
Hi there, I don't really see any "serious" problem in your code except that your opening body tag is in the wrong place :). Since I don't have php/apache running on my XP I cannot really tell if this is an installation problem. Anyway, I have php/apache (4.2.2/1.3.26) on Linux and (4.2.2/2.0.40) on Windows 2000 Pro. Your code works whether it's GET or POST. So, one thing that you might want to try is to install the latest version of PHP. Esp., as the php.net site says that the latest version (4.2.3) is "recommended update for all users of PHP, and Windows users in particular ". Also, you may want to check previous posts regarding 4.2.2/2.0.40 combination--doesn't look so stable on XP(?)... - E "Howard Roscoe" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi all, I'm assuming this is an installation error, hence the posting to this group. I've got an html form but when I use the POST method the form variables don't make it to the destination page, when I use the GET method, there's no problem. I've uploaded the test pages to our web servers and the POST and GET methods both work fine, therefore I'm assuming it's a problem with my installation, which is; PHP 4.2.2 Apache 2.0.40 on Windows XP Pro with as many MS patches as I can find !!. I've tried this with and without the register_globals, I've also tried setting the "always_populate_raw_post_data" to on by way of a stab in the dark. The only thing I can think of is something to do with the Apache configuration, but I can't find anythnin in there re this. The test PHP is; Form Page: html head titleUntitled Document/title meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /head form action="b.php" method=post name="bb" input name="aa" type="text" value="12" size="10"br input name="a1" type="submit" /form body /body /html Target Page: html head titleUntitled Document/title meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /head ?php echo "POSTED :".$_POST["aa"]."br"; echo "GET :".$_GET["aa"]."br"; ? body /body /html Any help / pointers will be much appreciated as this is starting to drive me nuts. Thanks, Howard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B%-%c%j%"%"%C%W$rL\;X$9$"$J$?$N%J%S%2!<%?!<(B MSN $B="?&!>?&(B http://career.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session problem
I think this one worked because if($count ==1){ $user_data = mysql_fetch_row($user_res); $user_id = $user_data[0]; // --- of this if(!session_is_registered(user_id)) session_register(user_id); if(!session_is_registered(username)) session_register(username); if(!session_is_registered(password)) session_register(password); $ok = 2; } The way you did here is kind of different from the above. else{ $data = mysql_fetch_row($data_res); if(!session_is_registered(data)) session_register(data); // [trouble*] } }//E-OF get_data($user_id) The $data array is definatly an array as I have done foreach echo tests and it dumps the information i am needing. but it won't put it in the session. *The reason _I think_ is because: quoted Note: It is not currently possible to register resource variables in a session. For example, you can not create a connection to a database and store the connection id as a session variable and expect the connection to still be valid the next time the session is restored. PHP functions that return a resource are identified by having a return type of resource in their function definitions. A list of functions that return resources are available in the resource types appendix. /quoted from here: http://www.php.net/manual/en/function.session-register.php - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help with installation
Of course, you restarted Apache? Also, try leaving this out --- IfDefine PHP4/IfDefine and just write LoadModule php4_moduleextramodules/libphp4.so (Applies to AddModule as well...) And make sure that the extramodules folder does exists! - E On Monday, September 09, 2002 11:43 PM R'twick Niceorgaw wrote: I'm sorry. but that's what I have in the config file. I just wrote it wronge here. Here's my complete php related configuration IfDefine PHP4 LoadModule php4_moduleextramodules/libphp4.so /IfDefine IfDefine PHP4 AddModule mod_php4.c /IfDefine AddType aplication/x-httpd-php .php AddType application/x-httpd-php-source .phps /snip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] BUG?: header(location: ) causes GET vars to be encoded in wrong charset in IE5.5
Hello, On Tuesday, September 10, 2002 1:52 PM Jean-Christian Imbeault wrote: snip The problem is that the POST variables are coming in EUC-JP (japanese) correctly but for some reason IE re-encodes the variable into some other charset (SJIS I am guessing) when requesting the new page sent in the Header(location: ) ... /snip I just wonder how do you know that the POST variable are in EUC-JP. Did you set this in your ini? Or, did you encode your php files in EUC-JP and you have the directive inside meta tags? I think you may want to play with these settings: mbstring.internal_encoding mbstring.http_input mbstring.http_output mbstring.detect_order Or, you can try the Multi-Byte String Functions ( http://jp2.php.net/manual/en/ref.mbstring.php ) to convert from one encoding to another. Just experiment a bit... still if nothing works, perhaps, we can try something again later... - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] BUG?: header(location: ) causes GET vars to be encoded in wrong charset in IE5.5
And by the way, please check the NOTE: on http://jp2.php.net/manual/en/function.header.php for the use of header(). Something's missing in the way you used it--perhaps, this is causing the problem... - E quoted Note: HTTP/1.1 requires an absolute URI as argument to Location: including the scheme, hostname and absolute path, but some clients accept relative URIs. You can usually use $_SERVER['HTTP_HOST'], $_SERVER['PHP_SELF'] and dirname() to make an absolute URI from a relative one yourself: header(Location: http://.$_SERVER['HTTP_HOST'] .dirname($_SERVER['PHP_SELF']) ./.$relative_url); /quoted On Tuesday, September 10, 2002 3:15 PM Hello, On Tuesday, September 10, 2002 1:52 PM Jean-Christian Imbeault wrote: snip The problem is that the POST variables are coming in EUC-JP (japanese) correctly but for some reason IE re-encodes the variable into some other charset (SJIS I am guessing) when requesting the new page sent in the Header(location: ) ... /snip I just wonder how do you know that the POST variable are in EUC-JP. Did you set this in your ini? Or, did you encode your php files in EUC-JP and you have the directive inside meta tags? I think you may want to play with these settings: mbstring.internal_encoding mbstring.http_input mbstring.http_output mbstring.detect_order Or, you can try the Multi-Byte String Functions ( http://jp2.php.net/manual/en/ref.mbstring.php ) to convert from one encoding to another. Just experiment a bit... still if nothing works, perhaps, we can try something again later... - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Best Practice
Hi there, On Sunday, September 22, 2002 12:20 PM Subject: Re: [PHP] Best Practice Peter J. Schoenster wrote: snip On 21 Sep 2002 at 12:51, Ashley M. Kirchner wrote: I'm working on converting several static (price) pages on our site into dynamic pages, with the data stored in an MySQL database and PHP to pull the data out, with CSS to build the page and present it. I don't see how CSS would build anything, I guess it's just terminology. /snip Actually, in a sense, CSS can "build" a page--esp. if "build" means how data are to be presented (formatted) by the browser. Remember, with CSS you can hide and unhide elements? For the original question... At the same time, I would also like to have a 'printer friendly' link on each page that visitors can click on and get the same page re-rendered for easy printing. What's the best way to get the data converted from one form to another? Should I be querying the database again to get the same data to reformat? Should I store the data in sessions and reformat based on the CSS? I would think having to query twice for the same thing would be a degradation in performance, right? So what's the best practice? The best practice, IMHO, is the one implemented here: http://www.alistapart.com/ Try the page with your standard-compliant browser (like N7) and with a (crappy) browser like N4 and see the difference. You can "dissect" the site and find out how they did it. Or, you can read articles like this: http://www.alistapart.com/stories/netscape/ And one for "easy printing": http://www.alistapart.com/stories/goingtoprint/ - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Design question.
(Sorry if I've already sent this.) I agree. But, I don't really see any problem having *.inc files as *.inc.php (so that they'll be executed by Apache) esp. IF the config file have only this: (Even if this is executed nothing shows up...) ?php $my_super_user = 'blahblah'; $my_super_password = 'blahblahblah'; ? I just thought this is worth knowing esp. if there's no way you can use .htaccess. (Of course, if you can't use .htaccess, you might want to change ISPs or set up your own server but that is for a different topic :) - E This explanation from Justin is worth saving. I also like to call all of my included modules *.inc, and I prefer to store them outside of document root. However, if you want to keep all of your files together, the .htaccess file shown below is the best way to restrict direct access to modules. Some people make the mistake of simply making *.inc files considered PHP by Apache (claiming it is better to execute them than to have their source code displayed), but this gives attackers the opportunity to execute your modules out of context - a very dangerous approach. One extra note worth adding is that you should add this configuration to your httpd.conf if you are the Web server administrator. This will keep you from having to remember the .htaccess file everywhere. Justin's method is best for when you do not have this option. Chris Justin French wrote: I place name all my included files *.inc... I place them all in a folder /inc/ and place a .htaccess file in that directory to restrict the files being served of HTTP: Files ~ \.inc$ Order Allow,Deny Deny from all /Files Another option would be to place them in a folder ABOVE your web root, so that Apache can't serve them -- if you have that option. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file uploads problem
Just a comment... On Tuesday, September 24, 2002 1:39 PM Jaski wrote: snip I tried to copy this file using move_uploaded_file($userfile, "/place/to/put/uploaded/file"); and here a strange thing happened. The file was successfully copied BUT it had permissions like -rw-- which I interpret as only accessible to root. I tried copy() function instead and it failed. ...having that "permission" doesn't necessarily mean that it's only accessible to root--unless of course you're running Apache as root, which I doubt you'd do. Anyway, if the file was successfully copied why not just try to open it there? - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re: [PHP] file uploads problem
Jaski, On Tuesday, September 24, 2002 5:07 PM Jaski wrote: No Edwin .. I can't do any thing to that file .. not even from my ftp client .. can't download can't change permissions .. I think you won't be able to do anything with the file IF you use your ftp client. The reason is because *you* don't own the file so you can't read it nor change it's permissions. Your *script(s)* owns the file so most probably if you use another script to read and change the permissions, the script would be able to do it. In other words, use your php script to read and change the permissions. Perhaps, you'd like to play with these functions and see what's happening... http://www.php.net/manual/en/function.is-readable.php http://www.php.net/manual/en/function.fileperms.php http://www.php.net/manual/en/function.chown.php Of course, there's a lot more others under http://www.php.net/manual/en/ref.filesystem.php HTH, - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re: [PHP] file uploads problem
Oops, what I wanted to post was http://www.php.net/manual/en/function.chmod.php and not http://www.php.net/manual/en/function.chown.php - E On Tuesday, September 24, 2002 6:00 PM @ Edwin wrote: Jaski, On Tuesday, September 24, 2002 5:07 PM Jaski wrote: No Edwin .. I can't do any thing to that file .. not even from my ftp client .. can't download can't change permissions .. I think you won't be able to do anything with the file IF you use your ftp client. The reason is because *you* don't own the file so you can't read it nor change it's permissions. Your *script(s)* owns the file so most probably if you use another script to read and change the permissions, the script would be able to do it. In other words, use your php script to read and change the permissions. Perhaps, you'd like to play with these functions and see what's happening... http://www.php.net/manual/en/function.is-readable.php http://www.php.net/manual/en/function.fileperms.php http://www.php.net/manual/en/function.chown.php Of course, there's a lot more others under http://www.php.net/manual/en/ref.filesystem.php HTH, - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] where's waldo
True. Perhaps. But, I think, you can actually do something like that WITH php. Say PHP+Flash or PHP+Javascript... Of course, if you're able to do something like this just by using PHP+Javascript (and HTML only), most probably, you can just take a peek at the code and find out where waldo is... ;) - E On Thursday, September 26, 2002 12:12 AM Marek Kilimajer wrote: This is for java, javascript, or flash, not much to do for php. Kenneth Love wrote: hi all. i'm interested in creating a php game that generates a page of random (ish) images, one of which is waldo (or the like). when the player clicks on waldo, they're taken to the next, slightly harder level. anyone think that sounds fun? any pointers, tips, advice, criticisms? -- -- http://kennethlove.onewingedangel.com -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] where's waldo
Good idea! And your idea about this is also great: input type="image" src="myimage.xxx" name="thename" / It should work... I forgot that there was someting like that in HTML... :) - E On Thursday, September 26, 2002 12:55 AM Subject: RE: [PHP] where's waldo Kevin Porter wrote: snip One more thing... if you store your 'waldo co-ordinates' data in a text file, make sure it is in a directory outside of the webtree... /snip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: length function
Why, can't you just use strlen()? http://www.php.net/manual/en/function.strlen.php Or, am I missing something? - E "Jeff Bluemel" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I am looking for a function that will give me the number of characters of a string, or number. I tried using the function length, but that function seems to deal with arrays, and doesn't seem to function like I am intending it to. -- Thanks, Jeff Bluemel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: length function
Why, can't you just use strlen()? http://www.php.net/manual/en/function.strlen.php Or, am I missing something? - E "Jeff Bluemel" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I am looking for a function that will give me the number of characters of a string, or number. I tried using the function length, but that function seems to deal with arrays, and doesn't seem to function like I am intending it to. -- Thanks, Jeff Bluemel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: length function
Why, can't you just use strlen()? http://www.php.net/manual/en/function.strlen.php Or, am I missing something? - E "Jeff Bluemel" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I am looking for a function that will give me the number of characters of a string, or number. I tried using the function length, but that function seems to deal with arrays, and doesn't seem to function like I am intending it to. -- Thanks, Jeff Bluemel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] length function
Why, can't you just use strlen()? http://www.php.net/manual/en/function.strlen.php Or, am I missing something? - E "Jeff Bluemel" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I am looking for a function that will give me the number of characters of a string, or number. I tried using the function length, but that function seems to deal with arrays, and doesn't seem to function like I am intending it to. -- Thanks, Jeff Bluemel _ $B$+$o$$$/$FL{2w$J%$%i%9%HK~:\(B MSN $B%-%c%i%/%?!<(B http://character.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] where's waldo
Well, I didn't really mean to imply anything about people's honesty and so forth... I just wanted to say that validating (anything) on the client side is not normally a good (and reliable) idea. Of course, as always mentioned, validation on the server side is always better. - E "Kenneth Love" [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... about the peeking at the code... yes, you could, unless the images were coded somehow. perhaps just numbers, not names. after a few tries they'd find "waldo" easily enough, but not at first. and besides. i'd like to give people credit for being more honest than that. "@ Edwin" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... True. Perhaps. But, I think, you can actually do something like that WITH php. Say PHP+Flash or PHP+Javascript... Of course, if you're able to do something like this just by using PHP+Javascript (and HTML only), most probably, you can just take a peek at the code and find out where "waldo" is... ;) - E On Thursday, September 26, 2002 12:12 AM Marek Kilimajer wrote: This is for java, javascript, or flash, not much to do for php. Kenneth Love wrote: hi all. i'm interested in creating a php game that generates a page of random (ish) images, one of which is waldo (or the like). when the player clicks on waldo, they're taken to the next, slightly harder level. anyone think that sounds fun? any pointers, tips, advice, criticisms? -- -- http://kennethlove.onewingedangel.com -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP and MSSQL Problem
Hello, ...just wondering... Are you sure VARCHAR in MS SQL can handle 5000? Should be 255 only? (I'm not really familiar with MS SQL but you can count the number of characters returned by php...) - E "Christopher J. Crane" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I wrote a simple script to return data from a query. The database is MS SQL and the field I am looking to return is a VARCHAR(5000). Everything seems to work except the data returned is not the whole field it is shortened. It only returns a portion of the field. Here is the field: 99 Services, Inc. is a full service IT systems integrator and general contractor specializing in cradle to grave technology planning with strong emphasis on LAN/WAN design (routing and switching) and deployment of high speed, fully redundant, high availability networks. 99 Services also provides Internet/Intranet/Website/email systems design. The company services small to medium sized businesses as well as home offices. Here is what is returned by the PHP: 99 Services, Inc. is a full service IT systems integrator and general contractor specializing in cradle to grave technology planning with strong emphasis on LAN/WAN design (routing and switching) and deployment of high speed, fully redundant, high availab Here is the script: ?PHP /* CTC Profile about Company */ /* = */ $HostName = "DAS54-DAL-SBC"; $UserName = "***"; //changed for security $Password = ""; //changed for security $DBName = "DirectoryDB"; MSSQL_CONNECT($HostName,$UserName,$Password); mssql_select_db($DBName) or DIE("Table unavailable"); $ProfileResults = MSSQL_QUERY("SELECT * FROM CompanyProfile WHERE CompanyID = '$ID'"); $RowCount = MSSQL_NUM_ROWS($ProfileResults); if($RowCount != 0) { for ($i = 0; $Field2 = MSSQL_FETCH_ARRAY($ProfileResults); ++$i) { $Profile = $Field2["Profile"]; echo $Field2["CompanyID"] . "br" . $Field2["Profile"] . "brbrTo read more information about this "; echo "company, visit their website\n"; } } else { print "This company, $sym is not listed in the CTC Directory."; } MSSQL_CLOSE(); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] where's waldo
I see. Now, that sounds a lot of fun! :) Anyway, enjoy! - E "Kenneth Love" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... no no, i understand. really, what i was getting at, i guess was that this isn't really meant to be developed for mass distribution. more for a class. "@ Edwin" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Well, I didn't really mean to imply anything about people's honesty and so forth... I just wanted to say that validating (anything) on the client side is not normally a good (and reliable) idea. Of course, as always mentioned, validation on the server side is always better. - E "Kenneth Love" [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... about the peeking at the code... yes, you could, unless the images were coded somehow. perhaps just numbers, not names. after a few tries they'd find "waldo" easily enough, but not at first. and besides. i'd like to give people credit for being more honest than that. "@ Edwin" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... True. Perhaps. But, I think, you can actually do something like that WITH php. Say PHP+Flash or PHP+Javascript... Of course, if you're able to do something like this just by using PHP+Javascript (and HTML only), most probably, you can just take a peek at the code and find out where "waldo" is... ;) - E On Thursday, September 26, 2002 12:12 AM Marek Kilimajer wrote: This is for java, javascript, or flash, not much to do for php. Kenneth Love wrote: hi all. i'm interested in creating a php game that generates a page of random (ish) images, one of which is waldo (or the like). when the player clicks on waldo, they're taken to the next, slightly harder level. anyone think that sounds fun? any pointers, tips, advice, criticisms? -- -- http://kennethlove.onewingedangel.com -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Multiple Domains in cookie?
You mean from this list? Please take a loot at the end of this e-mail... - E On Thursday, July 27, 2000 11:36 AM Saif wrote: Please how can I unsubscribe . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie Q: Any difference what the .ext is on include() files???
Hello, On Monday, September 30, 2002 4:32 PM Subject: Re: [PHP] Newbie Q: Any difference what the .ext is on include() files??? [ Rene Brehmer ] wrote: I appreciate your advice, but it would not really apply to my structure ... because of the amount of files I use, I've got seperate include folders for each section ... otherwise I'd get all weird in the head trying to remember which files go where. Of course, it's a good idea (and a good practice) to separate folders for each section of your site (/images/, /blahblah/, etc.). But, putting all include files in *one* folder (like /inc/ or /includes/ as suggested). Why, do you have thousands of files? Basically it's the site in my sig that I'm converting to PHP, with a few minor changes, made (easily) possible by the PHP. My first concern is to make the site without a frameset, and without requiring any scripting clientside. Once launched, I'll be looking into improving the site as much as possible...taking as much advantage of PHP as possible ... but again, I don't know the full extent of my options until I've gotten my webhotel... How'd anyone be able to pull out my PHP source anyway? You mean the includes? There are many ways if you don't follow the conventions (or suggestions) already given. Since it's an http server, it'll only respond to http requests, and since php is processed upon request, Why, did you name all your files with a .php extension? Or, are you sure that all your *.ext are being processed as php files? the enitre source will be altered to just html ... don't get that ... atleast the way I do it, the path to the included files is hidden, 'cause it's all variable controlled ... it just plugs together the variable with some path parts, directly in the include(...). ? So for anyone to pull the includes, they'll need to know the exact path to them, in order to retrieve them, right? Right. Perhaps. But you only need time to find out... unless you name your folders (or included files) something like: /thisIsMyVeryhardT0GuessFolderHehehe/ thisIsMyVeryhardT0GuessFolderHehehe.withVeryHardt0GuessExt maybe it takes more time ;) - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php 5 installation problem
Hi! On Thu, 16 Mar 2006 20:45:29 -0400 Miles Thompson [EMAIL PROTECTED] wrote: At 06:23 PM 3/16/2006, Anthony Ettinger wrote: [...] Is there a drawback to running php5 as CGI? Anthony, I really don't know, because computers are much faster, so there may not be the time lags there were 10 years ago. As I understand CGI, the web server sees that the page is of type .php, starts up PHP, PHP processes the page, the web server shuts down PHP and sends out the results. The overhead of starting and stopping PHP (or Perl, etc.) was the complaint. When PHP is loaded as an Apache module there is not startup / shutdown overhead. If I have this wrong, or if PHP5 as a CGI stays resident and there is no penalty, will someone please correct me. No, nothing wrong there, I think. But there are other differences. (Like some functions not working, etc.) Pros and cons, one might say. Anyway, here are some results of a quick google search: http://www.google.com/search?q=php+CGI+module+difference Hmm.. I just couldn't find it but there should be a page about it on www.php.net ... (^_-) Regards - Miles HTH, - Edwin - -- Give to a wise person and he will become still wiser. Impart knowledge to someone righteous and he will increase in learning. - Proverbs 9:9 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How does one obtain the resolution of an image in PHP?
Hi! On Thu, 16 Mar 2006 08:13:41 -0800 Simon M. Campden-Main [EMAIL PROTECTED] wrote: [ . . . ] I want ppi! [ . . . ] I'm running the current Cent OS [ . . . ] See if you have ImageMagick installed. You could probably use the identify command to find the info you need. For more information: $ man identify Of course, this solution is not *in* PHP but you can invoke that program inside your PHP scripts (^_-) HTH, - Edwin - -- Happy are the mild-tempered ones, since they will inherit the earth. - Matthew 5:5 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How does one obtain the resolution of an image in PHP?
Hi! On Thu, 16 Mar 2006 14:31:38 -0500 John Hinton [EMAIL PROTECTED] wrote: Simon M. Campden-Main wrote: Well, there's the meat of it, isn't it? I wonder how Paint Shop Pro comes up with PPI (Image - Image information). I have several thousand scanned images with resolution ranging from 72 PPI up to 1200 PPI (As reported by Paint Shop Pro) and want to discard, or more likely tag as rejected, any that suffer a resolution of less than 150 PPI. As you might imagine, I find the thought of doing it manually with Paint Shop Pro repugnant. Okay, if it was scanned at 72ppi then you can't really print it out again even with a near-similar quality. However, having an image with a 72ppi does NOT necessarily mean that you have an image unsuitable for printing. PPI or pixels per inch is a printing term. Last time I checked, dpi is the printing term. (^_^) dpi (dots per inch) - printer ppi (pixels per inch) - monitor/screen It has nothing to do with viewing on a monitor as a monitor's pixel setting is your set resolution, as in 800x600, 1024x768, 1600x1200.. etc. This is a constantly debated urban legend. A pixel on a monitor is a pixel... True. Pixels per inch are used in the printing world and relates to how many pixels are used to provide one inch of printed space. Obviously, at least up to the limits of the printer being used, a high PPI setting produces a higher quality 'printed' image. This really depends on how big the image is to be printed. Besides, an image/photo taken using a digital camera (at least mine) always defaults to 72ppi. BUT that does not mean that it will come out badly printed at 300 dpi -- it all depends on how big is the size (setting) of the picture when I first took it. If you don't believe me, use your paint program, change the PPI of an image and notice how the image doesn't change size on the screen. Also, do this and switch the image size display back and forth between inches and pixels.. the pixel count doesn't change, only the inches change.. but again... that's the printing world and has nothing to do with display on a monitor or webbrowser. True. This is basically because most monitors/screens are actually at or near 72 ppi. screen !== printer (^_-) So, an image 10,000pixels by 10,000pixels will be huge on screen. If set to a resolution of 1000ppi, the image would be printed at 10 x 10, but you still can't view the whole image on a monitor without zooming out. If resolution we set to 10,000dpi, the image would print as 1 x 1, but you still wouldn't be able to view it on a monitor (unless you have an I think you meant, ... but you still would be able ... awesome multi-display setup that can reach 10,000 pixels wide and tall). That's the bottom line. So, I keep seeing 'display size' when I'm thinking the term should be 'printed size'. John Hinton HTH HAND, - Edwin - -- A capable wife is a crown to her owner. - Proverbs 12:4 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] making a tutorial
Hi! On Fri, 17 Mar 2006 01:51:41 -0500 John Taylor-Johnston wrote: I'm making a tutorial and don't really understand how to do this myself :) pWhich of the following pets do have at home: br /input type=checkbox name=favourite[] value=dogdog br /input type=checkbox name=favourite[] value=catcat br /input type=checkbox name=favourite[] value=snakesnake br /input type=checkbox name=favourite[] value=othersnake br /input type=checkbox name=favourite[] value=nonenone of these /p While you're at it, why not use input ... / instead? (Pls. notice the last forward slash.) How do I parse favourite[]? I might have 2 or 5, so I need to parse ^0] - nMax. It is a checkbox. Not exactly sure what you meant but check what's submitted with: $_POST['favourite'] or $_GET['favourite'] I might use favourite[] with mail() or store it in a mysql field. If mysql, would I store it in a varchar(20) or an enum() and how? It all depends on how your tables are setup but I don't know about enum()... John HTH, - Edwin - -- Keep doing this in remembrance of me. - Luke 22:19 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] making php code from db work
Hi! On Fri, 17 Mar 2006 12:07:42 +0200 Schalk wrote: Greetings All, I pull the following snippet of code directly from a MySQL database: [ . . . ] lia href=?php echo _root ?/expertise/index.php? category=specialized_expertiseamp;content=Intermodalamp;side_content=our_work title=IntermodalIntermodal/a/li [ . . . ] As you can see in line three, I use the following PHP code there: ?php echo _root ? Unfortunately when this is loaded into the PHP page this bit of code is not parsed and the link still includes the code snippet. Is there a way I can make this work or would it be Hmm.. I wanted to say check http://www.php.net/eval but then again, someone very famous in this group once said: If eval() is the answer, you're almost certainly asking the wrong question. So, maybe, I shouldn't even recommend that. (^_-) Try: http://www.google.com/search?q=parsing+php+code+db better to build this nav tree in a more robust fashion such as loading the li one by one in a for loop for example? Maybe that one's better. Thanks in advance. HTH, - Edwin - -- A wise person will listen and take in more instruction. - Proverbs 1:5 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: How does one obtain the resolution of an image in PHP?
Hi! On Fri, 17 Mar 2006 09:46:16 +0100 Barry wrote: Simon M. Campden-Main wrote: Good morning, folks. Can any one direct me to a snippet or suggest an approach to obtaining the resolution of an image [file] with PHP. [ . . . ] There is no way you can do it. To have on screen e.g. 40 ppi or 80 ppi when the image has a size of 400x400 pixel you would have to read out the image how big a pixel in it is. at 80 ppi you would have your normal image and on 40 ppi the pixels used per dot would be duplicated. you still have 400 pixel in width and you would not be able to count the pixels who got duplicated. If you are lucky it's written in the file. Otherwise no chance. The normal screen resolution is: with an average of 0.26 mm ~ 3.8 pixel/mm ~ 97 pixel per inch. No matter what kind of resolution you would choose (800x600,1024x768 etc.) Reading the surrounding sentences, I think I can see where you're coming from. But, the above statement is a bit confusing. There is a reason why it's called pixel per INCH. And it definitely have something to do whether your monitor is set to 800x600, 1024x768, etc. A 15-inch monitor at 800x600 will have around 53ppi x 40ppi (800 pixels divided by 15 inches, etc.) and *the same* monitor at 1024x768 will have around 68ppi x 51ppi. If your 15' monitor is normally setup at 1024x768, everything (images, etc.) will look a bigger if the same image is viewed using the same monitor at 800x600. This happens because the pixels are now bigger. (One image pixel is now compose of many physical dots on the screen.) But, I guess, you already knew that. (^_^) an image having for example 48ppi would have pixels that use 2x2 pixels (4 pixels) as one colored pixel and so on. Now guess what you see when you have 194 ppi. Nothing, it's still 97 ppi because it's not possible for the screen to view anything else. Normally the screen would just duplicate the imagesize from 400x400 to 800x800. Greets Barry HTH HAND, - Edwin - -- He that is slow to anger is abundant in discernment, but one that is impatient is exalting foolishness. - Proverbs 14:29 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: How does one obtain the resolution of an image inPHP?
Hi! On Fri, 17 Mar 2006 13:12:21 - Ford, Mike wrote: On 17 March 2006 11:15, - Edwin - wrote: A 15-inch monitor at 800x600 will have around 53ppi x 40ppi (800 pixels divided by 15 inches, etc.) and *the same* monitor at 1024x768 will have around 68ppi x 51ppi. Er, no. The 15inches is a diagonal measure, so the screen is actually about 12x9, giving 67ppi in both directions. But of course! You're right (^_^) I was thinking more of if or for example as in for example you have a 25x25-inch monitor... But, yeah, a 25x25-inch monitor is rather ridiculous, I guess. Cheers! Mike - Edwin - -- Better is a needy but wise child than an old but stupid king... - Ecclesiastes 3:18 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] CPanel, PHP5 as CGI (was Re: [PHP] php 5 installation problem)
Hi! On Fri, 17 Mar 2006 08:24:51 -0400 Miles Thompson wrote: Thanks Edwin. I guess it was too late and I couldn't formulate a proper search expression. I'd like to hear Chris Shiflet's opinion on the security advantages of running PHP5 as CGI. That'd be nice. But as somebody pointed out earlier, one of the advantages is that PHP can run as another user instead of as the apache user. (Of course, it's still considered rather slooow though.) Anyway, there are some more info here: http://www.php.net/manual/en/security.cgi-bin.php Why, after years of running PHP as an Apache module, the sudden conversion to CGI operation? Remember, Miles, *your* $Web_Hosting_Company decides (or better yet, *you* decide) whether PHP5 should run as CGI or as an apache module. ;-) I've noticed occasional references of PHP5 having issues with CPanel. I think it was also pointed earlier (somewhere) that it's the other way around. :-) Is it simply easier for ISPs, given the intense competitive cost pressures they are under, to not wrestle with these issues, but to say Here it is as a CGI if you want it. I really have no idea (read: lazy to check now ;-) ) what CPanel is. If it is a program written in PHP (4?), they could just fix it to work with PHP5 -- CGI mode or not. Regards - Miles Thompson Regards, - Edwin - -- The showing of partiality is not good, nor that an able-bodied man should transgress over a mere piece of bread. - Proverbs 28:21 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP files in the SRC attribute of an SCRIPT element
Hi! On Fri, 17 Mar 2006 17:42:51 +0200 Karl-Heinz Christian Zeck wrote: Thank you for your quick reply. I tried to modify the file. I removed all it's content and wrote only a single line: alert(test); When I refresh the main page, I get the alert message - this means the file was loaded successfuly. Then I tried this code: alert(?php echo 'test';?); This way it doesn't work, no alert message, so the file wasn't loaded. Any ideas? I guess, it's because the file is NOT being parsed. If you go back to your first message (on this thread), you had something like this: script language=JavaScript type=text/javascript src=d:/projects/horde/dimp/js/ -snipped- /script Why are you using d:/ ? If the machine you're working on happens to be your test server as well, what you want is (something like this): src=http://localhost/path/to/srcDimpCore.js.php?etcetc; Thanks! HTH, - Edwin - -- An answer, when mild, turns away rage, but a word causing pain makes anger to come up. - Proverbs 15:1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How does one obtain the resolution of an image in PHP?
Hi! On Fri, 17 Mar 2006 10:58:12 -0500 John Hinton wrote: - Edwin - wrote: Hi! On Thu, 16 Mar 2006 14:31:38 -0500 John Hinton [EMAIL PROTECTED] wrote: Simon M. Campden-Main wrote: Well, there's the meat of it, isn't it? I wonder how Paint Shop Pro comes up with PPI (Image - Image information). I have several thousand scanned images with resolution ranging from 72 PPI up to 1200 PPI (As reported by Paint Shop Pro) and want to discard, or more likely tag as rejected, any that suffer a resolution of less than 150 PPI. As you might imagine, I find the thought of doing it manually with Paint Shop Pro repugnant. Okay, if it was scanned at 72ppi then you can't really print it out again even with a near-similar quality. However, having an image with a 72ppi does NOT necessarily mean that you have an image unsuitable for printing. PPI or pixels per inch is a printing term. Last time I checked, dpi is the printing term. (^_^) dpi (dots per inch) - printer ppi (pixels per inch) - monitor/screen Still missing it.. Yes, dpi is a printing term.. but has absolutely nothing to with with images. dpi or Dots per Inch is purely a I beg to differ... (see next) term that describes the limits of your printer. If for instance, we are talking about an ink jet printer with a 600 x 600 dpi capability, with black and three colors, that printer can print any of the four color or not print in a space 1/600th of an inch as it moves along. And there is no blending within that one dot... it's simply one of the colors or left the white or the paper color. One might think that an image should be scanned at 600 dpi to provide and equal quality, but really you can scan at a much reduced resolution and get the same results with a basic inkjet At a much reduced resolution? Try scanning some photo, say an A3 size photo, at 72ppi. Then, try printing that at 600dpi on the same A3 size paper and see what you get. color printer, because the scan will most often be done at 16.7 million colors.. the printer only has 4(+paper color) so it really takes a 4x4 dot area or so to start to get close to matching a single pixel. Now, lets don't even go there on printers. The above is greatly understated and was how old inkjets worked.. much has changed and I really haven't followed exactly what they are doing now, but obviously it seems that there is a blending over top of other colors in today's printers. Just trying to provide simple theory, quick to type, easy to grasp. Add to that that some have 8(+paper color). And that not all people are using inkjets. So, yet still ppi is being misrepresented.. Please stop doing this. Who is misrepresenting what? ;-) If you don't believe me try this. Open a quality paint program. In fact, Macromedia's Fireworks in the image sizing dialog box separates pixel dimensions from ppi putting ALL ppi function under the heading of Print Size. The example. Open or create an image 600 pixels x 300 pixels. Make sure you stay at 100% zoom factor. Set the printing Pixels/Inch to 150, but don't let the program change the Pixel dimensions. You will be given a print size of 4 x 2. The image will take up 600 x 300 pixels of your monitor screen space. Now with that same image, change only the resolution to 300. Leave the pixel dimensions the same (one has to be careful with the locking of proportions and samplings to be sure the program doesn't change the pixel dimensions when changing the Pixel/Inch). You will now see that the print size is 2 x 1, but yet the image size on the screen has not changed sizes. Of course! A pixel is a pixel to a monitor. A pixel is sent thru an algorithm on the way to a printer and by and large, print quality has to be much greater than monitor quality to 'look' as good. Basically, you can't get a 4 wide image on the screen to look as good when printed at 4 wide. That's correct. And nobody said otherwise. A general guideline is images for print should be no less than 150 ppi, newspaper quality, and 300 to 600 is recommended for color brochures and near photo quality. So, using our example above and assuming the printing company has requested 300 ppi images, that image at 600 x 300 which fills a major portion of one's monitor screen, can only be printed under this constraint at a maximum of 2 inches x 1 inch. If you're going to print, check with the printer before beginning as print quality is generally rising at all levels. The question of throwing away all images with 72dpi is irrelevant. 72dpi !== 72ppi Just to make it consistent, an image on the screen cannot have a dpi whereas a *printed* image can. The questions are: What resolution, pixels per inch, do you want to print at? Lets assume 300. What size are the images in pixels? Lets assume 1200 x 900. (I know, odd size but easy math to follow) Are you happy
Re: [PHP] Script not working from one computer
Hello, 1LT John W. Holmes [EMAIL PROTECTED] wrote: [snip] So, I'm sure it's not the PHP script, so I'm looking for ideas of what I should check, settings wise, on the client computer? Any help is greatly appreciated. [/snip] Well, my magic PHP 8-ball says... Just kidding :) Anyway, here's a long shot: What browser are you using? Encryption is 128bit? If you're using one with 40bit or 56bit(?), I'm sure it won't work against a server with 128bit SSL... - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Check wheter GD function is working
Hello, [EMAIL PROTECTED] wrote: Hello list, how can I check wheter GD-function is working and running? First check phpinfo() and see under gd then read more info here: http://www.php.net/manual/en/ref.image.php - E PS: Pls. don't flood the list with same messages... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Output of MySQl sorted query to text or Word file.
Hello, [EMAIL PROTECTED] wrote: ...[snip]... What do I need to use to create real linefeeds or new lines when viewing under windows? Try the manual again and check specifically the User Contributed Notes--I'm sure you'll find something :) http://www.php.net/manual/en/function.fputs.php - E ...[snip]... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Output of MySQl sorted query to text or Word file.
Oops... [EMAIL PROTECTED] wrote: success. And I have read through the user contributed notes and havent' found it there. Sorry 'bout the link earlier. (You could find some hints under file() though...) - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() problems...
Hello, Anthony Ritter [EMAIL PROTECTED] wrote: DL, I'm not sure I understand. Let me try :) I had this working a few months ago by changing the php.ini settings to: SMTP = localhost ;for win32 only sendmail_from = [EMAIL PROTECTED] ;for win32 only and I was able to run that script on my box and get an e-mail returned to me. Now, I getting a failed to connect. Strange... (I mean it's strange that it worked before. I don't think that setting would work unless you have your own mail server in your pc.) Please advise. I think what DL meant was to change localhost to (Ex.) smtp.yourdomain.com I'm using MS OE5. In that case you'll find that info by clicking Tools - Account - Mail - Property then click Server and check under SMTP. HTH, - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Where can I find a new HowTo of compiling php with gd support???
Did you try Google? Keyword: compiling php with gd support [EMAIL PROTECTED] wrote: Hi folks, a single and simple question : Where can I find a new HowTo of compiling php with gd support??? Incl Bugtraps? Oliver Etzel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] String to an Array
Hello, Rodrigo de Oliveira Costa [EMAIL PROTECTED] wrote: Hi guys, I got a string that I need to be transformed into na array of characters, something like: $str =im the one trying to do this; //this is the string I'd like to get an array that I can access something like $array[0] and get the value i . And this foward. Anyone have any clues on this? You can actually treat $str like an array so $str[0] would be i. If you're after something else, check the archives for more info: http://marc.theaimsgroup.com/?t=100526380400016r=1w=2 - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Humour me
Hello, John Taylor-Johnston [EMAIL PROTECTED] wrote: Humour me. New server. I'm a little tired. Where is my php.ini on a red hat server? I took it :) Anyway, Run phpinfo() --should give you a hint... - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Allowed memory size exhausted
Hello, Jeff Schwartz [EMAIL PROTECTED] wrote: I have a large amount of data (1,948,280 bytes) that I tried to write out to a file using if ($fp = fopen($file,w)): fwrite($fp,$contents,strlen($contents)); fclose($fp); endif; I'm not sure if I understand this correctly but don't you think you don't need strlen($contents) up there? Also, try fopen($file,wb). And here, and got Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 1948281 bytes) on the 2nd line. So, I tried to write out smaller portions with: if ($fp = fopen($file,w)): $size = 4096; while (strlen($contents)){ $temp = substr($contents,0,$size); fwrite($fp,$temp,$size); $contents = substr($contents,$size+1); } fclose($fp); endif; ...doing $contents = substr($contents,$size+1); would actually cause you to lose some data. Try this instead: if ($fp = fopen($file,wb)): // add b $size = 4096; while (strlen($contents)){ $temp = substr($contents,0,$size); fwrite($fp,$temp); // remove $size $contents = substr($contents,$size); // remove +1 } fclose($fp); endif; I didn't test so I'm not sure if it'll work--just some ideas... HTH, - E ...[snip]... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date() on two diff. servers
Hello, John W. Holmes [EMAIL PROTECTED] wrote: Daylight Savings Time? John, I think Daylight Saving Time creates a difference of 1 hour and not 1 day :) Anyway, I live in a place where we don't practice this so I could be wrong... ...[snip]... Now, what could be causing this problem? IMHO, no matter where you are in the world (or more to the point, what timezone you are in), 1039525200 seconds after a certain date (in this case the unix epoch) should be another certain date, yes? Justin, it depends how you got your timestamp in the first place, I think... I could be wrong again here but aren't these different? mktime() gmmktime() - E ...[snip]... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date() on two diff. servers
But, then again, it could be just because the other server's time is really late... (caused by old motherboard batteries, etc.) - E @ Edwin [EMAIL PROTECTED] wrote: Hello, John W. Holmes [EMAIL PROTECTED] wrote: Daylight Savings Time? John, I think Daylight Saving Time creates a difference of 1 hour and not 1 day :) Anyway, I live in a place where we don't practice this so I could be wrong... ...[snip]... Now, what could be causing this problem? IMHO, no matter where you are in the world (or more to the point, what timezone you are in), 1039525200 seconds after a certain date (in this case the unix epoch) should be another certain date, yes? Justin, it depends how you got your timestamp in the first place, I think... I could be wrong again here but aren't these different? mktime() gmmktime() - E ...[snip]... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date() on two diff. servers
Justin French [EMAIL PROTECTED] wrote: [snip] Perhaps strtotime() is NOT running off GMT, [/snip] Bingo! ...or, Bull's eye!, whatever :) Anyway, I think this is implied in the manual. http://www.php.net/manual/en/function.strtotime.php Also, check User Contributed Notes: piran at pobox dot com php at webdevelopers dot cz HTH, - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date() on two diff. servers
Justin French [EMAIL PROTECTED] wrote: on 09/12/02 3:06 PM, @ Edwin ([EMAIL PROTECTED]) wrote: [snip] Perhaps strtotime() is NOT running off GMT, [/snip] Bingo! *GULP*... so, what we're saying is, that if I intend to pass data around on multiple servers (in different timezones) using a unix timestamp for dates (which i prefer to do), I should be using gmdate() and gmmktime() rather than date() and strtotime()? I'm afraid so... That will sure as hell be a few lines of code to dig through Well... just hope that others chime in and suggest a better solution :) I'll also need an accurate (and daylight savings compliant!) way of determining the how far ahead of the GMT the server currently is, or for a specific timezone for a specific project (eg this current one, which is basing it's dates on Sydney, Australia. If I understand the problem correctly and if my understanding of the functions are correct, I'm not sure if you'd really need something like this. Consider this: ?php $timestamp_local = time(); $timestamp_gmt = gmmktime(); $run_local = date(F j, Y, G:i:s, $timestamp_local); $run_gmt = gmdate(F j, Y, G:i:s, $timestamp_gmt); echo Local Timestamp: $timestamp_localbr /; echo GMT Timestamp: $timestamp_gmtbr /br /; echo This script was run on: br /; echo $run_local (DATE with Local Timestamp)br /; echo $run_gmt (GMDATE with GMT Timestamp)br /; ? As you can see, although the timestamps are different, they produce the same results. So, *I think*, using gmdate() and gmmktime() would be enough. (Or, if you insist on using strtotime(), consider the example(s) in the User Contributed Notes I mentioned earlier.) I hope this give you some hints. - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php