0

check whether the answer is correct in sumbit box. I am stuck action = some website. It say sever 505 is not found. If user ebter a negative number how can I block it?

5
Contributors
9
Replies
29
Views
3 Years
Discussion Span
Last Post by safeer008
0

A 505 server error is caused when the server refuses the HTTP version your browser is supporting. Is that the error you are getting? You also mentioned 'not found' which is a 404.
And a user enters a negative where? In a input field? Use javascript to validate the value before sending if that is going to be a problem.

0
This is what i have
<form name="feedback" action="script.cgi" method="get" onSubmit="return checkform(this)">

  Amount: <input type="text" name="user">

  <input type="submit" value="Submit">

 </form>

<script>
function checkform(x)

{

    if (x < 0)

    {

        // something is wrong

        alert('There is a problem! Cannot be negative number.');

        return false;

    }

    // If the script gets this far through all of your fields

    // without problems, it's ok and you can submit the form



    return true;

}

</script>
0

the form declaration above
Should be something like
<form name="feedback" action="\cgi-bin\script.cgi" method="get" onSubmit='return checkform("user")'>
an accurate href is required, cgi scripts do not reside in the current folder
and do not work in the current folder
the usual required location is cgi-bin off the root

check your configuration to find the correct location for your cgi scripts
put scripts there, and refer to them there

the generic validation script requires the field to check as a parameter, at the OP post 'this' refers to the formname 'feedback' which will always be invalid. Checking the entry field 'name' is required.

Edited by almostbob

0

check your configuration to find the correct location for your cgi scripts
put scripts there, and refer to them there

how can i find it ?

0

there is noc:\\
href must be a valid uri, c: is not valid
your development system MUST be properly set up
valid examples choices are
localhost://cgi-bin-script/script.cgi
/cgi-bin/script.cgi
the cgi-bin folder must be in the html_root of the site, not the root of the drive
read the install/setup screens and setup your wamp stack accordingly
you cannot run cgi just in the browser
you must be running some local server
if you have not installed a local server, install one
or upload the script and test programs to a server and test them there

Edited by almostbob

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.