php-general Digest 16 Jan 2001 03:19:07 -0000 Issue 457 Topics (messages 34626 through 34741): safe_mode setup question 34626 by: Lutz Jaenicke Re: date comparison 34627 by: Joe Stump 34628 by: Joe Stump Re: Date data type problem 34629 by: Joe Stump 34699 by: Jason Murray Re: load balancing with php/apache? 34630 by: Joe Stump 34640 by: Alex Black Re: Modifying arrays 34631 by: Joe Stump GD Library ??? Where to find. 34632 by: Dallas Kropka 34634 by: Cynic problem that has been really annoying me... 34633 by: PeterOblivion.aol.com 34636 by: Toby Butzon 34639 by: Toby Butzon Re: Fixed: Simple form not passing variables 34635 by: jeff fitzmyers CyberCash Libraries? 34637 by: ncook 34649 by: Nathan Cook safe mode in 4.0.4pl1 34638 by: Ian Gulliver Re: hello 34641 by: Stephan Ahonen 34643 by: Toby Butzon how do I do this, please? 34642 by: John Hinsley Re: [PHP-DEV] cookies and sessions security 34644 by: Kristofer Widholm 34654 by: Tim Zickus 34703 by: Jason Murray looping 34645 by: Jerry Lake 34678 by: Ignacio Vazquez-Abrams 34685 by: Jerry Lake simple division.. but how? 34646 by: PeterOblivion.aol.com 34647 by: Cynic 34648 by: Alejandro Garin 34651 by: Cal Evans Format a number for Money 34650 by: Brandon Orther 34652 by: Chris Lee gif vs png using gd 34653 by: meeks.rightangleinc.com 34670 by: Mark Maggelet 2 questions, can't find in the manual or archives . . . 34655 by: Foley, John Zend Optimizer 34656 by: Marcus Ouimet 34663 by: Alejandro Garin 34668 by: Marcus Ouimet 34717 by: Thomas Deliduka mail() question 34657 by: Robert Hough 34659 by: jeremy brand 34661 by: Robert Hough 34662 by: jeremy brand 34665 by: Robert Hough 34666 by: jeremy brand 34669 by: Egan 34671 by: Robert Hough 34672 by: Egan 34673 by: jeremy brand 34674 by: Egan 34677 by: Egan 34707 by: mailing_list.gmx.at 34718 by: Robert Hough uploading files through php-generated scripts 34658 by: David P. Schwartz 4.0.4 Postgres link resource bug? 34660 by: kris.grinz.com 34711 by: Jon Rosenberg calling perl from within php 34664 by: Kevin McCarthy PDFLIB 3.0 PHP 4.04 34667 by: Cal Evans 34688 by: Jani Taskinen 34710 by: Cal Evans BC Math 34675 by: ncook 34680 by: jeremy brand Help with IMAP_open please 34676 by: Dezider Góra 34679 by: Ignacio Vazquez-Abrams changing strings to float vars 34681 by: bill 34706 by: Steve Edberg HELP WITH UPLOAD REQUIRED!!!!!!!! 34682 by: Mike Yuen 34720 by: Chris Lee 34723 by: Josh G 34724 by: Alexander Wagner 34726 by: Josh G 34735 by: Alexander Wagner Perl regular expression bug 34683 by: Shaun Thomas Array... 34684 by: WreckRman2 34686 by: jeremy brand 34693 by: Johannes Janson 34695 by: jeremy brand 34704 by: Mark Maggelet Re: Perl-like DBI and generic SQL 34687 by: Alex Black Re: Regex for telephone number 34689 by: Alex Black 34702 by: Jason Murray checkboxes into MySQL 34690 by: Jerry Lake 34692 by: jeremy brand 34705 by: Kevin McCarthy Basic SQL syntax 34691 by: James, Yz 34697 by: Johannes Janson 34708 by: James, Yz 34709 by: Johannes Janson 34712 by: James, Yz password() 34694 by: Jason Jacobs 34713 by: James, Yz 34716 by: Toby Butzon 34721 by: Chris Lee 34734 by: Stephan Ahonen Re: mixing HTML and PHP code 34696 by: Alex Black checkboxes into MySQL(trying again) 34698 by: Jerry Lake 34701 by: jeremy brand Re: logging page views, which method is better???? 34700 by: Rick Widmer PHP & FDF on Linux PPC 34714 by: Erick Schmidt Magic Quotes - Problems with Inconsistent Behavior removing Slashes 34715 by: Roy is_dir 34719 by: Pat Hanna Re: password() ::: and it's return... 34722 by: Maxim Maletsky 34725 by: Josh G 34727 by: Maxim Maletsky 34728 by: Chris Lee 34730 by: Toby Butzon 34731 by: Josh G 34732 by: Josh G 34733 by: Maxim Maletsky 34736 by: Josh G 34737 by: Maxim Maletsky 34741 by: Toby Butzon readfile and Location headers in php 4.0.4 and 4.0.4pl1 34729 by: Jason Brooke How do I do to update part of a string? 34738 by: Romulo Roberto Pereira 34739 by: Josh G 34740 by: Maxim Maletsky Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
Hi! On my webserver I want to switch to enable safe_mode setup, but not for all directories. 1) I have one common directory, in which I have some root-owned files with the header and footer of our lab. I want to allow all users to include these files to easily make them look similar :-) 2) Besides this directory I would prefer safe_mode. Unfortunately, when enabling safe_mode, requirement 1 fails, as the user's web-pages are owned by the users themselves. They are colleagues with a shell account, so include() must fail because of the different uid. I did not manage to work around safe_mode in a partial manner (e.g. by using "php_admin_value safe_mode Off" in a <Directory ...> statement), I could only globally swith on and off safe_mode. Are there any recommondations on how to allow for the partial use of safe_mode? Many thanks in advance, Lutz -- Lutz Jaenicke [EMAIL PROTECTED] BTU Cottbus http://www.aet.TU-Cottbus.DE/personen/jaenicke/ Lehrstuhl Allgemeine Elektrotechnik Tel. +49 355 69-4129 Universitaetsplatz 3-4, D-03044 Cottbus Fax. +49 355 69-4153
The way you want to do this is with UNIX timestamps. FYI a timestamp is the number of seconds starting at 1970 and going up (it's important to remember that date - since some people were born before, etc.) So you need to do this: $dateA = '12-25-1999'; $dateB = '12-24-1999'; // convert to unix time stamps $fooA = explode('-',$dateA); $fooB = explode('-',$dateB); $timestampA = mktime(0,0,0,$fooA[0],$fooA[1],$fooA[0]); $timestampB = mktime(0,0,0,$fooB[0],$fooB[1],$fooB[0]); if($timestampA > $timestampB) { echo $dateA . " is greater than B"; } Hope this helps - you can also check out this page: http://www.php.net/manual/en/ref.datetime.php --Joe On Mon, Jan 15, 2001 at 12:00:05PM -0600, Jacky@lilst wrote: > Greeting all, > Just now I asked about to tie string values together and would like to thank > Jason for that. Anyway one more thing, after I have tied string values > together and assigned that to a virables. can I used the value from that > variables to compare with another date value? Say another date value I will > use is also retrieved from a field in table which is in Date data type as > well. So it will be like > > > $query = "select myBirthdate from date where userId='1' "; > $dateResult =mysql_query($query); > $myBirthDate = (mysql_result($dateResult,0,"myBirthdate")); > > $thisBirthdate = "$year"."$month"."$day"; > > if ($thisBirthdate < $myBirthdate) { > do something > } else { > do some other thing > } > > Is it the correct way to do that? > cheers > Jack > [EMAIL PROTECTED] > "There is nothing more rewarding than reaching the goal you set for > yourself" > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Joe Stump, PHP Hacker [EMAIL PROTECTED] http://www.miester.org/
Yes - it may work like you are saying, but I would use a timestamp to be sure. You can make comparisons on regular date formats from within MySQL with the date or datetime fields. --Joe On Mon, Jan 15, 2001 at 12:39:13PM -0600, Jacky@lilst wrote: > all right, now I have both date values in the same format (yyyy/mm/dd), say > $Date1 = 20010115 and $Date2 =20010120. If what I want is to find out if > $Date1 come before $Date2, can I just use this sniplet below? > > if ($Date1 < $Date2) { > ........... > } else { > ....... > } > > Do I still need to use mktime() for this purpose? > cheers > Jack > [EMAIL PROTECTED] > "There is nothing more rewarding than reaching the goal you set for > yourself" > ----- Original Message ----- > From: Jason Murray <[EMAIL PROTECTED]> > To: 'Jacky@lilst' <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Sunday, January 14, 2001 11:37 PM > Subject: RE: [PHP] date comparison > > > > > can I used the value from that variables to compare with another > > > date value? Say another date value I will use is also retrieved > > > from a field in table which is in Date data type as well. > > > > When you get into this stuff, it all starts getting a lot more > complicated. > > > > If you want to compare two fields, make sure they're in the same format. > > > > Basically, make sure you use four digit years and two digit months and > > days to create your birthday fields, so they look like (for example, with > > today's date, 20010115 instead of 2001115 - that second one could really > > be anything). > > > > If you're sure you're storing the birthdays properly, you can then cut > > the strings up when you pull them out of the database, the first 4 chars > > are the year, the next two make the month (regardless of the actual month, > > this way it'll be "01" not "1"), then the day. > > > > Do that for both of the dates. > > > > Now, you can use the mktime() command to turn them into unix tiumestamps. > > > > $unixtimeme = mktime(myhour, myminute, mysecond, mymonth, myday, > myyear); > > $unixtimethem = mktime(theirhour, theirminute, theirsecond, theirmonth, > > theirday, theiryear); > > > > Now, a unix timestamp is the number of seconds from 00:00:01, Jan 1, 1970. > > > > You can figure out the difference in seconds between the two timestamps. > > > > Divide it by (24*3600), which is the number of seconds in a day, and there > > you have the number of days between the dates. > > > > Incidentally, if you want to find the number of days between your > birthDAYS, > > then you'll want to substitute in a specific year in the mktime() > statements > > above, as you'll otherwise end up with the number of days between your > exact > > DATES of birth. > > > > Jason > > > > -- > > Jason Murray > > [EMAIL PROTECTED] > > Web Design Team, Melbourne IT > > Fetch the comfy chair! > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Joe Stump, PHP Hacker [EMAIL PROTECTED] http://www.miester.org/
This is not possibly - do this on $date2 first: $foo_date2 = str_replace('-',$foo_date2); then if($date1 < $foo_date2) { } else { } --Joe On Mon, Jan 15, 2001 at 03:15:38PM -0600, Jacky@lilst wrote: > Hi people, > I have tried to compare 2 date values to see if one come before another using the >sniplet below: > > if ($date1 < $date2) { > do something > }else{ > ....... > } > > while $date1 is in "yyyymmdd" format but $date2 is in "yyyy-mm-dd" formate because I >get value of $date2 from a "date" data type field from a table. > Can I use this "yyyy-mm-dd" to compare with value from another date variabile in the >"yyyymmdd" format? If not possible, How do I make both of them to be in the same >format? > cheers > Jack > [EMAIL PROTECTED] > "There is nothing more rewarding than reaching the goal you set for yourself" -- Joe Stump, PHP Hacker [EMAIL PROTECTED] http://www.miester.org/
> while $date1 is in "yyyymmdd" format but $date2 is in > "yyyy-mm-dd" formate because I get value of $date2 from a > "date" data type field from a table. Ah, see ... this is what I was talking about with making sure they are in the same format :) > Can I use this "yyyy-mm-dd" to compare with value from > another date variabile in the "yyyymmdd" format? If not > possible, How do I make both of them to be in the same format? You can change yyyy-mm-dd to yyyymmdd like this: $withoutdashes = ereg_replace("[^0-9]", "", $withdashes); This wil actually remove everything from the string that is not a number between 0 and 9 (ie, numbers). Jason -- Jason Murray [EMAIL PROTECTED] Web Design Team, Melbourne IT Fetch the comfy chair!
I would agree - we started using one at work (the 760 I believe) with 128GB of online RAID 4 storage - YUM! We run a large SUN DB and run our DB straight from the NetApp. NetApp basically rules. --Joe On Mon, Jan 15, 2001 at 10:08:32AM -0000, Tim Parkin wrote: > A NetApp (Network Appliance) is a big RAID that uses multiple scsi drives to > create a single transparent volume which, with CIFS (transparent filesystem) > can be used by any OS. They are v fast, use NVRAM buffering and can go up to > post terabyte storage capacity without worries. > > Oh and they start at 60k pounds sterling > > But they are great. Network Attatched Storage at its best (gigabit fibre > too) > > Tim Parkin > Didio Communications > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 15, 2001 08:39 > To: Alex Black; [EMAIL PROTECTED] > Subject: Re: [PHP] load balancing with php/apache? > > > Addressed to: Alex Black <[EMAIL PROTECTED]> > [EMAIL PROTECTED] > > ** Reply to note from Alex Black <[EMAIL PROTECTED]> Sun, 14 Jan 2001 > 17:16:50 -0800 > > > > > Whoever said NFS is slow hasn't used a NetApp > > > > OK, I'll bite. What is NetApp? Network Appliance? > > > Is this a cache technology, or will it help if I want to transfer 1GB > of data with no duplication? Once upon a time I was considering using > NFS for backing up my web servers. Then I found it would take over 150 > hours per backup over my 56K Frame Relay link. I've got it down to > about 46 hours with tar.gz and ftp. It takes most of my sleep time > during the week. > > > > > > > Rick Widmer > Internet Marketing Specialists > http://www.developersdesk.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Joe Stump, PHP Hacker [EMAIL PROTECTED] http://www.miester.org/
> > We used LocalDirector for awhile, with it's 'sticky bit' functionality, > and it basically didn't work with AOL. I just looked at the > coyote product and they claim it works with 'large ISP' proxies - maybe a > veiled > reference to AOL directly (why not just say AOL?). from my testing, the "EQUALIZER" (I kind of like how obnoxious the name is, actually :) does in fact work with AOL. > Do you have any more info on HOW they do this? The > only thing I can think of is that they code it recognize particular IP blocks > known to be proxies for AOL/mindspring/etc and route ALL traffic from these to > a > particular box, which doesn't seem terribly balanced. OR... they drop a > separate > 'cookie' or similar header data piece between the server and the client and > track > that. The installation I tested is not large, though, and I did not hit it with more than one client.. in the case of the particular site, it doesn't matter... but I would be interested to know that. > Either way, it seems a bit expensive, although cheaper than LD, last time I > checked. Yeah, Cisco r' bastards :) At _least_ for the money, their stuff does actually work most of the time. > Personally, we do the 'stateless' model with session data in a database - > works > fine. Your coyote solution is still stateless, but the session data is kept > local > to the webserver. Yeah, we might end up writing a session handler for binarycloud, probably "switchable" so you can store sessions on the machine re: php.ini, or pipe 'em to your DB. > Problem I see with that is that if you need to take a particular machine > offline, > hundreds of people could lose their session data. Same can be said of taking > the > database offline, but taking a db offline will probably affect the whole site > anyway. Part of the benefit of an intelligent load balancer is that you can > remove/take down machines for maintenance/upgrades without worrying about the > impact on the visitors. > > Am I missing something? Nope, not a thing. That is a consequence of the stateless-but-not-quite model. In my case, it's fine. In other cases, it certainly is not :) _alex > > Alex Black wrote: > >> what? >> >> you use an utterly completely stateless model? >> >> craziness! >> >> so you set cookies, and store the sig in the db? >> >> agh! :) >> >> I'm using this box from "coyote systems" called, wait for it: >> >> "THE EQUALIZER" >> >> which is a really obnoxious name, but it sticks clients with a particular >> server intelligently, so we can be ever-so-slightly-lazy about that. >> >> do you _like_ that system? (that isn't a challenge, it's real interest) >> >> _a >> >> -- >> Alex Black, Head Monkey >> [EMAIL PROTECTED] >> >> The Turing Studio, Inc. >> http://www.turingstudio.com >> >> vox+510.666.0074 >> fax+510.666.0093 >> >> Saul Zaentz Film Center >> 2600 Tenth St Suite 433 >> Berkeley, CA 94710-2522 >> > >
$array = array('foo','bar','hello'); for($i = 0 ; $i < sizeof($array) ; ++$i) { if($i == 1) { $array[$i] = 'not_bar'; } } Hope this helps! Also check out: http://www.php.net/manual/en/ref.array.php --Joe On Mon, Jan 15, 2001 at 01:19:56PM +0200, Catalin Borcea wrote: > How do I modify the value of the current element of an array? > > -- Catalin Borcea -- > \\\|/// > \\ - - // > ( @ @ ) > -----oOOO----(_)----OOOo---- > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Joe Stump, PHP Hacker [EMAIL PROTECTED] http://www.miester.org/
Please point me to the GD library.... I cant seem to find it.
www.boutell.com/gd/ IIRC At 18:26 15.1. 2001, Dallas Kropka wrote the following: -------------------------------------------------------------- > Please point me to the GD library.... I cant seem to find it. > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] ------end of quote------ ____________________________________________________________ Cynic: A member of a group of ancient Greek philosophers who taught that virtue constitutes happiness and that self control is the essential part of virtue. [EMAIL PROTECTED]
I have a problem which i dont know how to solve.... my script... $game = "roguespear"; $title = "quepasa??mecasa..."; $num = mysql_query("SELECT * FROM DLtemplates WHERE id='$game'"); $num =mysql_fetch_array($num); print(stripslashes("$num[sub]")); what sub in DLtemplates where id=$game = $title so why does it print $title on the screen and not "quepasa??mecasa..."; any help apprecaited - Peter
First of all check this: print(stripslashes("$num[sub]")); ... should be... print(stripslashes($num['sub'])); That will change the result, but I don't know if it's the result you're going for... One other note of interest... why is your variable named $num? If it was supposed to be a significant number I would understand, but as far as I can tell, it's not... so you might consider changing this to be a little more descriptively named ;) --Toby ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, January 15, 2001 12:21 PM Subject: [PHP] problem that has been really annoying me... > I have a problem which i dont know how to solve.... > > my script... > $game = "roguespear"; > $title = "quepasa??mecasa..."; > $num = mysql_query("SELECT * FROM DLtemplates WHERE id='$game'"); > $num =mysql_fetch_array($num); > print(stripslashes("$num[sub]")); > > what sub in DLtemplates where id=$game = $title > > so why does it print > $title on the screen and not "quepasa??mecasa..."; > > any help apprecaited > > - Peter > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
O wait... I think I see what you're saying... the database actually has an entry in it that is '$title', not the value of $title... what you need to do is run eval('echo ' . $num['sub']) instead of the print command you've got right now (note: print/echo makes no difference for this example; just my personal pref to stick with echo). Regards, --Toby ----- Original Message ----- From: "Toby Butzon" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, January 15, 2001 12:35 PM Subject: Re: [PHP] problem that has been really annoying me... > First of all check this: > > print(stripslashes("$num[sub]")); > ... should be... > print(stripslashes($num['sub'])); > > That will change the result, but I don't know if it's the result you're > going for... > > One other note of interest... why is your variable named $num? If it was > supposed to be a significant number I would understand, but as far as I can > tell, it's not... so you might consider changing this to be a little more > descriptively named ;) > > --Toby > > ----- Original Message ----- > From: <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, January 15, 2001 12:21 PM > Subject: [PHP] problem that has been really annoying me... > > > > I have a problem which i dont know how to solve.... > > > > my script... > > $game = "roguespear"; > > $title = "quepasa??mecasa..."; > > $num = mysql_query("SELECT * FROM DLtemplates WHERE id='$game'"); > > $num =mysql_fetch_array($num); > > print(stripslashes("$num[sub]")); > > > > what sub in DLtemplates where id=$game = $title > > > > so why does it print > > $title on the screen and not "quepasa??mecasa..."; > > > > any help apprecaited > > > > - Peter > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
Thanks!, I was getting bogged down in variable declaration, OOP, etc. This works perfectly: Please enter user name here: <FORM> <INPUT TYPE=text NAME=name> <INPUT TYPE=submit VALUE=Submit> </FORM><BR> You typed: <? print $HTTP_GET_VARS["name"]; ?> >>> Within your configurations, is register_globals on? I try this code and it works just fine. Although if register_globals setting in php.ini is off it will not, try replacing : echo ($name); with print $HTTP_GET_VARS["name"]; And see what happens. If you want $name type variables to register as global, then turn the setting to on. Strangly, iirc, this should be on by default though. The fact that you have name=Bob in url would suggest this to be the "problem". Read about these settings here : http://www.php.net/manual/en/configuration.php#ini.register-globals Philip Olson http://www.cornado.com/ >>> __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
Where can I get the Cybercash Libraries? -nc
Nevermind, cybercash.com has an MCK (Merchant Kit) that has the libs in it. Thx, though. -nc ----------------------------------------------------------------------- .:: Nathan Cook - Network/Security Admin office: 208.343.3110 - Web Programmer email: [EMAIL PROTECTED] - Qmail Admin pager: 208.387.9983 - MIS Admin ----------------------------------------------------------------------- ----- Original Message ----- From: "ncook" <[EMAIL PROTECTED]> To: "Php List" <[EMAIL PROTECTED]> Sent: Monday, January 15, 2001 10:49 AM Subject: [PHP] CyberCash Libraries? > Where can I get the Cybercash Libraries? > > -nc > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
I'm running PHP 4.0.4pl1 as a CGI under Apache 1.3.14 with suexec. Whenever I turn on safe_mode in php.ini, the following messages appear from a script owned by and running as uid 1013 which is trying to include files owned by uid 1013 in a directory owned by 1013: Warning: SAFE MODE Restriction in effect. The script whose uid is -1 is not allowed to access header.php owned by uid 1013 in archive.php on line 1. Any help would be much appreciated.
I don't know about everybody else, but I learned PHP by taking a simple, pre-existing script and upgrading it to my needs by studying the syntax and putting in new code to do what I wanted it to, always keeping the PHP online manual at my side. By just jumping in like that, I've managed to build an acceptable knowledge of the language in about a month.
My fault for missing the original post... but if this is the discussion I think it is... I'd say if you've already got one language under your belt you can probably learn PHP without too much trouble just by reading the first few chapters of the manual and using the function reference beyond that... If you don't have any prior programming experience, there are some concepts that should probably be taught a little more extensively than the manual covers... you might want to look into online tutorials, published books, etc. --Toby ----- Original Message ----- From: "Stephan Ahonen" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, January 15, 2001 1:13 PM Subject: Re: [PHP] hello > I don't know about everybody else, but I learned PHP by taking a simple, > pre-existing script and upgrading it to my needs by studying the syntax and > putting in new code to do what I wanted it to, always keeping the PHP online > manual at my side. By just jumping in like that, I've managed to build an > acceptable knowledge of the language in about a month. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
Can anyone show me how to do this? I'm using a script out of Julie C. Meloni's book: <? if (ereg !=("^[0-9]+[.]?[0-9]*$", $val1)) { header("Location:http://localhost/calculate_form.html"); exit; if (ereg !=("^[0-9]+[.]?[0-9]*$", $val2)) { header("Location:http://localhost/calculate_form.html"); exit; if (($val1 == "") || ($val2 == "") || ($calc =="")) { header("Location:http://localhost/calculate_form.html"); exit; } if ($calc == "add") { $result = $val1 + $val2; } else if ($calc == "subtract") { $result = $val1 - $val2; } else if ($calc == "multiply") { $result = $val1 * $val2; } else if ($calc == "divide") { $result = $val1 / $val2; } ?> <HTML> <HEAD> <TITLE>Calculation Result</TITLE> </HEAD> <BODY> <P>The result of your calculation is: <? echo "$result"; ?></p> </BODY> </HTML> Now, as you'll see, if you fail to complete one of the fields or click one of the radio buttons, the form is returned. Which is fine in so far as it goes. But the script will attempt to perform calculations on non numeric fields and I also want it to return the form if anyone puts in a non numeric value. I think I need some ereg something like: (ereg("^[0-9]+[.]?[0-9]*$", $i, $p)) but I've absolutely no idea how to do it. If someone could show me, I'd be able to re-write a lot of my old C++ stuff in PHP and I'd have a fair idea how to do functions in PHP. Many thanks. -- ****************************************************************************** Marx: "Why do Anarchists only drink herbal tea?" Proudhon: "Because all proper tea is theft." ******************************************************************************
>Poor security: log in with a form or basic authentication; set cookie on >client with username/password combo (vulnerable to network sniffers, >anybody with access to browser's cookie file) >Decent security: log in with form or basic authentication; set cookie with >session id number and store user information in session database (or >session file or in session memory or however your sessions are handled...) >(vulnerable to sniffers) >Good security: perform auth over a secure connection, set cookie with >session id number and store user information (including ip address) in >session database (and check ip address for a match before allowing any >activity with the session)... (vulnerable to somebody copying a sniffed >session id and spoofing the ip address to trick the remote site) >Very good: keep the thing on a secure connection all the time, set a >session id cookie and keep all user info (possibly including remote ip) in >the server's session db... (vulnerable to nothing I can think of at the >moment...) > >There are probably more things you could do I haven't thought of... but >this oughta be a decent start ;) > >--Toby Wow, I never thought of using the remote IP! Thanks for the tip. I am going to use it today for an authentication system I'm building. Kristofer -- ______________________________________ Kristofer Widholm Web Pharmacy [EMAIL PROTECTED] 191 Grand Street, Brooklyn NY 11211 718.599.4893 ______________________________________
> Wow, I never thought of using the remote IP! Thanks for the tip. I > am going to use it today for an authentication system I'm building. Please note that remote IP is NOT reliable. For clients behind the proxies & gateways of large ISP's (AOL is the prime example) you can see the remote address bounce around from number to number, even within the same session, depending on which path the data takes. For more information, see http://webmaster.info.aol.com/ - Tim
> >Very good: keep the thing on a secure connection all the time, set a > >session id cookie and keep all user info (possibly including > >remote ip) in the server's session db... (vulnerable to nothing I can > think of at the moment...) > > Wow, I never thought of using the remote IP! Thanks for the tip. I > am going to use it today for an authentication system I'm building. Careful. This will die in the butt if the client comes in from an ISP using load-balancing proxy servers. Jason -- Jason Murray [EMAIL PROTECTED] Web Design Team, Melbourne IT Fetch the comfy chair!
excuse my density today my brain is still in weekend mode how would I make this loop put 4 or 5 items (haven't decided) per line instead of just one item and the checkbox on each line? <snip> echo "<table border='1' cellpadding='2' cellspacing='2'>"; while($myrow = mysql_fetch_array($result2)) { $name = $myrow["name"]; $personal_cost = $myrow["personal_cost"]; $small_cost = $myrow["small_cost"]; $large_cost = $myrow["large_cost"]; $category = $myrow["category"]; echo "<tr>"; echo "<td>"; echo $name; echo "</td>"; echo "<td><input type=checkbox name=topping value=".$cost.">".$cost."</td>"; echo "</tr>"; } echo "</table>"; </snip> Jerry Lake
On Mon, 15 Jan 2001, Jerry Lake wrote: > excuse my density today > my brain is still in weekend mode > > how would I make this loop put 4 or 5 items (haven't decided) > per line instead of just one item and the checkbox on each line? > > <snip> > echo "<table border='1' cellpadding='2' cellspacing='2'>"; > > while($myrow = mysql_fetch_array($result2)) > { > $name = $myrow["name"]; > $personal_cost = $myrow["personal_cost"]; > $small_cost = $myrow["small_cost"]; > $large_cost = $myrow["large_cost"]; > $category = $myrow["category"]; > > echo "<tr>"; > echo "<td>"; > echo $name; > echo "</td>"; > echo "<td><input type=checkbox name=topping value=".$cost.">".$cost."</td>"; > echo "</tr>"; > } > echo "</table>"; > </snip> > > Jerry Lake > Join the club :) <?php define('PERLINE', 4); // or 5, depending on taste ... echo "<table border='1' cellpadding='2' cellspacing='2'>"; echo "<tr>"; $i=0; $numrows=mysql_num_rows($result2); while($myrow = mysql_fetch_array($result2)) { ++$i; ... echo "<td>"; ... echo "</td>"; if (!($i%PERLINE) and ($numrows!=$i)) { echo("</tr><tr>"); }; }; echo "</tr>"; echo "</table>"; ?> -- Ignacio Vazquez-Abrams <[EMAIL PROTECTED]>
Thanks, (Ignacio) I came up with this <snip> $counter++; if ($counter > "4") { $counter = "1"; echo "</tr><tr bgcolor=" . $colors[ $i ++ % count( $colors ) ] . ">"; } </snip> Jerry Lake -----Original Message----- From: Ignacio Vazquez-Abrams [mailto:[EMAIL PROTECTED]] Sent: Monday, January 15, 2001 1:22 PM To: Jerry Lake Cc: PHP List Subject: Re: [PHP] looping On Mon, 15 Jan 2001, Jerry Lake wrote: > excuse my density today > my brain is still in weekend mode > > how would I make this loop put 4 or 5 items (haven't decided) > per line instead of just one item and the checkbox on each line? > > <snip> > echo "<table border='1' cellpadding='2' cellspacing='2'>"; > > while($myrow = mysql_fetch_array($result2)) > { > $name = $myrow["name"]; > $personal_cost = $myrow["personal_cost"]; > $small_cost = $myrow["small_cost"]; > $large_cost = $myrow["large_cost"]; > $category = $myrow["category"]; > > echo "<tr>"; > echo "<td>"; > echo $name; > echo "</td>"; > echo "<td><input type=checkbox name=topping value=".$cost.">".$cost."</td>"; > echo "</tr>"; > } > echo "</table>"; > </snip> > > Jerry Lake > Join the club :) <?php define('PERLINE', 4); // or 5, depending on taste ... echo "<table border='1' cellpadding='2' cellspacing='2'>"; echo "<tr>"; $i=0; $numrows=mysql_num_rows($result2); while($myrow = mysql_fetch_array($result2)) { ++$i; ... echo "<td>"; ... echo "</td>"; if (!($i%PERLINE) and ($numrows!=$i)) { echo("</tr><tr>"); }; }; echo "</tr>"; echo "</table>"; ?> -- Ignacio Vazquez-Abrams <[EMAIL PROTECTED]>
if you want to do 10 / 3 i want it to show 3 and not 3.33333 how do I control that? - Thanks
look at the math functions. also, number_format() might be your friend. At 19:53 15.1. 2001, [EMAIL PROTECTED] wrote the following: -------------------------------------------------------------- >if you want to do >10 / 3 >i want it to show 3 and not 3.33333 > >how do I control that? > > >- Thanks > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] ------end of quote------ ____________________________________________________________ Cynic: A member of a group of ancient Greek philosophers who taught that virtue constitutes happiness and that self control is the essential part of virtue. [EMAIL PROTECTED]
--- [EMAIL PROTECTED] wrote: > if you want to do > 10 / 3 > i want it to show 3 and not 3.33333 > > how do I control that? > $a= 10/3; echo (int)$a; echo $a; ----Result 3 3.33333 regards ===== ==================== Ing. Alejandro Garín Telecom Internet __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
$a= intvalue(10/3) echo($a) Cal http://www.calevans.com -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, January 15, 2001 12:53 PM To: [EMAIL PROTECTED] Subject: [PHP] simple division.. but how? if you want to do 10 / 3 i want it to show 3 and not 3.33333 how do I control that? - Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Hello Everybody, I want to take a number and echo it with only 2 numbers after the decimal point. I can't remember how to do this but I do remember it was easy. Thank you, -------------------------------------------- Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com --------------------------------------------
<? $price = 12.00; echo number_format($price, 2); ?> Chris Lee Mediawaveonline.com "Brandon Orther" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello Everybody, > > I want to take a number and echo it with only 2 numbers after the decimal > point. I can't remember how to do this but I do remember it was easy. > > Thank you, > > -------------------------------------------- > Brandon Orther > WebIntellects Design/Development Manager > [EMAIL PROTECTED] > 800-994-6364 > www.webintellects.com > -------------------------------------------- > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Hey folks, I've been experimenting with creating some graphics on the fly with GD. So far, so good. However, I've switched ISP's, and their gd doesn't support gifs. I've tried changing the header syntax header("content-Type: image/gif") to header("content-Type: image/png"); and the imagegif to imagepng, and all I get when I try to view the image is a broken quicktime icon. Is there some browser setting I need to change? Thanks in advance, Kelly ----------------------------------------------------------- This message was sent using Crocker Communications WebMail. https://webmail.crocker.com/
On Mon, 15 Jan 2001 19:52:29 GMT, [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote: >Hey folks, > >I've been experimenting with creating some graphics on the fly with >GD. So >far, so good. However, I've switched ISP's, and their gd doesn't >support >gifs. I've tried changing the header syntax header("content-Type: >image/gif") >to header("content-Type: image/png"); and the imagegif to imagepng, >and all I >get when I try to view the image is a broken quicktime icon. > >Is there some browser setting I need to change? > >Thanks in advance, What browser are you using? They started putting png in on ie4.0 and nn4.04
3 questions I guess. I'm writing a SYSV LP script in PHP so that I can have a print-to-database (MySQL) solution. First question: Am I wasting my time? Are there already canned solutions? (LPRng perhaps?) Second question: How do I go about opening file descriptors by numeric referance? (LP calls script with file descriptors for passing back debug and status info). Third question: How do I trap a signal (SIGTERM specifically) in a PHP script? Obviously, I have the latest PHP compiled as a CGI with native MySQL support. My OS environ is Solaris 7. John T. Foley Network Administrator Pollak Engineered Products, Actuator Products Division, A Stoneridge Company 195 Freeport Street, Boston MA 02122 ph: (617) 474-7266 fax: (617) 282-9058 The geographical center of Boston is in Roxbury. Due north of the center we find the South End. This is not to be confused with South Boston which lies directly east from the South End. North of the South End is East Boston and southwest of East Boston is the North End.
I have download the Zend Optimizer (Running Apache 1.3.14 and PHP 4.04) and untarred it. Then I copied the ZendOptimizer.so to usr/local/Zend/lib Then I edited the PHP.ini and added: zend_optimizer.optimization_level=15 zend_extension="/usr/local/Zend/lib/ZendOptimizer.so" Somewhere near the top. Then I restarted the server using apachectl restart. I also tried stopping and starting as well. It still isn't running? Any ideas. Is there anything else that needs to be done?
--- Marcus Ouimet <[EMAIL PROTECTED]> wrote: > I have download the Zend Optimizer (Running Apache > 1.3.14 and PHP 4.04) and untarred it. Then I copied > the ZendOptimizer.so to usr/local/Zend/lib Then I > edited the PHP.ini and added: > > zend_optimizer.optimization_level=15 > zend_extension="/usr/local/Zend/lib/ZendOptimizer.so" > > > Somewhere near the top. Then I restarted the server > using apachectl restart. I also tried stopping and > starting as well. It still isn't running? Any ideas. > Is there anything else that needs to be done? > with phpinfo() you see: This program makes use of the Zend scripting language engine: Zend Engine v1.0.3, Copyright (c) 1998-2000 Zend Technologies with Zend Optimizer v0.99, Copyright (c) 1998-2000, by Zend Technologies regards ===== ============== Ing. Alejandro Garín Telecom Internet __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
I did that and it only says: This program makes use of the Zend scripting language engine: Zend Engine v1.0.3, Copyright (c) 1998-2000 Zend Technologies And nothing about the optimizer. So I am assuming that it is not running? ----- Original Message ----- From: "Alejandro Garin" <[EMAIL PROTECTED]> To: "Marcus Ouimet" <[EMAIL PROTECTED]>; "PHP" <[EMAIL PROTECTED]> Sent: Monday, January 15, 2001 12:48 PM Subject: Re: [PHP] Zend Optimizer > --- Marcus Ouimet <[EMAIL PROTECTED]> wrote: > > I have download the Zend Optimizer (Running Apache > > 1.3.14 and PHP 4.04) and untarred it. Then I copied > > the ZendOptimizer.so to usr/local/Zend/lib Then I > > edited the PHP.ini and added: > > > > zend_optimizer.optimization_level=15 > > > zend_extension="/usr/local/Zend/lib/ZendOptimizer.so" > > > > > > Somewhere near the top. Then I restarted the server > > using apachectl restart. I also tried stopping and > > starting as well. It still isn't running? Any ideas. > > Is there anything else that needs to be done? > > > > with phpinfo() you see: > > This program makes use of the Zend scripting language > engine: > Zend Engine v1.0.3, Copyright (c) 1998-2000 Zend > Technologies > with Zend Optimizer v0.99, Copyright (c) > 1998-2000, by Zend Technologies > > > regards > > > ===== > ============== > Ing. Alejandro Garín > Telecom Internet > > __________________________________________________ > Do You Yahoo!? > Get email at your own domain with Yahoo! Mail. > http://personal.mail.yahoo.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
When I look at the website (http://www.zend.com/zend/optimizer/) it says it works with PHP Version 4.0.3 or 4.0.3pl1 it says no early or later versions of PHP are supported so I would htink that is the reason why it's not working. On 1/15/01 3:07 PM this was written: > I have download the Zend Optimizer (Running Apache 1.3.14 and PHP 4.04) and > untarred it. Then I copied the ZendOptimizer.so to usr/local/Zend/lib Then I > edited the PHP.ini and added: > > zend_optimizer.optimization_level=15 > zend_extension="/usr/local/Zend/lib/ZendOptimizer.so" > > Somewhere near the top. Then I restarted the server using apachectl restart. I > also tried stopping and starting as well. It still isn't running? Any ideas. > Is there anything else that needs to be done? -- Thomas Deliduka IT Manager ------------------------- New Eve Media The Solution To Your Internet Angst http://www.neweve.com/
Sorry in advance for being redundant. I was unable to find the answer I needed, on the php.net site. We have a mailto form, which uses the mail() funciton. For the most part, it works as intended. All of my headers seem to be coming through intact (To, From, Reply-To, Return-Path, Error-To, etc). However, if the message should bounce, it always bounces back to nobody. When we want it to bounce back to say, rch instead. Can any offer a possible solution here? TIA -- Robert Hough ([EMAIL PROTECTED])
Your Return-Path: header should have that email address. Jeremy Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more Get your own Free, Private email at http://www.smackdown.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com On Mon, 15 Jan 2001, Robert Hough wrote: > Date: Mon, 15 Jan 2001 15:13:42 -0500 (EST) > From: Robert Hough <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: [PHP] mail() question > > Sorry in advance for being redundant. I was unable to find the answer I > needed, on the php.net site. > > We have a mailto form, which uses the mail() funciton. For the most part, > it works as intended. All of my headers seem to be coming through intact > (To, From, Reply-To, Return-Path, Error-To, etc). > > However, if the message should bounce, it always bounces back to nobody. > When we want it to bounce back to say, rch instead. Can any offer a > possible solution here? > > TIA > > -- > Robert Hough ([EMAIL PROTECTED]) > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
On Mon, 15 Jan 2001, jeremy brand wrote: > Your Return-Path: header should have that email address. Thanks, but as stated in my post, all of my headers Return-Path included, are coming through correctly. Here is what I am using for my headers, is there something missing here? $headers .= "From: $sender_name $sender_address\n"; $headers .= "X-Sender: $sender_address\n"; $headers .= "X-Mailer: $version\n"; $headers .= "Return-Path: $sender_address\n"; $headers .= "Error-To: $sender_address\n"; -- Robert Hough ([EMAIL PROTECTED])
I understand. So, does $sender_address have the email address that you want it returned to? You didn't specifically say this, that is why I asked. If you actually get the mail sent on the internet, and the headers contain explicit instructions, then the mail has no choice but to return to who you specify in the Return-Path:. Jeremy Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more Get your own Free, Private email at http://www.smackdown.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com On Mon, 15 Jan 2001, Robert Hough wrote: > Date: Mon, 15 Jan 2001 15:27:06 -0500 (EST) > From: Robert Hough <[EMAIL PROTECTED]> > To: jeremy brand <[EMAIL PROTECTED]> > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] mail() question > > On Mon, 15 Jan 2001, jeremy brand wrote: > > Your Return-Path: header should have that email address. > > Thanks, but as stated in my post, all of my headers > Return-Path included, are coming through correctly. Here is what I am > using for my headers, is there something missing here? > > $headers .= "From: $sender_name $sender_address\n"; > $headers .= "X-Sender: $sender_address\n"; > $headers .= "X-Mailer: $version\n"; > $headers .= "Return-Path: $sender_address\n"; > $headers .= "Error-To: $sender_address\n"; > > > -- > Robert Hough ([EMAIL PROTECTED]) > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
On Mon, 15 Jan 2001, jeremy brand wrote: > So, does $sender_address have the email address that you want it > returned to? You didn't specifically say this, that is why I asked. Sorry, yes it does. The message, if delivered properly, is fine. The receiver can hit "Reply" and that works as intended. The From field also displays correctly. The problem happens when the message bounces. For whatever reason, if the message bounces, it returns to nobody. Which, of course is what the web server is running as. -- Robert Hough ([EMAIL PROTECTED])
Well, I don't know exactly what you mean by a bounce. But, an undelivered email will return to the Return-Path address. Why don't you forward the actuall email headers to the list and I can look at them. Jeremy Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more Get your own Free, Private email at http://www.smackdown.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com On Mon, 15 Jan 2001, Robert Hough wrote: > Date: Mon, 15 Jan 2001 15:53:01 -0500 (EST) > From: Robert Hough <[EMAIL PROTECTED]> > To: jeremy brand <[EMAIL PROTECTED]> > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] mail() question > > On Mon, 15 Jan 2001, jeremy brand wrote: > > So, does $sender_address have the email address that you want it > > returned to? You didn't specifically say this, that is why I asked. > > Sorry, yes it does. The message, if delivered properly, is fine. The > receiver can hit "Reply" and that works as intended. The From field also > displays correctly. > > The problem happens when the message bounces. For whatever reason, if the > message bounces, it returns to nobody. Which, of course is what the web > server is running as. > > -- > Robert Hough ([EMAIL PROTECTED]) > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
>> Thanks, but as stated in my post, all of my headers >> Return-Path included, are coming through correctly. >From the sendmail bat book: > The Return-Path: header is intended to show the envelope address of > the real sender ... it is intended to be used solely for notification > of delivery errors. > > There must be only one Return-Path: header in any mail message, and > should be placed there by the site performing final delivery. > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
On Mon, 15 Jan 2001, jeremy brand wrote: > Why don't you forward the actuall email headers to the list and I can > look at them. Well, after checking the headers myself, it doesn't look like sendmail is accepting my return-path, or php isn't sending it. Headers below: Received: (from nobody@localhost) by trinity.solveinteractive.com (8.11.1/8.11.1) id f0FKhQQ84040; Mon, 15 Jan 2001 15:43:26 -0500 (EST) (envelope-from nobody) Date: Mon, 15 Jan 2001 15:43:26 -0500 (EST) Message-Id: <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: Test message from PHP Test Mailer v1.1.1a From: Robert Hough <[EMAIL PROTECTED]> X-Sender: <[EMAIL PROTECTED]> X-Mailer: PHP Test Mailer v1.1.1a Error-To: <[EMAIL PROTECTED]> Content-Type: text X-UIDL: 21fbef1b63923735e759e4f52ab267bd Status: RO X-Status: X-Keywords: X-UID: 6 -- Robert Hough ([EMAIL PROTECTED])
On Mon, 15 Jan 2001 16:05:22 -0500, Egan <[EMAIL PROTECTED]> wrote: > >>> Thanks, but as stated in my post, all of my headers >>> Return-Path included, are coming through correctly. > > >>From the sendmail bat book: > > >> The Return-Path: header is intended to show the envelope address of >> the real sender ... it is intended to be used solely for notification >> of delivery errors. >> >> There must be only one Return-Path: header in any mail message, and >> should be placed there by the site performing final delivery. >> >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If the real sender is "nobody" then just make an alias in your aliases file to point "nobody" to somebody. :-)
I think that you answered your own question. I know that PHP sends Return-Path: headers, I do it all the time. But, I use qmail. All I can say is good luck with sendmail.cf (<bad humor>I hope you have enough system memory to open it in a text editor </bad bumor>) Jeremy Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more Get your own Free, Private email at http://www.smackdown.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com On Mon, 15 Jan 2001, Robert Hough wrote: > Date: Mon, 15 Jan 2001 16:08:18 -0500 (EST) > From: Robert Hough <[EMAIL PROTECTED]> > To: jeremy brand <[EMAIL PROTECTED]> > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] mail() question > > On Mon, 15 Jan 2001, jeremy brand wrote: > > Why don't you forward the actuall email headers to the list and I can > > look at them. > > Well, after checking the headers myself, it doesn't look like sendmail is > accepting my return-path, or php isn't sending it. Headers below: > > > Received: (from nobody@localhost) > by trinity.solveinteractive.com (8.11.1/8.11.1) id f0FKhQQ84040; > Mon, 15 Jan 2001 15:43:26 -0500 (EST) > (envelope-from nobody) > Date: Mon, 15 Jan 2001 15:43:26 -0500 (EST) > Message-Id: <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: Test message from PHP Test Mailer v1.1.1a > From: Robert Hough <[EMAIL PROTECTED]> > X-Sender: <[EMAIL PROTECTED]> > X-Mailer: PHP Test Mailer v1.1.1a > Error-To: <[EMAIL PROTECTED]> > Content-Type: text > X-UIDL: 21fbef1b63923735e759e4f52ab267bd > Status: RO > X-Status: > X-Keywords: > X-UID: 6 > > -- > Robert Hough ([EMAIL PROTECTED]) > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
On Mon, 15 Jan 2001 16:08:18 -0500 (EST), Robert Hough <[EMAIL PROTECTED]> wrote: >Well, after checking the headers myself, it doesn't look like sendmail is >accepting my return-path, or php isn't sending it. Headers below: > >Received: (from nobody@localhost) > by trinity.solveinteractive.com (8.11.1/8.11.1) id f0FKhQQ84040; > Mon, 15 Jan 2001 15:43:26 -0500 (EST) > (envelope-from nobody) >>>>>>> ^^^^^^^^ Right. Notice the keyword "envelope" above, and see "Return-Path:" in the bat book. The site performing final delivery controls Return-Path:
On Mon, 15 Jan 2001 13:16:23 -0800 (PST), jeremy brand <[EMAIL PROTECTED]> wrote: >I think that you answered your own question. I know that PHP sends >Return-Path: headers, I do it all the time. Then stop it! :-) See the sendmail bat book, even if using qmail: >>> There must be only one Return-Path: header in any mail message, and >>> should be placed there by the site performing final delivery. >>> >>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The site performing final delivery looks at the envelope address to determine "Return-Path: thus making it useless to send these headers yourself.
I asked the same question some weeks ago! The problem is, my root installed the mail-function so that "nobody" is the owner of the send-process! I wanted the same thing as you want - At last I did a workaround (not bad for sending that small amount of mails I do): I configured .procmailrc, so the mails I want to send are sent to my local account (specific subject), and then sendmail is called (the mail is sent with MY USER)! If I use headers like Error-To:, they now work as expected!! I hope you understand my filthy english! witty -- Sent through GMX FreeMail - http://www.gmx.net
Quick update, for anyone interested... I managed to answer my own question, but I'd still like to thank everyone that replied, it did lead me to the right place. What I ended up doing was using sendmail with the -f option. This did require me to add a new trusted user to my sendmail.cf though. Once that was done, I just used popen to dump the message to sendmail. Here's the ugly/incomplete version of the code. If you can't figure it out, or want to see the exacts let me know off list, and I'll send it to ya in the morning (read, give me time to clean it up). $mailer = "/usr/sbin/sendmail -t -i [EMAIL PROTECTED]"; $fd = popen($mailer, "w"); fputs($fd, "$headers"); fputs($fd, "$message"); pclose($fd); -- Robert Hough ([EMAIL PROTECTED])
I've got a strange thing with overriding an ini file in PHP. I'm trying to implement a simple example of a script that allows a file to be uploaded. I put an <INPUT TYPE="file" NAME="myfile" ENCTYPE="multipart/form-data"> tag on the form, along with a submit button. (yeah, the rest of the HTML is fine...) The script gets the file, uploads it, and the $myfile variable says the uploaded file is named something like "/var/tmp/phpq32345". However, I don't have write permissions to /var/tmp. (Neither does the process doing the actual upload!) I created a php3.ini file in the same directory that contains the script. It has only the line: upload_tmp_dir = myuploads Then I created a directory named myuploads in the same dir with 2777 perms. However, the script never sees this ini file! I printed out the cwd from the script, and it IS the same dir where the php3.ini file resides; I can even exec a command 'ls -l *.ini' and it shows up there just fine. I tried setting $PHPRC inside the script, but that doesn't work. I'm not sure how to inject PHPRC into the php script environment, because the scripts run as user "nobody". I can't figure out how to override the default location. Any suggestions? FYI: this is running on PHP 3.0.14, Apache 1.3.12 on a FreeBSD 4.0 platform. -David Schwartz
Hi, I have a script that worked up until I upgraded the server from PHP 4.0.2 to 4.0.4. I get: 1 is not a valid PostgreSQL link resource. Why is this broken all of a sudden? here is some code: function SQLCall($call){ global $psqlhost, $psqldb, $rows, $result; $db_connect=pg_connect("host=$psqlhost dbname=$psqldb"); $result=pg_exec($db_connect, "$call"); $rows=pg_numrows($result); } $call="insert into agents (fname, lname, address, city, state, zip, email, country, homephone, workphone, company, username, password, created, visits, fax, status, pridomain, title) values ('$fname', '$lname', '$address', '$city', '$bizstate', '$zip', '$email', '$country', '$homephone', '$workphone', '$company', '$username', '$cryptpass', '$created', $visits, '$fax', '$status', '$pridomain', '$title')"; SQLCall($call); include("results/newagent.php"); This (bug?) seems to only affect INSERT calls to pg_sql. The functions within the script which use UPDATE sql calls (using the same SQLCall($call) function in this script work fine. Any ideas? Thanks, Kris
It's b/c the globals in 4.0.4pl1 are not working, at least that's why mine broke. Try replacing the globals in the function with the actual variable declarations and see if the problem goes away. If not, I guess it's a different problem, but that fixed it for me. ----------------------------------------------------------------- Jonathan Rosenberg Be fierce, be fabulous, change the world! ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, January 15, 2001 3:21 PM Subject: [PHP] 4.0.4 Postgres link resource bug? > Hi, > > I have a script that worked up until I upgraded the server from PHP > 4.0.2 to 4.0.4. I get: > > 1 is not a valid PostgreSQL link resource. Why is this broken all of > a sudden? here is some code: > > function SQLCall($call){ > global $psqlhost, $psqldb, $rows, $result; > $db_connect=pg_connect("host=$psqlhost > dbname=$psqldb"); > $result=pg_exec($db_connect, "$call"); > $rows=pg_numrows($result); > } > > $call="insert into agents (fname, lname, address, city, state, > zip, email, > country, homephone, workphone, company, username, password, > created, visits, fax, status, > pridomain, title) values ('$fname', '$lname', '$address', '$city', > '$bizstate', > '$zip', '$email', '$country', '$homephone', '$workphone', '$company', > '$username', > '$cryptpass', '$created', $visits, '$fax', '$status', '$pridomain', > '$title')"; > SQLCall($call); > include("results/newagent.php"); > > This (bug?) seems to only affect INSERT calls to pg_sql. The > functions within the script which use UPDATE sql calls (using the > same SQLCall($call) function in this script work fine. > > Any ideas? > > Thanks, > > Kris > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Apologies if this is documented here, especially since it seems to be something commonly done, but I couldn't locate it. My problem: We are running PHP 4 on a Solaris 2.7 box with Apache 1.3.11 with mod_perl 1.24. We need to communicate with 3rd-party Perl APIs from within PHP to handle processing of a form. The API functions each expect an associated array and will return a result value to the calling party. I would assume that we would use exec( 'perl cgi-bin/myscript.pl', $assoc_array, $return_value) to do this, placing the perl script I write to handle the values in the server's cgi-bin directory. If this seems right, I would see the array in the perl script by parsing out the array, getting the values and sending them to the API functions. When I get the returned value from the called perl function in the API, I return it by assigning it to the third parameter in the perl script. I've worked with perl before, but it's been a while and I am trying to get back in the perl mind frame and I've never combined it with PHP so I could be off here. Any help would be greatly appreciated. TIA ---------------------- Kevin McCarthy Body & Soul http://www.bodynsoul.com
Has anyone gotten PHP 4.04 to compile with PDFLIB support? I have successfully compiled pdflib and all of it's supporting libs. (It runs the tests that come with it) But when I ./configure php, I use: ./configure --with-pdflib=/usr/local/lib And in the output of configure I see: ... checking whether to include Pdflib 3.x support... /usr/local/lib no ... I can't seem to figure out how to make it say YES! Any help would be greatly appreciated. Cal Cal http://www.calevans.com
On Mon, 15 Jan 2001, Cal Evans wrote: >But when I ./configure php, I use: > >./configure --with-pdflib=/usr/local/lib Leave the /lib part out..ie. use --with-pdflib=/usr/local instead. --Jani
You sir (or madam), are a god among men! Thanks for the assist. Cal http://www.calevans.com -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jani Taskinen Sent: Monday, January 15, 2001 3:59 PM To: Cal Evans Cc: [EMAIL PROTECTED] Subject: Re: [PHP] PDFLIB 3.0 PHP 4.04 On Mon, 15 Jan 2001, Cal Evans wrote: >But when I ./configure php, I use: > >./configure --with-pdflib=/usr/local/lib Leave the /lib part out..ie. use --with-pdflib=/usr/local instead. --Jani
BC Math, Arbitrary Precision Numbers? Can someone shed some light on these functions for me? Thanks. ----------------------------------------------------------------------- .:: Nathan Cook - Network/Security Admin office: 208.343.3110 - Web Programmer email: [EMAIL PROTECTED] - Qmail Admin pager: 208.387.9983 - MIS Admin -----------------------------------------------------------------------
They do just what they say. see: http://php.net/bc One drawback is that PHP can't natively handle these big numbers, so the return values from these functions are of type string. Jeremy Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more Get your own Free, Private email at http://www.smackdown.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com On Mon, 15 Jan 2001, Nathan Cook wrote: > Date: Mon, 15 Jan 2001 14:19:55 -0700 > From: Nathan Cook <[EMAIL PROTECTED]> > To: Php List <[EMAIL PROTECTED]> > Subject: [PHP] BC Math > > BC Math, Arbitrary Precision Numbers? > > Can someone shed some light on these functions for me? > Thanks. > ----------------------------------------------------------------------- > .:: Nathan Cook - Network/Security Admin > office: 208.343.3110 - Web Programmer > email: [EMAIL PROTECTED] - Qmail Admin > pager: 208.387.9983 - MIS Admin > ----------------------------------------------------------------------- > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
I always get this error when trying to connect to the mailbox. I have installed uw imap server. Warning: Couldn't open stream {localhost:143} in /home/httpd/html/webmail/mailbox.php on line 12 Affected line is: $connection = IMAP_Open("{localhost:143}", $name, $psw); tia Dezider
On Fri, 29 Dec 2000, Dezider [iso-8859-2] Góra wrote: > I always get this error when trying to connect to the mailbox. I have > installed uw imap server. > > Warning: Couldn't open stream {localhost:143} in > /home/httpd/html/webmail/mailbox.php on line 12 > > Affected line is: > > $connection = IMAP_Open("{localhost:143}", $name, $psw); > > tia > Dezider > Did you activate it in inetd or xinetd? Did you restart inetd or xinetd? -- Ignacio Vazquez-Abrams <[EMAIL PROTECTED]>
Sometimes clients put a dollar sign "$" in a form that only needs a number (like "1.50"). Is there a way to take a post variable and automatically convert it to a float value, stripping off any non-numeric characters? I tried doubleval() without success and I can't use intval() because it has decimals. kind regards, bill
At 4:28 PM -0500 1/15/01, bill wrote: >Sometimes clients put a dollar sign "$" in a form that only needs a >number (like "1.50"). > >Is there a way to take a post variable and automatically convert it to a >float value, stripping off any non-numeric characters? > >I tried doubleval() without success and I can't use intval() because it >has decimals. > >kind regards, > $SanitizedNumber = ereg_replace('[^0-9.]', '', $NumberString); If you really need to make this a float variable, then you can add $Number = (float)$SanitizedNumber; although in most cases PHP handles type conversion correctly on-the-fly. - steve +--- "They've got a cherry pie there, that'll kill ya" ------------------+ | Steve Edberg University of California, Davis | | [EMAIL PROTECTED] Computer Consultant | | http://aesric.ucdavis.edu/ http://pgfsun.ucdavis.edu/ | +-------------------------------------- FBI Special Agent Dale Cooper ---+
I am trying to allow various users to upload their own picture. What I would like to happen is to have the copy statement rename the .jpg image to the username. For example, if the username is mike, then I want the picture to be renamed mike.jpg The following is a snippet of code: <?PHP print "$CUserName" //ensures name is carried over from session if(copy($userfile,"c:/phpweb/userpics/$CUserName.jpg")) { print "Your picture has been uploaded!"; } else { print "Error"; } unlink($userfile) ?> The errors I get are as follows: Warning: unable to open " for reading: Permission denied in c:\phpweb/fuploadconfirm.php on line 15 Warning: Unlink failed (No such file or directory) in c:\phpweb/fuploadconfirm.php on line 31 Line 15 is the if copy($userfile........) line in the above code AND Line 31 is the unlink statement at the end. Thanks, Mike
are you running php in safemode? according to http://php.net/manual/en/function.unlink.php unlink() may not work with windows servers, I have no personal experience with windows so I can not confirm this. have you tried http://php.net/manual/en/function.move-uploaded-file.php this might be better suited. Chris Lee Mediawaveonline.com "Mike Yuen" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I am trying to allow various users to upload their own picture. What I > would like to happen is to have the copy statement rename the .jpg > image to the username. For example, if the username is mike, then I want > the picture to be renamed mike.jpg > > The following is a snippet of code: > > <?PHP > print "$CUserName" //ensures name is carried over from session > > if(copy($userfile,"c:/phpweb/userpics/$CUserName.jpg")) > { > print "Your picture has been uploaded!"; > } > else > { > print "Error"; > } > > unlink($userfile) > ?> > > The errors I get are as follows: > Warning: unable to open " for reading: Permission denied in > c:\phpweb/fuploadconfirm.php on line 15 > Warning: Unlink failed (No such file or directory) in > c:\phpweb/fuploadconfirm.php on line 31 > > Line 15 is the if copy($userfile........) line in the above code > > AND > > Line 31 is the unlink statement at the end. > > Thanks, > Mike > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Unlink works on some installations, not others. I think it works on NT but not 95 or perhaps the other way around. Why is this? Unlink is hardly an unsupported system call in windows! Anybody know? Gfunk - http://www.gfunk007.com/ I sense much beer in you. Beer leads to intoxication, intoxication to hangovers, and hangovers to... suffering. ----- Original Message ----- From: "Chris Lee" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, January 16, 2001 12:47 PM Subject: Re: [PHP] HELP WITH UPLOAD REQUIRED!!!!!!!! > are you running php in safemode? > > according to > http://php.net/manual/en/function.unlink.php > unlink() may not work with windows servers, I have no personal experience > with windows so I can not confirm this. > > have you tried > http://php.net/manual/en/function.move-uploaded-file.php > this might be better suited. > > Chris Lee > Mediawaveonline.com > > > "Mike Yuen" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > I am trying to allow various users to upload their own picture. What I > > would like to happen is to have the copy statement rename the .jpg > > image to the username. For example, if the username is mike, then I want > > the picture to be renamed mike.jpg > > > > The following is a snippet of code: > > > > <?PHP > > print "$CUserName" //ensures name is carried over from session > > > > if(copy($userfile,"c:/phpweb/userpics/$CUserName.jpg")) > > { > > print "Your picture has been uploaded!"; > > } > > else > > { > > print "Error"; > > } > > > > unlink($userfile) > > ?> > > > > The errors I get are as follows: > > Warning: unable to open " for reading: Permission denied in > > c:\phpweb/fuploadconfirm.php on line 15 > > Warning: Unlink failed (No such file or directory) in > > c:\phpweb/fuploadconfirm.php on line 31 > > > > Line 15 is the if copy($userfile........) line in the above code > > > > AND > > > > Line 31 is the unlink statement at the end. > > > > Thanks, > > Mike > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Josh G wrote: > Unlink works on some installations, not others. I think it works on NT > but not 95 or perhaps the other way around. Why is this? Unlink is > hardly an unsupported system call in windows! Anybody know? Unlink comes from UNIX so it's probably supported by NT rather than Win9x. This is just a guess, though. Wagner -- One maniac alone can do what 20 together cannot
A rose by any other name would smell as sweet, and I'm sure I remember deleting files back in my old dos days, not to mention win95 ;-) Gfunk - http://www.gfunk007.com/ I sense much beer in you. Beer leads to intoxication, intoxication to hangovers, and hangovers to... suffering. ----- Original Message ----- From: "Alexander Wagner" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, January 16, 2001 1:01 PM Subject: Re: [PHP] HELP WITH UPLOAD REQUIRED!!!!!!!! > Josh G wrote: > > Unlink works on some installations, not others. I think it works on NT > > but not 95 or perhaps the other way around. Why is this? Unlink is > > hardly an unsupported system call in windows! Anybody know? > > Unlink comes from UNIX so it's probably supported by NT rather than Win9x. > This is just a guess, though. > > Wagner > > -- > One maniac alone can do what 20 together cannot > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Josh G wrote: > A rose by any other name would smell as sweet, and I'm sure I > remember deleting files back in my old dos days, not to mention > win95 ;-) Um, I suppose every OS does. (I deleted one file or another as well) However this was about unlink, wasn't it? Unlink, basically, is a UNIX command. I don't really know how PHP-unlink works but it is possible that it simply won't work in a non-UNIX-environment. NT in a few ways is pretty close to UNIX so it may work here as well. Closer than 9x, anyway. Be warned. This whole mail is based on guesses. If you wanna know, try it, or ask someone who did. Wagner -- One maniac alone can do what 20 together cannot
This only applies to PHP 4.0.4 Back with PHP 4.0.2, I could do this: <?PHP $string = "[["; $string = preg_replace("/(\W)/", "\\\\1", $string); ?> $string would then contain "\[\[". Now, if I use that same code, $string contains "\\1\\1\\1\\1". I tried to compensate for this using PHP's new ability to allow perl syntax in the replace section. <?PHP $string = "[["; $string = preg_replace("/(\W)/", "\\$1", $string); ?> That leaves $string with "\$1\$1\$1\$1". Which tells me it thought I was backreferencing the $. So, to combat said assumption, I tried three, four, even five slashes in front of $1, and nothing worked. All I got were variations of "\$1\$1\$1\$1". I have to assume this is a bug, since this worked back in 4.0.2 which I stopped using due to segfaults under certain circumstances. Ideas? -- +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ | Shaun M. Thomas INN Database Programmer | | Phone: (309) 743-0812 Fax : (309) 743-0830 | | Email: [EMAIL PROTECTED] AIM : trifthen | | Web : hamster.lee.net | | | | "Most of our lives are about proving something, either to | | "ourselves or to someone else." | | -- Anonymous | +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
How can I do an array like below 100-1? <OPTION VALUE=\"100\"></OPTION> <OPTION VALUE=\"99\"></OPTION> <OPTION VALUE=\"98\"></OPTION> <OPTION VALUE=\"97\"></OPTION> to <OPTION VALUE=\"3\"></OPTION> <OPTION VALUE=\"2\"></OPTION> <OPTION VALUE=\"1\"></OPTION> WreckRman2 Combat Flight Center http://www.combatfs.com
for ($i=100; $i>0; $i++) print "<OPTION VALUE=\\\"$i\\\"></OPTION>\n"; But, I presume you would rather do this: for ($i=100; $i>0; $i++) print "<OPTION VALUE=\"$i\"></OPTION>\n"; because I can't imagine why you would want to escape double quotes in HTML. Jeremy Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more Get your own Free, Private email at http://www.smackdown.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com On Mon, 15 Jan 2001, WreckRman2 wrote: > Date: Mon, 15 Jan 2001 16:48:21 -0500 > From: WreckRman2 <[EMAIL PROTECTED]> > To: "'Php-General@Lists. Php. Net'" <[EMAIL PROTECTED]> > Subject: [PHP] Array... > > > How can I do an array like below 100-1? > > <OPTION VALUE=\"100\"></OPTION> > <OPTION VALUE=\"99\"></OPTION> > <OPTION VALUE=\"98\"></OPTION> > <OPTION VALUE=\"97\"></OPTION> > > to > > <OPTION VALUE=\"3\"></OPTION> > <OPTION VALUE=\"2\"></OPTION> > <OPTION VALUE=\"1\"></OPTION> > > WreckRman2 > Combat Flight Center > http://www.combatfs.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
> for ($i=100; $i>0; $i++) shouldn't it be $i--? this loop would run forever... > print "<OPTION VALUE=\\\"$i\\\"></OPTION>\n"; > > But, I presume you would rather do this: > for ($i=100; $i>0; $i++) > print "<OPTION VALUE=\"$i\"></OPTION>\n"; > > because I can't imagine why you would want to escape double quotes in > HTML. > > Jeremy > > Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] > http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more > Get your own Free, Private email at http://www.smackdown.com/ > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com > > On Mon, 15 Jan 2001, WreckRman2 wrote: > > > Date: Mon, 15 Jan 2001 16:48:21 -0500 > > From: WreckRman2 <[EMAIL PROTECTED]> > > To: "'Php-General@Lists. Php. Net'" <[EMAIL PROTECTED]> > > Subject: [PHP] Array... > > > > > > How can I do an array like below 100-1? > > > > <OPTION VALUE=\"100\"></OPTION> > > <OPTION VALUE=\"99\"></OPTION> > > <OPTION VALUE=\"98\"></OPTION> > > <OPTION VALUE=\"97\"></OPTION> > > > > to > > > > <OPTION VALUE=\"3\"></OPTION> > > <OPTION VALUE=\"2\"></OPTION> > > <OPTION VALUE=\"1\"></OPTION> > > > > WreckRman2 > > Combat Flight Center > > http://www.combatfs.com > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
*laughs* Yes. :) It is only 2:07 PM.. forgive me. Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more Get your own Free, Private email at http://www.smackdown.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com On Mon, 15 Jan 2001, Johannes Janson wrote: > Date: Mon, 15 Jan 2001 23:08:33 +0100 > From: Johannes Janson <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: Re: [PHP] Array... > > > for ($i=100; $i>0; $i++) > > shouldn't it be $i--? this loop would run forever... > > > print "<OPTION VALUE=\\\"$i\\\"></OPTION>\n"; > > > > But, I presume you would rather do this: > > for ($i=100; $i>0; $i++) > > print "<OPTION VALUE=\"$i\"></OPTION>\n"; > > > > because I can't imagine why you would want to escape double quotes in > > HTML. > > > > Jeremy > > > > Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: > [EMAIL PROTECTED] > > http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more > > Get your own Free, Private email at http://www.smackdown.com/ > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com > > > > On Mon, 15 Jan 2001, WreckRman2 wrote: > > > > > Date: Mon, 15 Jan 2001 16:48:21 -0500 > > > From: WreckRman2 <[EMAIL PROTECTED]> > > > To: "'Php-General@Lists. Php. Net'" <[EMAIL PROTECTED]> > > > Subject: [PHP] Array... > > > > > > > > > How can I do an array like below 100-1? > > > > > > <OPTION VALUE=\"100\"></OPTION> > > > <OPTION VALUE=\"99\"></OPTION> > > > <OPTION VALUE=\"98\"></OPTION> > > > <OPTION VALUE=\"97\"></OPTION> > > > > > > to > > > > > > <OPTION VALUE=\"3\"></OPTION> > > > <OPTION VALUE=\"2\"></OPTION> > > > <OPTION VALUE=\"1\"></OPTION> > > > > > > WreckRman2 > > > Combat Flight Center > > > http://www.combatfs.com > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
On Mon, 15 Jan 2001 13:57:04 -0800 (PST), jeremy brand ([EMAIL PROTECTED]) wrote: >for ($i=100; $i>0; $i++) > print "<OPTION VALUE=\\\"$i\\\"></OPTION>\n"; > >But, I presume you would rather do this: >for ($i=100; $i>0; $i++) ^^^ should be $i-- > print "<OPTION VALUE=\"$i\"></OPTION>\n"; or how about: <?for($i=100; $i>0; $i--){?> <OPTION VALUE="<?echo $i?>"></OPTION> <?}?>
I have found metabase to be superior to any other abstraction layer I've ever come across. Hey, it also allows you to do DB schema definitions with XML files, which is hugely cool. We're running development of commercial-grade (tested, yadda-yadda) doing development on mySQL, and moving to Oracle in production. With no problems. Without metabase, I would consider the above suicidal and idiotic, but with metabase it works like a charm. If you'd like other resources beyond an abstraction layer (like authentication, permissions, and all kinds of other groovy tools), have a look at binarycloud.com. _a -- Alex Black, Head Monkey [EMAIL PROTECTED] The Turing Studio, Inc. http://www.turingstudio.com vox+510.666.0074 fax+510.666.0093 Saul Zaentz Film Center 2600 Tenth St Suite 433 Berkeley, CA 94710-2522 > From: [EMAIL PROTECTED] (Michael Kimsal) > Newsgroups: php.general > Date: 15 Jan 2001 06:28:19 -0800 > Subject: Re: [PHP] Perl-like DBI and generic SQL > > > > Dean Hall wrote: > >> I read once on this list that PHP supports a DBI-like database access object >> (such as the one in Perl). Is this true? Does anyone know where I can find >> documentation for it? I can't seem to find it in the manual. >> >> Also, how do you all handle generic SQL for multiple DBMSs? I'd like >> (ideally) to write SQL that is DBMS-independent, although that's probably not >> possible. I'm very familiar with mysql and not much else; as far as I'm >> aware, mysql is the primary DBMS that has problems with standard SQL (like >> nested queries and such). Does anyone even worry about this? >> >> I'm writing a little piece of software that I'd like to be as extensible as >> possible and as usable as possible for people using any DBMS, including >> mysql. >> >> Anyway, if I can't find a generic built-in database interface in PHP, it'll >> all be moot. I'd really rather not use phplib; I'd like to use an interface >> built in to the interpreter rather than something that's interpreted on every >> page access. >> > > You won't find one. The 'benefit' of PHP is that is, for the most part, uses > native db drivers for access to each db. Should be a bit faster and allows > access to the specific features of each db. > > There is a PEAR repository which offers something similar to DBI, afaik, but > it's not widely discussed, from what I can see. PEAR is a set of files that > comes with a distribution, and there is a README. People on shared host > environments may be out of luck here, though, with respect to a README (d/l > the file and read it manualyl I guess). > > "metabase" from manuel lemos purports to be a single interface to multiple dbs > - write one SQL statement and it'd do the necessary translation on the SQL to > be specific to whatever db you are using. Haven't used it, but heard nice > things about it. But, it violates your 'not interpreted' clause. > > Good luck. > > > > >> >> Thanks for the help. >> Dean. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
case "phone_us": if(ereg("^([2-9][0-9]{2})([2-9][0-9]{2})([0-9]{4})$", $var)){ return TRUE; }else{ set_stringtypes_error(throw_error3("lib_string_types_108", $var)); } break; case "phone_int": if(!preg_match("/[^0-9\(\)\-\. ]/", $var)){ return TRUE; }else{ set_stringtypes_error(throw_error("lib_string_types_109", $var)); } break; works good for us. that's from the stringtypes lib in binarycloud. we're going to convert all of that stuff to be stored as rules in XML... groovy changes are afoot! _alex -- Alex Black, Head Monkey [EMAIL PROTECTED] The Turing Studio, Inc. http://www.turingstudio.com vox+510.666.0074 fax+510.666.0093 Saul Zaentz Film Center 2600 Tenth St Suite 433 Berkeley, CA 94710-2522 > From: [EMAIL PROTECTED] (Vikram Vaswani) > Newsgroups: php.general > Date: 15 Jan 2001 04:23:51 -0800 > Subject: [PHP] Regex for telephone number > > Hi! > > Can someone help me out with a regex to validate a phone number? > > Thanks > > Vikram > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
> Can someone help me out with a regex to validate a phone number? That's a tough one, because 555-5555 is just as valid as 1-800-BILLME. And here in Australia we have 131166 (yes, all you Aussies, that *IS* Pizza Hut's number... I couldn't think of any others :)) The best you can really do is make sure that its over a certain length. Jason -- Jason Murray [EMAIL PROTECTED] Web Design Team, Melbourne IT Fetch the comfy chair!
I know this has been discussed, but it messing with me. in a script I'm working on I pull out an array of checkboxes from a database, how do I store what people select back to the DB all I end up with is the last selection of the array. Jerry Lake -----Original Message----- From: jeremy brand [mailto:[EMAIL PROTECTED]] Sent: Monday, January 15, 2001 1:57 PM To: WreckRman2 Cc: 'Php-General@Lists. Php. Net' Subject: Re: [PHP] Array... for ($i=100; $i>0; $i++) print "<OPTION VALUE=\\\"$i\\\"></OPTION>\n"; But, I presume you would rather do this: for ($i=100; $i>0; $i++) print "<OPTION VALUE=\"$i\"></OPTION>\n"; because I can't imagine why you would want to escape double quotes in HTML. Jeremy Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more Get your own Free, Private email at http://www.smackdown.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com On Mon, 15 Jan 2001, WreckRman2 wrote: > Date: Mon, 15 Jan 2001 16:48:21 -0500 > From: WreckRman2 <[EMAIL PROTECTED]> > To: "'Php-General@Lists. Php. Net'" <[EMAIL PROTECTED]> > Subject: [PHP] Array... > > > How can I do an array like below 100-1? > > <OPTION VALUE=\"100\"></OPTION> > <OPTION VALUE=\"99\"></OPTION> > <OPTION VALUE=\"98\"></OPTION> > <OPTION VALUE=\"97\"></OPTION> > > to > > <OPTION VALUE=\"3\"></OPTION> > <OPTION VALUE=\"2\"></OPTION> > <OPTION VALUE=\"1\"></OPTION> > > WreckRman2 > Combat Flight Center > http://www.combatfs.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
What I see is that the below is not an array of checkboxes (that would be <input type="checkbox" ...>, not <option ...>). <Option> ... are part of a <select> But, to make a checkbox be checked, you simply do this: <input type="checkbox" ... checked> Jeremy Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more Get your own Free, Private email at http://www.smackdown.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com On Mon, 15 Jan 2001, Jerry Lake wrote: > Date: Mon, 15 Jan 2001 14:03:00 -0800 > From: Jerry Lake <[EMAIL PROTECTED]> > To: "'Php-General@Lists. Php. Net'" <[EMAIL PROTECTED]> > Subject: [PHP] checkboxes into MySQL > > I know this has been discussed, > but it messing with me. > > in a script I'm working on > I pull out an array of checkboxes > from a database, > > how do I store what people select > back to the DB > > all I end up with is the last selection > of the array. > > Jerry Lake > > -----Original Message----- > From: jeremy brand [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 15, 2001 1:57 PM > To: WreckRman2 > Cc: 'Php-General@Lists. Php. Net' > Subject: Re: [PHP] Array... > > > for ($i=100; $i>0; $i++) > print "<OPTION VALUE=\\\"$i\\\"></OPTION>\n"; > > But, I presume you would rather do this: > for ($i=100; $i>0; $i++) > print "<OPTION VALUE=\"$i\"></OPTION>\n"; > > because I can't imagine why you would want to escape double quotes in > HTML. > > Jeremy > > Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] > http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more > Get your own Free, Private email at http://www.smackdown.com/ > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com > > On Mon, 15 Jan 2001, WreckRman2 wrote: > > > Date: Mon, 15 Jan 2001 16:48:21 -0500 > > From: WreckRman2 <[EMAIL PROTECTED]> > > To: "'Php-General@Lists. Php. Net'" <[EMAIL PROTECTED]> > > Subject: [PHP] Array... > > > > > > How can I do an array like below 100-1? > > > > <OPTION VALUE=\"100\"></OPTION> > > <OPTION VALUE=\"99\"></OPTION> > > <OPTION VALUE=\"98\"></OPTION> > > <OPTION VALUE=\"97\"></OPTION> > > > > to > > > > <OPTION VALUE=\"3\"></OPTION> > > <OPTION VALUE=\"2\"></OPTION> > > <OPTION VALUE=\"1\"></OPTION> > > > > WreckRman2 > > Combat Flight Center > > http://www.combatfs.com > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
it took me a while to find this out, too. If you have say, 5 checkboxes, name them like so: <input type="checkbox" name="musicians[]" value="monk"> <input type="checkbox" name="musicians[]" value="trane"> <input type="checkbox" name="musicians[]" value="miles"> <input type="checkbox" name="musicians[]" value="dizzy"> <input type="checkbox" name="musicians[]" value="bird"> when submitted, in the script processing the form, check the array $musicians[]. The checked selections will be included as elements. So if trane and bird were checked, you will have a 2-element array in $musicians[]. $musicians[0] == "trane" $musicians[1] == "bird" HTH. At 02:03 PM 1/15/2001 -0800, Jerry Lake wrote: >I know this has been discussed, >but it messing with me. > >in a script I'm working on >I pull out an array of checkboxes >from a database, > >how do I store what people select >back to the DB > >all I end up with is the last selection >of the array. > >Jerry Lake > >-----Original Message----- >From: jeremy brand [mailto:[EMAIL PROTECTED]] >Sent: Monday, January 15, 2001 1:57 PM >To: WreckRman2 >Cc: 'Php-General@Lists. Php. Net' >Subject: Re: [PHP] Array... > > >for ($i=100; $i>0; $i++) > print "<OPTION VALUE=\\\"$i\\\"></OPTION>\n"; > >But, I presume you would rather do this: >for ($i=100; $i>0; $i++) > print "<OPTION VALUE=\"$i\"></OPTION>\n"; > >because I can't imagine why you would want to escape double quotes in >HTML. > >Jeremy > >Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] >http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more >Get your own Free, Private email at http://www.smackdown.com/ >- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com > >On Mon, 15 Jan 2001, WreckRman2 wrote: > > > Date: Mon, 15 Jan 2001 16:48:21 -0500 > > From: WreckRman2 <[EMAIL PROTECTED]> > > To: "'Php-General@Lists. Php. Net'" <[EMAIL PROTECTED]> > > Subject: [PHP] Array... > > > > > > How can I do an array like below 100-1? > > > > <OPTION VALUE=\"100\"></OPTION> > > <OPTION VALUE=\"99\"></OPTION> > > <OPTION VALUE=\"98\"></OPTION> > > <OPTION VALUE=\"97\"></OPTION> > > > > to > > > > <OPTION VALUE=\"3\"></OPTION> > > <OPTION VALUE=\"2\"></OPTION> > > <OPTION VALUE=\"1\"></OPTION> > > > > WreckRman2 > > Combat Flight Center > > http://www.combatfs.com > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] Kevin McCarthy Body & Soul http://www.bodynsoul.com
OK, I got a simple search page working (thanks to all of you who helped me). Another simple question for you. If I had a search and the data to be searched needs to be determined by check boxes, How would I write the sql>? Like this? $sql = "SELECT * FROM table WHERE town LIKE '%$search_data%' OR street LIKE '%$search_data%' "; Is "OR" even the correct syntax? Here's how I tried it, which didn't give any results..... (Where reference is the id number (or map reference) and search_data is the text field for users to tpye the query. if ($reference != "") $search_reference = "OR id LIKE '%$reference%'"; } $sql = "SELECT * FROM table WHERE town LIKE '%$search_data%' $search_reference"; $result = @mysql_query($sql,$connection) or die (mysql_error()); $num = mysql_num_rows($result); TIA, James.
try this: $sql = "SELECT * FROM table WHERE town LIKE '%$search_data%' "; if ($reference != "") $sql .= "OR whatever"; ""James, Yz"" <[EMAIL PROTECTED]> schrieb im Newsbeitrag 93vs2p$cng$[EMAIL PROTECTED]">news:93vs2p$cng$[EMAIL PROTECTED]... > OK, I got a simple search page working (thanks to all of you who helped me). > > Another simple question for you. If I had a search and the data to be > searched needs to be determined by check boxes, How would I write the sql>? > Like this? > > $sql = "SELECT * FROM table > WHERE town LIKE '%$search_data%' OR street LIKE '%$search_data%' "; > > Is "OR" even the correct syntax? Here's how I tried it, which didn't give > any results..... > > (Where reference is the id number (or map reference) and search_data is the > text field for users to tpye the query. > > if ($reference != "") > $search_reference = "OR id LIKE '%$reference%'"; > } > > $sql = "SELECT * FROM table > WHERE town LIKE '%$search_data%' $search_reference"; > > $result = @mysql_query($sql,$connection) > or die (mysql_error()); > > $num = mysql_num_rows($result); > > > TIA, > James. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
""Johannes Janson"" <[EMAIL PROTECTED]> wrote in message 93vs9u$osj$[EMAIL PROTECTED]">news:93vs9u$osj$[EMAIL PROTECTED]... > try this: > $sql = "SELECT * FROM table > WHERE town LIKE '%$search_data%' "; > > if ($reference != "") > $sql .= "OR whatever"; Ah, so you can constantiate (right word?) the query? Cool, Thanks ;) James.
> Ah, so you can constantiate (right word?) the query? I don't know what you mean by 'constantiate', but glad to hear it worked otis
> > Ah, so you can constantiate (right word?) the query? > > I don't know what you mean by 'constantiate', but glad to hear it worked It did, thank you ;) Someone pointed out where I'd gone wrong with the word privately: >> Ah, so you can constantiate (right word?) the query? > concatenate :)
Hi. I use password() to excrypt my passwords when I'm adding users to my mysql database. I'm wondering if there's a function to use to un-encrypt it (for a web interface to change the password, and so the admin who is editing user info can see what it is). Thanks for any help. Jason
Have a look at the base64_encode / decode stuff. I stumbled across an example there just this afternoon. It's available in the user contributed notes of the Quick Reference section for those functions at http://www.php.net James. ""Jason Jacobs"" <[EMAIL PROTECTED]> wrote in message 011501c07f3f$c415bcc0$5800a8c0@doc">news:011501c07f3f$c415bcc0$5800a8c0@doc... > Hi. I use password() to excrypt my passwords when I'm adding users to my > mysql database. I'm wondering if there's a function to use to un-encrypt it > (for a web interface to change the password, and so the admin who is editing > user info can see what it is). Thanks for any help. > > Jason > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Note that base64 encode/decode keeps passwords from being readily readable but does NOT protect anything from being decoded. The reason you can't decode Password and MD5 encrypted passwords is that if you could, all you'd have to do is find the encrypted version and decrypt it. Again, _anybody can decrypt a base64_encode()'d string_ if they get hold of it. --Toby ----- Original Message ----- From: "James, Yz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, January 15, 2001 6:51 PM Subject: Re: [PHP] password() > Have a look at the base64_encode / decode stuff. I stumbled across an > example there just this afternoon. > > It's available in the user contributed notes of the Quick Reference section > for those functions at http://www.php.net > > > James. > > > ""Jason Jacobs"" <[EMAIL PROTECTED]> wrote in message > 011501c07f3f$c415bcc0$5800a8c0@doc">news:011501c07f3f$c415bcc0$5800a8c0@doc... > > Hi. I use password() to excrypt my passwords when I'm adding users to my > > mysql database. I'm wondering if there's a function to use to un-encrypt > it > > (for a web interface to change the password, and so the admin who is > editing > > user info can see what it is). Thanks for any help. > > > > Jason > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
simple answer is no. the only way to decrypt the passwd is to run it through a cracker. All admins are used to this and know that if a user has lost a passwd that they are going to have to give them a new one, finding the old just isnt work one week of processing time :) Im curious to see how other php developers store their passwd's -plain text in db -use of unix password() -use of db password() -other ? Chris Lee Mediawaveonline.com ""Jason Jacobs"" <[EMAIL PROTECTED]> wrote in message 011501c07f3f$c415bcc0$5800a8c0@doc">news:011501c07f3f$c415bcc0$5800a8c0@doc... > Hi. I use password() to excrypt my passwords when I'm adding users to my > mysql database. I'm wondering if there's a function to use to un-encrypt it > (for a web interface to change the password, and so the admin who is editing > user info can see what it is). Thanks for any help. > > Jason > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
> Im curious to see how other php developers store their passwd's I store it in the "universal include file" as $password["User"] = "Encrypted password"; Then when the user logs in: if (encryption_function($entered_password) == $password[$entered_username]) { Do this stuff } else{ echo("Please don't hack the llamas"); } I'm serious about that last bit: Anyone who types in a wrong password gets a "Please don't hack the llamas" message.
>> the horse is back from the dead! > >huh? inside joke. > Why? If nested tables can do the work, i won't bother learning how layers > work... um, I mean in your application design, not your html. >> I don't like to do database connections when I've already output markup, >> what if something goes wrong, or I want to do a redirect, etc? > > If something goes wrong -> It's the DBA fault. :-) hehe in a production encironment: agh! >> I like to access functions in "DB Object" files - those functions return >> results in arrays which I can pass into markup. >> >> Makes the code a _helluvuh_ lot more maintainable. > > I'm pretty comfortable programming directly with OCIwhatever() functions > directly in the main code, that's it. ok, go ahead. that in my opinion is not the way to go, especially for portability and reuse of code... it's also the quick route to hair-pulling if you QA your code... > In other words, i don't need to make my code more maintainable because i'm > comfortable with maintaining it right now. well, then why bother arguing the point? my opinion only matters if you care about it? otherwise I'm just babbling. (ohh I see some responses to this one) >> True, but why not just bitch at macromedia until they include support for >> PHP in ultradev? > > (Well, i haven't purchased dreamweaver either) good, that means you're not using any diabolical visual tools :) >> (plegh, visual authoring tools: a necessary evil) > > Why, when you have notepad.exe and a couple of browsers to test that the > pages work properly? whoa, dude. that's scary. but do whatever you want! -alex
sorry about that, I forgot to erase the old post info here is a chunk of the code I am using <snip> //inclusion of pizza toppings from DB $query = ("SELECT * FROM toppings"); $result2 = mysql_db_query($DBName, $query) or die("Error in MySQL query"); echo "<table border='1' cellpadding='2' cellspacing='2'>"; echo "<tr bgcolor=" . $colors[ $i ++ % count( $colors ) ] . ">"; $colors = array( '#e4e4e4', '#ffffff' ); $i = 0; while($myrow = mysql_fetch_array($result2)) { $counter++; if ($counter > "4") { $counter = "1"; echo "</tr><tr bgcolor=" . $colors[ $i ++ % count( $colors ) ] . ">"; } $name = $myrow["name"]; $personal_cost = $myrow["personal_cost"]; $small_cost = $myrow["small_cost"]; $medium_cost = $myrow["medium_cost"]; $large_cost = $myrow["large_cost"]; $category = $myrow["category"]; </snip> <snip> echo "<td valign=top align=left>\r\n"; echo "<input type=checkbox name=".$name." value=".$cost.">".$name."</td>"; echo "</td>\r\n"; } if ($counter < 3) { while ($counter < 3) { echo "<td> </td>"; $counter++; } } echo "</tr>"; echo "</table>"; // memory flush mysql_free_result($result2); //end topping section </snip> Jerry Lake - [EMAIL PROTECTED] Web Designer Europa Communications - http://www.europa.com Pacifier Online - http://www.pacifier.com
Hi Jerry, Feel free (as in GPL) to use my libHtmlForm functions. This should solve your problem. http://www.nirvani.net/software/libHtmlForm/ See: html_input_checkbox() specifically. Jeremy Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more Get your own Free, Private email at http://www.smackdown.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com On Mon, 15 Jan 2001, Jerry Lake wrote: > Date: Mon, 15 Jan 2001 14:11:18 -0800 > From: Jerry Lake <[EMAIL PROTECTED]> > To: "'Php-General@Lists. Php. Net'" <[EMAIL PROTECTED]> > Subject: [PHP] checkboxes into MySQL(trying again) > > sorry about that, > I forgot to erase the old post > info > > here is a chunk of the code I am using > <snip> > //inclusion of pizza toppings from DB > $query = ("SELECT * FROM toppings"); > $result2 = mysql_db_query($DBName, $query) or > die("Error in MySQL query"); > > echo "<table border='1' cellpadding='2' cellspacing='2'>"; > echo "<tr bgcolor=" . $colors[ $i ++ % count( $colors ) ] . ">"; > > $colors = array( '#e4e4e4', '#ffffff' ); > > $i = 0; > > while($myrow = mysql_fetch_array($result2)) { > $counter++; > if ($counter > "4") { > $counter = "1"; > echo "</tr><tr bgcolor=" . $colors[ $i ++ % count( $colors ) ] . ">"; > } > $name = $myrow["name"]; > $personal_cost = $myrow["personal_cost"]; > $small_cost = $myrow["small_cost"]; > $medium_cost = $myrow["medium_cost"]; > $large_cost = $myrow["large_cost"]; > $category = $myrow["category"]; > </snip> > > <snip> > echo "<td valign=top align=left>\r\n"; > echo "<input type=checkbox name=".$name." value=".$cost.">".$name."</td>"; > echo "</td>\r\n"; > } > if ($counter < 3) { > while ($counter < 3) { > echo "<td> </td>"; > $counter++; > } > } > echo "</tr>"; > > echo "</table>"; > // memory flush > mysql_free_result($result2); > //end topping section > </snip> > > Jerry Lake - [EMAIL PROTECTED] > Web Designer > Europa Communications - http://www.europa.com > Pacifier Online - http://www.pacifier.com > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
And the answer about merging logs for webalizer is: > Is there a way to create a combined report showing hits to a number of > separate servers all handling the same web sites. > > I am guessing all you have to do is feed it each of the log files in > turn, and make sure you don't duplicate them. I think it requires not > using incremental mode, but I hope you know for sure. I am in the > process of recommending it on the php-general mailing list. Q: I have multiple load-balanced servers (or I'm using DNS round-robin to accoplish the same thing) and I want to generate one webalizer report for the whole farm, but each server generates its own log file. When I run webalizer on each of the logfiles in turn, it ignores a lot of the records because it thinks they're out of order! A: You need to merge all of the logfiles together so that webalizer sees the records in chronological order. One good way to do that on the fly is with mergelog (http://mergelog.sourceforge.net/), a quick common logfile sorter. An example: mergelog <server1>.log <server2>.log <server3>.log | webalizer -- Bradford L. Barrett [EMAIL PROTECTED] A free electron in a sea of neutrons DoD#1750 KD4NAW The only thing Micro$oft has done for society, is make people believe that computers are inherently unreliable.
Has anyone configured PHP to work with FDF on a PPC box? If so, do you have any helpful hints that may get me up and running. Thanks for the help. [EMAIL PROTECTED]
I'm seeing strange behavior with Magic Quotes in PHP on my ISP hosted accounts. Basically, it's not consistently removing the escaped backslashes before displaying. For instance, take the following piece database text (stored in, say, a character field).... It's fun to be a penguin. If I do a simple retrieve and echo on a webpage, I will get the following 80% of the time.. It's fun to be a penguin. But, the other 20% of the time I get It\'s fun to be a penguin. There's something inconsistent about the way MagicQuotes are removed by the system...it's as if the system gets "busy" or the cache gets flushed before PHP gets the opportunity to unescape the single quotes. Is anyone else seeing this behavior and has any suggestions on how to make it work more consistent? Yes, I've been including "stripslashes" to try to make SURE that these slashes get removed, but that doesn't work all the time EITHER. Roy
I have a snipet of code i'm using for a file maintanance program. I have no idea why but when the main loop repeats, the is_dir function doesn't return true even though it prints out a directory in the server. chdir("/certain/place/for/files/"); $handle=opendir("."); $file=readdir($handle); //to get rid of "." and ".." $file=readdir($handle); while($file=readdir($handle)) { if (is_dir($file)){ chdir("/certain/place/for/files/".$file."/"); $handle2=opendir("."); $file2=readdir($handle2); $file2=readdir($handle2); while($file2=readdir($handle2)) { ?> <tr bgcolor="<?php if ($j==0) { echo "ffffff"; $j=1; } else if ($j==1) { echo "ffffcf"; $j=0; } ?>"> <td><a href="website<?php echo $file;?>/<?php echo $file2;?>">[view]</a></td> <td><?php echo $file2;?></td> <td><a href="deleteimage.php3?file=<?php echo $file2;?>&root=<?php echo $file;?>">[delete]</a></td> </tr> <? } } else{ ?> <tr bgcolor="<?php if ($j==0) { echo "ffffff"; $j=1; } else if ($j==1) { echo "ffffcf"; $j=0; } ?>"> <td><a href="website<?php echo $file;?>">[view]</a></td> <td><?php echo $file;?></td> <td><a href="deleteimage.php3?file=<?php echo $file;?>&root=/">[delete]</a></td> </tr> <? } the script will print out the contents of the first directory but then the others are never opened, just printed out. Thanks Patrick }
Instead I am curious how other developers on this list are returning the MD5, password() or whatever in permanently encrypted passwords... What are procedures and what is the way the return process work? Any tricks/tips to share with all of us? Cheers, Maxim Maletsky -----Original Message----- From: Chris Lee [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 16, 2001 10:53 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] password() simple answer is no. the only way to decrypt the passwd is to run it through a cracker. All admins are used to this and know that if a user has lost a passwd that they are going to have to give them a new one, finding the old just isnt work one week of processing time :) Im curious to see how other php developers store their passwd's -plain text in db -use of unix password() -use of db password() -other ? Chris Lee Mediawaveonline.com ""Jason Jacobs"" <[EMAIL PROTECTED]> wrote in message 011501c07f3f$c415bcc0$5800a8c0@doc">news:011501c07f3f$c415bcc0$5800a8c0@doc... > Hi. I use password() to excrypt my passwords when I'm adding users to my > mysql database. I'm wondering if there's a function to use to un-encrypt it > (for a web interface to change the password, and so the admin who is editing > user info can see what it is). Thanks for any help. > > Jason > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
I'm not sure I understand the question. What exactly do you mean? Are you talking about returning it from the client already encrypted? Not sure if anybody does that, as JS doesn't have a whole lot of useful encryption stuff in it, and iirc the md5() algorith is rather lengthy. Gfunk - http://www.gfunk007.com/ I sense much beer in you. Beer leads to intoxication, intoxication to hangovers, and hangovers to... suffering. ----- Original Message ----- From: "Maxim Maletsky" <[EMAIL PROTECTED]> To: "'Chris Lee'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, January 16, 2001 1:01 PM Subject: RE: [PHP] password() ::: and it's return... > > Instead I am curious how other developers on this list are returning the > MD5, password() or whatever in permanently encrypted passwords... > > What are procedures and what is the way the return process work? > Any tricks/tips to share with all of us? > > Cheers, > Maxim Maletsky > > > > -----Original Message----- > From: Chris Lee [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, January 16, 2001 10:53 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] password() > > > simple answer is no. the only way to decrypt the passwd is to run it through > a cracker. All admins are used to this and know that if a user has lost a > passwd that they are going to have to give them a new one, finding the old > just isnt work one week of processing time :) > > Im curious to see how other php developers store their passwd's > -plain text in db > -use of unix password() > -use of db password() > -other ? > > Chris Lee > Mediawaveonline.com > > > ""Jason Jacobs"" <[EMAIL PROTECTED]> wrote in message > 011501c07f3f$c415bcc0$5800a8c0@doc">news:011501c07f3f$c415bcc0$5800a8c0@doc... > > Hi. I use password() to excrypt my passwords when I'm adding users to my > > mysql database. I'm wondering if there's a function to use to un-encrypt > it > > (for a web interface to change the password, and so the admin who is > editing > > user info can see what it is). Thanks for any help. > > > > Jason > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
No, simply when someone loses it's password. How do developers return it on their systems? What are the procedures, tips todo, tricks etc.... This is because I am working on a similar system right now, and the "password return" part is the one I am not too sure yet. Plus many of us would learn something new. Maxim Maletsky -----Original Message----- From: Josh G [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 16, 2001 11:07 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] password() ::: and it's return... I'm not sure I understand the question. What exactly do you mean? Are you talking about returning it from the client already encrypted? Not sure if anybody does that, as JS doesn't have a whole lot of useful encryption stuff in it, and iirc the md5() algorith is rather lengthy. Gfunk - http://www.gfunk007.com/ I sense much beer in you. Beer leads to intoxication, intoxication to hangovers, and hangovers to... suffering. ----- Original Message ----- From: "Maxim Maletsky" <[EMAIL PROTECTED]> To: "'Chris Lee'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, January 16, 2001 1:01 PM Subject: RE: [PHP] password() ::: and it's return... > > Instead I am curious how other developers on this list are returning the > MD5, password() or whatever in permanently encrypted passwords... > > What are procedures and what is the way the return process work? > Any tricks/tips to share with all of us? > > Cheers, > Maxim Maletsky > > > > -----Original Message----- > From: Chris Lee [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, January 16, 2001 10:53 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] password() > > > simple answer is no. the only way to decrypt the passwd is to run it through > a cracker. All admins are used to this and know that if a user has lost a > passwd that they are going to have to give them a new one, finding the old > just isnt work one week of processing time :) > > Im curious to see how other php developers store their passwd's > -plain text in db > -use of unix password() > -use of db password() > -other ? > > Chris Lee > Mediawaveonline.com > > > ""Jason Jacobs"" <[EMAIL PROTECTED]> wrote in message > 011501c07f3f$c415bcc0$5800a8c0@doc">news:011501c07f3f$c415bcc0$5800a8c0@doc... > > Hi. I use password() to excrypt my passwords when I'm adding users to my > > mysql database. I'm wondering if there's a function to use to un-encrypt > it > > (for a web interface to change the password, and so the admin who is > editing > > user info can see what it is). Thanks for any help. > > > > Jason > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
sites do though. many sites allow me to click some link and they email me my passwd in case Ive forgoten it. ICQ.com even does this. Chris Lee Mediawaveonline.com ""Josh G"" <[EMAIL PROTECTED]> wrote in message 00e401c07f60$f325c2a0$0e01a8c0@swinger">news:00e401c07f60$f325c2a0$0e01a8c0@swinger... > I'm not sure I understand the question. What exactly do you mean? Are > you talking about returning it from the client already encrypted? Not sure > if anybody does that, as JS doesn't have a whole lot of useful encryption > stuff in it, and iirc the md5() algorith is rather lengthy. > > Gfunk - http://www.gfunk007.com/ > > I sense much beer in you. Beer leads to intoxication, intoxication to > hangovers, and hangovers to... suffering. > > > ----- Original Message ----- > From: "Maxim Maletsky" <[EMAIL PROTECTED]> > To: "'Chris Lee'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Tuesday, January 16, 2001 1:01 PM > Subject: RE: [PHP] password() ::: and it's return... > > > > > > Instead I am curious how other developers on this list are returning the > > MD5, password() or whatever in permanently encrypted passwords... > > > > What are procedures and what is the way the return process work? > > Any tricks/tips to share with all of us? > > > > Cheers, > > Maxim Maletsky > > > > > > > > -----Original Message----- > > From: Chris Lee [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, January 16, 2001 10:53 AM > > To: [EMAIL PROTECTED] > > Subject: Re: [PHP] password() > > > > > > simple answer is no. the only way to decrypt the passwd is to run it > through > > a cracker. All admins are used to this and know that if a user has lost a > > passwd that they are going to have to give them a new one, finding the old > > just isnt work one week of processing time :) > > > > Im curious to see how other php developers store their passwd's > > -plain text in db > > -use of unix password() > > -use of db password() > > -other ? > > > > Chris Lee > > Mediawaveonline.com > > > > > > ""Jason Jacobs"" <[EMAIL PROTECTED]> wrote in message > > 011501c07f3f$c415bcc0$5800a8c0@doc">news:011501c07f3f$c415bcc0$5800a8c0@doc... > > > Hi. I use password() to excrypt my passwords when I'm adding users to > my > > > mysql database. I'm wondering if there's a function to use to > un-encrypt > > it > > > (for a web interface to change the password, and so the admin who is > > editing > > > user info can see what it is). Thanks for any help. > > > > > > Jason > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
I would guess the passwords are stored in plain text... on a dedicated machine, this is only as much of a risk as the machine's security in general is... still more of a risk than I'd take with data that needs to be secure... As someone mentioned earlier, if you want to provide for a user who might lose his password, I recommend that you simply force him to choose another. --Toby ----- Original Message ----- From: "Maxim Maletsky" <[EMAIL PROTECTED]> To: "'Josh G'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, January 15, 2001 9:17 PM Subject: RE: [PHP] password() ::: and it's return... > No, simply when someone loses it's password. How do developers return it on > their systems? What are the procedures, tips todo, tricks etc.... > > This is because I am working on a similar system right now, and the > "password return" part is the one I am not too sure yet. Plus many of us > would learn something new. > > Maxim Maletsky > > -----Original Message----- > From: Josh G [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, January 16, 2001 11:07 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] password() ::: and it's return... > > > I'm not sure I understand the question. What exactly do you mean? Are > you talking about returning it from the client already encrypted? Not sure > if anybody does that, as JS doesn't have a whole lot of useful encryption > stuff in it, and iirc the md5() algorith is rather lengthy. > > Gfunk - http://www.gfunk007.com/ > > I sense much beer in you. Beer leads to intoxication, intoxication to > hangovers, and hangovers to... suffering. > > > ----- Original Message ----- > From: "Maxim Maletsky" <[EMAIL PROTECTED]> > To: "'Chris Lee'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Tuesday, January 16, 2001 1:01 PM > Subject: RE: [PHP] password() ::: and it's return... > > > > > > Instead I am curious how other developers on this list are returning the > > MD5, password() or whatever in permanently encrypted passwords... > > > > What are procedures and what is the way the return process work? > > Any tricks/tips to share with all of us? > > > > Cheers, > > Maxim Maletsky > > > > > > > > -----Original Message----- > > From: Chris Lee [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, January 16, 2001 10:53 AM > > To: [EMAIL PROTECTED] > > Subject: Re: [PHP] password() > > > > > > simple answer is no. the only way to decrypt the passwd is to run it > through > > a cracker. All admins are used to this and know that if a user has lost a > > passwd that they are going to have to give them a new one, finding the old > > just isnt work one week of processing time :) > > > > Im curious to see how other php developers store their passwd's > > -plain text in db > > -use of unix password() > > -use of db password() > > -other ? > > > > Chris Lee > > Mediawaveonline.com > > > > > > ""Jason Jacobs"" <[EMAIL PROTECTED]> wrote in message > > 011501c07f3f$c415bcc0$5800a8c0@doc">news:011501c07f3f$c415bcc0$5800a8c0@doc... > > > Hi. I use password() to excrypt my passwords when I'm adding users to > my > > > mysql database. I'm wondering if there's a function to use to > un-encrypt > > it > > > (for a web interface to change the password, and so the admin who is > > editing > > > user info can see what it is). Thanks for any help. > > > > > > Jason > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
There are a few ways to go about this- 1) The "secret question" method, where the user enters a question only they would know the answer to upon signing up, and they can use this to get in if they forget the password. Which begs the question - why use a password in the first place? 2) Administrator intervention- a request is made to an administrator, who sets a new password on behalf of the user. 3) Email a generated password- Generate a password, and email it to the user. However, malicious users could do this to shut off other people's accounts, so perhaps you should have a two step process: a) the user says "I've lost my password" and an email is sent to said user's email address... b) the email contains a link to a script, which only then generates a new password and sends it back to the user. This makes sure that whoever it making the request at least has access to the email account listed for that user, and you can be more sure that nothing too shady's going on :-) Oh, and for verification, the link could be something like http://your.site.com/scripts/newpw?oldpw=foo&user=x where foo is the md5() password already in the database, so in order to spoof the link the hacker would already need to know the password or have db axs in the first place :) Hope I've given you some ideas. Gfunk - http://www.gfunk007.com/ I sense much beer in you. Beer leads to intoxication, intoxication to hangovers, and hangovers to... suffering. ----- Original Message ----- From: "Maxim Maletsky" <[EMAIL PROTECTED]> To: "'Josh G'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, January 16, 2001 1:17 PM Subject: RE: [PHP] password() ::: and it's return... > No, simply when someone loses it's password. How do developers return it on > their systems? What are the procedures, tips todo, tricks etc.... > > This is because I am working on a similar system right now, and the > "password return" part is the one I am not too sure yet. Plus many of us > would learn something new. > > Maxim Maletsky > > -----Original Message----- > From: Josh G [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, January 16, 2001 11:07 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] password() ::: and it's return... > > > I'm not sure I understand the question. What exactly do you mean? Are > you talking about returning it from the client already encrypted? Not sure > if anybody does that, as JS doesn't have a whole lot of useful encryption > stuff in it, and iirc the md5() algorith is rather lengthy. > > Gfunk - http://www.gfunk007.com/ > > I sense much beer in you. Beer leads to intoxication, intoxication to > hangovers, and hangovers to... suffering. > > > ----- Original Message ----- > From: "Maxim Maletsky" <[EMAIL PROTECTED]> > To: "'Chris Lee'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Tuesday, January 16, 2001 1:01 PM > Subject: RE: [PHP] password() ::: and it's return... > > > > > > Instead I am curious how other developers on this list are returning the > > MD5, password() or whatever in permanently encrypted passwords... > > > > What are procedures and what is the way the return process work? > > Any tricks/tips to share with all of us? > > > > Cheers, > > Maxim Maletsky > > > > > > > > -----Original Message----- > > From: Chris Lee [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, January 16, 2001 10:53 AM > > To: [EMAIL PROTECTED] > > Subject: Re: [PHP] password() > > > > > > simple answer is no. the only way to decrypt the passwd is to run it > through > > a cracker. All admins are used to this and know that if a user has lost a > > passwd that they are going to have to give them a new one, finding the old > > just isnt work one week of processing time :) > > > > Im curious to see how other php developers store their passwd's > > -plain text in db > > -use of unix password() > > -use of db password() > > -other ? > > > > Chris Lee > > Mediawaveonline.com > > > > > > ""Jason Jacobs"" <[EMAIL PROTECTED]> wrote in message > > 011501c07f3f$c415bcc0$5800a8c0@doc">news:011501c07f3f$c415bcc0$5800a8c0@doc... > > > Hi. I use password() to excrypt my passwords when I'm adding users to > my > > > mysql database. I'm wondering if there's a function to use to > un-encrypt > > it > > > (for a web interface to change the password, and so the admin who is > > editing > > > user info can see what it is). Thanks for any help. > > > > > > Jason > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Yeah, but this simply means that the password is stored somewhere unencrypted, or with a (by definition weaker) two-way encryption process. Gfunk - http://www.gfunk007.com/ I sense much beer in you. Beer leads to intoxication, intoxication to hangovers, and hangovers to... suffering. ----- Original Message ----- From: "Chris Lee" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, January 16, 2001 1:15 PM Subject: Re: [PHP] password() ::: and it's return... > sites do though. many sites allow me to click some link and they email me my > passwd in case Ive forgoten it. ICQ.com even does this. > > Chris Lee > Mediawaveonline.com > > > ""Josh G"" <[EMAIL PROTECTED]> wrote in message > 00e401c07f60$f325c2a0$0e01a8c0@swinger">news:00e401c07f60$f325c2a0$0e01a8c0@swinger... > > I'm not sure I understand the question. What exactly do you mean? Are > > you talking about returning it from the client already encrypted? Not sure > > if anybody does that, as JS doesn't have a whole lot of useful encryption > > stuff in it, and iirc the md5() algorith is rather lengthy. > > > > Gfunk - http://www.gfunk007.com/ > > > > I sense much beer in you. Beer leads to intoxication, intoxication to > > hangovers, and hangovers to... suffering. > > > > > > ----- Original Message ----- > > From: "Maxim Maletsky" <[EMAIL PROTECTED]> > > To: "'Chris Lee'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > > Sent: Tuesday, January 16, 2001 1:01 PM > > Subject: RE: [PHP] password() ::: and it's return... > > > > > > > > > > Instead I am curious how other developers on this list are returning the > > > MD5, password() or whatever in permanently encrypted passwords... > > > > > > What are procedures and what is the way the return process work? > > > Any tricks/tips to share with all of us? > > > > > > Cheers, > > > Maxim Maletsky > > > > > > > > > > > > -----Original Message----- > > > From: Chris Lee [mailto:[EMAIL PROTECTED]] > > > Sent: Tuesday, January 16, 2001 10:53 AM > > > To: [EMAIL PROTECTED] > > > Subject: Re: [PHP] password() > > > > > > > > > simple answer is no. the only way to decrypt the passwd is to run it > > through > > > a cracker. All admins are used to this and know that if a user has lost > a > > > passwd that they are going to have to give them a new one, finding the > old > > > just isnt work one week of processing time :) > > > > > > Im curious to see how other php developers store their passwd's > > > -plain text in db > > > -use of unix password() > > > -use of db password() > > > -other ? > > > > > > Chris Lee > > > Mediawaveonline.com > > > > > > > > > ""Jason Jacobs"" <[EMAIL PROTECTED]> wrote in message > > > 011501c07f3f$c415bcc0$5800a8c0@doc">news:011501c07f3f$c415bcc0$5800a8c0@doc... > > > > Hi. I use password() to excrypt my passwords when I'm adding users to > > my > > > > mysql database. I'm wondering if there's a function to use to > > un-encrypt > > > it > > > > (for a web interface to change the password, and so the admin who is > > > editing > > > > user info can see what it is). Thanks for any help. > > > > > > > > Jason > > > > > > > > > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Yeah, in fact that's my point. If you cannot decrypt a password, there's no way to return it , right? So how come these "big guys" DO return it to you? And what is the most secure way for it. Some of these companies deal with finances, the security is a REAL issue over there... Maxim Maletsky -----Original Message----- From: Chris Lee [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 16, 2001 11:16 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] password() ::: and it's return... sites do though. many sites allow me to click some link and they email me my passwd in case Ive forgoten it. ICQ.com even does this. Chris Lee Mediawaveonline.com ""Josh G"" <[EMAIL PROTECTED]> wrote in message 00e401c07f60$f325c2a0$0e01a8c0@swinger">news:00e401c07f60$f325c2a0$0e01a8c0@swinger... > I'm not sure I understand the question. What exactly do you mean? Are > you talking about returning it from the client already encrypted? Not sure > if anybody does that, as JS doesn't have a whole lot of useful encryption > stuff in it, and iirc the md5() algorith is rather lengthy. > > Gfunk - http://www.gfunk007.com/ > > I sense much beer in you. Beer leads to intoxication, intoxication to > hangovers, and hangovers to... suffering. > > > ----- Original Message ----- > From: "Maxim Maletsky" <[EMAIL PROTECTED]> > To: "'Chris Lee'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Tuesday, January 16, 2001 1:01 PM > Subject: RE: [PHP] password() ::: and it's return... > > > > > > Instead I am curious how other developers on this list are returning the > > MD5, password() or whatever in permanently encrypted passwords... > > > > What are procedures and what is the way the return process work? > > Any tricks/tips to share with all of us? > > > > Cheers, > > Maxim Maletsky > > > > > > > > -----Original Message----- > > From: Chris Lee [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, January 16, 2001 10:53 AM > > To: [EMAIL PROTECTED] > > Subject: Re: [PHP] password() > > > > > > simple answer is no. the only way to decrypt the passwd is to run it > through > > a cracker. All admins are used to this and know that if a user has lost a > > passwd that they are going to have to give them a new one, finding the old > > just isnt work one week of processing time :) > > > > Im curious to see how other php developers store their passwd's > > -plain text in db > > -use of unix password() > > -use of db password() > > -other ? > > > > Chris Lee > > Mediawaveonline.com > > > > > > ""Jason Jacobs"" <[EMAIL PROTECTED]> wrote in message > > 011501c07f3f$c415bcc0$5800a8c0@doc">news:011501c07f3f$c415bcc0$5800a8c0@doc... > > > Hi. I use password() to excrypt my passwords when I'm adding users to > my > > > mysql database. I'm wondering if there's a function to use to > un-encrypt > > it > > > (for a web interface to change the password, and so the admin who is > > editing > > > user info can see what it is). Thanks for any help. > > > > > > Jason > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Well it's up to you wether or not to encrypt passwords, but it's very irresponsible not to. If somebody cracks your system, chances are they'll get passwords that can be used on accounts your users have in other places, so your customers suffer more than they should for your lax in security. People say "but if they're in my db then the damage is done" but you're not the only one out there, and like it or not, there's no way anybody can manage a different password on every damned site that makes you sign up. Gfunk - http://www.gfunk007.com/ I sense much beer in you. Beer leads to intoxication, intoxication to hangovers, and hangovers to... suffering. ----- Original Message ----- From: "Maxim Maletsky" <[EMAIL PROTECTED]> To: "'Chris Lee'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, January 16, 2001 1:27 PM Subject: RE: [PHP] password() ::: and it's return... > Yeah, in fact that's my point. If you cannot decrypt a password, there's no > way to return it , right? > So how come these "big guys" DO return it to you? > And what is the most secure way for it. Some of these companies deal with > finances, the security is a REAL issue over there... > > Maxim Maletsky > > -----Original Message----- > From: Chris Lee [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, January 16, 2001 11:16 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] password() ::: and it's return... > > > sites do though. many sites allow me to click some link and they email me my > passwd in case Ive forgoten it. ICQ.com even does this. > > Chris Lee > Mediawaveonline.com > > > ""Josh G"" <[EMAIL PROTECTED]> wrote in message > 00e401c07f60$f325c2a0$0e01a8c0@swinger">news:00e401c07f60$f325c2a0$0e01a8c0@swinger... > > I'm not sure I understand the question. What exactly do you mean? Are > > you talking about returning it from the client already encrypted? Not sure > > if anybody does that, as JS doesn't have a whole lot of useful encryption > > stuff in it, and iirc the md5() algorith is rather lengthy. > > > > Gfunk - http://www.gfunk007.com/ > > > > I sense much beer in you. Beer leads to intoxication, intoxication to > > hangovers, and hangovers to... suffering. > > > > > > ----- Original Message ----- > > From: "Maxim Maletsky" <[EMAIL PROTECTED]> > > To: "'Chris Lee'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > > Sent: Tuesday, January 16, 2001 1:01 PM > > Subject: RE: [PHP] password() ::: and it's return... > > > > > > > > > > Instead I am curious how other developers on this list are returning the > > > MD5, password() or whatever in permanently encrypted passwords... > > > > > > What are procedures and what is the way the return process work? > > > Any tricks/tips to share with all of us? > > > > > > Cheers, > > > Maxim Maletsky > > > > > > > > > > > > -----Original Message----- > > > From: Chris Lee [mailto:[EMAIL PROTECTED]] > > > Sent: Tuesday, January 16, 2001 10:53 AM > > > To: [EMAIL PROTECTED] > > > Subject: Re: [PHP] password() > > > > > > > > > simple answer is no. the only way to decrypt the passwd is to run it > > through > > > a cracker. All admins are used to this and know that if a user has lost > a > > > passwd that they are going to have to give them a new one, finding the > old > > > just isnt work one week of processing time :) > > > > > > Im curious to see how other php developers store their passwd's > > > -plain text in db > > > -use of unix password() > > > -use of db password() > > > -other ? > > > > > > Chris Lee > > > Mediawaveonline.com > > > > > > > > > ""Jason Jacobs"" <[EMAIL PROTECTED]> wrote in message > > > 011501c07f3f$c415bcc0$5800a8c0@doc">news:011501c07f3f$c415bcc0$5800a8c0@doc... > > > > Hi. I use password() to excrypt my passwords when I'm adding users to > > my > > > > mysql database. I'm wondering if there's a function to use to > > un-encrypt > > > it > > > > (for a web interface to change the password, and so the admin who is > > > editing > > > > user info can see what it is). Thanks for any help. > > > > > > > > Jason > > > > > > > > > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
that's very true, you put in the risk the others accounts.... Maxim Maletsky -----Original Message----- From: Josh G [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 16, 2001 11:32 AM To: PHP User Group Subject: Re: [PHP] password() ::: and it's return... Well it's up to you wether or not to encrypt passwords, but it's very irresponsible not to. If somebody cracks your system, chances are they'll get passwords that can be used on accounts your users have in other places, so your customers suffer more than they should for your lax in security. People say "but if they're in my db then the damage is done" but you're not the only one out there, and like it or not, there's no way anybody can manage a different password on every damned site that makes you sign up. Gfunk - http://www.gfunk007.com/ I sense much beer in you. Beer leads to intoxication, intoxication to hangovers, and hangovers to... suffering. ----- Original Message ----- From: "Maxim Maletsky" <[EMAIL PROTECTED]> To: "'Chris Lee'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, January 16, 2001 1:27 PM Subject: RE: [PHP] password() ::: and it's return... > Yeah, in fact that's my point. If you cannot decrypt a password, there's no > way to return it , right? > So how come these "big guys" DO return it to you? > And what is the most secure way for it. Some of these companies deal with > finances, the security is a REAL issue over there... > > Maxim Maletsky > > -----Original Message----- > From: Chris Lee [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, January 16, 2001 11:16 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] password() ::: and it's return... > > > sites do though. many sites allow me to click some link and they email me my > passwd in case Ive forgoten it. ICQ.com even does this. > > Chris Lee > Mediawaveonline.com > > > ""Josh G"" <[EMAIL PROTECTED]> wrote in message > 00e401c07f60$f325c2a0$0e01a8c0@swinger">news:00e401c07f60$f325c2a0$0e01a8c0@swinger... > > I'm not sure I understand the question. What exactly do you mean? Are > > you talking about returning it from the client already encrypted? Not sure > > if anybody does that, as JS doesn't have a whole lot of useful encryption > > stuff in it, and iirc the md5() algorith is rather lengthy. > > > > Gfunk - http://www.gfunk007.com/ > > > > I sense much beer in you. Beer leads to intoxication, intoxication to > > hangovers, and hangovers to... suffering. > > > > > > ----- Original Message ----- > > From: "Maxim Maletsky" <[EMAIL PROTECTED]> > > To: "'Chris Lee'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > > Sent: Tuesday, January 16, 2001 1:01 PM > > Subject: RE: [PHP] password() ::: and it's return... > > > > > > > > > > Instead I am curious how other developers on this list are returning the > > > MD5, password() or whatever in permanently encrypted passwords... > > > > > > What are procedures and what is the way the return process work? > > > Any tricks/tips to share with all of us? > > > > > > Cheers, > > > Maxim Maletsky > > > > > > > > > > > > -----Original Message----- > > > From: Chris Lee [mailto:[EMAIL PROTECTED]] > > > Sent: Tuesday, January 16, 2001 10:53 AM > > > To: [EMAIL PROTECTED] > > > Subject: Re: [PHP] password() > > > > > > > > > simple answer is no. the only way to decrypt the passwd is to run it > > through > > > a cracker. All admins are used to this and know that if a user has lost > a > > > passwd that they are going to have to give them a new one, finding the > old > > > just isnt work one week of processing time :) > > > > > > Im curious to see how other php developers store their passwd's > > > -plain text in db > > > -use of unix password() > > > -use of db password() > > > -other ? > > > > > > Chris Lee > > > Mediawaveonline.com > > > > > > > > > ""Jason Jacobs"" <[EMAIL PROTECTED]> wrote in message > > > 011501c07f3f$c415bcc0$5800a8c0@doc">news:011501c07f3f$c415bcc0$5800a8c0@doc... > > > > Hi. I use password() to excrypt my passwords when I'm adding users to > > my > > > > mysql database. I'm wondering if there's a function to use to > > un-encrypt > > > it > > > > (for a web interface to change the password, and so the admin who is > > > editing > > > > user info can see what it is). Thanks for any help. > > > > > > > > Jason > > > > > > > > > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
> Well it's up to you wether or not to encrypt passwords, but it's very > irresponsible not to. If somebody cracks your system, chances are > they'll get passwords that can be used on accounts your users have > in other places, so your customers suffer more than they should for > your lax in security. In a way that's also the user's responsibility, though... for example, the passwords I use personally are divided into different levels of security. If some BS site makes me sign up for a newsletter or something, I usually give them the least-secure password. And the levels go on up, till we get to stuff like server admin passwords, etc. It's all about knowing how much to trust a site. Low-level passwords are generally used so often the only point of using it is to fill in the space ;) Higher-level passwords should be regarded as top secret info... About determining what to use on your own site... Think about what your users are likely to do. Although I personally use a fairly tight multiple-level password system, many people use their pet's name for every password they'll ever use... this is especially true for those who are less familiar with computers & the Internet. I think it's a good idea, no matter what kind of system you're building, to warn users of the risks involved with passwords and give them a good guide for creating an unguessable (and even cracking time intensive) password. At least then you've made an attempt to educate your visitors; if you then store their passwords in clear text and your system gets hacked, you've pushed the blame from yourself to the visitor (ie, "you should've known not to use the same password with hotmail, my site, and paypal"). [Sheesh this is getting longer than I intended for it to...] Even so, I still recommend sticking with MD5 or Password-encrypted passwords. The sites that offer to send passwords are inherently less secure, and any client that's looking for high-security should _not_ send passwords back to users. Just generate a new password and send it to the user. (An even better solution involving an email containing a link was posted a bit earlier today.) Hell, PayPal, who _better_ have its mind on security, sends a new generated password to a confirmed physical mailing address... that'd be pretty paranoid, but it's reassuring since the site holds credit card info, bank account info, hell I think it even has each user's social security number. Ok, well that's my 2 cents (or was it more like 4?)... Regards, --Toby
Is anyone else having trouble in 4.0.4 and 4.0.4pl1 with readfile when the argument is a http request to a script that sends a location header? eg: server1 - test.php <? readfile("http://server2/location.php"); ?> server2 - location.php <? header("Location: http://some.other.url); ?> Both Php 4.0.4 and 4.0.4pl1 return: Warning: readfile("http://server2/location.php") - Success in /path/to/test.php on line 1 I've got a box that still has 4.0.2 on it and this works fine on it. jason
I have a big string. How can I do to find some text inside and modify that text? I was thinking about ereg_replace(). But it is capable to handle big chuncks of text? If yes, it will notbe too heavy for theserver? Any other ideas? Thank you, Rom
You can always use the simple str_replace or my old fave, $newstring=implode($withthis,explode($this,$oldstring)); replaces all instances of $this with $withthis in $oldstring Gfunk - http://www.gfunk007.com/ I sense much beer in you. Beer leads to intoxication, intoxication to hangovers, and hangovers to... suffering. ----- Original Message ----- From: "Romulo Roberto Pereira" <[EMAIL PROTECTED]> To: "php-general" <[EMAIL PROTECTED]> Sent: Tuesday, January 16, 2001 1:39 PM Subject: [PHP] How do I do to update part of a string? > I have a big string. How can I do to find some text inside and modify that > text? I was thinking about ereg_replace(). But it is capable to handle big > chuncks of text? If yes, it will notbe too heavy for theserver? Any other > ideas? > > Thank you, > > Rom > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
if it is a simple del then use str_replace... however if there's a more complicated logic, then you will need an ereg_replace or preg_replace... will be heavier but more capable.. I use it on certain 10.000 words articles. And I replace not a big chunk of code but some few words in a big chunk. The best way to do it is on preparation of text, like when you are about to insert the article in the database, then if it is not a user to do you can wait some time, right? However if someone comes to read your site and you prepare the article for him replacing there thousands of things, then you have to care of your processing time. typically ereg()s are quite slow,.... Cheers, Maxim Maletsky -----Original Message----- From: Romulo Roberto Pereira [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 16, 2001 11:39 AM To: php-general Subject: [PHP] How do I do to update part of a string? I have a big string. How can I do to find some text inside and modify that text? I was thinking about ereg_replace(). But it is capable to handle big chuncks of text? If yes, it will notbe too heavy for theserver? Any other ideas? Thank you, Rom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]