To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.off-topic.geekOpen lugnet.off-topic.geek in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Off-Topic / Geek / 1480
  CGI question
 
I have the following perl script that I inherited in a program I am supposed to fix, the perl I understand, but I'm not really up on Forms.. (URL) you enter a login and then hit the submit button and things work well. If you hit submit with no text (...) (24 years ago, 6-Apr-00, to lugnet.off-topic.geek)
 
  Re: CGI question
 
(...) well, not sure how you can do it with java, but you shouldn't rely on java for form validation anyhow - it's unreliable, and easily overcome. If you had to, you could add another text field, in which case enter won't submit the form, and you'd (...) (24 years ago, 6-Apr-00, to lugnet.off-topic.geek)  
 
  Re: CGI question
 
(...) I agree that JavaScript really isn't the best way to validate this. As long as you're doing CGI, why not do a POST to the same script, evaluate, the answers, and complain if they're not any good? With regards to the multiple fields, I think (...) (24 years ago, 7-Apr-00, to lugnet.off-topic.geek)  
 
  Re: CGI question
 
(...) Reject it on the server end, and serve the form again with an appropriate error message. If you were using the CGI module (1), return an error if (for example) $cgi->param("Vlogin") returns a blank string. Oh, yeah. And don't rely on (...) (24 years ago, 7-Apr-00, to lugnet.off-topic.geek)  
 
  Re: CGI question
 
(...) nod, exactly. (...) you're very correct, I'm sorry. I don't have much experience with either java or JS, so the two unknowns are very similar. I do know that java is a respectable language though :) Dan (24 years ago, 7-Apr-00, to lugnet.off-topic.geek)
 
  Re: CGI question
 
(...) Javascript story: I just came across someone the other day who was mad because he had to "covert all his equal signs into double-equals so they'd work with netscape". Hrm. Not exactly confidence-inspiring, that. (24 years ago, 7-Apr-00, to lugnet.off-topic.geek)
 
  Re: CGI question
 
(...) I had a C programming class in college with this woman who was upset that "MOVE TO" and "MULTIPLY BY" weren't part of the C language. The moment she said that, an eerie silence fell over the classroom... The punchline is that two years later, (...) (24 years ago, 7-Apr-00, to lugnet.off-topic.geek)  
 
  Re: CGI question
 
(...) Thanks for all the responses from everybody, the final, simplest solution was to add the second text box. As for the javascript, not my choice. This is an internal prog anyways that runs on local, generic login workstations so browser options (...) (24 years ago, 7-Apr-00, to lugnet.off-topic.geek)
 
  Re: CGI question
 
(...) Scary bit of COBOL code one of my co-workers ran across today (he was given the code because it's the closest thing to documentation available for a file he has to deal with): IF FLD_XYZ_YR < 29 THEN FLD_XYZ_YR4 = 2000 + FLD_XYZ_YR4 ELSE (...) (24 years ago, 8-Apr-00, to lugnet.off-topic.geek)
 
  Re: CGI question
 
(...) Sure. That's a pretty typical Y2K fix. And it's basically what you do as a human when looking at a two-digit year. (If I tell you that the expiration date on my driver's license is 12-30-02, you assume 2002. If I tell you it's 12-30-98, you (...) (24 years ago, 8-Apr-00, to lugnet.off-topic.geek)  
 
  Re: CGI question
 
(...) Yeah, the windowing/epoching/whatevering isn't a big deal. The thing is, they *hardcoded* the 29. They didn't even make it a constant, defined at the top of the code (or in a copybook). So in some number of years, someone is going to have to (...) (24 years ago, 10-Apr-00, to lugnet.off-topic.geek)  
 
  Re: CGI question
 
(...) Oh, but no one will *possibly* be using the same code in 29 years. We don't need to worry about that. *much laughter* The unix epoch rollover is gonna be another one.... (24 years ago, 10-Apr-00, to lugnet.off-topic.geek)  
 
  Re: CGI question
 
(...) at least at the unix epoch, most of the code won't have to be changed - the assumption here is that we won't be using 32-bit boxes anymore, so a long int will be a lot longer :) :) Dan (24 years ago, 10-Apr-00, to lugnet.off-topic.geek)
 
  Re: CGI question
 
(...) In core, yah, but wot about in packed data structs on tapes? --Todd (24 years ago, 10-Apr-00, to lugnet.off-topic.geek)

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR