I am using a form action in Iframe page.(if1.php). I want to navigate to(mail.php) page which is a regular php page. (ie iframe page to another page). The code in iframe page(if1.php) for navigation is shown below..
<form target="myframe" action="mail.php" method="post">
<!-- code here -->
</form>
But i am getting the following error when i press a submit button in iframe page(if1.php). Why is this error happening? The browser that I'm using is chrome.
Not Acceptable An appropriate representation of the requested resource
/radical/mail.php could not be found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
First THANKS for all those who tried helping me in finding the solution ...
The issue was only a "server specific" and not "code specific"...The Server team was able to rectify the issue with some minor changes in server settings and every thing works fine now...
Again many Thanks
Regards,
Related
upon inspecting my console I get the error like below:
Uncaught SyntaxError: Invalid or unexpected token.
I've traced back this line to my script in the footer portion of my folder and the line goes
$('<?php echo $active_accordion_id ?>').addClass('show');
My noob question is this, why is this an error? This prints out what is needed for me to toggle the active accordion upon visiting the respective pages, according to the ID passed in each respective controller function. Since it is working as intended I am confused as to why it is an error.
Should I be bothered to change it since it is working as intended but it does bother me when I go into inspect mode. I would think that the best practice is to deal with this even if there might be no ramification from it (I hope not!). Shed some light if it would.
Thank you for reading my question!
I think it's not good to call and use PHP functions directly in the script.
You can create a hidden input tag for your element what you want to add some class in your view
your view:
<input type="hidden" id="element_id" value="<?php echo $active_accordion_id; ?>">
your javascript code
var id = $("#element_id").val();
$('#'+id).addClass('show');
I noticed why the error appears. All pages that loads the script doesn't necessarily have the accordion ID defined, so the error shows on those pages alone in console. So all I did is to assign null values for the active_accordion_id on those pages to not have that error appear.
I have created an HTML form which calls a php page (function) when submitted:
<form name="business" action="create-account-and-profile.php" method="POST">
<table>
<tbody>
....
I have made sure that create-account-and-profile.php is in the same directory. The php file is a form data processor which starts as follows:
require_once (ABSPATH . "wp-admin/includes/user.php");
if (isset($_POST['personal_email_id'])) {
$email_id = $_POST['personal_email_id'];
.......
For some reason unknown to me, when the form is submitted, a “404 not found” error was generated.
This is on a WORDPRESS platform, hosted in the Openshift environment.
I searched and reviewed relevant posts on this and WORDPRESS forums.
Any advice will be greatly appreciated.
JZ
You must check that create-account-and-profile.php is in the same relative path of HTML page containing the form. e.g.:
if you form is in
example.com/subdir/form.html
the php file must be in
example.com/subdir/create-account-and-profile.php
Have you tried opening the create-account-and-profile.php page simply by typing the URL into your browser? If you can't reach the page that way the problem is probably not connected to the POST request.
I think that not possible with wordpress since wordpress will route all http request to wp-content using internal functions of via httacess.
I am using iFrame mail-data.php embedded in payin.php page in which I enter user details for mailing.
Can I pass data from payin.php (original page) page to mail-data.php (iFrame) based on id retrieved from database?
How can I post data from mail-data.php (iFrame) to another page mail.php to execute mail function? If yes, how can I pass data from ordinary page to an iFrame page?
I tried using form action in iFrame page to mail.php, however I got the error which is shown.
Not Acceptable
An appropriate representation of the requested resource /radical/mail-data.php could not be found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
What may be the issue?
This code sample shows how you can use the target attribute of a form element to send the form request through the iframe:
<iframe src="about:blank" name="mail-data" />
<form action="mail-data.php" method="post" target="mail-data">
<!-- form fields !-->
</form>
I just passed the id value with the help of href to mail-data.php and then retreived the id by using get method ..It worked perfectly fine
thanks
I have tried to implement the POST/REDIRECT/GET design pattern in PHP and it works with Safari but not Google Chrome (for Mac) when I redirect to the exact same page. If I vary the URL slightly (say adding a trailing-slash) it works fine.
Here is a fully functional example:
<?php
if(TRUE === isset($_POST['submit'])) {
header('Location: http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'], true, 303);
exit();
}?>
<html><head></head><body>
<form action="" method="post"><input type="submit" name="submit" value="submit" /></form>
</body></html>
When I go to the page and click the submit button and then refresh the page, I get a dialog box asking me to confirm the re-submission of the form data. All my searching has said that the above code is the proper way to implement POST/REDIRECT/GET and should work (and it does in Safari) but it doesn't with Chrome on Mac.
Your code seems okay, I guess what you're experiencing is related to Issue 177855: Wrong handling of Redirection in Chrome 25
Refreshing a page you posted to gives you that popup box because the browser wants to know if it should resend the data that got you to that page originally. That will happen with all forms. You say it doesn't work in chrome. Do you get an error? Does it just not redirect?
Also, It would make more sense to use the anchor tag to link someone to a new page directly, or to use a roundabout way such as:
Forward
And to check for $_GET["act"] to be equal to "forward" opposed to checking if the form has been sent.
Here's my problem: I'm trying to set up a simple mobile contact form with a captcha built in. The page I'm working on can be found here: http://m.lancasterpainting.com/contact.php
I'm using the following php contact form: http://www.html-form-guide.com/contact-form/php-email-contact-form.html
I want to first say that I'm not the only one to run into this problem. After googling the issue, I've found multiple people struggling with this, but no-one seems to have an answer.
Now for the problem...
As you can see if you visit the page, each time the page is accessed, an error appears that says "Error: couldnot get Form object contact_form".
I cannot--for the life of me--figure out why the javascript can't find the form I pass it.
I call the function that generates this error at the top of the page:
var frmvalidator = new Validator("contact_form");
The form I'm referencing is as follows in the HTML code:
<div data-role="page" data-theme="e" id="contact_form" name="contact_form" data-position="inline">
...
And the function that is called that generates the error can be found in an external .js file here: http://m.lancasterpainting.com/scripts/gen_validatorv31.js
Is there something that I am simply not seeing? Why can't the javascript locate the form?
Thanks so much to anyone that helps with this.
There's no form named contact_form, but one with id=sendEmail. You may wonder, but div is not a form: <div id="contact_form"
Javascript code is run too early, document isn't ready and document.forms collection is even not available when form validator code is called.