Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: CGI form validation on submit

by benn (Vicar)
on Aug 13, 2003 at 13:26 UTC ( #283540=note: print w/replies, xml ) Need Help??

in reply to CGI form validation on submit

I think you need to be a little clearer on the whole client-server communication thing. Basically, the deal is something like this.

  • Your browser requests something (say, a CGI script) from a server.
  • The server runs the requested script, and sends your browser the output - usually, a bunch of HTML / images etc. - stuff your browser knows how to render.
  • Included in that HTML may be Javascript (or JScript or similar) - something too that most browsers know how to cope with. Note that this script is generally not allowed to interact with any part of the client machine *other* than the browser.
  • If the HTML contains a form, the values entered are sent back to the server as a new request when the form is submitted. The server can examine this request and take appropriate action
Hopefully you can see from this model that your CGI script runs *on the server*, not the client. The client simply receives the output, renders it, optionally uses client-side-scipting to process it (document.write, onSubmit etc.) and sends it back.

As an aside, you should never *rely* on client-side scripting to validate a form. Having it as an extra check before submission is fine, but the server script should do this also to cater for those who don't run JS / hand craft forms / hack your HTML. Many many JS shopping cart systems have learnt this to their cost :)

Hope this helps, Ben.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://283540]
[marto]: they still don't know there was a problem, nobody told them! :P
[Corion]: marto: Ow! I would assume there is a cron job monitoring the free disk space and automatically opening a ticket at 90%, 95% and 100% usage...
[Corion]: Even we had automatic emails back when we maintained the machine ourselves...
[marto]: Corion you under estimate how lazy these admins are :P
[Discipulus]: we too; using opsview alarms
[marto]: the key word: outsourcing ;)
[Corion]: marto: Yeah, feels like that ;) You could set up the cronjob that auto-creates tickets :-))
[marto]: the ticketing system does not accept calls via email, nor has it a working API. It's tied into Active Directory for authentication and the Solaris boxes aren't on that domain
[Corion]: The one thing I haven't figured out a solution to is how to get an edge-trigger instead of sending an email every 5 minutes if the usage is above 90%. I want one mail when it goes over 90% but no more emails as long as it stays between 90% and 95%.
[Corion]: marto: Clever! ;)

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2017-01-24 10:08 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (203 votes). Check out past polls.