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?

Recommended Answers

All 9 Replies

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.

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>

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.

i got this file:///C:/cgi-bin/script.cgi?user=-1 and This webpage is not found

is there a way i check without doing action?

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 ?

You have to follow the flow of your program to see where the scripts are needed.

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

The path of script.cgi may be not correct.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.