Jump to content

How to implement JavaScript into my HTML form

Recommended Posts

Hello, I have recently been working on a HTML form to submit new results into a search engine. However I have ran into a problem that I cant seem to get past. I have one page where the info from the form can be properly submitted, however it requires a password to get into. (its the admin panel) located at index.php?a=admin However when a user tries to insert a new site to the form the just are denied access because they cant log into the admin panel, even though the form itself is not actually in the admin panel...


The HTML form looks like this and is located in a page called /AddSite.html however its trying to submit the info to /index.php?a=admin how can I use JavaScript to possibly bypass needing the password? and not redirecting to the admin panel when you click submit?


(Also, not as important as the above issue... but as you can see I tried to add a capatcha, but I cant get it to be required, users can press submit without even using the capatcha... if anyone could tell me what I did wrong that would be helpful )


my current code:

<form action="/index.php?a=admin" method="post"><div class="">	Site Title: <input type="text" name="addtitle" value="" required/><br />	Site URL: <input type="url" name="addurl" value="http://" required/><br />	Site Description: <br /><textarea lass="ads" name="adddesc" required></textarea><div align="center" class="g-recaptcha" data-sitekey="6LfDoAYTAAAAAOUmPcjfwv3I84xYqFBV5tyQMPJu"></div></div><br /><input type="submit" value="Add new result"/></form>

Any help works!!! :D


Link to post
Share on other sites

how can I use JavaScript to possibly bypass needing the password?

You can't. It sounds like you need to find the code that processes that form and copy the relevant parts to a new file that doesn't require someone to be signed in, then submit to that file. The captcha handling is part of the form processing code, it will need to check for and validate the captcha response.
Link to post
Share on other sites
This topic is now closed to further replies.
  • Create New...