From pl at eskimo.com Mon May 12 00:45:37 2003 From: pl at eskimo.com (Peter Lehrer) Date: Mon, 12 May 2003 00:45:37 -0400 Subject: removing and copying files with wildcards on free bsd Message-ID: <00bd01c31841$60c57500$122c0242@default> Is there a way in free bsd to rename or copy a whole group of files using wildcards. For instance, i've been trying mv *.htm *.php or mv sld???.htm sld???.php but have been unable to do it in free bsd. I know it works in dos. Peter Lehrer From lists at redibishosting.com Thu May 1 10:41:30 2003 From: lists at redibishosting.com (Deidra McIntyre) Date: Thu, 1 May 2003 10:41:30 -0400 (EDT) Subject: Open Source's 'Affirmative Action' Battle Message-ID: <1949.172.131.208.245.1051800090.squirrel@www.myhostingadmin.com> Oregon and Texas state legislatures have bills that may support the Pro-Open Source cause. California's proposal is really anti-proprietary. New York had a public hearing on the issue this week. Here's the debate. For government IT bids... Pro-Open Source proponents argue that public institutions should be forced to look at all bid options (open source and proprietary) and explain their decisions because they are run off public dollars and for that reason a different standard should be held for public versus private IT contracts. Pro-Private proponents argue this is an issue of competition that should be the same as it is in the private sector and that, at least according to Microsoft, the total cost of ownership of open source implementation is not necessarily less expensive than proprietary implementation. Oregon, Texas, California: http://newsforge.com/newsforge/03/04/04/2231254.shtml?tid=4 New York: http://linuxtoday.com/infrastructure/2003043002026NWSWPB ******* Deidra McIntyre redIbis http://www.redibis.com From hans at nyphp.org Thu May 1 15:49:49 2003 From: hans at nyphp.org (Hans Zaunere) Date: Thu, 1 May 2003 12:49:49 -0700 (PDT) Subject: Masking Emails and Avoiding Spam Message-ID: <20030501194949.20601.qmail@web12808.mail.yahoo.com> I was sent the below today at work and thought I'd pass it on. > To prevent the harvesting of your or your organization's email address > from your web pages, we recommend that you implement one of the > two solutions offered below to replace your "mailto" links on html pages. > > 1) JavaScript Replacement > > For example, if your email address is webmaster at nyphp.edu, you would insert > the following code, replacing "user" with the information to the left of > the @ sign and replacing "site" with your host name. > > > > > 2) ASCII Code Replacement > You can replace the "@" sign in your mailto links with the ASCII code > equivalent "@". > > For example, if your email address is webmaster at nyphp.edu, you would do the > following: > > webmaster at nyphp.edu > > This will produce a link that says webmaster at nyphp.edu. > > > Please see the following web page for more information on protecting your > email address from spam: > > http://www.cdt.org/speech/spam/030319spamreport.shtml ===== Hans Zaunere President, New York PHP http://nyphp.org hans at nyphp.org From Ed at ComSimplicity.com Thu May 1 17:39:54 2003 From: Ed at ComSimplicity.com (Ed McCarroll) Date: Thu, 1 May 2003 14:39:54 -0700 Subject: [nycphp-talk] Masking Emails and Avoiding Spam In-Reply-To: <200305011950.h41Jnqot027712@parsec.nyphp.org> Message-ID: Um, (unless I'm missing something) the methods below both produce machine-readable email addresses. SpamBots are as capable as browsers at executing JavaScript and then interpreting the results. The neatest trick I've heard about had to do with a mouseover handler that changed the href of an tag on the fly. I haven't tried it, and am wondering if the same can be done for a screenshot image depicting the address. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Ed McCarroll MailTo:Ed at ComSimplicity.com ComSimplicity (310) 838-4330 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From Ed at ComSimplicity.com Thu May 1 17:59:52 2003 From: Ed at ComSimplicity.com (Ed McCarroll) Date: Thu, 1 May 2003 14:59:52 -0700 Subject: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS In-Reply-To: <200305012140.h41Ldmot030948@parsec.nyphp.org> Message-ID: > ... the methods below both produce ... I think I trimmed too much. I was referring to the following: > 1) JavaScript Replacement > > For example, if your email address is webmaster at nyphp.edu, you would insert > the following code, replacing "user" with the information to the left of > the @ sign and replacing "site" with your host name. > > > > > 2) ASCII Code Replacement > You can replace the "@" sign in your mailto links with the ASCII code > equivalent "@". > > For example, if your email address is webmaster at nyphp.edu, you would do the > following: > > webmaster at nyphp.edu > > This will produce a link that says webmaster at nyphp.edu. Sorry 'bout that. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Ed McCarroll MailTo:Ed at ComSimplicity.com ComSimplicity (310) 838-4330 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From soazine at pop.mail.rcn.net Thu May 1 18:18:20 2003 From: soazine at pop.mail.rcn.net (soazine@pop.erols.com) Date: Thu, 1 May 2003 18:18:20 -0400 Subject: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS Message-ID: <269620-22003541221820997@M2W066.mail2web.com> I am not sure of a good client-side solution to masking emails; what I had to do for my site (http://valsignalandet.com) is to build an entire server-side feedback solution; something becoming popular now with many sites. That way my email address is neither listed nor generated; it only exists within server-side code. Perhaps a bit heavy-handed but it has significantly cut down on spam that way. Phil Original Message: ----------------- From: Ed McCarroll Ed at ComSimplicity.com Date: Thu, 1 May 2003 17:59:44 -0400 To: talk at nyphp.org Subject: RE: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS > ... the methods below both produce ... I think I trimmed too much. I was referring to the following: > 1) JavaScript Replacement > > For example, if your email address is webmaster at nyphp.edu, you would insert > the following code, replacing "user" with the information to the left of > the @ sign and replacing "site" with your host name. > > > > > 2) ASCII Code Replacement > You can replace the "@" sign in your mailto links with the ASCII code > equivalent "@". > > For example, if your email address is webmaster at nyphp.edu, you would do the > following: > > webmaster at nyphp.edu > > This will produce a link that says webmaster at nyphp.edu. Sorry 'bout that. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Ed McCarroll MailTo:Ed at ComSimplicity.com ComSimplicity (310) 838-4330 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --- Unsubscribe at http://nyphp.org/list/ --- -------------------------------------------------------------------- mail2web - Check your email from the web at http://mail2web.com/ . From dkrook at hotmail.com Thu May 1 19:11:21 2003 From: dkrook at hotmail.com (D C Krook) Date: Thu, 01 May 2003 19:11:21 -0400 Subject: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS Message-ID: I'm a fan of the form, with server-side email, myself. But should the need arise (having one's email address on an on-line resume being the only justified reason I can think of), I would recommend Hiveware's (free) Enkoder: http://www.hiveware.com/enkoder_form.php There is also a Mac OS X desktop app for the job as well: http://www.hiveware.com/products.php _________________________________________________________________ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail From wfan at encogent.com Thu May 1 19:22:58 2003 From: wfan at encogent.com (Wellington Fan) Date: Thu, 1 May 2003 19:22:58 -0400 Subject: [nycphp-talk] Masking Emails and Avoiding Spam In-Reply-To: <200305011950.h41Jnqq3027712@parsec.nyphp.org> Message-ID: Hello Listfolk, This is going to be a bit of a ramble... Firstly, here's a pretty simple obfuscator: ///////////////////////////////////////////// // See it at: http://www.jenniferdalton.com/encoder.php function obfuscate($s,$type="html") { for($i=0; $i < strlen($s); $i++) { $encoded = sprintf("%02s",dechex(ord($s{$i}))); $hexscii .= '%'.$encoded; $hexents .= '&#x'.$encoded.';'; } return ($type=="html"?$hexents:$hexscii); } ///////////////////////////////////////////// Now, here's another technique with a little problem; maybe someone has a suggestion for fixing it.... Contents of z.html: ///////////////////////////////////////////// Mailer Mail me! ///////////////////////////////////////////// contents of z.php: ///////////////////////////////////////////// ///////////////////////////////////////////// See this pair at: http://www.jenniferdalton.com/z.html The problem being that the window in which mailme.html was residing (the opener) gets kinda fubar ("fubar", tech. jargon - See RFC - 3032 : http://www.zvon.org/tmRFC/RFC3092/Output/index.html ) I tried a target="_blank" but you now get an intermediate fubar window. Suggestions? ///////////////////////////////////////////// The cdt.org report that Hans points to (http://www.cdt.org/speech/spam/030319spamreport.shtml) seems to suggest that this character entity encoding is actually quite effective against spambots. Can this be true? I would think that this html entity strategy would be pretty easy to identify and defeat... Has anyone on the list written a smart spambot? C'mon, 'fess up! ///////////////////////////////////////////// Ok, one more ramble: spamgourmet kicks a**! nice disposable email addys, that one can create on the fly... http://www.spamgourmet.com -- spamme.8.beef23 at spamgourmet.com From jsiegel1 at optonline.net Thu May 1 19:52:15 2003 From: jsiegel1 at optonline.net (Jeff) Date: Thu, 01 May 2003 19:52:15 -0400 Subject: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS In-Reply-To: <200305012312.h41NBSuf034737@parsec.nyphp.org> Message-ID: <000201c3103c$b1771740$6501a8c0@EZDSDELL> This is slightly off-topic but...in light of the discussion...I thought I'd raise the issue. I'm interested in hearing other peoples views. This morning I received a phone call from one of my clients who "might" be considered a spammer. He's a headhunter who sends out job offers to a very select group of people (about 10,000 people worldwide). All his job offers are legitimate (he's been doing this since the early days of email and has placed people in some very high-paying positions around the globe). He does *not* hide who he is; he does *not* use a non-existent email account; he does *not* use a non-existent web address. Since his is *not* an opt-in list...as soon as someone says "Remove Me" he removes them from his list. However...now he's getting worried. When he sends emails to potential candidates that have an MSN address...the emails get bounced back. Again, let me emphasize that all his job offers are legitimate. They can be viewed at his website (he hides the name of the employer and salary range since...as a headhunter...he doesn't want anyone doing an end run around him. However...he also has "entry-level" jobs for students and does not make any money on those...he offers them as a "service" to the industry). The point is that my client is panicking. He's worried he'll be put out of business now that AOL, MSN, et al., are talking about ways to deal with spam. I'm interested to hear what others may think about this particular situation. Jeff From Ed at ComSimplicity.com Thu May 1 20:03:08 2003 From: Ed at ComSimplicity.com (Ed McCarroll) Date: Thu, 1 May 2003 17:03:08 -0700 Subject: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS In-Reply-To: <200305012352.h41NqMot036792@parsec.nyphp.org> Message-ID: Jeff, My definition of "spam" is unsolicited commercial email. Thus, I would consider your friend to be a spammer. (I'm sure he's a very nice spammer, but a spammer nonetheless.) The tactics that you mention in your "he does not ..." list are not a part of my definition of "spamming"; they are part of my definition of "dishonest, obnoxious, stupid, arrogant spamming." Regards, Ed - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Ed McCarroll MailTo:Ed at ComSimplicity.com ComSimplicity (310) 838-4330 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From jim at bizcomputinginc.com Thu May 1 20:11:31 2003 From: jim at bizcomputinginc.com (Jim Hendricks) Date: Thu, 1 May 2003 20:11:31 -0400 Subject: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS References: <200305012352.h41NqMoV036792@parsec.nyphp.org> Message-ID: <049f01c3103f$62e78530$6501a8c0@Notebook> As cold and uncaring as it sounds, if stopping someone from sending unsolicited e-mail is going to kill their business than they need to find another way to do their business, or lose their business. Spam is unsolicited e-mail. It doesn't matter weather you think you have a legitimate reason to send Spam, it's still spam. I'm against Spam, unsolicited sales calls on the phone, unsolicited faxes, junk mail and all such things. We get commercials on TV which I have never minded, because it's how TV gets it's money while I get TV for free. There are adverts in newspapers and magazines because this either pays for the rag, or helps to keep the subscription price down to a reasonable price. Mail is not free, the price of mail continues to go up as the post office is struggling under the increased load of mail where mail routes need to be made shorter and more delivery people added. Fax is not free, I have to pay for the paper and ink and if its a business line I have to pay for the message units used to receive the fax. E-mail is not free, I have to pay a provider for it, or buy the equipment and pay a provider to hook up to the net. What's even worse about spam is how it's in your face. I have kids who are receiving spam for all kinds of perverse crap. I don't get perverse crap in the mail ( and even if i did, it would be in an envelop where I can choose to throw it out before I even see the perversity ), I don't get calls from phone sex people trying to get my business, but yet I get totally offensive garbage in my e-mail. I have no sympathy for anyone who uses unsolicited means to sell their product or service. There are enough places to advertise right now in TV, Radio, Newspapers, Magazines, and Internet web sites. Jim ----- Original Message ----- From: "Jeff" To: "NYPHP Talk" Sent: Thursday, May 01, 2003 7:52 PM Subject: RE: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS > This is slightly off-topic but...in light of the discussion...I thought > I'd raise the issue. I'm interested in hearing other peoples views. > > This morning I received a phone call from one of my clients who "might" > be considered a spammer. He's a headhunter who sends out job offers to a > very select group of people (about 10,000 people worldwide). All his job > offers are legitimate (he's been doing this since the early days of > email and has placed people in some very high-paying positions around > the globe). He does *not* hide who he is; he does *not* use a > non-existent email account; he does *not* use a non-existent web > address. Since his is *not* an opt-in list...as soon as someone says > "Remove Me" he removes them from his list. However...now he's getting > worried. When he sends emails to potential candidates that have an MSN > address...the emails get bounced back. > > Again, let me emphasize that all his job offers are legitimate. They can > be viewed at his website (he hides the name of the employer and salary > range since...as a headhunter...he doesn't want anyone doing an end run > around him. However...he also has "entry-level" jobs for students and > does not make any money on those...he offers them as a "service" to the > industry). > > The point is that my client is panicking. He's worried he'll be put out > of business now that AOL, MSN, et al., are talking about ways to deal > with spam. > > I'm interested to hear what others may think about this particular > situation. > > Jeff > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > > > From jsiegel1 at optonline.net Thu May 1 20:12:44 2003 From: jsiegel1 at optonline.net (Jeff) Date: Thu, 01 May 2003 20:12:44 -0400 Subject: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS In-Reply-To: <200305020003.h42030uf037859@parsec.nyphp.org> Message-ID: <000401c3103f$8ea88a20$6501a8c0@EZDSDELL> Ed, I agree with you but up to a point. Is all unsolicited commercial email necessarily spam? Nearly all the spam I've received has come from spammers who go to great lengths to hide their true identity. You go to the website referred to in their email and there is nothing there. When there *is* a website, they offer no contact information other than a form-to-mail page. So is there a difference between the spammer who hides who he is and the spammer who is upfront and honest about who he is? I, for one, am not sure what the right answer is to this question. (And believe me...I am as plagued by spam as everyone else...I average 100 UCEs per day.) Jeff -----Original Message----- From: Ed McCarroll [mailto:Ed at ComSimplicity.com] Sent: Thursday, May 01, 2003 7:03 PM To: NYPHP Talk Subject: RE: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS Jeff, My definition of "spam" is unsolicited commercial email. Thus, I would consider your friend to be a spammer. (I'm sure he's a very nice spammer, but a spammer nonetheless.) The tactics that you mention in your "he does not ..." list are not a part of my definition of "spamming"; they are part of my definition of "dishonest, obnoxious, stupid, arrogant spamming." Regards, Ed - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Ed McCarroll MailTo:Ed at ComSimplicity.com ComSimplicity (310) 838-4330 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --- Unsubscribe at http://nyphp.org/list/ --- From jsiegel at ezdatasolutions.com Thu May 1 20:19:11 2003 From: jsiegel at ezdatasolutions.com (Jeffrey Siegel) Date: Thu, 1 May 2003 20:19:11 -0400 Subject: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS In-Reply-To: <200305020012.h420Bcuf038698@parsec.nyphp.org> Message-ID: <000501c31040$75220120$6501a8c0@EZDSDELL> Jim, It's my kids that I worry most about...at least where spam is concerned...so we are definitely in agreement there. One part of me agrees that spam is spam no matter what level of "honesty" may be behind it (in the case of my client). The other part of me is concerned about my client. Jeff -----Original Message----- From: Jim Hendricks [mailto:jim at bizcomputinginc.com] Sent: Thursday, May 01, 2003 7:12 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS As cold and uncaring as it sounds, if stopping someone from sending unsolicited e-mail is going to kill their business than they need to find another way to do their business, or lose their business. Spam is unsolicited e-mail. It doesn't matter weather you think you have a legitimate reason to send Spam, it's still spam. I'm against Spam, unsolicited sales calls on the phone, unsolicited faxes, junk mail and all such things. We get commercials on TV which I have never minded, because it's how TV gets it's money while I get TV for free. There are adverts in newspapers and magazines because this either pays for the rag, or helps to keep the subscription price down to a reasonable price. Mail is not free, the price of mail continues to go up as the post office is struggling under the increased load of mail where mail routes need to be made shorter and more delivery people added. Fax is not free, I have to pay for the paper and ink and if its a business line I have to pay for the message units used to receive the fax. E-mail is not free, I have to pay a provider for it, or buy the equipment and pay a provider to hook up to the net. What's even worse about spam is how it's in your face. I have kids who are receiving spam for all kinds of perverse crap. I don't get perverse crap in the mail ( and even if i did, it would be in an envelop where I can choose to throw it out before I even see the perversity ), I don't get calls from phone sex people trying to get my business, but yet I get totally offensive garbage in my e-mail. I have no sympathy for anyone who uses unsolicited means to sell their product or service. There are enough places to advertise right now in TV, Radio, Newspapers, Magazines, and Internet web sites. Jim ----- Original Message ----- From: "Jeff" To: "NYPHP Talk" Sent: Thursday, May 01, 2003 7:52 PM Subject: RE: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS > This is slightly off-topic but...in light of the discussion...I > thought I'd raise the issue. I'm interested in hearing other peoples > views. > > This morning I received a phone call from one of my clients who > "might" be considered a spammer. He's a headhunter who sends out job > offers to a very select group of people (about 10,000 people > worldwide). All his job offers are legitimate (he's been doing this > since the early days of email and has placed people in some very > high-paying positions around the globe). He does *not* hide who he is; > he does *not* use a non-existent email account; he does *not* use a > non-existent web address. Since his is *not* an opt-in list...as soon > as someone says "Remove Me" he removes them from his list. > However...now he's getting worried. When he sends emails to potential > candidates that have an MSN address...the emails get bounced back. > > Again, let me emphasize that all his job offers are legitimate. They > can be viewed at his website (he hides the name of the employer and > salary range since...as a headhunter...he doesn't want anyone doing an > end run around him. However...he also has "entry-level" jobs for > students and does not make any money on those...he offers them as a > "service" to the industry). > > The point is that my client is panicking. He's worried he'll be put > out of business now that AOL, MSN, et al., are talking about ways to > deal with spam. > > I'm interested to hear what others may think about this particular > situation. > > Jeff > > > > > > > > --- Unsubscribe at http://nyphp.org/list/ --- From jim at bizcomputinginc.com Thu May 1 20:31:41 2003 From: jim at bizcomputinginc.com (Jim Hendricks) Date: Thu, 1 May 2003 20:31:41 -0400 Subject: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS References: <200305020019.h420JGoV040278@parsec.nyphp.org> Message-ID: <04b301c31042$33fed310$6501a8c0@Notebook> Jeff, I'm not totally uncaring about your client, just pointing out that we live in a changing world, and as a business owner myself I understand if I am not able to change with the times, I don't deserve to be in business. What your client is doing may have been acceptable when spam was at the level of junk mail where every now and then I receive an e-mail about legitimate business that is sensitive enough to recognize that there are moral limits as to the content of the e-mail because there may be minors viewing the e-mail. But if we make exceptions as to what e-mails are acceptable spam then the spammers will figure out how to justify that their crap meets the exceptions. Your client needs to spend time investigating the other options available to him rather than bewail the fact that the spammers have ruined for him a good means of rapping out some business. He needs to look at the job services like dice where he can register as a head hunter and receive information about people looking for jobs that are soliciting his type of e-mails. He needs to look at getting his own site advertised well enough that job applicants would come to his site and enroll for his e-mails. To act as if the world is over because a means of marketing is going away is like crying the sky is falling! Jim ----- Original Message ----- From: "Jeffrey Siegel" To: "NYPHP Talk" Sent: Thursday, May 01, 2003 8:19 PM Subject: RE: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS > Jim, > > It's my kids that I worry most about...at least where spam is > concerned...so we are definitely in agreement there. > > One part of me agrees that spam is spam no matter what level of > "honesty" may be behind it (in the case of my client). The other part of > me is concerned about my client. > > Jeff > > -----Original Message----- > From: Jim Hendricks [mailto:jim at bizcomputinginc.com] > Sent: Thursday, May 01, 2003 7:12 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS > > > As cold and uncaring as it sounds, if stopping someone from sending > unsolicited e-mail is going to kill their business than they need to > find another way to do their business, or lose their business. > > Spam is unsolicited e-mail. It doesn't matter weather you think you > have a legitimate reason to send Spam, it's still spam. I'm against > Spam, unsolicited sales calls on the phone, unsolicited faxes, junk mail > and all such things. We get commercials on TV which I have never > minded, because it's how TV gets it's money while I get TV for free. > There are adverts in newspapers and magazines because this either pays > for the rag, or helps to keep the subscription price down to a > reasonable price. Mail is not free, the price of mail continues to go > up as the post office is struggling under the increased load of mail > where mail routes need to be made shorter and more delivery people > added. Fax is not free, I have to pay for the paper and ink and if its > a business line I have to pay for the message units used to receive the > fax. E-mail is not free, I have to pay a provider for it, or buy the > equipment and pay a provider to hook up to the net. > > What's even worse about spam is how it's in your face. I have kids who > are receiving spam for all kinds of perverse crap. I don't get perverse > crap in the mail ( and even if i did, it would be in an envelop where I > can choose to throw it out before I even see the perversity ), I don't > get calls from phone sex people trying to get my business, but yet I get > totally offensive garbage in my e-mail. > > I have no sympathy for anyone who uses unsolicited means to sell their > product or service. There are enough places to advertise right now in > TV, Radio, Newspapers, Magazines, and Internet web sites. > > Jim > > ----- Original Message ----- > From: "Jeff" > To: "NYPHP Talk" > Sent: Thursday, May 01, 2003 7:52 PM > Subject: RE: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS > > > > This is slightly off-topic but...in light of the discussion...I > > thought I'd raise the issue. I'm interested in hearing other peoples > > views. > > > > This morning I received a phone call from one of my clients who > > "might" be considered a spammer. He's a headhunter who sends out job > > offers to a very select group of people (about 10,000 people > > worldwide). All his job offers are legitimate (he's been doing this > > since the early days of email and has placed people in some very > > high-paying positions around the globe). He does *not* hide who he is; > > > he does *not* use a non-existent email account; he does *not* use a > > non-existent web address. Since his is *not* an opt-in list...as soon > > as someone says "Remove Me" he removes them from his list. > > However...now he's getting worried. When he sends emails to potential > > candidates that have an MSN address...the emails get bounced back. > > > > Again, let me emphasize that all his job offers are legitimate. They > > can be viewed at his website (he hides the name of the employer and > > salary range since...as a headhunter...he doesn't want anyone doing an > > > end run around him. However...he also has "entry-level" jobs for > > students and does not make any money on those...he offers them as a > > "service" to the industry). > > > > The point is that my client is panicking. He's worried he'll be put > > out of business now that AOL, MSN, et al., are talking about ways to > > deal with spam. > > > > I'm interested to hear what others may think about this particular > > situation. > > > > Jeff > > > > > > > > > > > > > > > > > > > > > > > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > > > From Ed at ComSimplicity.com Thu May 1 20:35:47 2003 From: Ed at ComSimplicity.com (Ed McCarroll) Date: Thu, 1 May 2003 17:35:47 -0700 Subject: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS In-Reply-To: <200305020012.h420Crot039454@parsec.nyphp.org> Message-ID: Jeff, > I agree with you but up to a point. Is all unsolicited commercial > email necessarily spam? Yes, it's spam. Spam is unsolicited commercial email. That's the plain, simple definition. You seem to think that calling it "spam" means that it's dirty, rotten, and evil. Perhaps we'd do better trying to discuss whether there is or is not an acceptable form of spam. I think any unsolicited commercial email is offensive. I also think it should be illegal for spammers to use the dishonest tactics to which you refer. But these are two separate issues. And many good people would disagree with my position on either. Regards, Ed - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Ed McCarroll MailTo:Ed at ComSimplicity.com ComSimplicity (310) 838-4330 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From jsiegel1 at optonline.net Thu May 1 20:48:40 2003 From: jsiegel1 at optonline.net (Jeff) Date: Thu, 01 May 2003 20:48:40 -0400 Subject: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS In-Reply-To: <200305020032.h420Vmuf041177@parsec.nyphp.org> Message-ID: <000101c31044$95969480$6501a8c0@EZDSDELL> Jim, Very, very well stated. I've been preparing a "speech" similar to your second paragraph in anticipation of my client's follow-up phone call. I also think that you are correct to point out about the "moral limits" of the email content and that is the bigger issue. Jeff -----Original Message----- From: Jim Hendricks [mailto:jim at bizcomputinginc.com] Sent: Thursday, May 01, 2003 7:32 PM To: NYPHP Talk Subject: Re: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS Jeff, I'm not totally uncaring about your client, just pointing out that we live in a changing world, and as a business owner myself I understand if I am not able to change with the times, I don't deserve to be in business. What your client is doing may have been acceptable when spam was at the level of junk mail where every now and then I receive an e-mail about legitimate business that is sensitive enough to recognize that there are moral limits as to the content of the e-mail because there may be minors viewing the e-mail. But if we make exceptions as to what e-mails are acceptable spam then the spammers will figure out how to justify that their crap meets the exceptions. Your client needs to spend time investigating the other options available to him rather than bewail the fact that the spammers have ruined for him a good means of rapping out some business. He needs to look at the job services like dice where he can register as a head hunter and receive information about people looking for jobs that are soliciting his type of e-mails. He needs to look at getting his own site advertised well enough that job applicants would come to his site and enroll for his e-mails. To act as if the world is over because a means of marketing is going away is like crying the sky is falling! Jim From jsiegel1 at optonline.net Thu May 1 20:48:40 2003 From: jsiegel1 at optonline.net (Jeff) Date: Thu, 01 May 2003 20:48:40 -0400 Subject: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS In-Reply-To: <200305020036.h420Zduf041966@parsec.nyphp.org> Message-ID: <000001c31044$936b01f0$6501a8c0@EZDSDELL> Ed, I think Jim raised an important point in his email concerning the "moral limits" of email content. I don't consider unsolicited catalogs via snail mail to be offensive though, when the Frederick's of Hollywood catalog shows up (I swear! I NEVER ORDERED ANYTHING FROM THEM!) that's when I get angry. And so while I get annoyed when I'm asked, for the umpteenth time, to get Gevalia coffee, I get very angry when I receive pornographic material. Jeff -----Original Message----- From: Ed McCarroll [mailto:Ed at ComSimplicity.com] Sent: Thursday, May 01, 2003 7:36 PM To: NYPHP Talk Subject: RE: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS Jeff, > I agree with you but up to a point. Is all unsolicited commercial > email necessarily spam? Yes, it's spam. Spam is unsolicited commercial email. That's the plain, simple definition. You seem to think that calling it "spam" means that it's dirty, rotten, and evil. Perhaps we'd do better trying to discuss whether there is or is not an acceptable form of spam. I think any unsolicited commercial email is offensive. I also think it should be illegal for spammers to use the dishonest tactics to which you refer. But these are two separate issues. And many good people would disagree with my position on either. Regards, Ed - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Ed McCarroll MailTo:Ed at ComSimplicity.com ComSimplicity (310) 838-4330 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --- Unsubscribe at http://nyphp.org/list/ --- From chris at psydeshow.org Thu May 1 20:51:48 2003 From: chris at psydeshow.org (Chris Snyder) Date: Thu, 01 May 2003 20:51:48 -0400 Subject: [nycphp-talk] Masking Emails and Avoiding Spam In-Reply-To: <200305011950.h41JnqvF027712@parsec.nyphp.org> References: <200305011950.h41JnqvF027712@parsec.nyphp.org> Message-ID: <3EB1C124.5020309@psydeshow.org> Hans Zaunere wrote: >I was sent the below today at work and thought I'd pass it on. > >>To prevent the harvesting of your or your organization's email address >>from your web pages, we recommend that you implement one of the >>two solutions offered below to replace your "mailto" links on html pages. >> I'm gonna get flamed by the text-only and accessibility camps for this, but another very effective way to advertise your email address without having it picked up by spambots is to use an image instead. I have a PHP label generator at http://chxo.com/labelgen/ that makes creating them a snap. There's a show source link on the page as well. chris. From smanes at magpie.com Thu May 1 21:10:57 2003 From: smanes at magpie.com (Steve Manes) Date: Thu, 01 May 2003 21:10:57 -0400 Subject: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS In-Reply-To: <200305012352.h41NqMst036792@parsec.nyphp.org> Message-ID: <5.1.1.6.2.20030501204639.015f0468@192.168.111.6> At 07:52 PM 5/1/2003 -0400, Jeff wrote: >The point is that my client is panicking. He's worried he'll be put out >of business now that AOL, MSN, et al., are talking about ways to deal >with spam. > >I'm interested to hear what others may think about this particular >situation. He has every right to panic because they're not just talking. In the case of AOL, they're already doing. I've forgotten the formula I saw a couple of weeks ago but if you send X emails to non-existent/expired AOL accounts in X days, you're automatically blackholed. Worse, your mail will just disappear into the bit bucket without a bounce. I know what the "official" definition is, but I don't think spam is unsolicited commercial email. It's unsolicited, unwanted bulk email. It's a lot like pornography: you know it when you see it. If I was out of work, living on ramen and water, and I landed a job because I was on that headhunter's list, I'd have a very different opinion of those mailings than someone who was happily employed at 3x the salary offered. I've gotten lots of spam that wasn't commercial, like chain letters demanding that I send a bunch of copies to my annoyed friends, political demands that I Bitch To Bush and the "prayer for the day" crap I used to get a couple of years ago. Virus email is probably the most evil form of spam even though there's rarely a commercial purpose to it. By the same token, the service advisories that Watchguard sends its customers and which I never opted into are both bulk and commercial, yet they contain information that I want. Your friend is probably going to have to make some adjustments. Sending a single job description out to 10,000 people is excessive. I think he might want to trickle out some "re-opt" emails to his subscribers and in the future send email only to those who respond affirmatively. From jsiegel1 at optonline.net Thu May 1 21:23:42 2003 From: jsiegel1 at optonline.net (Jeff) Date: Thu, 01 May 2003 21:23:42 -0400 Subject: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS In-Reply-To: <200305020111.h421Aguf045526@parsec.nyphp.org> Message-ID: <000001c31049$78858860$6501a8c0@EZDSDELL> Steve, "I think he might want to trickle out some "re-opt" emails to his subscribers and in the future send email only to those who respond affirmatively." I believe this is the way to go. And I should clarify one small point. He doesn't send the same job description to 10,000 people. He sends different job descriptions to different people based on their "specialty" areas. As was noted in another email...my client is going to have to rethink how he does business. Jeff -----Original Message----- From: Steve Manes [mailto:smanes at magpie.com] Sent: Thursday, May 01, 2003 8:11 PM To: NYPHP Talk Subject: RE: [nycphp-talk] Masking Emails and Avoiding Spam - OOPS At 07:52 PM 5/1/2003 -0400, Jeff wrote: >The point is that my client is panicking. He's worried he'll be put out >of business now that AOL, MSN, et al., are talking about ways to deal >with spam. > >I'm interested to hear what others may think about this particular >situation. He has every right to panic because they're not just talking. In the case of AOL, they're already doing. I've forgotten the formula I saw a couple of weeks ago but if you send X emails to non-existent/expired AOL accounts in X days, you're automatically blackholed. Worse, your mail will just disappear into the bit bucket without a bounce. I know what the "official" definition is, but I don't think spam is unsolicited commercial email. It's unsolicited, unwanted bulk email. It's a lot like pornography: you know it when you see it. If I was out of work, living on ramen and water, and I landed a job because I was on that headhunter's list, I'd have a very different opinion of those mailings than someone who was happily employed at 3x the salary offered. I've gotten lots of spam that wasn't commercial, like chain letters demanding that I send a bunch of copies to my annoyed friends, political demands that I Bitch To Bush and the "prayer for the day" crap I used to get a couple of years ago. Virus email is probably the most evil form of spam even though there's rarely a commercial purpose to it. By the same token, the service advisories that Watchguard sends its customers and which I never opted into are both bulk and commercial, yet they contain information that I want. Your friend is probably going to have to make some adjustments. Sending a single job description out to 10,000 people is excessive. I think he might want to trickle out some "re-opt" emails to his subscribers and in the future send email only to those who respond affirmatively. --- Unsubscribe at http://nyphp.org/list/ --- From jfreeman at amnh.org Thu May 1 22:21:31 2003 From: jfreeman at amnh.org (Joshua S. Freeman) Date: Thu, 01 May 2003 22:21:31 -0400 Subject: gnubie questions regarding working with form contents... In-Reply-To: <200305020051.h420ponl044415@parsec.nyphp.org> Message-ID: I have a page with PHP doing the following things so far: 1) if NOT submitting, then display a form. 2) if submitting, echo the contents of the submission and insert into the values into a database. The insert statement is working just fine. I'm having some problems with the echoing of the contents to the page. Here is the echo statement I'm using to echo the inserted values: ----------snip------------ while (list($name, $value) = each($HTTP_POST_VARS)) { echo "$name = $value
.\ "; ----------snip------------ problem number one is: I forgot how to do that using 'foreach' instead of while() each()... problem number two is: because of contents of $HTTP_POST_VARS, "submit = submit " is coming up as a result of the echo "$name = $value
.\ " statement. In other words, in addition to showing the submitter the values of his/her submission, s/he's also seeing that 'submit=submit' is a value too... The next problem is that I need to take the submitted name/value pairs and format and send an email with them to one email address... I have no idea how do that though I know it involves $HTTP_POST_VARS again... I want to do this all on one page. Any help/pointers appreciated! Thanks! Joshua From greg at mbwpartners.net Thu May 1 22:38:08 2003 From: greg at mbwpartners.net (Greg Wilson) Date: 01 May 2003 22:38:08 -0400 Subject: [nycphp-talk] gnubie questions regarding working with form contents... In-Reply-To: <200305020222.h422LZt3048134@parsec.nyphp.org> References: <200305020222.h422LZt3048134@parsec.nyphp.org> Message-ID: <1051843087.27932.8.camel@banner> On Thu, 2003-05-01 at 22:21, Joshua S. Freeman wrote: > I have a page with PHP doing the following things so far: > > 1) if NOT submitting, then display a form. > > 2) if submitting, echo the contents of the submission and insert into the > values into a database. > > The insert statement is working just fine. > > I'm having some problems with the echoing of the contents to the page. > > > Here is the echo statement I'm using to echo the inserted values: > > ----------snip------------ > > while (list($name, $value) = each($HTTP_POST_VARS)) { > > echo "$name = $value
.\ "; > > ----------snip------------ > > > problem number one is: I forgot how to do that using 'foreach' instead of > while() each()... try: foreach ($arr as $key => $value) { echo "Key: $key; Value: $value
\ "; } > > problem number two is: because of contents of $HTTP_POST_VARS, "submit = > submit " is coming up as a result of the > > echo "$name = $value
.\ " > > statement. > > In other words, in addition to showing the submitter the values of his/her > submission, s/he's also seeing that 'submit=submit' is a value too... > before your foreach: unset ($HTTP_POST_VARS['submit']); this will pull it out of the array > > The next problem is that I need to take the submitted name/value pairs and > format and send an email with them to one email address... I have no idea > how do that though I know it involves $HTTP_POST_VARS again... > change the foreach statement above to: foreach ($arr as $key => $value) { echo "Key: $key; Value: $value
\ "; $message .= "Key: $key; Value: $value
\ "; } and then use the mail function, something like: mail($contactemail, $subject, $message, $headers); to send the values. > I want to do this all on one page. > > Any help/pointers appreciated! > hope that helps! greg > Thanks! > > Joshua > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > From jfreeman at amnh.org Thu May 1 22:39:59 2003 From: jfreeman at amnh.org (Joshua S. Freeman) Date: Thu, 01 May 2003 22:39:59 -0400 Subject: [nycphp-talk] gnubie questions regarding working with form contents... In-Reply-To: <200305020238.h422cFnl049108@parsec.nyphp.org> Message-ID: brilliant Greg.. I'll try it all out tomorrow and let everyone know how it worked out. Thanks! g'night! J. On 5/1/03 10:38 PM, "Greg Wilson" wrote: > On Thu, 2003-05-01 at 22:21, Joshua S. Freeman wrote: >> I have a page with PHP doing the following things so far: >> >> 1) if NOT submitting, then display a form. >> >> 2) if submitting, echo the contents of the submission and insert into the >> values into a database. >> >> The insert statement is working just fine. >> >> I'm having some problems with the echoing of the contents to the page. >> >> >> Here is the echo statement I'm using to echo the inserted values: >> >> ----------snip------------ >> >> while (list($name, $value) = each($HTTP_POST_VARS)) { >> >> echo "$name = $value
.\ "; >> >> ----------snip------------ >> >> >> problem number one is: I forgot how to do that using 'foreach' instead of >> while() each()... > > try: > foreach ($arr as $key => $value) { > echo "Key: $key; Value: $value
\ "; > } > > >> >> problem number two is: because of contents of $HTTP_POST_VARS, "submit = >> submit " is coming up as a result of the >> >> echo "$name = $value
.\ " >> >> statement. >> >> In other words, in addition to showing the submitter the values of his/her >> submission, s/he's also seeing that 'submit=submit' is a value too... >> > > before your foreach: > unset ($HTTP_POST_VARS['submit']); > this will pull it out of the array > >> >> The next problem is that I need to take the submitted name/value pairs and >> format and send an email with them to one email address... I have no idea >> how do that though I know it involves $HTTP_POST_VARS again... >> > > change the foreach statement above to: > foreach ($arr as $key => $value) { > echo "Key: $key; Value: $value
\ "; > $message .= "Key: $key; Value: $value
\ "; > } > > and then use the mail function, something like: > mail($contactemail, $subject, $message, $headers); > to send the values. > > >> I want to do this all on one page. >> >> Any help/pointers appreciated! >> > > hope that helps! > > greg > > >> Thanks! >> >> Joshua >> >> >> >> >> >> > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > > From pinyo at nyc.rr.com Thu May 1 22:58:08 2003 From: pinyo at nyc.rr.com (Pinyo Bhulipongsanon) Date: Thu, 1 May 2003 22:58:08 -0400 Subject: Pass by reference has been deprecated? References: <200305020238.h422cFtx049108@parsec.nyphp.org> Message-ID: <007901c31056$a8da3350$10c8a8c0@hewlettlydtpep> Hello, I need your expert help please. Can someone tell me more information about this warning? If the pass-by-reference is going away, then how do I change the value of multiple variables through a function? Thank you so much for your help. Pinyo Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /usr/www/users/markzill/marktaw/commenter/commenter.php on line 22 From greg at mbwpartners.net Thu May 1 23:00:41 2003 From: greg at mbwpartners.net (Greg Wilson) Date: 01 May 2003 23:00:41 -0400 Subject: [nycphp-talk] gnubie questions regarding working with form contents... In-Reply-To: <200305020240.h422e4t3049870@parsec.nyphp.org> References: <200305020240.h422e4t3049870@parsec.nyphp.org> Message-ID: <1051844441.27932.24.camel@banner> Joshua You'll probably want to dump the POST variables into a different array before you unset. Try: $arr = array(); $arr = $HTTP_POST_VARS; // or is it $arr[] = $HTTP_POST_VARS; unset($arr['submit']); foreach ($arr as $key => $value) { echo "Key: $key; Value: $value
\ "; $message .= $key ." = ". $value ."
\ "; } Good luck! greg On Thu, 2003-05-01 at 22:40, Joshua S. Freeman wrote: > brilliant Greg.. > > I'll try it all out tomorrow and let everyone know how it worked out. > > Thanks! > > g'night! > > J. > > On 5/1/03 10:38 PM, "Greg Wilson" wrote: > > > On Thu, 2003-05-01 at 22:21, Joshua S. Freeman wrote: From nyphp at websapp.com Thu May 1 23:12:26 2003 From: nyphp at websapp.com (Daniel Kushner) Date: Thu, 1 May 2003 23:12:26 -0400 Subject: [nycphp-talk] gnubie questions regarding working with form contents... In-Reply-To: <200305020301.h4230lxt051658@parsec.nyphp.org> Message-ID: > $arr = array(); > $arr = $HTTP_POST_VARS; // or is it $arr[] = $HTTP_POST_VARS; Please note that there is no reason to declare $arr as an array (and create new array). $arr = $_POST copies the $_POST array to the new variable $arr. --Daniel From gw.nyphp at gwprogramming.com Thu May 1 23:11:52 2003 From: gw.nyphp at gwprogramming.com (George Webb) Date: Thu, 1 May 2003 23:11:52 -0400 (EDT) Subject: [nycphp-talk] gnubie questions regarding working with form contents... Message-ID: <200305020311.h423Brop010876@gw00.com> J., Don't forget that if you're outputting your results to a web (HTML) page, you need to run htmlspecialchars() on them so that any HTML entities will appear properly: foreach ( $arr as $key => $value ) { $key = htmlspecialchars ( $key ); $value = htmlspecialchars ( $value ); echo "Key: $key; Value: $value
\ "; } As a shortcut, if you know your "keys" are all already safe for HTML, you can skip the htmlspecialchars() for each $key, and just escape the "values." (But often you never *really* know; someone could easily spoof your form and repost their own key/value pairs.) A lot of web applications neglect this HTML escaping issue, which causes problems, including security risks! Example: the user could type a WELCOME TO A GREAT SITE!
form_top; $form_bottom=<<

RETRIEVE YOUR LOGIN INFO

You can get your login information by entering either your login name or your email address below. Your password will be sent to the email address that we currently have on file for you.
Enter Your Login Name:  
-OR-  
Enter Your Email Address:  
form_bottom; echo "$form_top"; echo "$form_middle"; echo "$form_bottom"; } # End of function ShowForm ############ END OF FUNCTIONS ############### -----Original Message----- From: Wellington Fan [mailto:wfan at encogent.com] Sent: Wednesday, May 14, 2003 1:48 PM To: NYPHP Talk Subject: RE: [nycphp-talk] Forms & Refresh Question & General Form Security absolutely. do this where it makes sense. > -----Original Message----- > From: Chris Shiflett [mailto:shiflett at php.net] > Sent: Wednesday, May 14, 2003 12:23 PM > To: NYPHP Talk > Subject: RE: [nycphp-talk] Forms & Refresh Question & General Form > Security > > > --- Wellington Fan wrote: > > "page_with_form.php" > > > > submits to > > > > "form_processor.php" > > > > which redirects to > > > > "page_with_form.php?status=(success|failure)" > > You do realize you're basically trusting the user with the value > of status, > right? I hope you're not using that for anything important. > > Chris > > > > > > --- Unsubscribe at http://nyphp.org/list/ --- From ejp at well.com Thu May 15 08:34:43 2003 From: ejp at well.com (Edward Potter) Date: Thu, 15 May 2003 08:34:43 -0400 Subject: [nycphp-talk] Wireless Hot Spots In-Reply-To: <200305142032.h4EKVUxx009588@parsec.nyphp.org> Message-ID: <9B0B22FE-86D1-11D7-9553-000393BF8A42@well.com> We offer a free wireless hotspot, no login, no passwords, etc. T1. 36th and 10th. And we also have free bicycles and a Cafe. "What are you guys %&%**%*% crazy!" "nah, we trust everyone, we're Utopians." PS.. We are moving in 2 weeks, however. :-) - ed > Try here: http://www.nodedb.com/unitedstates/ny/newyork/? as well > as here http://www.nycwireless.net/ .. I am amazed how often I can > connect to an open office wireless network. No security. I sat in a > Starbucks on broadway and could connect to two different networks > freely. I was at a clients apartment who had just purchased an > airport he thought I set it up but I was using his neighbors system. > So try you're often surprised. > > > On Wednesday, May 14, 2003, at 02:45 PM, Andrew Yochum wrote: > >> Almost forgot... if your a Verizon customer, supposedly you can hop on >> their >> WiFi points listed here for no charge: >> >> https://www33.verizon.com/wifi/login/locations/locations-remote.jsp >> >> On Wed, May 14, 2003 at 02:37:58PM -0400, Andrew Yochum wrote: >>> For starbucks: >>> http://locations.hotspot.t-mobile.com/page6.asp?state=ny >>> Other: >>> http://www.nodedb.com/unitedstates/ny/newyork/? >>> >>> On Wed, May 14, 2003 at 02:33:55PM -0400, Chris Shiflett wrote: >>>> Does anyone know where some good wireless hot spots are in >>>> Manhattan? I will be >>>> all over looking at apartments and doing interviews, and I'd like to >>>> be able to >>>> drop in a Starbucks or something and keep up with email, etc. >>>> >>>> Thanks for your help. >>>> >>>> Chris >>>> >>>> >>>> >>>> >>> >>> -- >>> Andrew Yochum >>> Digital Pulp, Inc. >>> 212.679.0676x255 >>> andrew at digitalpulp.com >>> >>> >>> >>> >> >> -- >> Andrew Yochum >> Digital Pulp, Inc. >> 212.679.0676x255 >> andrew at digitalpulp.com >> >> >> >> > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > From jemaxwell at jaymax.com Thu May 15 11:10:01 2003 From: jemaxwell at jaymax.com (Joseph Maxwell) Date: Thu, 15 May 2003 08:10:01 -0700 Subject: Digest form for this list Message-ID: <3EC3ADC8.60F8F91C@jaymax.com> Hello, Is there a Digest Form for this list? -- Joe -- From webapprentice at onemain.com Thu May 15 08:34:50 2003 From: webapprentice at onemain.com (Stephen Tang) Date: Thu, 15 May 2003 08:34:50 -0400 (GMT) Subject: They will need to work on it. Re: [nycphp-talk] Digest form for this list Message-ID: <1800179.1053012891097.JavaMail.nobody@beaker.psp.pas.earthlink.net> Hans Z. said it's something that needs to be done. It's in his TODO list. --Stephen -------Original Message------- From: Joseph Maxwell Sent: 05/15/03 11:09 AM To: NYPHP Talk Subject: [nycphp-talk] Digest form for this list > > Hello, Is there a Digest Form for this list? -- Joe -- --- Unsubscribe at http://nyphp.org/list/ --- > From jsiegel1 at optonline.net Fri May 16 07:52:23 2003 From: jsiegel1 at optonline.net (Jeff) Date: Fri, 16 May 2003 07:52:23 -0400 Subject: Java interpreter Message-ID: <000c01c31ba1$9d453930$6501a8c0@EZDSDELL> I need to install a Java interpreter on a Linux box. I was at Sun's site but honestly...it's not obvious what I need to download. Can anyone offer any pointers? Jeff From andrew at digitalpulp.com Fri May 16 08:33:47 2003 From: andrew at digitalpulp.com (Andrew Yochum) Date: Fri, 16 May 2003 08:33:47 -0400 Subject: [nycphp-talk] Java interpreter In-Reply-To: <200305161154.h4GBsESP059488@parsec.nyphp.org> References: <200305161154.h4GBsESP059488@parsec.nyphp.org> Message-ID: <20030516123341.GA1645@localhost.localdomain> >From this page: http://java.sun.com/j2se/1.4.1/download.html ... grab the JRE (if your just running java) or the SDK (if you need development tools) from the "J2SE v 1.4.1_02" section. That should do it. On Fri, May 16, 2003 at 07:54:14AM -0400, Jeff wrote: > I need to install a Java interpreter on a Linux box. I was at Sun's site > but honestly...it's not obvious what I need to download. > > Can anyone offer any pointers? > > Jeff > > > > --- Unsubscribe at http://nyphp.org/list/ --- > From jsiegel1 at optonline.net Fri May 16 10:45:14 2003 From: jsiegel1 at optonline.net (Jeff) Date: Fri, 16 May 2003 10:45:14 -0400 Subject: [nycphp-talk] Java interpreter In-Reply-To: <200305161234.h4GCXoXr060821@parsec.nyphp.org> Message-ID: <000101c31bb9$c352f780$6501a8c0@EZDSDELL> Thank you SO MUCH!! It wasn't obvious, at first, what to download (I was at the site last night). Jeff -----Original Message----- From: Andrew Yochum [mailto:andrew at digitalpulp.com] Sent: Friday, May 16, 2003 7:34 AM To: NYPHP Talk Subject: Re: [nycphp-talk] Java interpreter >From this page: http://java.sun.com/j2se/1.4.1/download.html .. grab the JRE (if your just running java) or the SDK (if you need development tools) from the "J2SE v 1.4.1_02" section. That should do it. On Fri, May 16, 2003 at 07:54:14AM -0400, Jeff wrote: > I need to install a Java interpreter on a Linux box. I was at Sun's > site but honestly...it's not obvious what I need to download. > > Can anyone offer any pointers? > > Jeff > > > > > --- Unsubscribe at http://nyphp.org/list/ --- From nestorflorez at earthlink.net Fri May 16 11:26:26 2003 From: nestorflorez at earthlink.net (Nestor Florez) Date: Fri, 16 May 2003 08:26:26 -0700 (PDT) Subject: Help with regex Message-ID: <5694601.1053098841330.JavaMail.nobody@kermit.psp.pas.earthlink.net> Hi people, I am having problems doing a regex using ereg_replace I am reading a file and when I find a line with white space and I want to remove these characters up to an including the '>'. This is what a typical line looks like: ----------------------------------------- 205 Asaro, Doreen G.I.S.   ---------------------------------------------- I have tried the following but it does not work ------------------------------------------ foreach($content as $line) { $line = ereg_replace(".*>", "", $line); print "$i = $line
"; $i++; } ------------------------------------------ I also tried : $line = ereg_replace(".*?>", "", $line); To make sure that it does not remove the entire line when it finds the '>' in "" but I get this error: *Warning*: ereg_replace() [function.ereg-replace ]: REG_BADRPT: in *c:\\program files\\apache group\\apache\\htdocs\\php\\readphone.php* on line *35* Any ideas? Thanks, Nestor From neerajrattu at consultant.com Fri May 16 11:41:43 2003 From: neerajrattu at consultant.com (Neeraj Rattu) Date: Fri, 16 May 2003 10:41:43 -0500 Subject: [nycphp-talk] Job Posting/ Recruitment Package Message-ID: <20030516154143.68719.qmail@mail.com> Hello list, Can i get involved in this. I have done good work for a reqruitment company. www.tannet.com I have good experience in this. Can i be of any help. Regards, Neeraj ----- Original Message ----- From: Hans Zaunere Date: Wed, 7 May 2003 17:34:16 -0400 To: NYPHP Talk Subject: Re: [nycphp-talk] Job Posting/ Recruitment Package --- Mike West wrote: > Suggestion on AMP based Job/ Resume Posting / Recruitment type package? > Hoping > to post resumes, collect personal info and match jobs to jobs available. We (NYPHP) are looking for one, too :) So far I haven't been able to find anything nice. Our current job board, despite steadfast efforts by Sklar, can't offer what we'd like. I believe Chris is working on a better system, and this will be a continuing Open Source project of NYPHP. Best, H --- Unsubscribe at http://nyphp.org/list/ --- -- __________________________________________________________ Sign-up for your own FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup From gmalcolm at professionalcredit.com Fri May 16 11:45:05 2003 From: gmalcolm at professionalcredit.com (Malcolm, Gary) Date: Fri, 16 May 2003 08:45:05 -0700 Subject: [nycphp-talk] Help with regex Message-ID: <715DAA079998D3118B8B00508B2C071D453D3A@pcsnet> try something like: preg_replace("/\\w+.*/","",$line); > -----Original Message----- > From: Nestor Florez [mailto:nestorflorez at earthlink.net] > Sent: Friday, 16 May, 2003 8:27 AM > To: NYPHP Talk > Subject: [nycphp-talk] Help with regex > > > Hi people, > > I am having problems doing a regex using ereg_replace > I am reading a file and when I find a line with white space > and > I want to remove these characters up to an including the '>'. > This is what a typical line looks like: > ----------------------------------------- > 205 > Asaro, Doreen > G.I.S. >   > ---------------------------------------------- > > I have tried the following but it does not work > ------------------------------------------ > foreach($content as $line) > { > $line = ereg_replace(".*>", "", $line); > print "$i = $line
"; > $i++; > } > ------------------------------------------ > > I also tried : > $line = ereg_replace(".*?>", "", $line); > To make sure that it does not remove the entire line when it > finds the '>' in "" > but I get this error: > *Warning*: ereg_replace() [function.ereg-replace > ]: REG_BADRPT: in > *c:\\program files\\apache > group\\apache\\htdocs\\php\\readphone.php* on line *35* > > Any ideas? > > Thanks, > > Nestor > > > --- Unsubscribe at http://nyphp.org/list/ --- > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zaunere at yahoo.com Fri May 16 12:01:27 2003 From: zaunere at yahoo.com (Hans Zaunere) Date: Fri, 16 May 2003 09:01:27 -0700 (PDT) Subject: [nycphp-talk] Job Posting/ Recruitment Package In-Reply-To: <200305161542.h4GFfpXJ067303@parsec.nyphp.org> Message-ID: <20030516160127.8175.qmail@web12801.mail.yahoo.com> Hi Neeraj, --- Neeraj Rattu wrote: > Hello list, > > Can i get involved in this. I have done good work for a reqruitment > company. www.tannet.com > > I have good experience in this. Can i be of any help. Sure thing, thank you! Chris S. has been making strides in getting the new system online. Subscribe to NYPHP-Dev to stay abreast of what's going on and we'll see what needs to happen next. Thanks again, H > > Regards, > Neeraj > ----- Original Message ----- > From: Hans Zaunere > Date: Wed, 7 May 2003 17:34:16 -0400 > To: NYPHP Talk > Subject: Re: [nycphp-talk] Job Posting/ Recruitment Package > > > --- Mike West wrote: > > Suggestion on AMP based Job/ Resume Posting / Recruitment type package? > > Hoping > > to post resumes, collect personal info and match jobs to jobs available. > > We (NYPHP) are looking for one, too :) > > So far I haven't been able to find anything nice. Our current job board, > despite steadfast efforts by Sklar, can't offer what we'd like. I believe > Chris is working on a better system, and this will be a continuing Open > Source project of NYPHP. > > Best, > > H > > > > > > > > > > -- > __________________________________________________________ > Sign-up for your own FREE Personalized E-mail at Mail.com > http://www.mail.com/?sr=signup > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > From chris at psydeshow.org Fri May 16 12:19:32 2003 From: chris at psydeshow.org (Chris Snyder) Date: Fri, 16 May 2003 12:19:32 -0400 Subject: [nycphp-talk] Job Posting/ Recruitment Package In-Reply-To: <200305161542.h4GFfpYR067303@parsec.nyphp.org> References: <200305161542.h4GFfpYR067303@parsec.nyphp.org> Message-ID: <3EC50F94.10005@psydeshow.org> Take a look at http://dev.nyphp.org/content/jobs2 and feel free to contact me with suggestions and requests. Neeraj Rattu wrote: >Hello list, > >Can i get involved in this. I have done good work for a reqruitment company. www.tannet.com > >I have good experience in this. Can i be of any help. > >Regards, >Neeraj >----- Original Message ----- >From: Hans Zaunere >Date: Wed, 7 May 2003 17:34:16 -0400 >To: NYPHP Talk >Subject: Re: [nycphp-talk] Job Posting/ Recruitment Package > > >--- Mike West wrote: > > >>Suggestion on AMP based Job/ Resume Posting / Recruitment type package? >>Hoping >>to post resumes, collect personal info and match jobs to jobs available. >> >> > >We (NYPHP) are looking for one, too :) > >So far I haven't been able to find anything nice. Our current job board, >despite steadfast efforts by Sklar, can't offer what we'd like. I believe >Chris is working on a better system, and this will be a continuing Open >Source project of NYPHP. > >Best, > >H > > > > > > > > > > > -- do you have a photoblog yet? http://fotola.com (help beta-test!) From danielc at analysisandsolutions.com Fri May 16 12:28:09 2003 From: danielc at analysisandsolutions.com (Analysis & Solutions) Date: Fri, 16 May 2003 12:28:09 -0400 Subject: [nycphp-talk] Help with regex In-Reply-To: <200305161527.h4GFRNQx065928@parsec.nyphp.org> References: <200305161527.h4GFRNQx065928@parsec.nyphp.org> Message-ID: <20030516162809.GA25280@panix.com> Hi Nestor: On Fri, May 16, 2003 at 11:27:23AM -0400, Nestor Florez wrote: > 205 > > $line = ereg_replace(".*>", "", $line); As you probably realized, this is too greedy. The reason is because ".*" is matching ANY character, including ">" so it goes through the whole line until it gets to the final ">" This can be tweaked a tad so all characters except ">" are $line = ereg_replace('^[^>]+>', '', $line); Also notice the anchoring of the expression to the start of the line to avoid the expression repeating it's actions on subsequent >'s, and the use of single quotes since no variables are in the expressions. > $line = ereg_replace(".*?>", "", $line); You're on the right track, but "?" is for preg expressions. So, another option is converting it to a preg function: $line = preg_replace('/^.*?>/', '', $line); Enjoy, --Dan -- FREE scripts that make web and database programming easier http://www.analysisandsolutions.com/software/ T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7th Ave #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 From nyphp at NewAgeWeb.com Fri May 16 12:33:13 2003 From: nyphp at NewAgeWeb.com (Jerry Kapron) Date: Fri, 16 May 2003 12:33:13 -0400 Subject: [nycphp-talk] Help with regex Message-ID: <002101c31bc8$d8cc9080$de01a8c0@duron.lan.newageweb.com> "*?" is an bad combination. That's why you get the error. Perhaps you are looking for something like "[[:space:]]?<[tT][dD][^>]*>" Jerry -- 42.7% of all statistics are made up on the spot. -----Original Message----- From: Nestor Florez To: NYPHP Talk Date: Friday, May 16, 2003 12:07 PM Subject: [nycphp-talk] Help with regex >Hi people, > >I am having problems doing a regex using ereg_replace >I am reading a file and when I find a line with white space and >I want to remove these characters up to an including the '>'. >This is what a typical line looks like: >----------------------------------------- > 205 > Asaro, Doreen > G.I.S. >   >---------------------------------------------- > >I have tried the following but it does not work >------------------------------------------ >foreach($content as $line) >{ > $line = ereg_replace(".*>", "", $line); > print "$i = $line
"; > $i++; >} >------------------------------------------ > >I also tried : >$line = ereg_replace(".*?>", "", $line); >To make sure that it does not remove the entire line when it finds the '>' in "" >but I get this error: >*Warning*: ereg_replace() [function.ereg-replace ]: REG_BADRPT: in *c:\\program files\\apache group\\apache\\htdocs\\php\\readphone.php* on line *35* > >Any ideas? > >Thanks, > >Nestor > > >--- Unsubscribe at http://nyphp.org/list/ --- > > From shiflett at php.net Fri May 16 14:30:55 2003 From: shiflett at php.net (Chris Shiflett) Date: Fri, 16 May 2003 11:30:55 -0700 (PDT) Subject: [nycphp-talk] Forms & Refresh Question & General Form Security In-Reply-To: <200305141637.h4EGacvf088360@parsec.nyphp.org> Message-ID: <20030516183055.95410.qmail@web14307.mail.yahoo.com> --- "Bhulipongsanon, Pinyo" wrote: > > You do realize you're basically trusting the user with the value of > > status, right? I hope you're not using that for anything important. > > First, can't we improve this with session variable instead of $_GET > variable? Yes, good suggestion. > Second, you can always check for a valid $HTTP_REFERRER The Referer header is not required by the HTTP specification, even in 1.1, so relying on that is not necessarily a good idea. You will basically render your application useless to any Web client that does not provide this *optional* HTTP header. If you want to do that, it's fine, so long as you are taking that caveat into consideration. Chris From pinyo at nyc.rr.com Fri May 16 16:04:41 2003 From: pinyo at nyc.rr.com (Pinyo Bhulipongsanon) Date: Fri, 16 May 2003 16:04:41 -0400 Subject: [nycphp-talk] Forms & Refresh Question & General Form Security References: <200305161831.h4GIUxXD076413@parsec.nyphp.org> Message-ID: <002f01c31be6$6378e040$01c8a8c0@hewlettlydtpep> Chris, Thank you for you comment. What are some of the browsers that do not support http_referrer? Pinyo ----- Original Message ----- From: "Chris Shiflett" To: "NYPHP Talk" Sent: Friday, May 16, 2003 2:30 PM Subject: RE: [nycphp-talk] Forms & Refresh Question & General Form Security > --- "Bhulipongsanon, Pinyo" wrote: > > > You do realize you're basically trusting the user with the value of > > > status, right? I hope you're not using that for anything important. > > > > First, can't we improve this with session variable instead of $_GET > > variable? > > Yes, good suggestion. > > > Second, you can always check for a valid $HTTP_REFERRER > > The Referer header is not required by the HTTP specification, even in 1.1, so > relying on that is not necessarily a good idea. You will basically render your > application useless to any Web client that does not provide this *optional* > HTTP header. If you want to do that, it's fine, so long as you are taking that > caveat into consideration. > > Chris > > > --- Unsubscribe at http://nyphp.org/list/ --- > > From cmerlo at turing.matcmp.ncc.edu Fri May 16 16:15:39 2003 From: cmerlo at turing.matcmp.ncc.edu (Christopher R. Merlo) Date: Fri, 16 May 2003 16:15:39 -0400 Subject: Browser's local time? Message-ID: <20030516161539.A19459@turing.matcmp.ncc.edu> Folks: I would like to display the time on my web server, along with the time on the user's local machine, so that users can see any clock skew. Is this possible in straight PHP, or do I have to write JavaScript or something similar? -c -- cmerlo at turing.matcmp.ncc.edu http://turing.matcmp.ncc.edu/~cmerlo Flon's Law: There is not now, and never will be, a language in which it is the least bit difficult to write bad programs. From ophir at prusak.com Fri May 16 16:23:38 2003 From: ophir at prusak.com (Ophir Prusak) Date: Fri, 16 May 2003 16:23:38 -0400 Subject: [nycphp-talk] Forms & Refresh Question & General Form Security References: <200305162005.h4GK4iYN078914@parsec.nyphp.org> Message-ID: <03a301c31be9$08dd5a00$bf65a8c0@tag1002> To answer your question, all the major browsers support http referer, but the real issue is that the browser sends the server this data, and there is no way you can verify it. The cURL library even allows you to send any data you want as the http refer string. I wouldn't be to worried if you're using this for something like a guestbook, but if %100 reliable security is needed, you need to use something else. What you can do is encode the current time stamp (with something strong) and pass that as a variable. That way you can tell if someone tries to use an old string. > Chris, > > Thank you for you comment. What are some of the browsers that do not support > http_referrer? > > Pinyo > From webapprentice at onemain.com Fri May 16 13:38:43 2003 From: webapprentice at onemain.com (Stephen Tang) Date: Fri, 16 May 2003 13:38:43 -0400 (GMT) Subject: [nycphp-talk] Browser's local time? Message-ID: <5497682.1053117524083.JavaMail.nobody@dewey.psp.pas.earthlink.net> My experience with that is to use Javascript to display the user machine's local time (the Javascript asks the browser to display what it sees as the local time as dictated by the Operating System...so if the OS has the wrong time, it will show the wrong time. --Stephen -------Original Message------- From: "Christopher R. Merlo" Sent: 05/16/03 04:15 PM To: NYPHP Talk Subject: [nycphp-talk] Browser's local time? > > Folks: I would like to display the time on my web server, along with the time on the user's local machine, so that users can see any clock skew. Is this possible in straight PHP, or do I have to write JavaScript or something similar? -c -- cmerlo at turing.matcmp.ncc.edu http://turing.matcmp.ncc.edu/~cmerlo Flon's Law: There is not now, and never will be, a language in which it is the least bit difficult to write bad programs. --- Unsubscribe at http://nyphp.org/list/ --- > From nestorflorez at earthlink.net Fri May 16 16:54:25 2003 From: nestorflorez at earthlink.net (Nestor Florez) Date: Fri, 16 May 2003 13:54:25 -0700 (PDT) Subject: [nycphp-talk] Help with regex Message-ID: <7213432.1053118519689.JavaMail.nobody@beaker.psp.pas.earthlink.net> Dan et all, Thanks for your help, I was able to do what I wanted Using the following regex $_ =~ s/.*[^>]+>(.*[^<])<\\/td>/\\1/gi; I decide to use perl instead PHP because it was a lot easier reading the files in perl with the "while()", but I prefer PHP for creating web pages. When I tried using php ----------------------- 33 $content = file($myfile); #readfile into array 34 foreach($content as $line_num => $line) 35 { 36 $a = "/.*[^>]+>(.*[^<])<\\/td>/\\1/"; #reg expression 37 $line = preg_replace($a, '$1', $line); #replace 38 } ------------------------------ I still get an error: Warning: Unknown modifier '' in c:\\program files\\apache group\\apache\\htdocs\\php\\readphone.php on line 37 My problem is solved, but I wish what was causing the error message. Thnaks again to all, Nestor :-) Is ther an easy way to read a file in PHP like there is in perl -------Original Message------- From: Analysis & Solutions Sent: 05/16/03 09:28 AM To: NYPHP Talk Subject: Re: [nycphp-talk] Help with regex > > Hi Nestor: On Fri, May 16, 2003 at 11:27:23AM -0400, Nestor Florez wrote: > 205 > > $line = ereg_replace(".*>", "", $line); As you probably realized, this is too greedy. The reason is because ".*" is matching ANY character, including ">" so it goes through the whole line until it gets to the final ">" This can be tweaked a tad so all characters except ">" are $line = ereg_replace('^[^>]+>', '', $line); Also notice the anchoring of the expression to the start of the line to avoid the expression repeating it's actions on subsequent >'s, and the use of single quotes since no variables are in the expressions. > $line = ereg_replace(".*?>", "", $line); You're on the right track, but "?" is for preg expressions. So, another option is converting it to a preg function: $line = preg_replace('/^.*?>/', '', $line); Enjoy, --Dan -- FREE scripts that make web and database programming easier http://www.analysisandsolutions.com/software/ T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7th Ave #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 --- Unsubscribe at http://nyphp.org/list/ --- > From gmalcolm at professionalcredit.com Fri May 16 16:58:04 2003 From: gmalcolm at professionalcredit.com (Malcolm, Gary) Date: Fri, 16 May 2003 13:58:04 -0700 Subject: [nycphp-talk] Help with regex Message-ID: <715DAA079998D3118B8B00508B2C071D453D3B@pcsnet> the error sounds like a file translation problem... this may be crazy but erase and replace all the whitespace on line 37... gary > -----Original Message----- > From: Nestor Florez [mailto:nestorflorez at earthlink.net] > Sent: Friday, 16 May, 2003 1:55 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Help with regex > > > Dan et all, > > Thanks for your help, I was able to do what I wanted > Using the following regex > $_ =~ s/.*[^>]+>(.*[^<])<\\/td>/\\1/gi; > > I decide to use perl instead PHP because it was a lot easier > reading the files in perl with the "while()", but I > prefer PHP for creating web pages. > When I tried using php > ----------------------- > 33 $content = file($myfile); #readfile into array > 34 foreach($content as $line_num => $line) > 35 { > 36 $a = "/.*[^>]+>(.*[^<])<\\/td>/\\1/"; #reg expression > 37 $line = preg_replace($a, '$1', $line); #replace > 38 } > ------------------------------ > I still get an error: > Warning: Unknown modifier '' in c:\\program files\\apache > group\\apache\\htdocs\\php\\readphone.php on line 37 > > My problem is solved, but I wish what was causing the error message. > > Thnaks again to all, > > Nestor :-) > > > Is ther an easy way to read a file in PHP like there is in perl > -------Original Message------- > From: Analysis & Solutions > Sent: 05/16/03 09:28 AM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Help with regex > > > > > Hi Nestor: > > On Fri, May 16, 2003 at 11:27:23AM -0400, Nestor Florez wrote: > > > 205 > > > > $line = ereg_replace(".*>", "", $line); > > As you probably realized, this is too greedy. The reason is > because ".*" > is matching ANY character, including ">" so it goes through > the whole line > until it gets to the final ">" This can be tweaked a tad so all > characters except ">" are > > $line = ereg_replace('^[^>]+>', '', $line); > > Also notice the anchoring of the expression to the start of > the line to > avoid the expression repeating it's actions on subsequent > >'s, and the use > > of single quotes since no variables are in the expressions. > > > > $line = ereg_replace(".*?>", "", $line); > > You're on the right track, but "?" is for preg expressions. > So, another > option is converting it to a preg function: > > $line = preg_replace('/^.*?>/', '', $line); > > Enjoy, > > --Dan > > -- > FREE scripts that make web and database programming easier > href="http://www.analysisandsolutions.com/software/">http://ww > w.analysisandsolutions.com/software/ > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > 4015 7th Ave #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 > > > --- Unsubscribe at href="http://nyphp.org/list/">http://nyphp.org/list/ --- > > > > > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmerlo at turing.matcmp.ncc.edu Fri May 16 18:06:51 2003 From: cmerlo at turing.matcmp.ncc.edu (Christopher R. Merlo) Date: Fri, 16 May 2003 18:06:51 -0400 Subject: [nycphp-talk] Browser's local time? In-Reply-To: <200305162039.h4GKclaD081510@parsec.nyphp.org>; from webapprentice@onemain.com on Fri, May 16, 2003 at 04:38:47PM -0400 References: <200305162039.h4GKclaD081510@parsec.nyphp.org> Message-ID: <20030516180651.B19459@turing.matcmp.ncc.edu> On 2003-05-16 16:38 -0400, Stephen Tang wrote: > My experience with that is to use Javascript to display the user > machine's local time (the Javascript asks the browser to display > what it sees as the local time as dictated by the Operating > System...so if the OS has the wrong time, it will show the wrong > time. I've never written any JavaScript. Can anyone recommend a good web site to learn the basics from? -- cmerlo at turing.matcmp.ncc.edu http://turing.matcmp.ncc.edu/~cmerlo Flon's Law: There is not now, and never will be, a language in which it is the least bit difficult to write bad programs. From gmalcolm at professionalcredit.com Fri May 16 18:08:35 2003 From: gmalcolm at professionalcredit.com (Malcolm, Gary) Date: Fri, 16 May 2003 15:08:35 -0700 Subject: [nycphp-talk] Browser's local time? Message-ID: <715DAA079998D3118B8B00508B2C071D453D3C@pcsnet> http://www.dynamicdrive.com/dynamicindex6/index.html > -----Original Message----- > From: Christopher R. Merlo [mailto:cmerlo at turing.matcmp.ncc.edu] > Sent: Friday, 16 May, 2003 3:07 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Browser's local time? > > > On 2003-05-16 16:38 -0400, Stephen Tang > wrote: > > > My experience with that is to use Javascript to display the user > > machine's local time (the Javascript asks the browser to display > > what it sees as the local time as dictated by the Operating > > System...so if the OS has the wrong time, it will show the wrong > > time. > > I've never written any JavaScript. Can anyone recommend a good web > site to learn the basics from? > > -- > cmerlo at turing.matcmp.ncc.edu > http://turing.matcmp.ncc.edu/~cmerlo > > Flon's Law: There is not now, and never will be, a language in which > it is the least bit difficult to write bad programs. > > > --- Unsubscribe at http://nyphp.org/list/ --- > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chendry at nyc.rr.com Fri May 16 18:10:05 2003 From: chendry at nyc.rr.com (Christopher Hendry) Date: Fri, 16 May 2003 18:10:05 -0400 Subject: [nycphp-talk] Browser's local time? In-Reply-To: <200305162207.h4GM6sX7085621@parsec.nyphp.org> Message-ID: this is a good place to start: http://www.javascript.com ;) -> -----Original Message----- -> From: Christopher R. Merlo [mailto:cmerlo at turing.matcmp.ncc.edu] -> Sent: Friday, May 16, 2003 6:07 PM -> To: NYPHP Talk -> Subject: Re: [nycphp-talk] Browser's local time? -> -> -> On 2003-05-16 16:38 -0400, Stephen Tang -> wrote: -> -> > My experience with that is to use Javascript to display the user -> > machine's local time (the Javascript asks the browser to display -> > what it sees as the local time as dictated by the Operating -> > System...so if the OS has the wrong time, it will show the wrong -> > time. -> -> I've never written any JavaScript. Can anyone recommend a good web -> site to learn the basics from? -> -> -- -> cmerlo at turing.matcmp.ncc.edu http://turing.matcmp.ncc.edu/~cmerlo -> -> Flon's Law: There is not now, and never will be, a language in which -> it is the least bit difficult to write bad programs. -> -> -> --- Unsubscribe at http://nyphp.org/list/ --- -> -> -> From webapprentice at onemain.com Fri May 16 18:17:03 2003 From: webapprentice at onemain.com (Webapprentice) Date: Fri, 16 May 2003 18:17:03 -0400 Subject: [nycphp-talk] Browser's local time? In-Reply-To: <200305162207.h4GM6sXZ085621@parsec.nyphp.org> References: <200305162207.h4GM6sXZ085621@parsec.nyphp.org> Message-ID: <3EC5635F.7080206@onemain.com> Try this for starters. http://www.xs4all.nl/~ppk/js/date.html This is a tutorial on Javascript date/time. --Stephen Christopher R. Merlo wrote: > On 2003-05-16 16:38 -0400, Stephen Tang wrote: > > >>My experience with that is to use Javascript to display the user >>machine's local time (the Javascript asks the browser to display >>what it sees as the local time as dictated by the Operating >>System...so if the OS has the wrong time, it will show the wrong >>time. > > > I've never written any JavaScript. Can anyone recommend a good web > site to learn the basics from? > From cmerlo at turing.matcmp.ncc.edu Fri May 16 20:27:56 2003 From: cmerlo at turing.matcmp.ncc.edu (Christopher R. Merlo) Date: Fri, 16 May 2003 20:27:56 -0400 Subject: [nycphp-talk] Browser's local time? In-Reply-To: <200305162016.h4GKFfaD079771@parsec.nyphp.org>; from cmerlo@turing.matcmp.ncc.edu on Fri, May 16, 2003 at 04:15:41PM -0400 References: <200305162016.h4GKFfaD079771@parsec.nyphp.org> Message-ID: <20030516202756.C19459@turing.matcmp.ncc.edu> Thank you all for the links. I got it working. http://turing.matcmp.ncc.edu/~cmerlo/devel/, in case you're interested. -- cmerlo at turing.matcmp.ncc.edu http://turing.matcmp.ncc.edu/~cmerlo Flon's Law: There is not now, and never will be, a language in which it is the least bit difficult to write bad programs. From dennis at webstew.com Fri May 16 07:48:09 2003 From: dennis at webstew.com (Dennis Butler) Date: Fri, 16 May 2003 07:48:09 -0400 Subject: Highlighting keywords in query Message-ID: <3EC4CFF9.6070002@webstew.com> If I wanted to print just the keywords the user typed into a form, within the query results, say in a red font, but leave the rest of the data from the table cell in black, is there a way of inserting some logic inside the print statement within an SQL query to isolate only the matched word that was typed in. Let's say I typed in "dynamics" in the keyword field of the form and my results were lists of titles such as "Intensity dependence and transient dynamics of donor-- acceptor pair recombination in ZnO thin films grown on (001) silicon" I want only the word "dynamics" to be red and the rest of the title to be black, is this possible with a MySQL query? Thanks, Dennis From danielc at analysisandsolutions.com Sat May 17 13:35:04 2003 From: danielc at analysisandsolutions.com (Analysis & Solutions) Date: Sat, 17 May 2003 13:35:04 -0400 Subject: [nycphp-talk] Highlighting keywords in query In-Reply-To: <200305171531.h4HFUuQx019054@parsec.nyphp.org> References: <200305171531.h4HFUuQx019054@parsec.nyphp.org> Message-ID: <20030517173503.GA19740@panix.com> Hi Dennis: On Sat, May 17, 2003 at 11:30:56AM -0400, Dennis Butler wrote: > If I wanted to print just the keywords the user typed into a form, > within the query results, say in a red font, but leave the rest of the > data from the table cell in black, is there a way of inserting some > logic inside the print statement within an SQL query to isolate only the > matched word that was typed in. There are probably existing tutorials out there about this. I haven't done this personally. But, I can think of two ways to do it. One is in the SQL query. For example, MySQL has a REPLACE() function. The other is a preg_replace() the resulting text before you output it. I'd probably go this way. Get your search terms into a string. There are lots of ways to do this, depending on how your searh terms are initially acquired/defined, but here's one: $Terms = implode('|', $SearchTerms); Then put the terms into a regex: $out = preg_replace("/($Terms)/i", '\\\\1', $out); Then use style sheets to make the "color" of the class "term" red. This has better cross platform performance than and uses less space: Note: the above code is off the top of my head and hasn't been tested. Enjoy, --Dan -- FREE scripts that make web and database programming easier http://www.analysisandsolutions.com/software/ T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7th Ave #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 From tgales at tgaconnect.com Sat May 17 14:24:55 2003 From: tgales at tgaconnect.com (Tim Gales) Date: Sat, 17 May 2003 14:24:55 -0400 Subject: broken link Message-ID: <000001c31ca1$9dc01730$0d01a8c0@OBERON1> To whom it may concern: I was using the search form (entered a keyword ?build?). I go a response for HYPERLINK "http://newyorkphp.org/content/presentations/presentations.php"http://newyor kphp.org/content/presentations/presentations.php It 404?d --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.480 / Virus Database: 276 - Release Date: 5/12/2003 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 145 bytes Desc: not available URL: From shemin.sr at verizon.net Sat May 17 15:54:33 2003 From: shemin.sr at verizon.net (Susan Shemin) Date: Sat, 17 May 2003 12:54:33 -0700 Subject: MySQL security Message-ID: <000b01c31cae$3d90e8a0$56fc2f04@dslverizon.net> How secure is a MySQL database? I'm putting together a new site (with individual logins), and I want to market the site on the basis that their data will be secure, and no one can hack into it. Can I say this with using MySQL? Susan From pl at eskimo.com Sat May 17 18:41:46 2003 From: pl at eskimo.com (Peter Lehrer) Date: Sat, 17 May 2003 15:41:46 -0700 (PDT) Subject: determining tab delimited or comma separated Message-ID: Is there a built-in function which determines if a record in a file is tab delimited or comma separated? --peter lehrer From pl at eskimo.com Sat May 17 20:49:54 2003 From: pl at eskimo.com (Peter Lehrer) Date: Sat, 17 May 2003 17:49:54 -0700 (PDT) Subject: LOAD DATA LOCAL INFILE Message-ID: I am using LOAD DATA LOCAL and I get this error message: mysql> LOAD DATA LOCAL INFILE "down.dat" INTO TABLE 1rc; ERROR 1148: The used command is not allowed with this MySQL version The MySQL version is 3.23.49-log. This error occurs both on Widnows 95 and RedHat 6.1. The MySQL manual says that the LOCAL option should work on versions 3.22.15 and above so I don't know why it working on my version. Any help in getting LOAD DATA LOCAL to work would be great. Peter Lehrer From zaunere at yahoo.com Sat May 17 21:37:52 2003 From: zaunere at yahoo.com (Hans Zaunere) Date: Sat, 17 May 2003 18:37:52 -0700 (PDT) Subject: [nycphp-talk] MySQL security In-Reply-To: <200305171947.h4HJkMXJ029861@parsec.nyphp.org> Message-ID: <20030518013752.63278.qmail@web12808.mail.yahoo.com> --- Susan Shemin wrote: > How secure is a MySQL database? Very. > I'm putting together a new site (with > individual logins), and I want to market the site on the basis that their > data will be secure, and no one can hack into it. Can I say this with > using MySQL? Certainly. That said, MySQL's security depends on proper setup and use of it's permissions system, as is the case with any other database. And, if you will only be accessing the DB from the local system, set MySQL not to listen on a public socket with the disable-tcp configuration option in my.cnf. An advantage that MySQL has is it's Open Source development model. While I realize that some would suggest Open Source is a security weakness, especially in MySQL's I don't think this is so. There are thousands of eyes on the MySQL codebase, constantly auditing it and trying to weed out any issues. H > > Susan > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > From zaunere at yahoo.com Sat May 17 21:42:46 2003 From: zaunere at yahoo.com (Hans Zaunere) Date: Sat, 17 May 2003 18:42:46 -0700 (PDT) Subject: [nycphp-talk] determining tab delimited or comma separated In-Reply-To: <200305172242.h4HMfqXJ036295@parsec.nyphp.org> Message-ID: <20030518014246.35875.qmail@web12802.mail.yahoo.com> --- Peter Lehrer wrote: > Is there a built-in function which determines if a record in a file is tab > delimited or comma separated? Not in PHP that I know of. Typically, an entire file will either be tab or comma seperated, not a particular record, and a parser is written to handle a particular case. Then, when processing a given file the fact if it's using tabs, commas or even fixed-width is specified, since trying to guess from the file's contents could lead to unexpected results. H > > --peter lehrer > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > From zaunere at yahoo.com Sat May 17 21:43:48 2003 From: zaunere at yahoo.com (Hans Zaunere) Date: Sat, 17 May 2003 18:43:48 -0700 (PDT) Subject: [nycphp-talk] LOAD DATA LOCAL INFILE In-Reply-To: <200305180050.h4I0nxXJ040337@parsec.nyphp.org> Message-ID: <20030518014348.56444.qmail@web12806.mail.yahoo.com> --- Peter Lehrer wrote: > I am using LOAD DATA LOCAL and I get this error message: > > mysql> LOAD DATA LOCAL INFILE "down.dat" INTO TABLE 1rc; > ERROR 1148: The used command is not allowed with this MySQL version > > The MySQL version is 3.23.49-log. > This error occurs both on Widnows 95 and RedHat 6.1. > > The MySQL manual says that the LOCAL option should work on versions > 3.22.15 and above so I don't know why it working on my version. > > Any help in getting LOAD DATA LOCAL to work would be great. There were security issues with this command because it would allow MySQL to potentially read any file (/etc/shadow for instance). http://www.mysql.com/doc/en/LOAD_DATA_LOCAL.html H > > Peter Lehrer > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > From tim_gales at email.msn.com Sat May 17 21:44:13 2003 From: tim_gales at email.msn.com (Tim Gales) Date: Sat, 17 May 2003 21:44:13 -0400 Subject: [nycphp-talk] LOAD DATA LOCAL INFILE In-Reply-To: <200305180050.h4I0nxT5040337@parsec.nyphp.org> Message-ID: <000001c31cde$fc367290$6d9bfea9@OBERON1> Peter, I am assuming you are using phpMyAdmin -- Try this: when you export the data use data and structure and click 'add drop table' . (Copy your table first of course, before trying this -- Or use a test table...) -----Original Message----- From: Peter Lehrer [mailto:pl at eskimo.com] Sent: Saturday, May 17, 2003 8:50 PM To: NYPHP Talk Subject: [nycphp-talk] LOAD DATA LOCAL INFILE I am using LOAD DATA LOCAL and I get this error message: mysql> LOAD DATA LOCAL INFILE "down.dat" INTO TABLE 1rc; ERROR 1148: The used command is not allowed with this MySQL version The MySQL version is 3.23.49-log. This error occurs both on Widnows 95 and RedHat 6.1. The MySQL manual says that the LOCAL option should work on versions 3.22.15 and above so I don't know why it working on my version. Any help in getting LOAD DATA LOCAL to work would be great. Peter Lehrer --- Unsubscribe at http://nyphp.org/list/ --- --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.480 / Virus Database: 276 - Release Date: 5/12/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.480 / Virus Database: 276 - Release Date: 5/12/2003 From pl at eskimo.com Sat May 17 23:17:03 2003 From: pl at eskimo.com (Peter Lehrer) Date: Sat, 17 May 2003 20:17:03 -0700 (PDT) Subject: [nycphp-talk] LOAD DATA LOCAL INFILE In-Reply-To: <200305180144.h4I1hoTH043980@parsec.nyphp.org> Message-ID: On Sat, 17 May 2003, Hans Zaunere wrote: Got it to work. Thanks Hans. Peter Lehrer > > --- Peter Lehrer wrote: > > I am using LOAD DATA LOCAL and I get this error message: > > > > mysql> LOAD DATA LOCAL INFILE "down.dat" INTO TABLE 1rc; > > ERROR 1148: The used command is not allowed with this MySQL version > > > > The MySQL version is 3.23.49-log. > > This error occurs both on Widnows 95 and RedHat 6.1. > > > > The MySQL manual says that the LOCAL option should work on versions > > 3.22.15 and above so I don't know why it working on my version. > > > > Any help in getting LOAD DATA LOCAL to work would be great. > > There were security issues with this command because it would allow MySQL to > potentially read any file (/etc/shadow for instance). > > http://www.mysql.com/doc/en/LOAD_DATA_LOCAL.html > > H > > > > > Peter Lehrer > > > > > > > > > > > > > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > From markert at optonline.net Sat May 17 23:31:30 2003 From: markert at optonline.net (John W. Markert) Date: Sat, 17 May 2003 23:31:30 -0400 Subject: A few questions Message-ID: <007b01c31cee$3f11ef40$0300a8c0@dads> I could use a few answers from a kind sole out there.... When using PHP with MySQL is there a way to find the index of a field/column by providing the associative name? I have n related elements in a table that I want to process in a loop and I want to ask MySQL where to start processing. Is there a way to get the logged in user name under Windows 2000 with PHP? Thanks for your help. John ___________________________________________ John W. Markert 14 Joanna Way Kinnelon, NJ 07405 Phone: (973)838-8956 Cell: (201)788-1740 Fax: (973)838-4561 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jadair at adairservices.net Sun May 18 00:20:28 2003 From: jadair at adairservices.net (John Adair) Date: Sun, 18 May 2003 00:20:28 -0400 Subject: [nycphp-talk] MySQL security In-Reply-To: <200305180137.h4I1btQd042360@parsec.nyphp.org> Message-ID: I can't seem to find my my.cnf file. I know mysql is up and running. phpmyadmin can access it and all. How do I figure out where the my.cnf file (if by another name) is the actual configuration file in use. Do you have any other security advice? -----Original Message----- From: Hans Zaunere [mailto:zaunere at yahoo.com] Sent: Saturday, May 17, 2003 9:38 PM To: NYPHP Talk Subject: Re: [nycphp-talk] MySQL security --- Susan Shemin wrote: > How secure is a MySQL database? Very. > I'm putting together a new site (with > individual logins), and I want to market the site on the basis that their > data will be secure, and no one can hack into it. Can I say this with > using MySQL? Certainly. That said, MySQL's security depends on proper setup and use of it's permissions system, as is the case with any other database. And, if you will only be accessing the DB from the local system, set MySQL not to listen on a public socket with the disable-tcp configuration option in my.cnf. An advantage that MySQL has is it's Open Source development model. While I realize that some would suggest Open Source is a security weakness, especially in MySQL's I don't think this is so. There are thousands of eyes on the MySQL codebase, constantly auditing it and trying to weed out any issues. H > > Susan > > > > > > --- Unsubscribe at http://nyphp.org/list/ --- From delta at rochester.rr.com Sun May 18 08:46:02 2003 From: delta at rochester.rr.com (deedee) Date: Sun, 18 May 2003 08:46:02 -0400 Subject: archive the news to 'next page' Message-ID: <00bb01c31d3b$723e3020$fc00fe0a@KEITZWS2> if you would like to see what i'm working on at www.keitz.org, below the banner i have some 'news' i retrieve from a mysql database. i'm trying to do something that i'm sure is done on everysite... the news is getting overwhelming for the homepage so i thought i'd put a link to the 'archives'. in order to use the code (sql_calc_found_rows) i wanted to use i had to upgrade .... finally i'm getting somewhere with the following code. $query = "SELECT SQL_CALC_FOUND_ROWS DATE_FORMAT(Newsdate,'
%W
%D %M %Y %r
'), News FROM www_news ORDER BY NewsDate DESC limit 3;"; $result = mysql_query($query,$link); if (!$result) { die("

!queryErr - error executing query.


$query"); } $sql_news_count = "SELECT FOUND_ROWS()"; $count_news_results = mysql_result (mysql_query ( $sql_news_count ),3); //print "News ($count_news_results):"; 3 of news articles Archives "); print("
$Date
$News
"); print(""); if ($AltColor == "#F0F0F0") { $AltColor = "#E0E0E0"; } else { $AltColor = "#F0F0F0"; } } ?> SO...... i'm going to make an HREF for the word Archives to something like new1.php and then i need to somehow start a new starting reference point to display the news. i know i have counted the total available news accurately because i got 11 when i put in the code //print "News ($count_news_results):"; i guess i need to somehow define a variable that is equal to $count_news_results minus the three news articles i previously displayed. but at somepoint i need a loop to end when i run out of news. i must be brain dead this morning....cuz i'm sure this is common code. thanks for any help you can offer. regards, deedee -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris at psydeshow.org Sun May 18 10:09:53 2003 From: chris at psydeshow.org (Chris Snyder) Date: Sun, 18 May 2003 10:09:53 -0400 Subject: [nycphp-talk] archive the news to 'next page' In-Reply-To: <200305181247.h4ICkDYR064961@parsec.nyphp.org> References: <200305181247.h4ICkDYR064961@parsec.nyphp.org> Message-ID: <3EC79431.60902@psydeshow.org> deedee wrote: >SO...... i'm going to make an HREF for the word Archives to something like new1.php and then i need to somehow start a new starting reference point to display the news. i know i have counted the total available news accurately because i got 11 when i put in the code //print "News ($count_news_results):"; i guess i need to somehow define a variable that is equal to $count_news_results minus the three news articles i previously displayed. but at somepoint i need a loop to end when i run out of news. > > > The code I'd use would be something like this for the main page -- I'm not sure what FOUND_ROWS is, I've always used count on a column to find totals: // set up the number to display on the main page: $pagetotal= 3; // get the total number of articles $totalquery= "SELECT count(NewsDate) FROM www_news"; $totalresult= mysql_query($totalquery); if ($array= mysql_fetch_row($totalresult)) $total= $array[0]; // display the first three $query = "SELECT DATE_FORMAT(NewsDate,'
%W
%D %M %Y %r
'),News FROM www_news ORDER BY NewsDate DESC LIMIT $pagetotal"; $result = mysql_query($query); if (!$result) { die("

!queryErr - error executing query.


$query"); } // use your while loop to print the news... while ($array= mysql_fetch_row($result)) { etc. etc. etc. } // then for the link to the archives if ($total > $pagetotal) { $archive= $total - $pagetotal; print "news archive ($archive stories)"; } And in newsarchive.php you would use the offset you sent to build the query: $offset= $_GET['offset']; $query = "SELECT DATE_FORMAT(NewsDate,'
%W
%D %M %Y %r
'),News FROM www_news ORDER BY NewsDate DESC LIMIT $offset, -1"; // the -1 means select from $offset to the end of the record set From cmerlo at turing.matcmp.ncc.edu Sun May 18 12:45:48 2003 From: cmerlo at turing.matcmp.ncc.edu (Christopher R. Merlo) Date: Sun, 18 May 2003 12:45:48 -0400 Subject: [nycphp-talk] archive the news to 'next page' In-Reply-To: <200305181247.h4ICkDaD064961@parsec.nyphp.org>; from delta@rochester.rr.com on Sun, May 18, 2003 at 08:46:13AM -0400 References: <200305181247.h4ICkDaD064961@parsec.nyphp.org> Message-ID: <20030518124548.G19459@turing.matcmp.ncc.edu> Deedee: Here's what I put in my left-side nav thing: *** $news_query = "select topic, date from site_news order by date desc"; $news_result = @mysql_query( $news_query ); // Notice on next line, I assume that there's more than two news items for( $i = 0; $i < 2; $i++ ) { $row = @mysql_fetch_assoc( $news_result ); print "

" . $row[ "topic" ] . "
" . date( "j M Y g:i a", strtotime( $row[ "date" ] ) ) . "

\ "; } print "

"; print_link( "$docroot/news.php", "Read Site News..." ); print "

\ "; *** The assumption works because it's my site top to bottom. YMMV. The page news.php, which shows all the news, looks like this: *** // Select all entries from site_news table $news_query = "select * from site_news order by date desc"; $news_result = @mysql_query( $news_query ); // And display them while( $row = @mysql_fetch_assoc( $news_result ) ) { print "

" . $row[ "topic" ] . " [ " . date( "j M Y g:i a", strtotime( $row[ "date" ] ) ) . " ]

\ "; print "

" . $row[ "news" ] . "

\ "; } *** BTW, just so you're not confused, this is code from my devel site. The live site actually displays the first two items on the front page, not just headlines and dates, and doesn't display anything in the nav bar. HTH! -c -- cmerlo at turing.matcmp.ncc.edu http://turing.matcmp.ncc.edu/~cmerlo "Nuclear war would really set back cable." -- Ted Turner From zaunere at yahoo.com Sun May 18 13:20:52 2003 From: zaunere at yahoo.com (Hans Zaunere) Date: Sun, 18 May 2003 10:20:52 -0700 (PDT) Subject: [nycphp-talk] MySQL security In-Reply-To: <200305180420.h4I4KIXJ051459@parsec.nyphp.org> Message-ID: <20030518172052.63869.qmail@web12807.mail.yahoo.com> --- John Adair wrote: > I can't seem to find my my.cnf file. I know mysql is up and running. > phpmyadmin can access it and all. How do I figure out where the my.cnf > file (if by another name) is the actual configuration file in use. It can be a bit tricky, and really depends on your OS and how MySQL was setup. If you used a RedHat RPM, for instance, then my.cnf should be in /etc. If not, you just need to create one there. If you've compiled from source or installed the binary package mysql.com then my.cnf isn't created by default so you can just create it in either /etc/ or in your data directory. If this is Windows, sorry, I have no idea :) (but typically, you can create the my.cnf in your data directory and it'll get picked up). > Do you have any other security advice? Well, for instance, if you're setting up a shared server, where multiple people will have DBs, some of the privacy/etc settings are nice (http://www.mysql.com/doc/en/Privileges_options.html). And, in general, just be diligent with giving permissions, trying to the most restrictive and becoming more lenient from there. H > > -----Original Message----- > From: Hans Zaunere [mailto:zaunere at yahoo.com] > Sent: Saturday, May 17, 2003 9:38 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] MySQL security > > > > --- Susan Shemin wrote: > > How secure is a MySQL database? > > Very. > > > I'm putting together a new site (with > > individual logins), and I want to market the site on the basis that their > > data will be secure, and no one can hack into it. Can I say this with > > using MySQL? > > Certainly. > > That said, MySQL's security depends on proper setup and use of it's > permissions system, as is the case with any other database. And, if you > will > only be accessing the DB from the local system, set MySQL not to listen on > a > public socket with the disable-tcp configuration option in my.cnf. > > An advantage that MySQL has is it's Open Source development model. While I > realize that some would suggest Open Source is a security weakness, > especially in MySQL's I don't think this is so. There are thousands of > eyes > on the MySQL codebase, constantly auditing it and trying to weed out any > issues. > > H > > > > > > Susan > > > > > > > > > > > > > > > > > > > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > From zaunere at yahoo.com Sun May 18 13:28:45 2003 From: zaunere at yahoo.com (Hans Zaunere) Date: Sun, 18 May 2003 10:28:45 -0700 (PDT) Subject: [nycphp-talk] A few questions In-Reply-To: <200305180333.h4I3XFXJ049406@parsec.nyphp.org> Message-ID: <20030518172845.62186.qmail@web12808.mail.yahoo.com> --- "John W. Markert" wrote: > I could use a few answers from a kind sole out there.... > > When using PHP with MySQL is there a way to find the index of a > field/column by providing the associative name? I have n related elements > in a table that I want to process in a loop and I want to ask MySQL where > to start processing. I'm not sure if I understand 100%, but maybe all you need is a SELECT statement? Something like: SELECT * FROM mytable WHERE col1='name' If you need to restrict the results more, you can of course add tests to the WHERE clause. > Is there a way to get the logged in user name under Windows 2000 with PHP? I'm assuming you mean with PHP running under Windows 2000 as the server environment? If so, then phpinfo(); should give you a broad list of available environment variables, one of which being the user that owns the process. H > Thanks for your help. > > John > > ___________________________________________ > > John W. Markert > 14 Joanna Way > Kinnelon, NJ 07405 > Phone: (973)838-8956 > Cell: (201)788-1740 > Fax: (973)838-4561 > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > From delta at rochester.rr.com Sun May 18 21:36:45 2003 From: delta at rochester.rr.com (deedee) Date: Sun, 18 May 2003 21:36:45 -0400 Subject: [nycphp-talk] archive the news to 'next page' References: <200305181729.h4IHSmYj075497@parsec.nyphp.org> Message-ID: <001201c31da7$1bbcfc60$fc00fe0a@KEITZWS2> thank you everyone who offered assistance, the archive/more news functionality is in production! on a side note, SELECT SQL_CALC_FOUND_ROWS (using mysql 4.0.12) determines the number of rows in a query without looping through and counting everything...very helpful when the database contains hundreds or thousands of records. The number of rows can then be retrieved with SELECT FOUND_ROWS(). regards, deedee From nestorflorez at earthlink.net Mon May 19 00:20:05 2003 From: nestorflorez at earthlink.net (Nestor) Date: Sun, 18 May 2003 21:20:05 -0700 Subject: regex help In-Reply-To: <20030516155729.48097.qmail@web40406.mail.yahoo.com> Message-ID: Thanks to all forthe regex help I actualy was trying to accomplish this in PHP but I ended up doing it in perl. It was easier reading the file itself. $_ =~ s/.*[^>]+>(.*[^<])<\\/td>/\\1/gi; Thanks again, nestor :-) -----Original Message----- From: Ovid [mailto:poec at yahoo.com] Sent: Friday, May 16, 2003 8:57 AM To: Dennis Stout; Nestor Florez; beginners-cgi at perl.org Cc: nflorez at guhsd.net Subject: Re: regex help --- Dennis Stout wrote: > Or this: > > $_ = s/(.*)<\\/td>//gi; Comments: 1. The binding operator (=~) should be used. 2. If $_ is used, then it's redundant and can be omitted. 3. It's broken. The following demonstrates: $_ = 'thisthat'; s/(.*)<\\/td>//gi; print $1; Cheers, Ovid ===== Ovid http://www.perlmonks.org/index.pl?node_id=17000 Web Programming with Perl http://users.easystreet.com/ovid/cgi_course/ Silence Is Evil http://users.easystreet.com/ovid/philosophy/indexdecency.htm __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com -- To unsubscribe, e-mail: beginners-cgi-unsubscribe at perl.org For additional commands, e-mail: beginners-cgi-help at perl.org --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.476 / Virus Database: 273 - Release Date: 4/24/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.476 / Virus Database: 273 - Release Date: 4/24/2003 From danielc at analysisandsolutions.com Mon May 19 01:04:44 2003 From: danielc at analysisandsolutions.com (Analysis & Solutions) Date: Mon, 19 May 2003 01:04:44 -0400 Subject: [nycphp-talk] MySQL security In-Reply-To: <200305180420.h4I4KIQx051459@parsec.nyphp.org> References: <200305180420.h4I4KIQx051459@parsec.nyphp.org> Message-ID: <20030519050444.GA20451@panix.com> Hi John: On Sun, May 18, 2003 at 12:20:18AM -0400, John Adair wrote: > I can't seem to find my my.cnf file. One isn't installed by default, necessarily. What does come with the distribution, at least on Windows, is a set of sample files. They're in the root of your MySQL direcory, with names like "my-small.cnf" and "my-huge.cnf." Copy an appropriate one to the appropriate location: /etc or c:\\. It's also a good idea to put a blank one in your mysql/data directory, just to make sure a malicious one doesn't get put there. Now, MAKE SURE the file permissions on these files don't allow anyone but the system administrator to change their contents. > phpmyadmin can access it and all. I stay away from third party convenience tools like that. phpmyadmin has had some very basic vulnerabilities. Plus, I imagine one can store passwords in a file > Do you have any other security advice? Put your database username/password in one separate file which you then include from the rest of your scripts. Then, place that file in a secure location, preferably not in the document root of the web server. Then make sure permissions on that file only allow authorized persons to view, let alone, heaven forbid, edit it. Finally, the default MySQL distribution has several security openings. Do the following queries to close them. delete from user where Host='%'; delete from user where User=''; delete from db where Host='%'; update user set User='NewRootName', Password=password('NewPassword') where User='root'; flush privileges; I've got an execllent tutorial regarding MySQL installation. While it focuses on Windows machines, there are lots of general tips in there too. It's on line at http://www.analysisandsolutions.com/code/mybasic.htm Enjoy, --Dan -- FREE scripts that make web and database programming easier http://www.analysisandsolutions.com/software/ T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7th Ave #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 From danielc at analysisandsolutions.com Mon May 19 01:08:58 2003 From: danielc at analysisandsolutions.com (Analysis & Solutions) Date: Mon, 19 May 2003 01:08:58 -0400 Subject: [nycphp-talk] determining tab delimited or comma separated In-Reply-To: <200305172241.h4HMfqQx036295@parsec.nyphp.org> References: <200305172241.h4HMfqQx036295@parsec.nyphp.org> Message-ID: <20030519050858.GB20451@panix.com> On Sat, May 17, 2003 at 06:41:52PM -0400, Peter Lehrer wrote: > Is there a built-in function which determines if a record in a file is tab > delimited or comma separated? No. But you could make a guess by doing explode(',', $line) and explode("\ ", $line) and see which one produces the number of expected array elements. As Hans suggested, a file should be in one format. --Dan -- FREE scripts that make web and database programming easier http://www.analysisandsolutions.com/software/ T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7th Ave #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 From danielc at analysisandsolutions.com Mon May 19 01:22:10 2003 From: danielc at analysisandsolutions.com (Analysis & Solutions) Date: Mon, 19 May 2003 01:22:10 -0400 Subject: [nycphp-talk] A few questions In-Reply-To: <200305180333.h4I3XFQx049406@parsec.nyphp.org> References: <200305180333.h4I3XFQx049406@parsec.nyphp.org> Message-ID: <20030519052210.GC20451@panix.com> Sire: On Sat, May 17, 2003 at 11:33:15PM -0400, John W. Markert wrote: > > When using PHP with MySQL is there a way to find the index of a > field/column by providing the associative name? I have n related > elements in a table that I want to process in a loop and I want to ask > MySQL where to start processing. I don't believe there is one directly. You could try to rig something up using mysql_fetch_array(). That returns an array containing values of both assciative and enumerated keys. Then you might be able to find your answer using array_search(). Hmm... Actually, create two arrays. One enumerated. One associative. Find the value from the associative. Then use that value as the needle in the enumerated array "haystack" via array_search(). But, after all that's said, I don't really see the point. Why are you trying to do this? Sounds like you're creating a problem or attacking something in a way that may be better approachced from another direction. --Dan -- FREE scripts that make web and database programming easier http://www.analysisandsolutions.com/software/ T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7th Ave #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 From steve at soler.net Mon May 19 01:25:29 2003 From: steve at soler.net (Steve Soler) Date: Mon, 19 May 2003 01:25:29 -0400 Subject: Seeking PHP/MySQL Freelancer Message-ID: <4DB4B04E-89BA-11D7-8EDF-003065481BD8@soler.net> I'm looking for a PHP/MySQL developer willing to work with my company on a freelance basis. I don't currently have any major projects available, but a few minor ones. I'm really looking for one reliable developer that can work with my company on a regular freelance basis as we take on more and more PHP projects. It may start off slow, but I intend for the work flow to pick up in due time. If you are interested please visit my website and fill out the online resume/application http://hr.soler.net/ Thanks in advance! - Steve Soler From tech_learner at yahoo.com Mon May 19 01:53:33 2003 From: tech_learner at yahoo.com (Tracy) Date: Sun, 18 May 2003 22:53:33 -0700 (PDT) Subject: [nycphp-talk] form confusion... In-Reply-To: <200305141914.h4EJCu0t001511@parsec.nyphp.org> Message-ID: <20030519055333.70942.qmail@web14305.mail.yahoo.com> Hi everyone, i hope u have found the solution u want... if not and if u dont mind, plz take a look at this book "Professional PHP4 Programming". the codes are available for download. this book has 4 case studies, one is on protein database. i feel it would help in yr case too. All the best. n excuse such a sudden late reply. Tracy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Coming together is a beginning... keeping together is progress... working together is success !!! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --------------------------------- Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. -------------- next part -------------- An HTML attachment was scrubbed... URL: From brent at landover.com Mon May 19 09:33:07 2003 From: brent at landover.com (Brent Baisley) Date: Mon, 19 May 2003 09:33:07 -0400 Subject: [nycphp-talk] Highlighting keywords in query In-Reply-To: <200305171531.h4HFUuVj019054@parsec.nyphp.org> Message-ID: <6D4D7175-89FE-11D7-83CC-0050E4C5CF70@landover.com> Why would you want to do it in the query? Formatting, like color, should really be done in the presentation layer. For my purposes I create 10 classes in my style sheets so that I can hilight up 10 search words in different colors. I then do a search and replace on the words so that "dynamics" would be changed to dynamics. This won't interfere with any of you other formatting or color schemes you have in place. On Saturday, May 17, 2003, at 11:30 AM, Dennis Butler wrote: > Let's say I typed in "dynamics" in the keyword field of the form and my > results were lists of titles such as "Intensity dependence and > transient > dynamics of donor-- acceptor pair recombination in ZnO thin films grown > on (001) silicon" I want only the word "dynamics" to be red and the > rest of the title to be black, is this possible with a MySQL query? > -- Brent Baisley Systems Architect Landover Associates, Inc. Search & Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 From jfreeman at amnh.org Mon May 19 15:33:08 2003 From: jfreeman at amnh.org (Joshua S. Freeman) Date: Mon, 19 May 2003 15:33:08 -0400 Subject: are enums verboten? Message-ID: First, thanks to everyone who answered my last salvo of questions. I look forward to moving down to NY this summer so I can start meeting you in person at NYPHP meetings... This one is more of a MySQL question than a PHP question but here goes.. I'm creating a LAMP app. for a scientist who needs to gather a crapload of information about a collection of scientific specimens. The main table ('specimens') has 61 fields. For fields such as 'species_id' what will go in there is simply the id number referencing information from a lookup table containing 20 or 30 species names, each with an id number. (species_id smallint(6) NOT NULL default '0') For fields such as 'priority' or 'condition' I'm thinking of using type 'enum': priority enum('1','2','3','4') NOT NULL default '1', gen_condition enum('good','fair','poor','very poor') NOT NULL default 'good'... Is this alright?.. or.. should I do the same thing with 'priority' and 'gen_condition' that I do with 'species_id' ?... An additional question: there are NUMEROUS questions in the survey that ask the surveyor to choose between 'high - moderate - low' ... in reference to various different parameters in the survey. do i have just ONE table that looks up 'high', 'moderate', 'low' (like the species lookup table which has two fields- species_id and species_name) or do I make different lookup tables for 'high', 'moderate', 'low'... once for each question in the survey asking "how much incidence of blah-blah do you see ? high? medium? low?" I hope my questions are clear. I look forward to some guidance. Thanks! J. From jfreeman at amnh.org Mon May 19 15:43:02 2003 From: jfreeman at amnh.org (Joshua S. Freeman) Date: Mon, 19 May 2003 15:43:02 -0400 Subject: [nycphp-talk] form confusion... In-Reply-To: <200305190553.h4J5raQv098614@parsec.nyphp.org> Message-ID: not at all! Thanks!.. who publishes the book? is any of the code on the 'net for download? J. On 5/19/03 1:53 AM, "Tracy" wrote: > Hi everyone, > i hope u have found the solution u want... > if not and if u dont mind, plz take a look at this book "Professional PHP4 > Programming". the codes are available for download. this book has 4 case > studies, one is on protein database. i feel it would help in yr case too. > > All the best. n excuse such a sudden late reply. > Tracy > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Coming together is a beginning... > keeping together is progress... > working together is success !!! > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > --------------------------------- > Do you Yahoo!? > The New Yahoo! Search - Faster. Easier. Bingo. > > > --- Unsubscribe at http://nyphp.org/list/ --- > > > From louie at zibi.co.il Mon May 19 16:06:15 2003 From: louie at zibi.co.il (louie) Date: Mon, 19 May 2003 16:06:15 -0400 Subject: [nycphp-talk] form confusion... References: <200305191943.h4JJgnch024443@parsec.nyphp.org> Message-ID: <001101c31e42$1b808c30$7552fea9@w3j5c4> http://www.wrox.com/dynamic/books/download.aspx is the publisher i think best ----- Original Message ----- From: "Joshua S. Freeman" To: "NYPHP Talk" Sent: Monday, May 19, 2003 3:42 PM Subject: Re: [nycphp-talk] form confusion... > not at all! Thanks!.. who publishes the book? is any of the code on the > 'net for download? > > J. > > On 5/19/03 1:53 AM, "Tracy" wrote: > > > Hi everyone, > > i hope u have found the solution u want... > > if not and if u dont mind, plz take a look at this book "Professional PHP4 > > Programming". the codes are available for download. this book has 4 case > > studies, one is on protein database. i feel it would help in yr case too. > > > > All the best. n excuse such a sudden late reply. > > Tracy > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Coming together is a beginning... > > keeping together is progress... > > working together is success !!! > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > --------------------------------- > > Do you Yahoo!? > > The New Yahoo! Search - Faster. Easier. Bingo. > > > > > > > > > > > > > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > > > From dkrook at hotmail.com Mon May 19 17:04:53 2003 From: dkrook at hotmail.com (D C Krook) Date: Mon, 19 May 2003 17:04:53 -0400 Subject: [nycphp-talk] form confusion... Message-ID: Wrox is the publisher (sadly, now out of business), The title you want is: Professional PHP4 Programming http://www.wrox.com/dynamic/books/download.aspx?isbn=1861006918&email= Code samples http://web.wrox.com/professional/6918.zip (271k) >not at all! Thanks!.. who publishes the book? is any of the code on the >'net for download? _________________________________________________________________ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail From zaunere at yahoo.com Mon May 19 19:17:01 2003 From: zaunere at yahoo.com (Hans Zaunere) Date: Mon, 19 May 2003 16:17:01 -0700 (PDT) Subject: [nycphp-talk] are enums verboten? In-Reply-To: <200305191933.h4JJWvXL023510@parsec.nyphp.org> Message-ID: <20030519231701.44840.qmail@web12807.mail.yahoo.com> --- "Joshua S. Freeman" wrote: > First, thanks to everyone who answered my last salvo of questions. I look > forward to moving down to NY this summer so I can start meeting you in > person at NYPHP meetings... > > > This one is more of a MySQL question than a PHP question but here goes.. > > I'm creating a LAMP app. for a scientist who needs to gather a crapload of > information about a collection of scientific specimens. > > The main table ('specimens') has 61 fields. > > For fields such as 'species_id' what will go in there is simply the id > number referencing information from a lookup table containing 20 or 30 > species names, each with an id number. > > (species_id smallint(6) NOT NULL default '0') > > For fields such as 'priority' or 'condition' I'm thinking of using type > 'enum': > > priority enum('1','2','3','4') NOT NULL default '1', > gen_condition enum('good','fair','poor','very poor') NOT NULL default > 'good'... > > Is this alright?.. Well, knowing how scientists (I don't know any, but watch the Science Channel) they will ineveitably add 'very good', 'average', and so on. While this isn't nessecarily a bad thing, it is ineveitable. > or.. should I do the same thing with 'priority' and 'gen_condition' that I > do with 'species_id' ?... Personally, I would. I've played with the enum and set column types, and always ended up going back to regular columns for various reasons (using certain functions on columns, getting the values of a particular column, more flexibility with joins, etc). That said, set or enum columns certainly aren't verboten, IMHO. > An additional question: > > there are NUMEROUS questions in the survey that ask the surveyor to choose > between 'high - moderate - low' ... in reference to various different > parameters in the survey. > > do i have just ONE table that looks up 'high', 'moderate', 'low' (like the > species lookup table which has two fields- species_id and species_name) or > do I make different lookup tables for 'high', 'moderate', 'low'... once for > each question in the survey asking "how much incidence of blah-blah do you > see ? high? medium? low?" I would go with just a single table. Additionally, when I have a lot of options to select from, and the data is all generally the same, I like to use just a single generic table, consisting of an auto_increment id, possibly timestamp when the choice was added, another int field to determine type of the row (a species, rating, etc) and the value itself. When delivering some research software for NYUCD I use a single table to over 30+ types of oddball info and it worked very nicely. Best, H > > I hope my questions are clear. I look forward to some guidance. > > Thanks! > > J. > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > From gw.nyphp at gwprogramming.com Mon May 19 19:29:59 2003 From: gw.nyphp at gwprogramming.com (George Webb) Date: Mon, 19 May 2003 19:29:59 -0400 (EDT) Subject: [nycphp-talk] are enums verboten? Message-ID: <200305192330.h4JNU0BW019320@gw00.com> Dear J., According to a somewhat recent version of the MySQL manual, enums are an efficient way to store the data you described, since each item takes exactly one of a relatively few discrete values. Also, the length of the enummed values you chose (e.g. 'good' / 'very poor' / etc.) doesn't really affect the storage or accessing issues. (So you can choose long, verbose, human-readable names just as efficiently as short terse names.) I couldn't really follow your description, but it sounds if you have a lot of enum fields in a table, each with the same set of possible values, you might also want to consider having two separate tables -- one main table, and a table of, say, high-medium-low responses. The 2nd table, would of course be keyed back to a unique ID in the first table, as well as have its own field name key (i.e. which high-medium-low question). I don't think it will matter as much for performance whichever way you go. The first way is simpler, but a little harder to add fields, since you may have to hard-code all the column names into your input HTML form, your PHP script, your MySQL table, and maybe also your reporting HTML interfaces. With the second (two-table) approach, you can keep the list of fields flexible -- i.e. you won't have to change your database structure whenever you add/remove fields. To be even more flexible, you could forget about the enum fields (and efficiency thereof) and just store all the responses as TEXT columns. This would really allow you to easily add/remove fields from your input and reporting interfaces. If you have plenty of disk space and CPU power at all times, you might rather trade efficiency for flexibility. I recently built a "LAMP" form handler for a guy who had an HTML questionnaire of some sort. My handler simply cycles through all $_POST fields, and inserts each field as its own row in the database. So I made two tables as described above: each questionnaire POST inserts one (1) row into the first table, gets the last_insert_id from that operation, and then stores a row in the other table for *each* of the $_POST fields/values. The second table inserts also get keyed with that last_insert_id, in order to tie each questionnaire's data together. The tables look like this: mysql> desc q1_id; +--------+--------------------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------+--------------------------------+------+-----+---------+----------------+ | id | int(11) | | PRI | NULL | auto_increment | | status | enum('NEW','DOWNLOAD','PURGE') | | | NEW | | | ts | timestamp(14) | YES | | NULL | | +--------+--------------------------------+------+-----+---------+----------------+ 3 rows in set (0.00 sec) mysql> desc q1; +-------+--------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+--------------------+------+-----+---------+-------+ | id | int(11) | | MUL | 0 | | | name | varchar(16) binary | | MUL | | | | value | text | YES | | NULL | | +-------+--------------------+------+-----+---------+-------+ 3 rows in set (0.00 sec) Then, the reporting interface works roughly like this: 1/ SELECT DISTINCT all field names from the second table -- in order to get a complete list of fields. 2/ SELECT second table LEFT JOIN first table ORDER BY the common ID -- this groups all of the data for each submission together. 3/ Loop through the results, watching for the common ID to change. When it does, print out all the fields, in the order gotten in step 1/. The result is a spreadsheet which changes dynamically whenever new fields are added to the questionnaire. I will never have to update the PHP application or the MySQL structure. The guy can change his own HTML fields, and they will automatically appear in his spreadsheet report. I hope you find this half as interesting as I do! Have fun re-writing! Best, George Webb gw.nyphp at gwprogramming.com From gmalcolm at professionalcredit.com Mon May 19 19:42:59 2003 From: gmalcolm at professionalcredit.com (Malcolm, Gary) Date: Mon, 19 May 2003 16:42:59 -0700 Subject: [nycphp-talk] are enums verboten? Message-ID: <715DAA079998D3118B8B00508B2C071D453D43@pcsnet> my 2 cents: I started out loving enum fields, especially for storing the results of select inputs from web forms. The romance was short lived. As I needed more and more mined information from my db's, as well as having to create more categories for the above mentioned selects the UNnormalized effect in my database took their toll on my short sighted design ideas. Basically, my way of thinking now is that if something in a table column changes with greater frequency than the rest of the information in the row then it probably should be pulled into another table. Hey, joins are quite speedy if slightly complex at first :) A nice side affect of this practice is the ability to keep a record of changes rather than just a write over of old information (kinda roll your own tranactioning). Gary -------------- next part -------------- An HTML attachment was scrubbed... URL: From danielc at analysisandsolutions.com Mon May 19 22:08:09 2003 From: danielc at analysisandsolutions.com (Analysis & Solutions) Date: Mon, 19 May 2003 22:08:09 -0400 Subject: [nycphp-talk] are enums verboten? In-Reply-To: <200305191933.h4JJWvQx023510@parsec.nyphp.org> References: <200305191933.h4JJWvQx023510@parsec.nyphp.org> Message-ID: <20030520020809.GA1050@panix.com> Hi Joshua: I'd second Hans' motion to normalize the data. First, because it allows adding, editing, deleting categories throughout the database by adjusting the values in one field, rather than having to issue several ALTER TABLE queries. Second, it allows long term portability of your schema to other database management systems. Considering your setup, I'd use a char(1) field so you can quickly make sense out of the abbreviated value when viewing the output from the main table. --Dan -- FREE scripts that make web and database programming easier http://www.analysisandsolutions.com/software/ T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7th Ave #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 From smanes at magpie.com Mon May 19 23:00:11 2003 From: smanes at magpie.com (Steve Manes) Date: Mon, 19 May 2003 23:00:11 -0400 Subject: [nycphp-talk] are enums verboten? In-Reply-To: <200305191933.h4JJWvW7023510@parsec.nyphp.org> References: <200305191933.h4JJWvW7023510@parsec.nyphp.org> Message-ID: <3EC99A3B.9090105@magpie.com> Joshua S. Freeman wrote: > For fields such as 'priority' or 'condition' I'm thinking of using type > 'enum': Tagging on a late reply, enums are cool but they become unwieldy with large sets. They're mainly useful for protecting against range violations, which you can do just as easily in your application. But mainly they're a poor substitute for foreign key constraints, or at least I think so. I haven't played with InnoDB's FK constraints yet but the general idea is to create your restricted dataset in a reference table, indexed on a unique ID. Then you reference that table from your main table whenever you add a new row with a species_id you want to have first defined: CREATE TABLE ref_species ( species_id INT NOT NULL, description VARCHAR2(100), PRIMARY KEY (id)); CREATE TABLE species ( id INT NOT NULL, species_id NOT NULL, ... more columns ... FOREIGN KEY (species_id) REFERENCES ref_species(species_id) ON DELETE SET NULL) TYPE=INNODB; (or something like that). What this does is prevent you from entering a species_id into 'species' that wasn't predefined in 'ref_species'. This should be a last line of defense though because it will throw a db error if you try to do otherwise. Your application should sanity-check that value before you ship it off to the database. From smanes at magpie.com Mon May 19 23:02:13 2003 From: smanes at magpie.com (Steve Manes) Date: Mon, 19 May 2003 23:02:13 -0400 Subject: [nycphp-talk] are enums verboten? In-Reply-To: <200305200300.h4K30FW7040225@parsec.nyphp.org> References: <200305200300.h4K30FW7040225@parsec.nyphp.org> Message-ID: <3EC99AB5.8000206@magpie.com> Steve Manes wrote: > I haven't played with InnoDB's FK constraints yet but the general idea > is to create your restricted dataset in a reference table, indexed on a > unique ID. Then you reference that table from your main table whenever > you add a new row with a species_id you want to have first defined: > > CREATE TABLE ref_species ( > species_id INT NOT NULL, > description VARCHAR2(100), > PRIMARY KEY (id)); er... PRIMARY KEY (species_id). From xml at aumcomputers.com Tue May 20 06:09:39 2003 From: xml at aumcomputers.com (Anirudh Zala) Date: Tue, 20 May 2003 15:39:39 +0530 Subject: [nycphp-talk] XML files Message-ID: <017701c31eb7$eeb147f0$0100007f@com1> Larry Let's have look about your problems 1 by 1 1: Problem of storing and accessing large volume of files in 1 container directory. A: In such cases splitted directory structure solution is best like what "Rick Seeger" has suggested. Hence you can design a special directory structure that can generate new directory as and when total amout of files execeeds the limit say... 100 files per directory. Below sample function does that (it generate new directory as soon as "id" exceeds value 100) // CRATES A DIRECTORY ACCORDING TO GIVEN ID AND PARENT DIR PATH function createDir($id,$parent) { $nd_dirlimit = 100; $mod = ceil($id/$nd_dirlimit) - 1; $dirs = $mod * $nd_dirlimit + 1; $dire = $dirs + $nd_dirlimit - 1; $tempDir = $dirs."_".$dire; if(! file_exists("$parent/$tempDir")) mkdir("$parent/$tempDir",0777); return "$tempDir"; } By above method dirctory structure will be like ../1_100/, ../101_200/, ../201_300/ and in each directory file name with id say "1.xml" to "100.xml" (or with any name) will reside. Once above directory structure is implemented no script will crawl like now :D. 2: Importing Data into DB by parsing XML files A: Use php's file "XPath.class.php" this is very nice OO file to parse XML documents at greater speed. It has lot of easy to use method and properties like $xml->evaluate, $xml->setAttributes, $xml->appendChild, $xml->removeAttribute, $xml->exportToFile etc...by which you can parse lot of XML documents like playing Zigsaw puzzles. It is very handy, class based php file. Check example at http://www.soi.city.ac.uk/~sa386/php/XPath_V2/testBench/useCases/ Some times it is useful to use Utilities of Perl and executing your perl/cgi scripts from console level. This very fastest and reliable method IF such doucmens are to be generated, read or write in batch mode. Perl's XML::DOM package helps here. Other advantage of such mechanism is that you can run such scripts seperately from other servers that has connection with your DB server, hence reduction of overhaed on your main server that has php scripts running. Another method is XSQL that is powerful but still new to us and PHP, where your DB SQL is written directly into XML file that syncronises (update your XML document from DB by executing XSQL) your XML and DB from 2 ways. (Can't tell much here :( ) 3: Is there another way to index and query large volumes of documents? A: I am not getting here exactly your problem, But if you need faster document access from directory or file system (serching 1 file from million files) then answer of 1 st question can help here where you just need to search particular document from 100 files from documnet diretory, already given from DB. And if question is related to Data then use of indexes (Indexing commonly used fields in Db like primary keys and foreigh keys) in mysql can make "Access of record" faster. Thanks, Anirudh Zala (azala at lechuon.com) ------------------------------------------------------------------------------------------------------ Anirudh Zala (Project Manager), Tel: +91 281 2451894 AUM Computers, Gsm: +91 98981 37727 317, Star Plaza, anirudh at aumcomputers.com Rajkot-360001, Gujarat, INDIA, http://www.aumcomputers.com ------------------------------------------------------------------------------------------------------ ----- Original Message ----- From: "Larry Chuon" To: "NYPHP Talk" Sent: Wednesday, 07 May, 2003 4:01 AM Subject: RE: [nycphp-talk] XML files > Thank you all for your quick responses. I'll consider generating XML on the > fly (still new at this). Here's another question. Besides importing the > files to dB, is there another way to index and query large volumes of > documents. I'm going out of tangent a bit here. Let say, I'm archiving > tons of document for a public library. They want to scan and digitize > millions of articles. What is the best way to index and search for articles > say by keywords or captions? > > > > -----Original Message----- > From: Malcolm, Gary [mailto:gmalcolm at professionalcredit.com] > Sent: Tuesday, May 06, 2003 5:53 PM > To: NYPHP Talk > Subject: RE: [nycphp-talk] XML files > > http://www.phpwebhosting.com/ > http://phphosts.codewalkers.com > http://www.oinko.net/freephp > www.free-php-hosting.com > > cheap hosting... cheap db access... i love (hearts in eyes) mysql > > > > -----Original Message----- > > From: soazine at pop.erols.com [mailto:soazine at pop.mail.rcn.net] > > Sent: Tuesday, 06 May, 2003 2:41 PM > > To: NYPHP Talk > > Subject: Re: [nycphp-talk] XML files > > > > > > Importing the XML files into a database is an ideal solution, > > unfortunately, not always an available one, such as in my > > case. I have > > space on a remote server where database access is very > > expensive (it's my > > own site and out of my price range to afford db access), so I have to > > resort to XML as well. PHP parses XML extremely fast and > > efficiently; I > > highly recommend it. > > > > I'd use PHP's available XML parsers along with grouping them into > > directories sorted by a date or some other delimiter to allow > > for smaller > > amount of files per directory. > > > > Phil > > > > Original Message: > > ----------------- > > From: Analysis & Solutions danielc at analysisandsolutions.com > > Date: Tue, 6 May 2003 17:35:16 -0400 > > To: talk at nyphp.org > > Subject: Re: [nycphp-talk] XML files > > > > > > On Tue, May 06, 2003 at 04:49:21PM -0400, Larry Chuon wrote: > > > I'm doing everything that you mention below. > > > > So, import the files into a database and get rid of the XML files. > > > > Here's a quick tutorial on how to parse XML in PHP: > > http:www.analysisandsolutions.com/code/phpxml.htm > > > > Enjoy, > > > > --Dan > > > > -- > > FREE scripts that make web and database programming easier > > http://www.analysisandsolutions.com/software/ > > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > > 4015 7th Ave #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 > > > > > > > > > > > > > > -------------------------------------------------------------------- > > mail2web - Check your email from the web at > > http://mail2web.com/ . > > > > > > > > > > > > > > > > > > > > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonbaer at jonbaer.net Tue May 20 15:28:06 2003 From: jonbaer at jonbaer.net (Jon Baer) Date: Tue, 20 May 2003 12:28:06 -0700 Subject: PHP CLI / Cygwin Message-ID: <000501c31f05$f09e0050$6400a8c0@Townsend> kinda retarded question, but how do you get php to interpret directly on the command line within the script itself? #!/cygdrive/c/php/cli/php -q seems to have no effect ... - jon From markert at optonline.net Tue May 20 13:23:04 2003 From: markert at optonline.net (John W. Markert) Date: Tue, 20 May 2003 13:23:04 -0400 Subject: debugger Message-ID: <001b01c31ef4$79a42580$0300a8c0@dads> Hi All... Does anyone know of any PHP debugging tools other than PHP info? thanks. John ___________________________________________ John W. Markert 14 Joanna Way Kinnelon, NJ 07405 Phone: (973)838-8956 Cell: (201)788-1740 Fax: (973)838-4561 email: markert at optonline.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From ophir at prusak.com Tue May 20 13:37:30 2003 From: ophir at prusak.com (Ophir Prusak) Date: Tue, 20 May 2003 13:37:30 -0400 Subject: [nycphp-talk] debugger References: <200305201724.h4KHN0YP065025@parsec.nyphp.org> Message-ID: <019501c31ef6$7cf7ab60$bf65a8c0@tag1002> zend studio has a very nice debugging tool ----- Original Message ----- From: "John W. Markert" To: "NYPHP Talk" Sent: Tuesday, May 20, 2003 1:23 PM Subject: [nycphp-talk] debugger > Hi All... > > Does anyone know of any PHP debugging tools other than PHP info? thanks. > > John > ___________________________________________ > > John W. Markert > 14 Joanna Way > Kinnelon, NJ 07405 > Phone: (973)838-8956 > Cell: (201)788-1740 > Fax: (973)838-4561 > email: markert at optonline.net > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > > From jlacey at ix.netcom.com Tue May 20 13:40:31 2003 From: jlacey at ix.netcom.com (John Lacey) Date: Tue, 20 May 2003 11:40:31 -0600 Subject: [nycphp-talk] debugger References: <200305201723.h4KHN0VR065025@parsec.nyphp.org> Message-ID: <000801c31ef6$ea0881c0$0200000a@Pentium700> ----- Original Message ----- From: "John W. Markert" To: "NYPHP Talk" Sent: Tuesday, May 20, 2003 11:23 AM Subject: [nycphp-talk] debugger Hi All... Does anyone know of any PHP debugging tools other than PHP info? thanks. well, depends on what you'd like to do and what box things are running on... given that phpinfo( ) can help in certain circumstances, you can place echo or print statements strategically in your code as well as make use of var_dump( ) and print_r( ). print_r is particularly handy... if on the other hand you're looking for a development/debugging environment, Zend provides that in their Zend Studio product (for $) and thereare also debuggers that run on a particular platform like gdb -- although gdb (the GNU debugger) may be more than you're looking for.. John ___________________________________________ John W. Markert 14 Joanna Way Kinnelon, NJ 07405 Phone: (973)838-8956 Cell: (201)788-1740 Fax: (973)838-4561 email: markert at optonline.net --- Unsubscribe at http://nyphp.org/list/ --- From dkrook at hotmail.com Tue May 20 13:40:52 2003 From: dkrook at hotmail.com (D C Krook) Date: Tue, 20 May 2003 13:40:52 -0400 Subject: Closing ?> tag Message-ID: Greetings, I noticed at Zeev's demo of the Zend Studio that he tended to leave off the end ?> tag when writing up sample code. In the phpComponents documentation (http://pcoms.net/submit.php), Hans advises leaving it off: "Layout: The first line of pCom source should only contain tag Message-ID: <715DAA079998D3118B8B00508B2C071D453D46@pcsnet> the whole idea makes me uncomfortable. like leaving dishes in the sink. what happens when including unclosed files with mixed html/php? > -----Original Message----- > From: D C Krook [mailto:dkrook at hotmail.com] > Sent: Tuesday, 20 May, 2003 10:41 AM > To: NYPHP Talk > Subject: [nycphp-talk] Closing ?> tag > > > Greetings, > > I noticed at Zeev's demo of the Zend Studio that he tended to > leave off the > end ?> tag when writing up sample code. > > > In the phpComponents documentation > (http://pcoms.net/submit.php), Hans > advises leaving it off: > > "Layout: The first line of pCom source should only contain > opening PHP tag. Closing PHP tags must not be used...The full > opening PHP > tag never be > used." > > > On the other hand, Sterling strongly advises that it not be left off > (http://lists.php.net/article.php?group=php.lang&article=403): > > "I definitely think that _you_ should do it." > > > Is there any rationale for leaving it off? Style? > Performance? Ensuring > that you're keeping logic separate from presentation templates? > > > Thanks for any thoughts, > -Dan > > > > > > > ========================================== > Daniel Christer Krook > http://krook.net/ || http://krook.info/ > http://civet.net/ || http://dev.krook.org/ > > _________________________________________________________________ > MSN 8 with e-mail virus protection service: 2 months FREE* > http://join.msn.com/?page=features/virus > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim_gales at msn.com Tue May 20 13:45:43 2003 From: tim_gales at msn.com (Tim Gales) Date: Tue, 20 May 2003 13:45:43 -0400 Subject: [nycphp-talk] debugger Message-ID: An HTML attachment was scrubbed... URL: From chris at psydeshow.org Tue May 20 14:09:02 2003 From: chris at psydeshow.org (Chris Snyder) Date: Tue, 20 May 2003 14:09:02 -0400 Subject: [nycphp-talk] Closing ?> tag In-Reply-To: <200305201742.h4KHetYT067045@parsec.nyphp.org> References: <200305201742.h4KHetYT067045@parsec.nyphp.org> Message-ID: <3ECA6F3E.5010504@psydeshow.org> D C Krook wrote: >Greetings, > >I noticed at Zeev's demo of the Zend Studio that he tended to leave off the >end ?> tag when writing up sample code. > > > I noticed that too -- and I was happy to see it since the editor I use (Quanta) seems to add blank lines at the end of my files sometimes, thus wreaking havoc with header() calls. Delete the ?> tags, problem solved. Heh. But seriously, it does seem a little sloppy. Is there any reason to leave them off, other than to ensure that no unparsed output creeps into your code? From zaunere at yahoo.com Tue May 20 15:30:39 2003 From: zaunere at yahoo.com (Hans Zaunere) Date: Tue, 20 May 2003 12:30:39 -0700 (PDT) Subject: [nycphp-talk] PHP CLI / Cygwin In-Reply-To: <200305201622.h4KGKgXL062704@parsec.nyphp.org> Message-ID: <20030520193039.81477.qmail@web12806.mail.yahoo.com> --- Jon Baer wrote: > kinda retarded question, but how do you get php to interpret directly on > the > command line within the script itself? > > #!/cygdrive/c/php/cli/php -q > > // code > ?> Not sure if I understand, but try getting rid of that empty line right after the first hash-bang line. Other than that, make sure the script itself is marked as +x and that it has UNIX line endings. H > > seems to have no effect ... > > - jon > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > From zaunere at yahoo.com Tue May 20 15:34:03 2003 From: zaunere at yahoo.com (Hans Zaunere) Date: Tue, 20 May 2003 12:34:03 -0700 (PDT) Subject: [nycphp-talk] debugger In-Reply-To: <200305201724.h4KHN0XL065025@parsec.nyphp.org> Message-ID: <20030520193403.53604.qmail@web12808.mail.yahoo.com> --- "John W. Markert" wrote: > Hi All... > > Does anyone know of any PHP debugging tools other than PHP info? thanks. Well, there's of course Zend's products, http://dd.cron.ru/dbg/, apd.communityconnect.com, and a slew of IDE products that integrate these (look at the Survey area of the dd.cron.ru link). Internal to PHP, var_dump() and print_r() are nice, plus debug_backtrace() and good ol' echo :) H > > John > ___________________________________________ > > John W. Markert > 14 Joanna Way > Kinnelon, NJ 07405 > Phone: (973)838-8956 > Cell: (201)788-1740 > Fax: (973)838-4561 > email: markert at optonline.net > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > From jonbaer at jonbaer.net Tue May 20 18:50:24 2003 From: jonbaer at jonbaer.net (Jon Baer) Date: Tue, 20 May 2003 15:50:24 -0700 Subject: [nycphp-talk] PHP CLI / Cygwin References: <200305201931.h4KJUjVb072469@parsec.nyphp.org> Message-ID: <002501c31f22$3360b1f0$6400a8c0@Townsend> That was it ... thanks Hans. - Jon ----- Original Message ----- From: "Hans Zaunere" To: "NYPHP Talk" Sent: Tuesday, May 20, 2003 12:30 PM Subject: Re: [nycphp-talk] PHP CLI / Cygwin > > --- Jon Baer wrote: > > kinda retarded question, but how do you get php to interpret directly on > > the > > command line within the script itself? > > > > #!/cygdrive/c/php/cli/php -q > > > > > // code > > ?> > > Not sure if I understand, but try getting rid of that empty line right after > the first hash-bang line. Other than that, make sure the script itself is > marked as +x and that it has UNIX line endings. > > H > > > > > seems to have no effect ... > > > > - jon > > > > > > > > > > > > > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > > From drodriguez1 at mac.com Tue May 20 15:42:57 2003 From: drodriguez1 at mac.com (David Rodriguez) Date: Tue, 20 May 2003 15:42:57 -0400 Subject: [nycphp-talk] Closing ?> tag Message-ID: <7722464.1053459777635.JavaMail.drodriguez1@mac.com> It almost reads like a joke. D. On Tuesday, May 20, 2003, at 01:40PM, D C Krook wrote: >Greetings, > >I noticed at Zeev's demo of the Zend Studio that he tended to leave off the >end ?> tag when writing up sample code. > > >In the phpComponents documentation (http://pcoms.net/submit.php), Hans >advises leaving it off: > >"Layout: The first line of pCom source should only contain opening PHP tag. Closing PHP tags must not be used...The full opening PHP >tag used." > > >On the other hand, Sterling strongly advises that it not be left off >(http://lists.php.net/article.php?group=php.lang&article=403): > >"I definitely think that _you_ should do it." > > >Is there any rationale for leaving it off? Style? Performance? Ensuring >that you're keeping logic separate from presentation templates? > > >Thanks for any thoughts, >-Dan > > > > > > >========================================== >Daniel Christer Krook >http://krook.net/ || http://krook.info/ >http://civet.net/ || http://dev.krook.org/ > >_________________________________________________________________ >MSN 8 with e-mail virus protection service: 2 months FREE* >http://join.msn.com/?page=features/virus > > > >--- Unsubscribe at http://nyphp.org/list/ --- > > > > David "e.Dave" Rodriguez http://www.digitalsilk.com/ From zaunere at yahoo.com Tue May 20 16:10:25 2003 From: zaunere at yahoo.com (Hans Zaunere) Date: Tue, 20 May 2003 13:10:25 -0700 (PDT) Subject: [nycphp-talk] Closing ?> tag In-Reply-To: <200305201741.h4KHetXL067045@parsec.nyphp.org> Message-ID: <20030520201025.64271.qmail@web12807.mail.yahoo.com> --- D C Krook wrote: > Greetings, > > I noticed at Zeev's demo of the Zend Studio that he tended to leave off the > > end ?> tag when writing up sample code. > > > In the phpComponents documentation (http://pcoms.net/submit.php), Hans > advises leaving it off: > > "Layout: The first line of pCom source should only contain opening PHP tag. Closing PHP tags must not be used...The full opening PHP > tag used." > > > On the other hand, Sterling strongly advises that it not be left off > (http://lists.php.net/article.php?group=php.lang&article=403): > > "I definitely think that _you_ should do it." Well, two against one :) In the posting above, the poster outlines the exact reason for not including an ending tag, IMO. In included files using an end tag will only bite you in the end, and there is no reason for it; PHP will drop out of PHP parsing mode at the end of the file anyway. And: http://bugs.php.net/bug.php?id=21891 which probably could have been received a little better :) > Is there any rationale for leaving it off? Style? Yeah, style and debugging. > Performance? Maybe a tiny tiny tiny tiny bit. > Ensuring that you're keeping logic separate from presentation templates? Yeah, style and debugging. :) H From gmalcolm at professionalcredit.com Tue May 20 16:24:50 2003 From: gmalcolm at professionalcredit.com (Malcolm, Gary) Date: Tue, 20 May 2003 13:24:50 -0700 Subject: [nycphp-talk] Closing ?> tag Message-ID: <715DAA079998D3118B8B00508B2C071D453D49@pcsnet> well, at least i 'get' the argument for includes... But I am still pretty uncomfortable assuming that I only want php in an include. Also, depending on a parsing engines behavior based on code formatting smacks of all those horrors one can only call "Python." I guess I am concerned here about a double standard... for example: I think we can probably agree that curly braces should be used on all conditionals and loops, if only for clarity(double standard?). So, when we decide that delimiters need only be used willy-nilly I begin to get that same sinking feeling as when I code JScript or HTML 3.x (mostly knowing that I'll be revisiting this code in some bizarre bug-hunt when the unexpected happens as it always does) -------------- next part -------------- An HTML attachment was scrubbed... URL: From southwell at dneba.com Tue May 20 16:30:55 2003 From: southwell at dneba.com (Michael Southwell) Date: Tue, 20 May 2003 16:30:55 -0400 Subject: [nycphp-talk] Closing ?> tag In-Reply-To: <200305202010.h4KKAWST076499@parsec.nyphp.org> Message-ID: <5.1.0.14.2.20030520162839.00b302d8@mail.optonline.net> aha, so this refers *only* to tags in included files where the only or last item is php code? At 04:10 PM 5/20/2003, you wrote: >Well, two against one :) In the posting above, the poster outlines the exact >reason for not including an ending tag, IMO. In included files using an end >tag will only bite you in the end, and there is no reason for it; PHP will >drop out of PHP parsing mode at the end of the file anyway. And: > >http://bugs.php.net/bug.php?id=21891 > >which probably could have been received a little better :) > > > > Is there any rationale for leaving it off? Style? >Yeah, style and debugging. > > > Performance? >Maybe a tiny tiny tiny tiny bit. > > > Ensuring that you're keeping logic separate from presentation templates? > >Yeah, style and debugging. :) > > >H > > > > >--- Unsubscribe at http://nyphp.org/list/ --- Michael G. Southwell ================================= DNEBA Enterprises 81 South Road Bloomingdale, NJ 07403-1419 973/492-7873 (voice and fax) southwell at dneba.com http://www.dneba.com ====================================================== From chris at psydeshow.org Tue May 20 16:46:24 2003 From: chris at psydeshow.org (Chris Snyder) Date: Tue, 20 May 2003 16:46:24 -0400 Subject: [nycphp-talk] Closing ?> tag In-Reply-To: <200305202011.h4KKAWYT076499@parsec.nyphp.org> References: <200305202011.h4KKAWYT076499@parsec.nyphp.org> Message-ID: <3ECA9420.7050000@psydeshow.org> Hans Zaunere wrote: >And: > >http://bugs.php.net/bug.php?id=21891 > >which probably could have been received a little better :) > > > Yeah, I just left my two cents there-- the documentation for include() specifically states that end tags are required. Lopping them off is a style decision that depends on some as-yet undocumented behavior. It seems like a "best practice" for includes that are purely PHP, but is it a bug or a feature? From bpang at bpang.com Tue May 20 16:50:46 2003 From: bpang at bpang.com (Brian Pang) Date: Tue, 20 May 2003 16:50:46 -0400 Subject: [nycphp-talk] Closing ?> tag Message-ID: You guys can do what you want, but I end every php file with return;?> with absolutely nothing after the closing tag... as for editors that add stuff at the ends of files... why would you ever want to let it do that? :) > Hans Zaunere wrote: > > >And: > > > >http://bugs.php.net/bug.php?id=21891 > > > >which probably could have been received a little better :) > > > > > > > Yeah, I just left my two cents there-- the documentation for include() > specifically states that end tags are required. Lopping them off is a > style decision that depends on some as-yet undocumented behavior. > > It seems like a "best practice" for includes that are purely PHP, but is > it a bug or a feature? > > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > > > From danielc at analysisandsolutions.com Tue May 20 23:56:37 2003 From: danielc at analysisandsolutions.com (Analysis & Solutions) Date: Tue, 20 May 2003 23:56:37 -0400 Subject: [nycphp-talk] Closing ?> tag In-Reply-To: <200305202010.h4KKAWQx076499@parsec.nyphp.org> References: <200305202010.h4KKAWQx076499@parsec.nyphp.org> Message-ID: <20030521035637.GA6713@panix.com> Folks: Hans said: > > In included files using an end > tag will only bite you in the end, and there is no reason for it; PHP will > drop out of PHP parsing mode at the end of the file anyway. I always use closing tags and use frequent header() calls, and have yet to be bitten. As others have mentioned, the docs say included files need to be complete files, so items with opening tags need closing tags. > http://bugs.php.net/bug.php?id=21891 I hate unclear and inconsistent docs, let alone behaviors! I hope that gets cleared up. --Dan -- FREE scripts that make web and database programming easier http://www.analysisandsolutions.com/software/ T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7th Ave #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 From thegeek at thecolorgeek.com Wed May 21 09:38:52 2003 From: thegeek at thecolorgeek.com (The Geek) Date: Wed, 21 May 2003 09:38:52 -0400 Subject: web hosting In-Reply-To: <200305121547.h4CFjmwP083048@parsec.nyphp.org> Message-ID: <8F7CAE7A-8B91-11D7-ACD7-003065489A1E@thecolorgeek.com> I know it has been discussed here before but doesn't seem like there is a way to access an archive for this list. Looking for web host that will support Perl, PHP and MySQL basically a LAMP setup. Price of course is always important. From jkelly at sussex.cc.nj.us Wed May 21 09:46:09 2003 From: jkelly at sussex.cc.nj.us (jessica kelly) Date: Wed, 21 May 2003 09:46:09 -0400 Subject: [nycphp-talk] web hosting Message-ID: Try out http://ipowerweb.com It's something like $8.00 a month if you pay a year in advance. Jessica >>> thegeek at thecolorgeek.com 5/21/03 9:38:58 AM >>> I know it has been discussed here before but doesn't seem like there is a way to access an archive for this list. Looking for web host that will support Perl, PHP and MySQL basically a LAMP setup. Price of course is always important. --- Unsubscribe at http://nyphp.org/list/ --- From jonbaer at jonbaer.net Wed May 21 09:48:58 2003 From: jonbaer at jonbaer.net (Jon Baer) Date: Wed, 21 May 2003 06:48:58 -0700 Subject: [nycphp-talk] web hosting References: <200305211339.h4LDcwVb003992@parsec.nyphp.org> Message-ID: <003f01c31f9f$bacd8c80$6400a8c0@Townsend> http://www.phpwebhosting.com $9.95 ----- Original Message ----- From: "The Geek" To: "NYPHP Talk" Sent: Wednesday, May 21, 2003 6:38 AM Subject: [nycphp-talk] web hosting > I know it has been discussed here before but doesn't seem like there is > a way to access an archive for this list. Looking for web host that > will support Perl, PHP and MySQL basically a LAMP setup. Price of > course is always important. > > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > > From nyphp at websapp.com Wed May 21 09:50:33 2003 From: nyphp at websapp.com (Daniel Kushner) Date: Wed, 21 May 2003 09:50:33 -0400 Subject: [nycphp-talk] web hosting In-Reply-To: <200305211340.h4LDcwbB003992@parsec.nyphp.org> Message-ID: Lead by some NYPHP members: http://thehostingcompany.us --DK > -----Original Message----- > From: The Geek [mailto:thegeek at thecolorgeek.com] > Sent: Wednesday, May 21, 2003 9:39 AM > To: NYPHP Talk > Subject: [nycphp-talk] web hosting > > > I know it has been discussed here before but doesn't seem like there is > a way to access an archive for this list. Looking for web host that > will support Perl, PHP and MySQL basically a LAMP setup. Price of > course is always important. > > > > > --- Unsubscribe at http://nyphp.org/list/ --- > From Pinyo.Bhulipongsanon at usa.xerox.com Wed May 21 09:50:12 2003 From: Pinyo.Bhulipongsanon at usa.xerox.com (Bhulipongsanon, Pinyo) Date: Wed, 21 May 2003 09:50:12 -0400 Subject: [nycphp-talk] web hosting Message-ID: Why are you advertising here? That's lame. -----Original Message----- From: jessica kelly [mailto:jkelly at sussex.cc.nj.us] Sent: Wednesday, May 21, 2003 9:46 AM To: NYPHP Talk Subject: Re: [nycphp-talk] web hosting Try out http://ipowerweb.com It's something like $8.00 a month if you pay a year in advance. Jessica >>> thegeek at thecolorgeek.com 5/21/03 9:38:58 AM >>> I know it has been discussed here before but doesn't seem like there is a way to access an archive for this list. Looking for web host that will support Perl, PHP and MySQL basically a LAMP setup. Price of course is always important. --- Unsubscribe at http://nyphp.org/list/ --- From agfische at email.smith.edu Wed May 21 10:02:41 2003 From: agfische at email.smith.edu (Aaron Fischer) Date: Wed, 21 May 2003 10:02:41 -0400 Subject: [nycphp-talk] web hosting In-Reply-To: <200305211359.h4LDxjT9007357@parsec.nyphp.org> Message-ID: Pinyo read the original post which was a request for hosting recommendations with price clarifications helpful as well. Aaron On Wednesday, May 21, 2003, at 09:59 US/Eastern, Bhulipongsanon, Pinyo wrote: > Why are you advertising here? That's lame. > > -----Original Message----- > From: jessica kelly [mailto:jkelly at sussex.cc.nj.us] > Sent: Wednesday, May 21, 2003 9:46 AM > To: NYPHP Talk > Subject: Re: [nycphp-talk] web hosting > > > Try out http://ipowerweb.com > It's something like $8.00 a month if you pay a year in advance. > > Jessica > >>>> thegeek at thecolorgeek.com 5/21/03 9:38:58 AM >>> > I know it has been discussed here before but doesn't seem like there is > a way to access an archive for this list. Looking for web host that > will support Perl, PHP and MySQL basically a LAMP setup. Price of > course is always important. > > > > > > > > > > > > > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > From Pinyo.Bhulipongsanon at usa.xerox.com Wed May 21 10:00:01 2003 From: Pinyo.Bhulipongsanon at usa.xerox.com (Bhulipongsanon, Pinyo) Date: Wed, 21 May 2003 10:00:01 -0400 Subject: [nycphp-talk] web hosting Message-ID: oops, sorry, just noticed the question. :-( -----Original Message----- From: jessica kelly [mailto:jkelly at sussex.cc.nj.us] Sent: Wednesday, May 21, 2003 9:46 AM To: NYPHP Talk Subject: Re: [nycphp-talk] web hosting Try out http://ipowerweb.com It's something like $8.00 a month if you pay a year in advance. Jessica >>> thegeek at thecolorgeek.com 5/21/03 9:38:58 AM >>> I know it has been discussed here before but doesn't seem like there is a way to access an archive for this list. Looking for web host that will support Perl, PHP and MySQL basically a LAMP setup. Price of course is always important. --- Unsubscribe at http://nyphp.org/list/ --- From zaunere at yahoo.com Wed May 21 10:24:20 2003 From: zaunere at yahoo.com (Hans Zaunere) Date: Wed, 21 May 2003 07:24:20 -0700 (PDT) Subject: [nycphp-talk] web hosting In-Reply-To: <200305211340.h4LDcwXL003992@parsec.nyphp.org> Message-ID: <20030521142420.96495.qmail@web12802.mail.yahoo.com> --- The Geek wrote: > I know it has been discussed here before but doesn't seem like there is > a way to access an archive for this list. Of course there are! (that said, finding anything in them is another story :) http://nyphp.org and click Mailing Lists, then look at the listings of available mailing lists and click Archive. H > Looking for web host that > will support Perl, PHP and MySQL basically a LAMP setup. Price of > course is always important. > > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > From sickledown at hotmail.com Wed May 21 10:51:11 2003 From: sickledown at hotmail.com (scap) Date: Wed, 21 May 2003 07:51:11 -0700 Subject: [nycphp-talk] web hosting References: <200305211339.h4LDcwUr003992@parsec.nyphp.org> Message-ID: http://nomonthlyfees.com/ has been reliable, very affordable and their support staff deserves many kudos $200 sign-up with domain name / $70 a year (about $6.00 a month) ----- Original Message ----- From: "The Geek" To: "NYPHP Talk" Sent: Wednesday, May 21, 2003 6:38 AM Subject: [nycphp-talk] web hosting I know it has been discussed here before but doesn't seem like there is a way to access an archive for this list. Looking for web host that will support Perl, PHP and MySQL basically a LAMP setup. Price of course is always important. --- Unsubscribe at http://nyphp.org/list/ --- From Ed at ComSimplicity.com Wed May 21 11:03:40 2003 From: Ed at ComSimplicity.com (Ed McCarroll) Date: Wed, 21 May 2003 08:03:40 -0700 Subject: [nycphp-talk] web hosting In-Reply-To: <200305211339.h4LDcwS7003992@parsec.nyphp.org> Message-ID: Resources for finding a host: http://www.findmyhosting.com/ http://webhostingtalk.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Ed McCarroll MailTo:Ed at ComSimplicity.com ComSimplicity (310) 838-4330 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From melissa at inexact.info Wed May 21 11:06:02 2003 From: melissa at inexact.info (Melissa Pott) Date: Wed, 21 May 2003 11:06:02 -0400 Subject: [nycphp-talk] web hosting In-Reply-To: <200305211339.h4LDcwVD003992@parsec.nyphp.org> References: <200305211339.h4LDcwVD003992@parsec.nyphp.org> Message-ID: <1053529746.C921BA1@w5.dngr.org> I have been using Dreamhost for a few months. They have several plans available starting around 10 bucks. On Wed, 21 May 2003 9:59AM -0500, The Geek wrote: > I know it has been discussed here before but doesn't seem like there is > a way to access an archive for this list. Looking for web host that > will support Perl, PHP and MySQL basically a LAMP setup. Price of > course is always important. > > > > > --- Unsubscribe at http://nyphp.org/list/ --- --melissa From louie at zibi.co.il Wed May 21 14:03:48 2003 From: louie at zibi.co.il (louie) Date: Wed, 21 May 2003 14:03:48 -0400 Subject: [nycphp-talk] web hosting References: <200305211340.h4LDcwch003992@parsec.nyphp.org> Message-ID: <002101c31fc3$5465fe40$7552fea9@w3j5c4> howdy ! try looking into http://prohosters.com $59 a year for unix box no setup fee best regards ----- Original Message ----- From: "The Geek" To: "NYPHP Talk" Sent: Wednesday, May 21, 2003 9:38 AM Subject: [nycphp-talk] web hosting > I know it has been discussed here before but doesn't seem like there is > a way to access an archive for this list. Looking for web host that > will support Perl, PHP and MySQL basically a LAMP setup. Price of > course is always important. > > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > > > From jfreeman at amnh.org Wed May 21 14:37:35 2003 From: jfreeman at amnh.org (Joshua S. Freeman) Date: Wed, 21 May 2003 14:37:35 -0400 Subject: I'm stupid... Message-ID: I've made a conceptual breakthrough (duh!) with regards to this project I'm working on to really get to a meaningful skill level with MySQL/PHP development. But.. for some reason, I'm really stuck on this one point: I have a database called 'wasps'. The database has 19 tables so far most of which are 'lookup' tables (is that the right term?)... The main table in the database is called 'specimens'. Each 'specimen' has a taxonomy (order, family, genus, subgenus, species, subspecies). For each part of the taxonomy I have a separate table. Ideally, when someone loads the survey form to begin building a new record in the 'specimens' table, I want to query those taxonomy tables (order, family, genus, etc...) so that I can build menus based on the rows inside each taxonomic table... I want to do this using 'foreach'... I've tried a few different things but I can't get it to work: mysql_connect($host, $user, $password) or die("Could not connect to database"); mysql_select_db($database) or die ("Could not select $database database"); print "The current database is $database"; $query= mysql_query("select * FROM order"); $result = $query; print (""); } ?> but this does not work.. i know I'm close.. and I just spent 2 hours at barnes & nobles at a table in the cafe with a bunch of PHP books (couldn't find that WROX book someone suggested earlier) trying to make this work on just the order table because that table only has one record in it... but I could not make it work.. if I can figure out how to make this, I'll be able to make considerable progress on this thing.. Someone please help me over this hump! Thanks! J. From gmalcolm at professionalcredit.com Wed May 21 14:47:34 2003 From: gmalcolm at professionalcredit.com (Malcolm, Gary) Date: Wed, 21 May 2003 11:47:34 -0700 Subject: [nycphp-talk] I'm stupid... Message-ID: <715DAA079998D3118B8B00508B2C071D453D50@pcsnet> your $query just returns a pointer to the mysql result set... it is not an array now use mysql_fetch_assoc($query); to get each row in tuern as an assoc array... > -----Original Message----- > From: Joshua S. Freeman [mailto:jfreeman at amnh.org] > Sent: Wednesday, 21 May, 2003 11:38 AM > To: NYPHP Talk > Subject: [nycphp-talk] I'm stupid... > > > I've made a conceptual breakthrough (duh!) with regards to > this project I'm > working on to really get to a meaningful skill level with MySQL/PHP > development. But.. for some reason, I'm really stuck on this > one point: > > I have a database called 'wasps'. The database has 19 tables > so far most of > which are 'lookup' tables (is that the right term?)... > > The main table in the database is called 'specimens'. Each > 'specimen' has a > taxonomy (order, family, genus, subgenus, species, subspecies). > > For each part of the taxonomy I have a separate table. > > Ideally, when someone loads the survey form to begin building > a new record > in the 'specimens' table, I want to query those taxonomy > tables (order, > family, genus, etc...) so that I can build > menus based on the rows inside each > taxonomic table... > > I want to do this using 'foreach'... > > I've tried a few different things but I can't get it to work: > > mysql_connect($host, $user, $password) > or die("Could not connect to database"); > mysql_select_db($database) > or die ("Could not select $database database"); > > print "The current database is $database"; > > $query= mysql_query("select * FROM order"); > > $result = $query; > print (""); > } > > ?> > > but this does not work.. i know I'm close.. and I just spent > 2 hours at > barnes & nobles at a table in the cafe with a bunch of PHP > books (couldn't > find that WROX book someone suggested earlier) trying to > make this work on > just the order table because that table only has one record > in it... but I > could not make it work.. if I can figure out how to make > this, I'll be able > to make considerable progress on this thing.. > > Someone please help me over this hump! > > Thanks! > > J. > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From soazine at pop.mail.rcn.net Wed May 21 14:54:35 2003 From: soazine at pop.mail.rcn.net (soazine@pop.erols.com) Date: Wed, 21 May 2003 14:54:35 -0400 Subject: [nycphp-talk] I'm stupid... Message-ID: <293580-220035321185435526@M2W053.mail2web.com> I'm sorry but only I am allowed to self-abase myself, you will have to stop at once. Meanwhile, your $query is a mySQL reference pointer, not an array. To obtain an array out of the resultset pointer there are several ways in PHP to do it, one way that pops up in my head (probably not the best way but..) is mysql_fetch_rows: for ($i = 0; $row = mysql_fetch_row($query); $i++) { echo ""; } Phil Original Message: ----------------- From: Joshua S. Freeman jfreeman at amnh.org Date: Wed, 21 May 2003 14:37:39 -0400 To: talk at nyphp.org Subject: [nycphp-talk] I'm stupid... I've made a conceptual breakthrough (duh!) with regards to this project I'm working on to really get to a meaningful skill level with MySQL/PHP development. But.. for some reason, I'm really stuck on this one point: I have a database called 'wasps'. The database has 19 tables so far most of which are 'lookup' tables (is that the right term?)... The main table in the database is called 'specimens'. Each 'specimen' has a taxonomy (order, family, genus, subgenus, species, subspecies). For each part of the taxonomy I have a separate table. Ideally, when someone loads the survey form to begin building a new record in the 'specimens' table, I want to query those taxonomy tables (order, family, genus, etc...) so that I can build menus based on the rows inside each taxonomic table... I want to do this using 'foreach'... I've tried a few different things but I can't get it to work: mysql_connect($host, $user, $password) or die("Could not connect to database"); mysql_select_db($database) or die ("Could not select $database database"); print "The current database is $database"; $query= mysql_query("select * FROM order"); $result = $query; print (""); } ?> but this does not work.. i know I'm close.. and I just spent 2 hours at barnes & nobles at a table in the cafe with a bunch of PHP books (couldn't find that WROX book someone suggested earlier) trying to make this work on just the order table because that table only has one record in it... but I could not make it work.. if I can figure out how to make this, I'll be able to make considerable progress on this thing.. Someone please help me over this hump! Thanks! J. --- Unsubscribe at http://nyphp.org/list/ --- -------------------------------------------------------------------- mail2web - Check your email from the web at http://mail2web.com/ . From dkrook at hotmail.com Wed May 21 14:54:51 2003 From: dkrook at hotmail.com (D C Krook) Date: Wed, 21 May 2003 14:54:51 -0400 Subject: [nycphp-talk] I'm stupid... Message-ID: The option looks suspicious: You're missing a quote that I assume you're escaping, and you're assigning a non-unique value to the entire set of options print ""; try: foreach ($result as $key=>$val) { print ""; } >$result = $query; > print (""); > } > _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From jfreeman at amnh.org Wed May 21 14:55:43 2003 From: jfreeman at amnh.org (Joshua S. Freeman) Date: Wed, 21 May 2003 14:55:43 -0400 Subject: [nycphp-talk] I'm stupid... In-Reply-To: <200305211848.h4LImXQv022776@parsec.nyphp.org> Message-ID: Like this? mysql_connect($host, $user, $password) or die("Could not connect to database"); mysql_select_db($database) or die ("Could not select $database database"); print "The current database is $database"; $query= mysql_query("select * FROM order"); 22 $result = mysql_fetch_assoc($query); 23 print (""); ?> when I try to run this in the browser I get this: Warning: Supplied argument is not a valid MySQL result resource in /Users/jfreeman/Sites/wasps/test.php3 on line 22 so... i guess i'm still close.. but no cigar.. J. On 5/21/03 2:48 PM, "Malcolm, Gary" wrote: > your $query just returns a pointer to the mysql result set... it is not an > array > > now use mysql_fetch_assoc($query); to get each row in tuern as an assoc > array... From nyphp at websapp.com Wed May 21 14:57:18 2003 From: nyphp at websapp.com (Daniel Kushner) Date: Wed, 21 May 2003 14:57:18 -0400 Subject: [nycphp-talk] I'm stupid... In-Reply-To: <200305211856.h4LItkbB025105@parsec.nyphp.org> Message-ID: This is an informative thread, but can the subject please be changed? :) --DK > -----Original Message----- > From: Joshua S. Freeman [mailto:jfreeman at amnh.org] > Sent: Wednesday, May 21, 2003 2:56 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] I'm stupid... > > > Like this? > > > mysql_connect($host, $user, $password) > or die("Could not connect to database"); > mysql_select_db($database) > or die ("Could not select $database database"); > > print "The current database is $database"; > > $query= mysql_query("select * FROM order"); > > 22 $result = mysql_fetch_assoc($query); > 23 print (""); > > > ?> > > > when I try to run this in the browser I get this: > > > Warning: Supplied argument is not a valid MySQL result resource in > /Users/jfreeman/Sites/wasps/test.php3 on line 22 > > so... i guess i'm still close.. but no cigar.. > > J. > > > On 5/21/03 2:48 PM, "Malcolm, Gary" > wrote: > > > your $query just returns a pointer to the mysql result set... > it is not an > > array > > > > now use mysql_fetch_assoc($query); to get each row in tuern as an assoc > > array... > > > > --- Unsubscribe at http://nyphp.org/list/ --- > From zaunere at yahoo.com Wed May 21 14:58:45 2003 From: zaunere at yahoo.com (Hans Zaunere) Date: Wed, 21 May 2003 11:58:45 -0700 (PDT) Subject: [nycphp-talk] I'm stupid... In-Reply-To: <200305211838.h4LIbdXL021838@parsec.nyphp.org> Message-ID: <20030521185845.22133.qmail@web12804.mail.yahoo.com> --- "Joshua S. Freeman" wrote: > I've made a conceptual breakthrough (duh!) with regards to this project I'm > working on to really get to a meaningful skill level with MySQL/PHP > development. But.. for some reason, I'm really stuck on this one point: > > I have a database called 'wasps'. The database has 19 tables so far most > of > which are 'lookup' tables (is that the right term?)... > > The main table in the database is called 'specimens'. Each 'specimen' has > a > taxonomy (order, family, genus, subgenus, species, subspecies). > > For each part of the taxonomy I have a separate table. > > Ideally, when someone loads the survey form to begin building a new record > in the 'specimens' table, I want to query those taxonomy tables (order, > family, genus, etc...) so that I can build > menus based on the rows inside each > taxonomic table... > > I want to do this using 'foreach'... > > I've tried a few different things but I can't get it to work: > > mysql_connect($host, $user, $password) > or die("Could not connect to database"); > mysql_select_db($database) > or die ("Could not select $database database"); > > print "The current database is $database"; > > $query= mysql_query("select * FROM order"); I think you want to return to $result here, since it's used below. > > $result = $query; > print (""); > } > > ?> > > but this does not work.. i know I'm close.. and I just spent 2 hours at > barnes & nobles at a table in the cafe with a bunch of PHP books (couldn't > find that WROX book someone suggested earlier) trying to make this work on > just the order table because that table only has one record in it... but I > could not make it work.. if I can figure out how to make this, I'll be able > to make considerable progress on this thing.. > > Someone please help me over this hump! > > Thanks! > > J. > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > From bfeqx44002 at sneakemail.com Wed May 21 15:03:16 2003 From: bfeqx44002 at sneakemail.com (gadhra) Date: Wed, 21 May 2003 15:03:16 -0400 Subject: [nycphp-talk] Problems With Mysql Query (was: I'm stupid...) In-Reply-To: <200305211859.h4LIwmZ1026055@parsec.nyphp.org> References: <200305211859.h4LIwmZ1026055@parsec.nyphp.org> Message-ID: <23516-63374@sneakemail.com> Josh, Can you write your query like this: mysql_query("select * from order") or die ("query failed:
error_no: ".mysql_errno()."
error: ".mysql_error()."
query:$sql

$error_msg"); and tell us what happens? Hans Zaunere zaunere-at-yahoo.com |NY PHP| wrote: >--- "Joshua S. Freeman" wrote: > > >>I've made a conceptual breakthrough (duh!) with regards to this project I'm >>working on to really get to a meaningful skill level with MySQL/PHP >>development. But.. for some reason, I'm really stuck on this one point: >> >>I have a database called 'wasps'. The database has 19 tables so far most >>of >>which are 'lookup' tables (is that the right term?)... >> >>The main table in the database is called 'specimens'. Each 'specimen' has >>a >>taxonomy (order, family, genus, subgenus, species, subspecies). >> >>For each part of the taxonomy I have a separate table. >> >>Ideally, when someone loads the survey form to begin building a new record >>in the 'specimens' table, I want to query those taxonomy tables (order, >>family, genus, etc...) so that I can build >> menus based on the rows inside each >>taxonomic table... >> >>I want to do this using 'foreach'... >> >>I've tried a few different things but I can't get it to work: >> >>mysql_connect($host, $user, $password) >> or die("Could not connect to database"); >>mysql_select_db($database) >> or die ("Could not select $database database"); >> >>print "The current database is $database"; >> >>$query= mysql_query("select * FROM order"); >> >> > >I think you want to return to $result here, since it's used below. > > >>$result = $query; >> print (""); >> } >> >>?> >> >>but this does not work.. i know I'm close.. and I just spent 2 hours at >>barnes & nobles at a table in the cafe with a bunch of PHP books (couldn't >>find that WROX book someone suggested earlier) trying to make this work on >>just the order table because that table only has one record in it... but I >>could not make it work.. if I can figure out how to make this, I'll be able >>to make considerable progress on this thing.. >> >>Someone please help me over this hump! >> >>Thanks! >> >>J. >> >> >> >> >> >> >> >> > > > >--- Unsubscribe at http://nyphp.org/list/ --- > > > > > > > -- +gadhra+(/s) ********************* XXXXXXXXXXXXXXXXX And seize the metropolis; It's you it's built on From jlacey at ix.netcom.com Wed May 21 15:03:41 2003 From: jlacey at ix.netcom.com (John Lacey) Date: Wed, 21 May 2003 13:03:41 -0600 Subject: [nycphp-talk] He's persistent!! References: <200305211859.h4LIwjVR026006@parsec.nyphp.org> Message-ID: <001d01c31fcb$b2d98d90$0200000a@Pentium700> Daniel, new around these parts... but I was thinkin the same thing :) john ----- Original Message ----- From: "Daniel Kushner" To: "NYPHP Talk" Sent: Wednesday, May 21, 2003 12:58 PM Subject: RE: [nycphp-talk] I'm stupid... This is an informative thread, but can the subject please be changed? :) --DK > -----Original Message----- > From: Joshua S. Freeman [mailto:jfreeman at amnh.org] > Sent: Wednesday, May 21, 2003 2:56 PM > To: NYPHP Talk > Subject: Re: [nycphp-talk] I'm stupid... > > > Like this? > > > mysql_connect($host, $user, $password) > or die("Could not connect to database"); > mysql_select_db($database) > or die ("Could not select $database database"); > > print "The current database is $database"; > > $query= mysql_query("select * FROM order"); > > 22 $result = mysql_fetch_assoc($query); > 23 print (""); > > > ?> > > > when I try to run this in the browser I get this: > > > Warning: Supplied argument is not a valid MySQL result resource in > /Users/jfreeman/Sites/wasps/test.php3 on line 22 > > so... i guess i'm still close.. but no cigar.. > > J. > > > On 5/21/03 2:48 PM, "Malcolm, Gary" > wrote: > > > your $query just returns a pointer to the mysql result set... > it is not an > > array > > > > now use mysql_fetch_assoc($query); to get each row in tuern as an assoc > > array... > > > > > --- Unsubscribe at http://nyphp.org/list/ --- From jfreeman at amnh.org Wed May 21 15:06:29 2003 From: jfreeman at amnh.org (Joshua S. Freeman) Date: Wed, 21 May 2003 15:06:29 -0400 Subject: learning about foreach() In-Reply-To: <200305211858.h4LIwmQv026055@parsec.nyphp.org> Message-ID: Hi Hans, et al. Thanks for the response and advice Hans... I don't know if this is salient to your response but ideally, what I want the combination of the query and the foreach to do is to go into the 'order' table, grab the single record that's in there (it has two columns, an 'order_id' column and an 'order_name' column) and then, in my form, build: so... the "1" in the 'value="1" is from the 'order_id' column and the 'Hymenoptera' is from the 'order_name' column. I'm not sure if this was clear before.. I know it wasn't clear from my code snippet. Thanks.. J. On 5/21/03 2:58 PM, "Hans Zaunere" wrote: > > --- "Joshua S. Freeman" wrote: >> I've made a conceptual breakthrough (duh!) with regards to this project I'm >> working on to really get to a meaningful skill level with MySQL/PHP >> development. But.. for some reason, I'm really stuck on this one point: >> >> I have a database called 'wasps'. The database has 19 tables so far most >> of >> which are 'lookup' tables (is that the right term?)... >> >> The main table in the database is called 'specimens'. Each 'specimen' has >> a >> taxonomy (order, family, genus, subgenus, species, subspecies). >> >> For each part of the taxonomy I have a separate table. >> >> Ideally, when someone loads the survey form to begin building a new record >> in the 'specimens' table, I want to query those taxonomy tables (order, >> family, genus, etc...) so that I can build >> menus based on the rows inside each >> taxonomic table... >> >> I want to do this using 'foreach'... >> >> I've tried a few different things but I can't get it to work: >> >> mysql_connect($host, $user, $password) >> or die("Could not connect to database"); >> mysql_select_db($database) >> or die ("Could not select $database database"); >> >> print "The current database is $database"; >> >> $query= mysql_query("select * FROM order"); > > I think you want to return to $result here, since it's used below. >> >> $result = $query; >> print (""); >> } >> >> ?> >> >> but this does not work.. i know I'm close.. and I just spent 2 hours at >> barnes & nobles at a table in the cafe with a bunch of PHP books (couldn't >> find that WROX book someone suggested earlier) trying to make this work on >> just the order table because that table only has one record in it... but I >> could not make it work.. if I can figure out how to make this, I'll be able >> to make considerable progress on this thing.. >> >> Someone please help me over this hump! >> >> Thanks! >> >> J. >> >> >> >> >> >> > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > > From max at idsociety.com Wed May 21 15:10:18 2003 From: max at idsociety.com (max goldberg) Date: Wed, 21 May 2003 15:10:18 -0400 Subject: [nycphp-talk] I'm stupid... In-Reply-To: <200305211838.h4LIbdV3021838@parsec.nyphp.org> References: <200305211838.h4LIbdV3021838@parsec.nyphp.org> Message-ID: <3ECBCF1A.2090407@idsociety.com> No one seems to have mentioned this, but 'order' is a reserved word in MySQL. See http://mysql.tviund.is/doc/en/Reserved_words.html -max Joshua S. Freeman wrote: > I've made a conceptual breakthrough (duh!) with regards to this project I'm > working on to really get to a meaningful skill level with MySQL/PHP > development. But.. for some reason, I'm really stuck on this one point: > > I have a database called 'wasps'. The database has 19 tables so far most of > which are 'lookup' tables (is that the right term?)... > > The main table in the database is called 'specimens'. Each 'specimen' has a > taxonomy (order, family, genus, subgenus, species, subspecies). > > For each part of the taxonomy I have a separate table. > > Ideally, when someone loads the survey form to begin building a new record > in the 'specimens' table, I want to query those taxonomy tables (order, > family, genus, etc...) so that I can build > menus based on the rows inside each > taxonomic table... > > I want to do this using 'foreach'... > > I've tried a few different things but I can't get it to work: > > mysql_connect($host, $user, $password) > or die("Could not connect to database"); > mysql_select_db($database) > or die ("Could not select $database database"); > > print "The current database is $database"; > > $query= mysql_query("select * FROM order"); > > $result = $query; > print (""); > } > > ?> > > but this does not work.. i know I'm close.. and I just spent 2 hours at > barnes & nobles at a table in the cafe with a bunch of PHP books (couldn't > find that WROX book someone suggested earlier) trying to make this work on > just the order table because that table only has one record in it... but I > could not make it work.. if I can figure out how to make this, I'll be able > to make considerable progress on this thing.. > > Someone please help me over this hump! > > Thanks! > > J. > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > From bfeqx44002 at sneakemail.com Wed May 21 15:14:43 2003 From: bfeqx44002 at sneakemail.com (gadhra) Date: Wed, 21 May 2003 15:14:43 -0400 Subject: [nycphp-talk] learning about foreach In-Reply-To: <200305211907.h4LJ6YZ1029422@parsec.nyphp.org> References: <200305211907.h4LJ6YZ1029422@parsec.nyphp.org> Message-ID: <28618-93087@sneakemail.com> Hi Josh, See my other post on your mysql problem. I would modify your query to be this: $sql = "select order_id, order_name from order"; then, when you get the results straightened out, you can do something like this: $result = mysql_query($sql); print ''; Something that might be a good thing to do is to run the query above, and do the following: print_r(mysql_fetch_row($result)); print_r(mysql_fetch_assoc($result)); print_r(mysql_fetch_array($result)); This can give you a lot of insight into how PHP stores the MySQL data, and how you might iterate through it. +gadhra+ Joshua S. Freeman jfreeman-at-amnh.org |NY PHP| wrote: >Hi Hans, et al. > >Thanks for the response and advice Hans... > >I don't know if this is salient to your response but ideally, what I want >the combination of the query and the foreach to do is to go into the 'order' >table, grab the single record that's in there (it has two columns, an >'order_id' column and an 'order_name' column) and then, in my form, build: > > > > > >so... the "1" in the 'value="1" is from the 'order_id' column and the >'Hymenoptera' is from the 'order_name' column. > >I'm not sure if this was clear before.. I know it wasn't clear from my code >snippet. > >Thanks.. > >J. > > > >On 5/21/03 2:58 PM, "Hans Zaunere" wrote: > > > >>--- "Joshua S. Freeman" wrote: >> >> >>>I've made a conceptual breakthrough (duh!) with regards to this project I'm >>>working on to really get to a meaningful skill level with MySQL/PHP >>>development. But.. for some reason, I'm really stuck on this one point: >>> >>>I have a database called 'wasps'. The database has 19 tables so far most >>>of >>>which are 'lookup' tables (is that the right term?)... >>> >>>The main table in the database is called 'specimens'. Each 'specimen' has >>>a >>>taxonomy (order, family, genus, subgenus, species, subspecies). >>> >>>For each part of the taxonomy I have a separate table. >>> >>>Ideally, when someone loads the survey form to begin building a new record >>>in the 'specimens' table, I want to query those taxonomy tables (order, >>>family, genus, etc...) so that I can build >>> menus based on the rows inside each >>>taxonomic table... >>> >>>I want to do this using 'foreach'... >>> >>>I've tried a few different things but I can't get it to work: >>> >>>mysql_connect($host, $user, $password) >>> or die("Could not connect to database"); >>>mysql_select_db($database) >>> or die ("Could not select $database database"); >>> >>>print "The current database is $database"; >>> >>>$query= mysql_query("select * FROM order"); >>> >>> >>I think you want to return to $result here, since it's used below. >> >> >>>$result = $query; >>> print (""); >>> } >>> >>>?> >>> >>>but this does not work.. i know I'm close.. and I just spent 2 hours at >>>barnes & nobles at a table in the cafe with a bunch of PHP books (couldn't >>>find that WROX book someone suggested earlier) trying to make this work on >>>just the order table because that table only has one record in it... but I >>>could not make it work.. if I can figure out how to make this, I'll be able >>>to make considerable progress on this thing.. >>> >>>Someone please help me over this hump! >>> >>>Thanks! >>> >>>J. >>> >>> >>> >>> >>> >>> >>> >>> >> >> >> >> >> >> >> > > > >--- Unsubscribe at http://nyphp.org/list/ --- > > > > > > > -- +gadhra+(/s) ********************* XXXXXXXXXXXXXXXXX And seize the metropolis; It's you it's built on From jfreeman at amnh.org Wed May 21 15:17:06 2003 From: jfreeman at amnh.org (Joshua S. Freeman) Date: Wed, 21 May 2003 15:17:06 -0400 Subject: [nycphp-talk]learning about foreach() In-Reply-To: <200305211910.h4LJA5Qv030273@parsec.nyphp.org> Message-ID: Max, give yourself a big hand... you know.. that was creeping around in the back of my brain at one point but I wasn't sure if that was going to break what I was trying to do or not.. apparently you hit the nail on the head... so.. now.. it's building this: so.. i'm close... here's the code I'm using now: $query= mysql_query("select * FROM taxa_order"); $result = mysql_fetch_assoc($query); print (""); so.. what do i need to adjust so I get this: ? J. On 5/21/03 3:10 PM, "max goldberg" wrote: > No one seems to have mentioned this, but 'order' is a reserved word in > MySQL. See http://mysql.tviund.is/doc/en/Reserved_words.html > > -max > > Joshua S. Freeman wrote: > >> I've made a conceptual breakthrough (duh!) with regards to this > project I'm >> working on to really get to a meaningful skill level with MySQL/PHP >> development. But.. for some reason, I'm really stuck on this one point: >> >> I have a database called 'wasps'. The database has 19 tables so far > most of >> which are 'lookup' tables (is that the right term?)... >> >> The main table in the database is called 'specimens'. Each 'specimen' > has a >> taxonomy (order, family, genus, subgenus, species, subspecies). >> >> For each part of the taxonomy I have a separate table. >> >> Ideally, when someone loads the survey form to begin building a new record >> in the 'specimens' table, I want to query those taxonomy tables (order, >> family, genus, etc...) so that I can build >> menus based on the rows inside each >> taxonomic table... >> >> I want to do this using 'foreach'... >> >> I've tried a few different things but I can't get it to work: >> >> mysql_connect($host, $user, $password) >> or die("Could not connect to database"); >> mysql_select_db($database) >> or die ("Could not select $database database"); >> >> print "The current database is $database"; >> >> $query= mysql_query("select * FROM order"); >> >> $result = $query; >> print (""); >> } >> >> ?> >> >> but this does not work.. i know I'm close.. and I just spent 2 hours at >> barnes & nobles at a table in the cafe with a bunch of PHP books (couldn't >> find that WROX book someone suggested earlier) trying to make this > work on >> just the order table because that table only has one record in it... > but I >> could not make it work.. if I can figure out how to make this, I'll be > able >> to make considerable progress on this thing.. >> >> Someone please help me over this hump! >> >> Thanks! >> >> J. >> >> >> >> >> >> > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > > From jfreeman at amnh.org Wed May 21 15:37:50 2003 From: jfreeman at amnh.org (Joshua S. Freeman) Date: Wed, 21 May 2003 15:37:50 -0400 Subject: learning about foreach() continued Message-ID: Thanks for everyone who's chimed in so far... I appreciate the various code snippets but I'm trying to see if I can do everything I need here using 'foreach()'... so.. since this: $query= mysql_query("select * FROM taxa_order"); $result = mysql_fetch_assoc($query); print (""); yields this: how do I get it to stop from creating two rows (there's only one row in the table!) and how do I get it to stop from including the names of the columns and just including the value for each column in the one row? J. From max at idsociety.com Wed May 21 15:48:07 2003 From: max at idsociety.com (max goldberg) Date: Wed, 21 May 2003 15:48:07 -0400 Subject: [nycphp-talk] learning about foreach continued In-Reply-To: <200305211938.h4LJbsV3033212@parsec.nyphp.org> References: <200305211938.h4LJbsV3033212@parsec.nyphp.org> Message-ID: <3ECBD7F7.8050909@idsociety.com> >From www.php.net/mysql The function mysql_fetch_array() uses a constant for the different types of result arrays. The following constants are defined: Table 3. MySQL fetch constants constant description MYSQL_ASSOC Columns are returned into the array having the fieldname as the array index. MYSQL_BOTH Columns are returned into the array having both a numerical index and the fieldname as the array index. MYSQL_NUM Columns are returned into the array having a numerical index to the fields. This index starts with 0, the first field in the result. More at http://www.php.net/manual/en/function.mysql-fetch-array.php -max Joshua S. Freeman wrote: > Thanks for everyone who's chimed in so far... I appreciate the various code > snippets but I'm trying to see if I can do everything I need here using > 'foreach()'... > > so.. > > since this: > > $query= mysql_query("select * FROM taxa_order"); > > $result = mysql_fetch_assoc($query); > print (""); > > yields this: > > > > how do I get it to stop from creating two rows (there's > only one row in the table!) and how do I get it to stop from including the > names of the columns and just including the value for each column in the one > row? > > J. > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > From jfreeman at amnh.org Wed May 21 15:59:03 2003 From: jfreeman at amnh.org (Joshua S. Freeman) Date: Wed, 21 May 2003 15:59:03 -0400 Subject: [nycphp-talk] learning about foreach continued In-Reply-To: <200305211947.h4LJltQv034142@parsec.nyphp.org> Message-ID: Hi Max, I can see you're trying to help me and I appreciate it. So... I can't seem to do anything with either mysql_fetch_both or mysql_fetch_num... mysql_fetch_array brings up TOO much information... I don't have enough background yet to put the information you've given me here to good use. J. On 5/21/03 3:47 PM, "max goldberg" wrote: > From www.php.net/mysql > > The function mysql_fetch_array() uses a constant for the different types > of result arrays. The following constants are defined: > > Table 3. MySQL fetch constants > > constant description > MYSQL_ASSOC Columns are returned into the array having the fieldname as > the array index. > MYSQL_BOTH Columns are returned into the array having both a numerical > index and the fieldname as the array index. > MYSQL_NUM Columns are returned into the array having a numerical index > to the fields. This index starts with 0, the first field in the result. > > More at http://www.php.net/manual/en/function.mysql-fetch-array.php > > -max > > > Joshua S. Freeman wrote: > >> Thanks for everyone who's chimed in so far... I appreciate the various > code >> snippets but I'm trying to see if I can do everything I need here using >> 'foreach()'... >> >> so.. >> >> since this: >> >> $query= mysql_query("select * FROM taxa_order"); >> >> $result = mysql_fetch_assoc($query); >> print (""); >> >> yields this: >> >> >> >> how do I get it to stop from creating two rows (there's >> only one row in the table!) and how do I get it to stop from including the >> names of the columns and just including the value for each column in > the one >> row? >> >> J. >> >> >> >> >> >> > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > > From zaunere at yahoo.com Wed May 21 16:05:16 2003 From: zaunere at yahoo.com (Hans Zaunere) Date: Wed, 21 May 2003 13:05:16 -0700 (PDT) Subject: [nycphp-talk] learning about foreach continued In-Reply-To: <200305211938.h4LJbsXL033212@parsec.nyphp.org> Message-ID: <20030521200516.99149.qmail@web12807.mail.yahoo.com> --- "Joshua S. Freeman" wrote: > Thanks for everyone who's chimed in so far... I appreciate the various code > snippets but I'm trying to see if I can do everything I need here using > 'foreach()'... > > so.. > > since this: > > $query= mysql_query("select * FROM taxa_order"); > > $result = mysql_fetch_assoc($query); > print (""); > > yields this: > > You'll need to do this: Oh wait, you wanted to use foreach() -- Don't :) Unless you want to iterate over the result using for()/while(), then you could iterate over the resulting array with a foreach - but that's just silly. What you'd like to see is a "mysql_fetch_resultset_into_array()" like Oracle has. Then you'd have an array that you could iterate over. I think this would make for a good pCom :) H From max at idsociety.com Wed May 21 16:13:59 2003 From: max at idsociety.com (max goldberg) Date: Wed, 21 May 2003 16:13:59 -0400 Subject: [nycphp-talk] learning about foreach continued In-Reply-To: <200305211959.h4LJx8V3035130@parsec.nyphp.org> References: <200305211959.h4LJx8V3035130@parsec.nyphp.org> Message-ID: <3ECBDE07.1080802@idsociety.com> You probably want something like this: $result = mysql_fetch_assoc($query); echo '"; If you would like me to explain further how this works just ask. -Max Joshua S. Freeman wrote: > Hi Max, > > I can see you're trying to help me and I appreciate it. > > So... I can't seem to do anything with either mysql_fetch_both or > mysql_fetch_num... mysql_fetch_array brings up TOO much information... > > I don't have enough background yet to put the information you've given me > here to good use. > > J. > > On 5/21/03 3:47 PM, "max goldberg" wrote: > > >>From www.php.net/mysql >> >>The function mysql_fetch_array() uses a constant for the different types >>of result arrays. The following constants are defined: >> >>Table 3. MySQL fetch constants >> >>constant description >>MYSQL_ASSOC Columns are returned into the array having the fieldname as >>the array index. >>MYSQL_BOTH Columns are returned into the array having both a numerical >>index and the fieldname as the array index. >>MYSQL_NUM Columns are returned into the array having a numerical index >>to the fields. This index starts with 0, the first field in the result. >> >>More at http://www.php.net/manual/en/function.mysql-fetch-array.php >> >>-max >> >> >>Joshua S. Freeman wrote: >> >> >>>Thanks for everyone who's chimed in so far... I appreciate the various >> >>code >> >>>snippets but I'm trying to see if I can do everything I need here using >>>'foreach()'... >>> >>>so.. >>> >>>since this: >>> >>>$query= mysql_query("select * FROM taxa_order"); >>> >>> $result = mysql_fetch_assoc($query); >>> print (""); >>> >>>yields this: >>> >>> >>> >>>how do I get it to stop from creating two rows (there's >>>only one row in the table!) and how do I get it to stop from including the >>>names of the columns and just including the value for each column in >> >>the one >> >>>row? >>> >>>J. >>> >>> >>> >>> >>> >>> >> >> >> >> >> >> >> > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > From jfreeman at amnh.org Wed May 21 16:14:27 2003 From: jfreeman at amnh.org (Joshua S. Freeman) Date: Wed, 21 May 2003 16:14:27 -0400 Subject: success! (learning about foreach()) Message-ID: well.. I didn't do it using 'foreach'.. but I did do it using some code from chapter 17 of the wrox book that was recommended by louie... here's the working code: $query= mysql_query("select * FROM taxa_order"); print (" which is exactly what I was trying to do... now.. if only i could figure out how to get the same result using 'foreach'... J. From gmalcolm at professionalcredit.com Wed May 21 16:16:02 2003 From: gmalcolm at professionalcredit.com (Malcolm, Gary) Date: Wed, 21 May 2003 13:16:02 -0700 Subject: [nycphp-talk] learning about foreach continued Message-ID: <715DAA079998D3118B8B00508B2C071D453D51@pcsnet> your foreach is incrementing through the first array (or row) of the result... try //get all result $query= mysql_query("select * FROM taxa_order"); //get each row while( $result = mysql_fetch_assoc($query){ //get rid of array extract($result); // build options $options = "$order_name"; } print(); foreach is more apropos when doing thing like listing elements of an array hope this helps gary. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gmalcolm at professionalcredit.com Wed May 21 16:21:43 2003 From: gmalcolm at professionalcredit.com (Malcolm, Gary) Date: Wed, 21 May 2003 13:21:43 -0700 Subject: [nycphp-talk] learning about foreach continued Message-ID: <715DAA079998D3118B8B00508B2C071D453D52@pcsnet> BTW... as far as i can tell, mysql_fetch_array($result,MYSQL_ASSOC) and mysql_fetch_assoc($result) do exactly the same thing gary -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfreeman at amnh.org Wed May 21 16:47:11 2003 From: jfreeman at amnh.org (Joshua S. Freeman) Date: Wed, 21 May 2003 16:47:11 -0400 Subject: next hurdle... Message-ID: Here's some code: \ "; while ($row = mysql_fetch_row($query)) { print "\ "; } print (""); ?> Here's the result: which is *almost* what I want. What I *want* is this: Is there something I can change in my PHP code which will change the results I have into the results I want? J. From jfreeman at amnh.org Wed May 21 16:51:32 2003 From: jfreeman at amnh.org (Joshua S. Freeman) Date: Wed, 21 May 2003 16:51:32 -0400 Subject: no hurdle! Message-ID: just an anomaly in the contents of the subfamily table.. there's an empty row at the beginning. :-) everything is working the way I need it! woo hoo! Thanks folks! J. From lists at ny-tech.net Wed May 21 16:53:28 2003 From: lists at ny-tech.net (Nasir Zubair) Date: Wed, 21 May 2003 16:53:28 -0400 (Eastern Daylight Time) Subject: [nycphp-talk] next hurdle... References: <200305212047.h4LKlFWx040841@parsec.nyphp.org> Message-ID: <3ECBE748.000001.03628@MAIN> How about this: \ "; while ($row = mysql_fetch_row($query)) { if($row[0] != "" && $row[1] != "") print "\ "; } print (""); ?> -------Original Message------- From: talk at nyphp.org Date: Wednesday, May 21, 2003 4:47:40 PM To: NYPHP Talk Subject: [nycphp-talk] next hurdle... Here's some code: \ "; while ($row = mysql_fetch_row($query)) { print "\ "; } print (""); ?> Here's the result: which is *almost* what I want. What I *want* is this: Is there something I can change in my PHP code which will change the results I have into the results I want? J. --- Unsubscribe at http://nyphp.org/list/ --- . -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: IMSTP.gif Type: image/gif Size: 494 bytes Desc: not available URL: From louie at zibi.co.il Wed May 21 16:42:37 2003 From: louie at zibi.co.il (louie) Date: Wed, 21 May 2003 16:42:37 -0400 Subject: [nycphp-talk] success! References: <200305212015.h4LKEUch037738@parsec.nyphp.org> Message-ID: <005d01c31fd9$86df47d0$7552fea9@w3j5c4> greetings folks ! i dont know about you all but this thread for me was like looking at a childbirth from all the suggestion for a better delivery to the slow labor of changing the subject finally i can say "MAZAL TOV" a line of working code was born in the wieght of 34 bytes best regards, ps i didnt recommended the book just mention the publisher so Uncredit me and keep up the good work spreading php ----- Original Message ----- From: "Joshua S. Freeman" To: "NYPHP Talk" Sent: Wednesday, May 21, 2003 4:14 PM Subject: [nycphp-talk] success! > well.. I didn't do it using 'foreach'.. but I did do it using some code from > chapter 17 of the wrox book that was recommended by louie... > > > here's the working code: > > $query= mysql_query("select * FROM taxa_order"); > > print (" > > which is exactly what I was trying to do... > > now.. if only i could figure out how to get the same result using > 'foreach'... > > J. > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > > > From soazine at pop.mail.rcn.net Wed May 21 16:54:43 2003 From: soazine at pop.mail.rcn.net (soazine@pop.erols.com) Date: Wed, 21 May 2003 16:54:43 -0400 Subject: [nycphp-talk] next hurdle... Message-ID: <410-220035321205443617@M2W035.mail2web.com> Without knowing too much about your table structure and schema I can only guess that the data in your table is configured in such a way as: id name 1 NULL 2 Eumen.. 3 Masar.. etc. Check your data and retry the query parsing, else, try another looping method Phil Original Message: ----------------- From: Joshua S. Freeman jfreeman at amnh.org Date: Wed, 21 May 2003 16:47:15 -0400 To: talk at nyphp.org Subject: [nycphp-talk] next hurdle... Here's some code: \ "; while ($row = mysql_fetch_row($query)) { print "\ "; } print (""); ?> Here's the result: which is *almost* what I want. What I *want* is this: Is there something I can change in my PHP code which will change the results I have into the results I want? J. --- Unsubscribe at http://nyphp.org/list/ --- -------------------------------------------------------------------- mail2web - Check your email from the web at http://mail2web.com/ . From lists at ny-tech.net Wed May 21 16:55:08 2003 From: lists at ny-tech.net (Nasir Zubair) Date: Wed, 21 May 2003 16:55:08 -0400 (Eastern Daylight Time) Subject: [nycphp-talk] next hurdle... References: <200305212047.h4LKlFWx040841@parsec.nyphp.org> Message-ID: <3ECBE7AC.000004.03628@MAIN> How about this: \ "; while ($row = mysql_fetch_row($query)) { if($row[0] != "" && $row[1] != "") print "\ "; } print (""); ?> -------Original Message------- From: talk at nyphp.org Date: Wednesday, May 21, 2003 4:47:40 PM To: NYPHP Talk Subject: [nycphp-talk] next hurdle... Here's some code: \ "; while ($row = mysql_fetch_row($query)) { print "\ "; } print (""); ?> Here's the result: which is *almost* what I want. What I *want* is this: Is there something I can change in my PHP code which will change the results I have into the results I want? J. --- Unsubscribe at http://nyphp.org/list/ --- . From cmerlo at turing.matcmp.ncc.edu Wed May 21 17:03:58 2003 From: cmerlo at turing.matcmp.ncc.edu (Christopher R. Merlo) Date: Wed, 21 May 2003 17:03:58 -0400 Subject: [nycphp-talk] learning about foreach In-Reply-To: <200305211907.h4LJ6YaH029422@parsec.nyphp.org>; from jfreeman@amnh.org on Wed, May 21, 2003 at 03:06:34PM -0400 References: <200305211907.h4LJ6YaH029422@parsec.nyphp.org> Message-ID: <20030521170358.P19459@turing.matcmp.ncc.edu> On 2003-05-21 15:06 -0400, Joshua S. Freeman wrote: > I'm not sure if this was clear before.. I know it wasn't clear from my code > snippet. For some reason, I get the idea that you want the computer to figure out the names of the MySQL columns, *without human knowkedge beforehand*, and have them show up on the web site. Is that true? -- cmerlo at turing.matcmp.ncc.edu http://turing.matcmp.ncc.edu/~cmerlo You can't always get what you want. -- The Rolling Stones From jfreeman at amnh.org Wed May 21 20:49:16 2003 From: jfreeman at amnh.org (Joshua S. Freeman) Date: Wed, 21 May 2003 20:49:16 -0400 Subject: new problems (VERY LONG but hopefully interesting) Message-ID: If I can solve the problems described below for one place in the project I'm working on, the solution will be applicable to many other places as well. I also think that the information will be useful for other people learning how to build apps using MySQL/PHP. As I've mentioned before, the main table in my database is called 'specimens'. With regards to the survey form here's what I can do so far: I am able to use PHP to build menus and lists. Some of these are menus where the surveyor can only select one item. I *can* figure out how to write INSERT statements so that these selections can be inserted in a record in the 'specimens' table. Others of these are menus where the surveyor can select more than one item. I *believe* this means I'm going to have to create a table that relates the specimen_id (the key to the 'specimens' table) with the 1 or >1 number of items that are selected from the list by the surveyor. I'm not sure what the structure of that relate-table should be. For example, there's a section of the survey regarding the 'composition' of the specimens that are being surveyed. In my form, it's a drop-down list from which multiple selections can be made. The drop-down list in the form is dynamically built by querying the 'composition' table. here's a dump of the 'composition' table: CREATE TABLE composition ( comp_element_id smallint(3) NOT NULL auto_increment, comp_element varchar(50) NOT NULL default '', PRIMARY KEY (comp_element_id) ) TYPE=MyISAM; # # Dumping data for table `composition` # INSERT INTO composition VALUES (1, 'Paper/Carton'); INSERT INTO composition VALUES (2, 'Glandular Secretion'); INSERT INTO composition VALUES (3, 'Leaves'); INSERT INTO composition VALUES (4, 'Bark Fragments'); INSERT INTO composition VALUES (5, 'Paper/Carton with high Saliva Content'); INSERT INTO composition VALUES (6, 'Insect Remains'); INSERT INTO composition VALUES (7, 'Wood/Twigs'); INSERT INTO composition VALUES (8, 'Leaves/Wood chewed into Paste'); INSERT INTO composition VALUES (9, 'Clay/Mud'); INSERT INTO composition VALUES (10, 'Wax'); INSERT INTO composition VALUES (11, 'Rootlets'); INSERT INTO composition VALUES (12, 'Plant Resin'); Let's say that the surveyor selects id numbers 1, 3, 4, 8, 10, 12 from the drop-down multiple select list. In that case, I guess I have to create a new table that relates my main 'specimen' table with the compositional elements in the 'composition' table. I will call this table 'composition_group'. This table has three columns. One stores a 'comp_group_id', one stores the 'specimen_id' number of the specimen we're working on at the moment, and the last column stores the the id numbers 1, 3, 4, 8, 10 and 12 from the 'composition' table so we know which compositional elements this specimen is comprised of. I believe the 'composition_group' table will look like this: CREATE TABLE composition_group ( comp_group_id smallint(3) NOT NULL auto_increment, specimen_id smallint(3) NOT NULL, comp_group_values varchar(50) NOT NULL default '', PRIMARY KEY (comp_group_id) ) TYPE=MyISAM; # # Dumping data for table `composition_group` # INSERT INTO composition_group VALUES (1, 5, '1, 3, 4, 8, 10, 12'); INSERT INTO composition_group VALUES (2, 6, '2, 3, 10'); INSERT INTO composition_group VALUES (3, 7, '4, 6, 7, 8, 11'); INSERT INTO composition_group VALUES (4, 8, '7, 8, 10'); Does this make sense?... Meanwhile, back in the main 'specimen' table, the column for 'composition' will contain the 'comp_group_id' that relates to the current 'specimen_id'. Right? ***I'm worried about the fact that the comp_group_values are numeric and need to have commas between them... will this be a problem?*** So.. that's the first problem... I think the second problem is stickier. For many of the areas of the survey, whether they are presented as single select drop-down menus, multiple select drop-down menus or checkboxes, there is also a space for the surveyor to input an 'other' such as: Other using this example, whatever is typed in there needs to be added to the end of the 'composition' table and made part of the record in the 'composition_group' table for that survey... thus, then NEXT time someone loads the form, the new compositional element would be part of the drop down menu or list. Where I get completely lost how to handle the 'other' problem with survey areas that use checkboxes instead of menus/lists. I guess this means that I'm going to have to also learn how to build groups of checkboxes dynamically by looking inside the database.. Well.. I could probably figure this out using the same PHP I used to dynamically build menus/lists. Anyway.. these are the next problems I need help solving. Any advice greatly appreciated. !!! Thanks! J. From melissa at inexact.info Wed May 21 21:11:46 2003 From: melissa at inexact.info (Melissa) Date: Wed, 21 May 2003 21:11:46 -0400 Subject: [nycphp-talk] new problems In-Reply-To: <200305220049.h4M0nLVD050092@parsec.nyphp.org> Message-ID: Just as a point of database normalization, I don't think you need to have the specimen id and the composition group id in both tables....I would leave the composition group id column out of the specimen table, and just have the relation be specimen id in both the composition group table and the specimen table. As for the 'other' option...you would have to create two insert statements, the first one inserting a new record into the composition options table, the second inserting that record (including the newly created value in composition options) into the composition group table. > -----Original Message----- > From: Joshua S. Freeman [mailto:jfreeman at amnh.org] > Sent: Wednesday, May 21, 2003 8:49 PM > To: NYPHP Talk > Subject: [nycphp-talk] new problems > > > If I can solve the problems described below for one place in the > project I'm > working on, the solution will be applicable to many other places > as well. I > also think that the information will be useful for other people > learning how > to build apps using MySQL/PHP. > > As I've mentioned before, the main table in my database is called > 'specimens'. > > With regards to the survey form here's what I can do so far: > > I am able to use PHP to build menus and > lists. > > Some of these are menus where the surveyor can only select one item. I > *can* figure out how to write INSERT statements so that these > selections can > be inserted in a record in the 'specimens' table. > > Others of these are menus where the surveyor can select more than > one item. > I *believe* this means I'm going to have to create a table that > relates the > specimen_id (the key to the 'specimens' table) with the 1 or >1 number of > items that are selected from the list by the surveyor. > > I'm not sure what the structure of that relate-table should be. > > For example, there's a section of the survey regarding the > 'composition' of > the specimens that are being surveyed. In my form, it's a drop-down list > from which multiple selections can be made. The drop-down list > in the form > is dynamically built by querying the 'composition' table. > > here's a dump of the 'composition' table: > > CREATE TABLE composition ( > comp_element_id smallint(3) NOT NULL auto_increment, > comp_element varchar(50) NOT NULL default '', > PRIMARY KEY (comp_element_id) > ) TYPE=MyISAM; > > # > # Dumping data for table `composition` > # > > INSERT INTO composition VALUES (1, 'Paper/Carton'); > INSERT INTO composition VALUES (2, 'Glandular Secretion'); > INSERT INTO composition VALUES (3, 'Leaves'); > INSERT INTO composition VALUES (4, 'Bark Fragments'); > INSERT INTO composition VALUES (5, 'Paper/Carton with high Saliva > Content'); > INSERT INTO composition VALUES (6, 'Insect Remains'); > INSERT INTO composition VALUES (7, 'Wood/Twigs'); > INSERT INTO composition VALUES (8, 'Leaves/Wood chewed into Paste'); > INSERT INTO composition VALUES (9, 'Clay/Mud'); > INSERT INTO composition VALUES (10, 'Wax'); > INSERT INTO composition VALUES (11, 'Rootlets'); > INSERT INTO composition VALUES (12, 'Plant Resin'); > > Let's say that the surveyor selects id numbers 1, 3, 4, 8, 10, 12 from the > drop-down multiple select list. > > In that case, I guess I have to create a new table that relates my main > 'specimen' table with the compositional elements in the > 'composition' table. > > I will call this table 'composition_group'. > > This table has three columns. One stores a 'comp_group_id', one stores the > 'specimen_id' number of the specimen we're working on at the > moment, and the > last column stores the the id numbers 1, 3, 4, 8, 10 and 12 from the > 'composition' table so we know which compositional elements this > specimen is > comprised of. > > I believe the 'composition_group' table will look like this: > > > CREATE TABLE composition_group ( > comp_group_id smallint(3) NOT NULL auto_increment, > specimen_id smallint(3) NOT NULL, > comp_group_values varchar(50) NOT NULL default '', > PRIMARY KEY (comp_group_id) > ) TYPE=MyISAM; > > # > # Dumping data for table `composition_group` > # > > INSERT INTO composition_group VALUES (1, 5, '1, 3, 4, 8, 10, 12'); > INSERT INTO composition_group VALUES (2, 6, '2, 3, 10'); > INSERT INTO composition_group VALUES (3, 7, '4, 6, 7, 8, 11'); > INSERT INTO composition_group VALUES (4, 8, '7, 8, 10'); > > Does this make sense?... > > Meanwhile, back in the main 'specimen' table, the column for 'composition' > will contain the 'comp_group_id' that relates to the current > 'specimen_id'. > > Right? > > ***I'm worried about the fact that the comp_group_values are numeric and > need to have commas between them... will this be a problem?*** > > > So.. that's the first problem... > > > I think the second problem is stickier. > > For many of the areas of the survey, whether they are presented as single > select drop-down menus, multiple select drop-down menus or > checkboxes, there > is also a space for the surveyor to input an 'other' such as: > > Other > > using this example, whatever is typed in there needs to be added > to the end > of the 'composition' table and made part of the record in the > 'composition_group' table for that survey... > > thus, then NEXT time someone loads the form, the new compositional element > would be part of the drop down menu or list. > > Where I get completely lost how to handle the 'other' problem with survey > areas that use checkboxes instead of menus/lists. I guess this means that > I'm going to have to also learn how to build groups of checkboxes > dynamically by looking inside the database.. > > Well.. I could probably figure this out using the same PHP I used to > dynamically build menus/lists. > > Anyway.. these are the next problems I need help solving. > > Any advice greatly appreciated. > > !!! > > Thanks! > > J. > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > From jfreeman at amnh.org Wed May 21 22:05:25 2003 From: jfreeman at amnh.org (Joshua S. Freeman) Date: Wed, 21 May 2003 22:05:25 -0400 Subject: [nycphp-talk] new problems In-Reply-To: <200305220111.h4M1BhQv051361@parsec.nyphp.org> Message-ID: First of all, thanks for reading my ridiculously long message! On 5/21/03 9:11 PM, "Melissa" wrote: > Just as a point of database normalization, I don't think you need to have > the specimen id and the composition group id in both tables >I would leave the composition group id column out of the specimen table, and >just have the relation be specimen id in both the composition group table and >the specimen table. I see.. so... i should remove the column for 'composition_group_id' from the 'specimen' table... but the composition_group table will look the way I described it below... > > As for the 'other' option...you would have to create two insert statements, > the first one inserting a new record into the composition options table, the > second inserting that record (including the newly created value in > composition options) into the composition group table. OK.. so, all I'm left with is that the next time someone loads the form, all the menus/lists and checkboxes are dynamically built in the
so that any additions to the menus are properly displayed.. Thanks Melissa... cheers, J. > > > >> -----Original Message----- >> From: Joshua S. Freeman [mailto:jfreeman at amnh.org] >> Sent: Wednesday, May 21, 2003 8:49 PM >> To: NYPHP Talk >> Subject: [nycphp-talk] new problems >> >> >> If I can solve the problems described below for one place in the >> project I'm >> working on, the solution will be applicable to many other places >> as well. I >> also think that the information will be useful for other people >> learning how >> to build apps using MySQL/PHP. >> >> As I've mentioned before, the main table in my database is called >> 'specimens'. >> >> With regards to the survey form here's what I can do so far: >> >> I am able to use PHP to build menus and >> lists. >> >> Some of these are menus where the surveyor can only select one item. I >> *can* figure out how to write INSERT statements so that these >> selections can >> be inserted in a record in the 'specimens' table. >> >> Others of these are menus where the surveyor can select more than >> one item. >> I *believe* this means I'm going to have to create a table that >> relates the >> specimen_id (the key to the 'specimens' table) with the 1 or >1 number of >> items that are selected from the list by the surveyor. >> >> I'm not sure what the structure of that relate-table should be. >> >> For example, there's a section of the survey regarding the >> 'composition' of >> the specimens that are being surveyed. In my form, it's a drop-down list >> from which multiple selections can be made. The drop-down list >> in the form >> is dynamically built by querying the 'composition' table. >> >> here's a dump of the 'composition' table: >> >> CREATE TABLE composition ( >> comp_element_id smallint(3) NOT NULL auto_increment, >> comp_element varchar(50) NOT NULL default '', >> PRIMARY KEY (comp_element_id) >> ) TYPE=MyISAM; >> >> # >> # Dumping data for table `composition` >> # >> >> INSERT INTO composition VALUES (1, 'Paper/Carton'); >> INSERT INTO composition VALUES (2, 'Glandular Secretion'); >> INSERT INTO composition VALUES (3, 'Leaves'); >> INSERT INTO composition VALUES (4, 'Bark Fragments'); >> INSERT INTO composition VALUES (5, 'Paper/Carton with high Saliva >> Content'); >> INSERT INTO composition VALUES (6, 'Insect Remains'); >> INSERT INTO composition VALUES (7, 'Wood/Twigs'); >> INSERT INTO composition VALUES (8, 'Leaves/Wood chewed into Paste'); >> INSERT INTO composition VALUES (9, 'Clay/Mud'); >> INSERT INTO composition VALUES (10, 'Wax'); >> INSERT INTO composition VALUES (11, 'Rootlets'); >> INSERT INTO composition VALUES (12, 'Plant Resin'); >> >> Let's say that the surveyor selects id numbers 1, 3, 4, 8, 10, 12 from the >> drop-down multiple select list. >> >> In that case, I guess I have to create a new table that relates my main >> 'specimen' table with the compositional elements in the >> 'composition' table. >> >> I will call this table 'composition_group'. >> >> This table has three columns. One stores a 'comp_group_id', one stores the >> 'specimen_id' number of the specimen we're working on at the >> moment, and the >> last column stores the the id numbers 1, 3, 4, 8, 10 and 12 from the >> 'composition' table so we know which compositional elements this >> specimen is >> comprised of. >> >> I believe the 'composition_group' table will look like this: >> >> >> CREATE TABLE composition_group ( >> comp_group_id smallint(3) NOT NULL auto_increment, >> specimen_id smallint(3) NOT NULL, >> comp_group_values varchar(50) NOT NULL default '', >> PRIMARY KEY (comp_group_id) >> ) TYPE=MyISAM; >> >> # >> # Dumping data for table `composition_group` >> # >> >> INSERT INTO composition_group VALUES (1, 5, '1, 3, 4, 8, 10, 12'); >> INSERT INTO composition_group VALUES (2, 6, '2, 3, 10'); >> INSERT INTO composition_group VALUES (3, 7, '4, 6, 7, 8, 11'); >> INSERT INTO composition_group VALUES (4, 8, '7, 8, 10'); >> >> Does this make sense?... >> >> Meanwhile, back in the main 'specimen' table, the column for 'composition' >> will contain the 'comp_group_id' that relates to the current >> 'specimen_id'. >> >> Right? >> >> ***I'm worried about the fact that the comp_group_values are numeric and >> need to have commas between them... will this be a problem?*** >> >> >> So.. that's the first problem... >> >> >> I think the second problem is stickier. >> >> For many of the areas of the survey, whether they are presented as single >> select drop-down menus, multiple select drop-down menus or >> checkboxes, there >> is also a space for the surveyor to input an 'other' such as: >> >> Other >> >> using this example, whatever is typed in there needs to be added >> to the end >> of the 'composition' table and made part of the record in the >> 'composition_group' table for that survey... >> >> thus, then NEXT time someone loads the form, the new compositional element >> would be part of the drop down menu or list. >> >> Where I get completely lost how to handle the 'other' problem with survey >> areas that use checkboxes instead of menus/lists. I guess this means that >> I'm going to have to also learn how to build groups of checkboxes >> dynamically by looking inside the database.. >> >> Well.. I could probably figure this out using the same PHP I used to >> dynamically build menus/lists. >> >> Anyway.. these are the next problems I need help solving. >> >> Any advice greatly appreciated. >> >> !!! >> >> Thanks! >> >> J. >> >> >> >> >> >> > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > > From tech_learner at yahoo.com Thu May 22 00:48:07 2003 From: tech_learner at yahoo.com (Tracy) Date: Wed, 21 May 2003 21:48:07 -0700 (PDT) Subject: [nycphp-talk] new problems In-Reply-To: <200305220051.h4M0nLcD050092@parsec.nyphp.org> Message-ID: <20030522044807.23890.qmail@web14304.mail.yahoo.com> Hi, too bad i made u search for the book, i thought, the code should help along with the tutorials on O'reiley and devarticles. anyways.... ok, if u are game to try a small example, i would like to try to break this table into two. one that holds the "only" selected option and one that holds >1 options with the id field in common. is this how u r proceeding? may be repeating your work to u.... if u r not very particular about the column names and can go with opt1, opt2, opt3 and so on, then u only need the initial table to be ID OPT1 1 abc when the user selects more than one, u can have the table extended. there is a tutorial by Ben Rowe where he describes how to include the details provided by the user at the time of registration. ... "The last function allows us to customize what the session table stores. The session table stores a primary key, session id, username, userid and auth level (used for creating administrators, etc). But what happens when you want to store a persons first and last names so that you can quickly retrieve them? " ... i guess u r in a similar position. take a look at the first 2 parts, that should help. http://www.devarticles.com/author.php?authorId=3 >I'm not sure what the structure of that relate-table should be. i guess yr 2nd problem is partly answered too. i mean either of yr queries would find a solution. Tracy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Coming together is a beginning... keeping together is progress... working together is success !!! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --------------------------------- Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pinyo.Bhulipongsanon at usa.xerox.com Thu May 22 09:03:59 2003 From: Pinyo.Bhulipongsanon at usa.xerox.com (Bhulipongsanon, Pinyo) Date: Thu, 22 May 2003 09:03:59 -0400 Subject: global variables Message-ID: Hi all, I have questions regarding global. It appears that my program that uses global no longer work consistently. I think because global has been turned off in newer server. I only need global variables so that functions can use them, however I really do not want to pass everything by value to the function. So this code is out: global $var1, $var2; I don't know if I should use session (cost?): declare $_SESSION['var1']... outside the function and do the reverse inside the function My current solution is to use $_GET: declare $_GET['var1']... outside the function and do the reverse inside the function, i.e., $var1 = $_GET['var1'] Can someone tell me if there's anything wrong with this last option? I don't want to use 2nd option because my program is an include file so I cannot use session_start() consistently. Thank you, Pinyo From jonbaer at jonbaer.net Thu May 22 09:18:25 2003 From: jonbaer at jonbaer.net (Jon Baer) Date: Thu, 22 May 2003 06:18:25 -0700 Subject: Need virtual host Apache help ... Message-ID: <000701c32064$a066b590$6400a8c0@Townsend> Im trying to setup my laptop to host 5 different PHP-based sites for dev purposes and getting lost on how to setup Virtual hosting so that it's port based w/Apache (I can't remember if it could do it or not or if it was another webserver), ie. port 81 -> site 1, port 82 -> site 2, etc. ? Any ideas? I just would like to not edit httpd.conf every time. - Jon From jlacey at ix.netcom.com Thu May 22 09:33:02 2003 From: jlacey at ix.netcom.com (John Lacey) Date: Thu, 22 May 2003 07:33:02 -0600 Subject: [nycphp-talk] Need virtual host Apache help ... References: <200305221319.h4MDIdVR068492@parsec.nyphp.org> Message-ID: <000a01c32066$aca95f40$0200000a@Pentium700> why not just have each site in a separate directory under DocumentRoot? e.g. if the document root is /var/www/html, then site directories under that path, "site1", "site2", etc so the only thing you'd have to do is http://locahost/site1 and so forth... or just localhost/site1 ----- Original Message ----- From: "Jon Baer" To: "NYPHP Talk" Sent: Thursday, May 22, 2003 7:18 AM Subject: [nycphp-talk] Need virtual host Apache help ... Im trying to setup my laptop to host 5 different PHP-based sites for dev purposes and getting lost on how to setup Virtual hosting so that it's port based w/Apache (I can't remember if it could do it or not or if it was another webserver), ie. port 81 -> site 1, port 82 -> site 2, etc. ? Any ideas? I just would like to not edit httpd.conf every time. - Jon --- Unsubscribe at http://nyphp.org/list/ --- From jonbaer at jonbaer.net Thu May 22 09:38:41 2003 From: jonbaer at jonbaer.net (Jon Baer) Date: Thu, 22 May 2003 06:38:41 -0700 Subject: [nycphp-talk] Need virtual host Apache help ... References: <200305221333.h4MDXKVb069506@parsec.nyphp.org> Message-ID: <000501c32067$7587f2f0$6400a8c0@Townsend> Much of the code reflects on relative directories based on the root path ... (images, styles, etc) ... ----- Original Message ----- From: "John Lacey" To: "NYPHP Talk" Sent: Thursday, May 22, 2003 6:33 AM Subject: Re: [nycphp-talk] Need virtual host Apache help ... > > why not just have each site in a separate directory under DocumentRoot? > > e.g. if the document root is /var/www/html, then site directories under > that path, "site1", "site2", etc > > so the only thing you'd have to do is http://locahost/site1 > and so forth... or just localhost/site1 > > > > > > ----- Original Message ----- > From: "Jon Baer" > To: "NYPHP Talk" > Sent: Thursday, May 22, 2003 7:18 AM > Subject: [nycphp-talk] Need virtual host Apache help ... > > > Im trying to setup my laptop to host 5 different PHP-based sites for dev > purposes and getting lost on how to setup Virtual hosting so that it's > port > based w/Apache (I can't remember if it could do it or not or if it was > another webserver), ie. port 81 -> site 1, port 82 -> site 2, etc. > > > ? > > > Any ideas? I just would like to not edit httpd.conf every time. > > - Jon > > > > > > > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > > From nyphp at websapp.com Thu May 22 09:45:40 2003 From: nyphp at websapp.com (Daniel Kushner) Date: Thu, 22 May 2003 09:45:40 -0400 Subject: [nycphp-talk] Need virtual host Apache help ... In-Reply-To: <200305221339.h4MDcobB070347@parsec.nyphp.org> Message-ID: Hi Jon, On my Windows development enviroment, I do this: Create virtual hosts in httpd.conf ServerName dev.nyphp.org DocumentRoot "d:\\sites\\dev.nyphp.org" You can also define other server specific configurations there as well as PHP ini values. In the hosts file (C:\\WINNT\\system32\\drivers\\etc\\hosts) I add the virtual domain to resolve to my localhost: 127.0.0.1 dev.nyphp.org The (IE) browsers needs to be closed before any changes in the hosts file will kick in. (This can also be done on a Linux box) Hope this helps. Best, Daniel Kushner Vice President, New York PHP http://nyphp.org/ daniel at nyphp.org > -----Original Message----- > From: Jon Baer [mailto:jonbaer at jonbaer.net] > Sent: Thursday, May 22, 2003 9:39 AM > To: NYPHP Talk > Subject: Re: [nycphp-talk] Need virtual host Apache help ... > > > Much of the code reflects on relative directories based on the > root path ... > (images, styles, etc) ... > > ----- Original Message ----- > From: "John Lacey" > To: "NYPHP Talk" > Sent: Thursday, May 22, 2003 6:33 AM > Subject: Re: [nycphp-talk] Need virtual host Apache help ... > > > > > > why not just have each site in a separate directory under DocumentRoot? > > > > e.g. if the document root is /var/www/html, then site directories under > > that path, "site1", "site2", etc > > > > so the only thing you'd have to do is http://locahost/site1 > > and so forth... or just localhost/site1 > > > > > > > > > > > > ----- Original Message ----- > > From: "Jon Baer" > > To: "NYPHP Talk" > > Sent: Thursday, May 22, 2003 7:18 AM > > Subject: [nycphp-talk] Need virtual host Apache help ... > > > > > > Im trying to setup my laptop to host 5 different PHP-based sites for dev > > purposes and getting lost on how to setup Virtual hosting so that it's > > port > > based w/Apache (I can't remember if it could do it or not or if it was > > another webserver), ie. port 81 -> site 1, port 82 -> site 2, etc. > > > > > > ? > > > > > > Any ideas? I just would like to not edit httpd.conf every time. > > > > - Jon > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --- Unsubscribe at http://nyphp.org/list/ --- > From chendry at nyc.rr.com Thu May 22 09:50:13 2003 From: chendry at nyc.rr.com (Christopher Hendry) Date: Thu, 22 May 2003 09:50:13 -0400 Subject: [nycphp-talk] Need virtual host Apache help ... In-Reply-To: <200305221319.h4MDIdX9068492@parsec.nyphp.org> Message-ID: Does it need to be port based? I don't know how to set that up, but I use Apache for plenty of different dev sites on my computers (windows): Be sure to uncomment this line in httpd.conf: NameVirtualHost * Then minimum add this per site: DocumentRoot "c:\\foobar" ServerName foobar Also edit your windows/system32/drivers/etc/hosts file to reflect the new sites, ie: 127.0.0.1 foobar The above works for me. :) -> -----Original Message----- -> From: Jon Baer [mailto:jonbaer at jonbaer.net] -> Sent: Thursday, May 22, 2003 9:19 AM -> To: NYPHP Talk -> Subject: [nycphp-talk] Need virtual host Apache help ... -> -> -> Im trying to setup my laptop to host 5 different PHP-based sites for dev -> purposes and getting lost on how to setup Virtual hosting so -> that it's port -> based w/Apache (I can't remember if it could do it or not or if it was -> another webserver), ie. port 81 -> site 1, port 82 -> site 2, etc. -> -> -> ? -> -> -> Any ideas? I just would like to not edit httpd.conf every time. -> -> - Jon -> -> -> -> --- Unsubscribe at http://nyphp.org/list/ --- -> -> -> From thegeek at thecolorgeek.com Thu May 22 09:53:58 2003 From: thegeek at thecolorgeek.com (The Geek) Date: Thu, 22 May 2003 09:53:58 -0400 Subject: [nycphp-talk] Need virtual host Apache help ... In-Reply-To: <200305221339.h4MDcoZn070347@parsec.nyphp.org> Message-ID: Even if you do get virtual host working I believe you sill still have problems due to DNS issues. So even if virtual host is for www.xxxx.com is working your DNS will need to point to your laptop as the host of that domain. Otherwise how else will the domain be resolved. Do you need to have all sites active at once? On Thursday, May 22, 2003, at 09:38 AM, Jon Baer wrote: > Much of the code reflects on relative directories based on the root > path ... > (images, styles, etc) ... > > ----- Original Message ----- > From: "John Lacey" > To: "NYPHP Talk" > Sent: Thursday, May 22, 2003 6:33 AM > Subject: Re: [nycphp-talk] Need virtual host Apache help ... > > >> >> why not just have each site in a separate directory under >> DocumentRoot? >> >> e.g. if the document root is /var/www/html, then site directories >> under >> that path, "site1", "site2", etc >> >> so the only thing you'd have to do is http://locahost/site1 >> and so forth... or just localhost/site1 >> >> >> >> >> >> ----- Original Message ----- >> From: "Jon Baer" >> To: "NYPHP Talk" >> Sent: Thursday, May 22, 2003 7:18 AM >> Subject: [nycphp-talk] Need virtual host Apache help ... >> >> >> Im trying to setup my laptop to host 5 different PHP-based sites for >> dev >> purposes and getting lost on how to setup Virtual hosting so that it's >> port >> based w/Apache (I can't remember if it could do it or not or if it was >> another webserver), ie. port 81 -> site 1, port 82 -> site 2, etc. >> >> >> ? >> >> >> Any ideas? I just would like to not edit httpd.conf every time. >> >> - Jon >> >> >> >> >> >> >> >> >> >> >> >> >> > > > > --- Unsubscribe at http://nyphp.org/list/ --- > From max at idsociety.com Thu May 22 09:58:41 2003 From: max at idsociety.com (max goldberg) Date: Thu, 22 May 2003 09:58:41 -0400 Subject: [nycphp-talk] Need virtual host Apache help ... In-Reply-To: <200305221318.h4MDIdV3068492@parsec.nyphp.org> References: <200305221318.h4MDIdV3068492@parsec.nyphp.org> Message-ID: <3ECCD791.8000203@idsociety.com> To specify a port to listen to multiple ports, you have to do two things if I am remembering correctly. The first is find the line that says 'Listen 80' and change it to 'Listen 80 81 82' etc. Then on each tag you can do etc. Another solution would be to follow John Lacey's suggestion but use host based vhosts. You could add a line in your hosts file for each site, and then just use http://site1/ and http://site2/ The hosts file should be in /etc/hosts or in your windows directory. If you wanted to do it this way you would add lines like this: 127.0.0.1 site1 127.0.0.1 site2 You can name them whatever you like (as long as they are legitimate host names) -Max Jon Baer wrote: > Im trying to setup my laptop to host 5 different PHP-based sites for dev > purposes and getting lost on how to setup Virtual hosting so that it's port > based w/Apache (I can't remember if it could do it or not or if it was > another webserver), ie. port 81 -> site 1, port 82 -> site 2, etc. > > > ? > > > Any ideas? I just would like to not edit httpd.conf every time. > > - Jon > > > > --- Unsubscribe at http://nyphp.org/list/ --- > > From jonbaer at jonbaer.net Thu May 22 10:09:04 2003 From: jonbaer at jonbaer.net (Jon Baer) Date: Thu, 22 May 2003 07:09:04 -0700 Subject: [nycphp-talk] Need virtual host Apache help ... References: <200305221347.h4MDl8Vb071232@parsec.nyphp.org> Message-ID: <002e01c3206b$b4322300$6400a8c0@Townsend> Ahhhh ... forgot about the host file ... much thanks! :-) I just mapped a bunch of single names to localhost: 127.0.0.1 site1 127.0.0.1 site2 127.0.0.1 site3 And the virtual hosting works like a charm ... > > In the hosts file (C:\\WINNT\\system32\\drivers\\etc\\hosts) I add the virtual > domain to resolve to my localhost: > 127.0.0.1 dev.nyphp.org > From jonbaer at jonbaer.net Thu May 22 10:11:52 2003 From: jonbaer at jonbaer.net (Jon Baer) Date: Thu, 22 May 2003 07:11:52 -0700 Subject: [nycphp-talk] Need virtual host Apache help ... References: <200305221354.h4MDs2Vb072855@parsec.nyphp.org> Message-ID: <003201c3206c$184f1aa0$6400a8c0@Townsend> True ... with a full domain it won't work and it's just me @ the moment so the names along the network don't really matter, it's just more convienent to have them up @ once. ----- Original Message ----- From: "The Geek" To: "NYPHP Talk" Sent: Thursday, May 22, 2003 6:54 AM Subject: Re: [nycphp-talk] Need virtual host Apache help ... > Even if you do get virtual host working I believe you sill still have > problems due to DNS issues. So even if virtual host is for > www.xxxx.com is working your DNS will need to point to your laptop as > the host of that domain. Otherwise how else will the domain be > resolved. Do you need to have all sites active at once? > > From jonbaer at jonbaer.net Thu May 22 10:15:55 2003 From: jonbaer at jonbaer.net (Jon Baer) Date: Thu, 22 May 2003 07:15:55 -0700 Subject: [nycphp-talk] Need virtual host Apache help ... References: <200305221359.h4MDwjVb073661@parsec.nyphp.org> Message-ID: <003e01c3206c$a9986700$6400a8c0@Townsend> Ahh .... Thank you. I just realized they all won't map out to ports either way because "localhost" can only have a single DocumentRoot. The named hosting works fine. - Jon ----- Original Message ----- From: "max goldberg" To: "NYPHP Talk" Sent: Thursday, May 22, 2003 6:58 AM Subject: Re: [nycphp-talk] Need virtual host Apache help ... > To specify a port to listen to multiple ports, you have to do two things > if I am remembering correctly. The first is find the line that says > 'Listen 80' and change it to 'Listen 80 81 82' etc. Then on each > tag you can do etc. Another solution From emm at scriptdigital.com Thu May 22 10:35:26 2003 From: emm at scriptdigital.com (Emmanuel. M. Decarie) Date: Thu, 22 May 2003 10:35:26 -0400 Subject: Adding
and

to a text Message-ID: Hello, I have this function (see below) that add

to create paragraph to text that are coming either from a database (where its unformatted), or from a