Hi I have a form that is submitted after a JS file has completed validation checks
in the form the main line is
<form style='background-color:ccc' id='form1' name='form1' method='post' action='dual_process.php' > ;
The code for submitting the form is (This calls a JS script)
<input class="buttn" type="button" name="su" id="su" value="Confirm and Submit Details" <? echo "onclick='$validate;' " ?> />
After the JS script have validated the form the following line is executed
if (!msg) {
var frm = document.getElementById("form1");
frm.submit() ;
This all worked fine until I moved to a new web host now when I submit the form I get the following error
Forbidden
You do not have permission to access this document.
Could anyone suggest what I am doing wrong OR if there is something that the new host does not like (Old host Simple Web Hosting New one IDAQ )
Thanks I advance for any help
Mick
Hy,
Try use double quotes to the form attributes: action="dual_process.php", and the others.
The most common reason for the 403 error is that directory browsing is forbidden for the Web site.
Check if you can directly access the "dual_process.php" page, and maybe a better response can give you the administrator of that server.
Related
I have a html page in which I have complex form. For sending the data to my email I use mailer from the site at which I created my form. After completing and sending the data I see an error:
"Not Found
The requested URL was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."
But after sending the data I'd like to go to another page. I know how to move to another page when I create my own php file (header("Location: page.html")). Do you know how to implement it, when I don't have an access to php file?
Part of the code looks like this:
<FORM name="mlwebform" onSubmit="return checkForm(this)" method="POST" action="http://www.mouselabweb.org/mlwebmailer.php"><INPUT type=hidden name="procdata" value="">
I tried to add a hyperlink in submit button, but it doesn't work.
<input style="height:50px; width: 100px; font-size:12pt;" type="submit" value="Dalej" onClick=timefunction('submit','submit','submit')>
I have a form with one text input field:
index.html
<form method="post" action="comment.php">
<a href="javascript:void(0)">
<div class="avatar" style="background:url('img/user4561.jpg') center/cover"></div>
</a>
<input name="comm" type="text"/>
<input type="submit" value="submit"/>
</form>
And here is comment.php in the same directory
<?php
echo $_POST["comm"];
?>
Now the most incredible event. The form data does not get submitted! I get an error:
Notice: Undefined index: comm in 192.168.0.1/comment.php on line 2
I changed comment.php like this:
<?php
if(isset($_POST["comm"])) {
echo "It is set";
} else {
echo "It is not set";
}
?>
and I get:
It is not set
So, I copied the HTML code of the form into another blank webpage. I also changed the action attribute of the form to "192.168.0.1/comment.php". Now I get
It is set
I also tried using GET instead of POST, but I am again in the same conflict.
EDIT: I removed all other files and code, except for the form and its script. The problem persists. You can now read and modify the source code. Go to files.000webhost.com. Use chatstack as the website name and 6RxOkuJ1CIkbNqxKUMGr as the password.
EDIT: I modified the code for the form above to exactly match that in the above given link. I noticed that removing the link from inside the form solves the problem. I have already done this, but this is so weird. According to this post it is totally fine to have other elements inside a <form> element. There are also other parts of my website where I have <div> elements inside a form element and the form is working fine.
What is this? Is it the server or something else?
I am pretty sure the information provided here is not enough. Feel free to ask for any additional information. There is just too much information to write in a post, and I don't know which part of it is relevant.
Open your dev-console in browser.
Go to the network tab. Now you fill in your form and submit. After your comment.php is loaded, you check for the very first row in the network tab (should be the comment.php html document).
When you click on that request it should display you, whether the request was GET or POST and also what data were sent to this document.
You can also try at comment.php var_dump($_REQUEST); to see what data were sent and how it can be accessed.
By this you can see if server all over receives any data. If yes, then you go for an other server like apache2 for testing purpose to look if bug is fixed.
That's how I would to that, but I suspect that by editing your code for the public, you accidentally withheld some information that would solve this simple problem.
It's very unlikely that web-servers like WAMP had passed the testing environment before publishing a new version allthough no data could be procesed by server
Running PhpStorm 2016.3.2, Ubuntu 16.04 with PHP7 and LAMP stack installed and tested.
I seem to have an error in PhpStorm (or somewhere else down the line), whereby clicking 'Submit' in an html form will result in a '404 not found' error, even if the form action path is valid.
I built a very simple application to demonstrate this, however it should be noted that this error has occurred every time I use an html form in PhpStorm so far, even example applications that I know have no errors in code.
The code for my form is as follows
var $form = <<< FORM
<form action='?' method="post">
<p>Enter your number </p>
<input type="text" name="formInput"
maxlength="10">
<input type="submit" name="formSubmit"
value="Submit">
</form>
FORM;
Once 'Submit' is clicked, the 404 error happens. I have tried multiple permeations of form action such as "" and even a variable set to APP_ROOT_PATH, and then just manually typing out the correct path (even a different php file) also with single and double quotes.
The reason I believe these paths to be valid is that simply by clicking in the address window from the 404 error page and hitting enter (thereby going to the path it was trying to get to) the form loads again fine.
I can't get my head around why this might be, if it was a permissions or path error surely I would not be able to access the path from the browser either?
EDIT: Looking at the source code reveals that the action is what I intended it to be. Even copying the url from there and pasting it into the browser will open the correct form. It is just when clicking 'submit' that the 404 error happens. The correct url is also in the address bar on the 404 page.
EDIT 2 : For note, the '?' action in the above code is irrelevant to the issue as the error occurs no matter what correct link I put there, be it "" or the full path.
I've got an annoying problem.
My website https://exmple.com has a contact form.
The logic is placed in the same directory as the send.php file.
In general, an email form works, however, sometimes I get "Server not found" error (1/10). What may be to resign for this weird behaviour?
The form looks like:
<form method="post" action="send.php">
...
</form>
I've already tried:
action = "send.php"
action = "/send.php"
action = "https://exmple.com/send.php"
Each try gives the same result.
This is a SSL connection, index.php file is in the same directory as send.php.
Thanks for your help!
I keep getting a 404 error when trying to submit this form. In my website directory i have a folder called mobile, which inside has forms.php and process.php.
The form is located on this page
http://localhost/mobile/forms.php?ft=0&id=2
here is the form
<form action='/mobile/process.php?o=9&ft=0' method='POST'>
//details
</form>
When i try to submit i get a 404 error, when it should go to http://localhost/mobile/process.php?o=9&ft=0? How do i fix this?
By looking at the URL's what I conclude is that both the php files are on the same page so change your action url from
<form action='/mobile/process.php?o=9&ft=0' method='POST'>
To
<form action='process.php?o=9&ft=0' method='POST'>
A forward slash before the mobile means it selects the folder from the root.. So you probably don't need that here.
Last but not the least, be sure the file names are proper, and also make sure the cases are same, because the file names are case sensitive.
Note: You may also get 404 error if you are using header('Location:
xyz.php'); on the form processing page, for redirecting the user to
some page after the form processes and you may encounter 404 because
the page on which the script has redirected doesn't exist. so make sure
that the URL is correct if you are using header()
Try changing
<form action='/mobile/process.php?o=9&ft=0' method='POST'>
to
<form action='process.php?o=9&ft=0' method='POST'>
Since they are in the same directory.
You can't pass a GET parameter in the form action.
In order to pass parameters, you will have to create a hidden input like :
<input type="hidden" name="o">