http://www.geocities.com/geniusdoms/TheGenius
[EMAIL PROTECTED] wrote: beginners-cgi Digest 26 Nov 2003 17:53:12 -0000 Issue 497 Topics (messages 10148 through 10155): Re: extracting email addys. 10148 by: John Horner Storing Form Data without submitting it. 10149 by: Marcus Willemsen 10151 by: Wiggins d Anconia 10153 by: Andrew Gaffney 10154 by: Bob Showalter Redirecting to a different url with cgi 10150 by: Ash Singh 10152 by: Wiggins d Anconia CGI Redirection 10155 by: Ash Singh Administrivia: To subscribe to the digest, e-mail: To unsubscribe from the digest, e-mail: To post to the list, e-mail: ---------------------------------------------------------------------- > ATTACHMENT part 2 message/rfc822 Date: Tue, 25 Nov 2003 07:32:59 +1100 To: "Silent Zed" , From: John Horner Subject: RE: extracting email addys. Here's my position on this. Randal is a very respected member of the Perl community, but in this case I think his response was a bit extreme, especially as it didn't spell out *why* he was so annoyed. First of all, what's "The FAQ"? Perl, and the various version of Perl, have a lot of different FAQs. In this case, Randal was referring to the general Perl FAQ, sub-section "How do I check a valid mail address?" http://www.perldoc.com/perl5.8.0/pod/perlfaq9.html which is, somewhat confusingly, not in the regex FAQ, is about checking the *validity* of addresses, and starts with a blunt statement that it's impossible. The whole thing is pretty much in the context of "I've been given an address -- how do I tell if it's valid?", and it does indeed address serious issues, which not many people know about, because email addresses can take a number of different and obscure forms and still be valid. However, Sara didn't want to check the validity of email addresses. All the addresses she wanted to fix were valid, known to her, and presumably in one of the more normal forms, as in [EMAIL PROTECTED] -- if Sara had said "I want to match email addresses in the form '[EMAIL PROTECTED]' and replace the '@' symbol", then I submit that the solutions would have been just fine. Randal's right, people should read the FAQ. Everyone go and read it right now. But the FAQ entry he mentioned doesn't directly address the problem at hand, and the solution promised would almost certainly have sufficed. I wish someone had answered more like this: -------- The following regex [regex] will find most normal '[EMAIL PROTECTED]' email addresses -- but please, if you haven't, read the FAQ, [address] because this is *not* a regex that will match every valid email address. ---------- jh > ATTACHMENT part 3 message/rfc822 Subject: Storing Form Data without submitting it. Date: Wed, 26 Nov 2003 15:14:53 +0100 From: "Marcus Willemsen" To: Hi everybody, I' m not sure this is the right list to ask this kind of question but I don't know where else. We are using html forms to insert and update news articles (texts) stored in a mysql database. Ever so often one of our journalists forgets to press the submit button or his computer crashes and everything written so far is lost. Is it possible to built something like an "autosave" function that submits the form data automatically every couple of minutes and updates the database entry? Any hint's where to look up these kind of things? Thanks Marcus Marcus Willemsen Online Redaktion Juve Verlag GmbH Sachsenring. 6 50677 Köln ++49 (0)221 91 38 80 16 www.juve.de Geschäftsführer: Dr. Astrid Gerber, Dr. Aled W. Griffiths Sitz der Gesellschaft: Köln Amtsgericht Köln HRB 29593, Gerichtsstand: Köln Bankverbindung: Stadtsparkasse Köln, BLZ 37050198, Kto-Nr. 4772281 > ATTACHMENT part 4 message/rfc822 Date: Wed, 26 Nov 2003 07:28:27 -0700 From: "Wiggins d Anconia" To: "Marcus Willemsen" , Subject: Re: Storing Form Data without submitting it. > > Hi everybody, > > I' m not sure this is the right list to ask this kind of question but I don't know where else. We are using html forms to insert and update news articles (texts) stored in a mysql database. Ever so often one of our journalists forgets to press the submit button or his computer crashes and everything written so far is lost. Is it possible to built something like an "autosave" function that submits the form data automatically every couple of minutes and updates the database entry? > Any hint's where to look up these kind of things? > It is sort of the right place :-)... Because this is a client side action (at least what triggers it) you are probably going to want to look to javascript. I believe you can setup timers in javascript that will trigger actions, that will be the hard part, the easy part is the action that is triggered is just a standard submit of the form, then the server side script would just store the info and reprint the form with the fields filled in the same, which I am assuming you can do. As a suggestion I would add (at least) two features, 1) a "clock" that displays a form element that is continually updated with the number of seconds left until the next save (as you will have to reload the page and there is nothing your journalist will hate more than being in the middle of a great thought and having his page reload on him) which brings me to... 2) have a "reset" clock button, so that if the user *is* paying attention they can reset it so that the refresh doesn't happen... Which brings me to "not refreshing" since I know you will ask. Presumably the javascript could build a request and submit it in a separate object (possibly in a popup window) which would provide all of the data from the form, the response would be that the form data has been saved and then wait a second or two and close the window automatically, then theoretically you wouldn't have to refresh the page. But now we are getting much more into the Javascript land where I am not nearly as strong..... Obviously you should also store some sort of status so that a half story isn't posted online just because it is saved in the database... Now that I have thought through it more this is an interesting idea and I might just have to play around with it :-)... http://danconia.org > ATTACHMENT part 5 message/rfc822 Date: Wed, 26 Nov 2003 08:30:53 -0600 From: Andrew Gaffney To: [EMAIL PROTECTED] Subject: Re: Storing Form Data without submitting it. Wiggins d Anconia wrote: > >>Hi everybody, >> >>I' m not sure this is the right list to ask this kind of question but > > I don't know where else. We are using html forms to insert and update > news articles (texts) stored in a mysql database. Ever so often one of > our journalists forgets to press the submit button or his computer > crashes and everything written so far is lost. Is it possible to built > something like an "autosave" function that submits the form data > automatically every couple of minutes and updates the database entry? > >> Any hint's where to look up these kind of things? >> > > > It is sort of the right place :-)... Because this is a client side > action (at least what triggers it) you are probably going to want to > look to javascript. I believe you can setup timers in javascript that > will trigger actions, that will be the hard part, the easy part is the > action that is triggered is just a standard submit of the form, then the > server side script would just store the info and reprint the form with > the fields filled in the same, which I am assuming you can do. I believe there is an HTTP status code that tells the browser that the form was successfully submitted, but not to go anywhere. I don't know what it is off the top of my head, but I think it would work in this case. -- Andrew Gaffney > ATTACHMENT part 6 message/rfc822 From: Bob Showalter To: 'Andrew Gaffney' , [EMAIL PROTECTED] Subject: RE: Storing Form Data without submitting it. Date: Wed, 26 Nov 2003 10:01:29 -0500 Andrew Gaffney wrote: > > I believe there is an HTTP status code that tells the browser that > the form was successfully submitted, but not to go anywhere. I don't > know what it is off the top of my head, but I think it would work in > this case. Would that be 204 No Content? http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5 I've never used that before. I wonder if the various browsers behave properly when they get that? > ATTACHMENT part 7 message/rfc822 From: Ash Singh To: [EMAIL PROTECTED] Subject: Redirecting to a different url with cgi Date: Wed, 26 Nov 2003 16:19:39 +0200 v\:* {behavior:url(#default#VML);}o\:* {behavior:url(#default#VML);}w\:* {behavior:url(#default#VML);}.shape {behavior:url(#default#VML);} What is the perl code to redirect to a new url, in cgi. All I need is to execute a perl script and when its done to redirect the clients browser to a new location. I am running Windows 2000 and IIS. Developer eMessageX.com Tel: +27 (0)11 789 1808 Fax: +27 (0)11 326 0152 Cell: +27 (0)72 203 5989 Email:[EMAIL PROTECTED] > ATTACHMENT part 8 message/rfc822 Date: Wed, 26 Nov 2003 07:30:35 -0700 From: "Wiggins d Anconia" To: Ash Singh , [EMAIL PROTECTED] Subject: Re: Redirecting to a different url with cgi > > What is the perl code to redirect to a new url, in cgi. All I need is to > execute a perl script and when its done to redirect the clients browser to a > new location. > I am running Windows 2000 and IIS. > > If you are using CGI.pm then it has a 'redirect' method: http://search.cpan.org/~lds/CGI.pm-3.00/CGI.pm#GENERATING_A_REDIRECTION_HEADER If you are not, then you just need to send a properly formed "location" header: print "Location: http://danconia.org\n\n"; http://danconia.org > ATTACHMENT part 9 message/rfc822 From: Ash Singh To: [EMAIL PROTECTED] Subject: CGI Redirection Date: Wed, 26 Nov 2003 17:07:48 +0200 v\:* {behavior:url(#default#VML);}o\:* {behavior:url(#default#VML);}w\:* {behavior:url(#default#VML);}.shape {behavior:url(#default#VML);} print $query->redirect('http://www.google.com '); Thanks a lot for your assistance, I need to redirect and the browser automatically go to that location, without any user intervention. Is there any way to do this. Developer eMessageX.com Tel: +27 (0)11 789 1808 Fax: +27 (0)11 326 0152 Cell: +27 (0)72 203 5989 Email:[EMAIL PROTECTED] --------------------------------- Download Yahoo! Messenger now for a chance to WIN Robbie Williams "Live At Knebworth DVD"