I'm fairly new as a web developer.
I have a form that POST from a Facebook Canvas app (belonging to a third party service) to a file on my server. And then put the response in an iframe:
<iframe style="width: 0px; height: 0px;" name='theiframe' src='...'> </iframe>
<form style="display: none;" id='mandrill_form' action="https://www.mysite.com/myfile.php" method="POST" target='theiframe'>
<input id='mandrillSend' type="text" name="email"><br>
<input id='nameSend' type="text" name="user"><br>
<input id='addressSend' type="text" name="address"><br>
<input id='zipSend' type="text" name="zip"><br>
<input id='citySend' type="text" name="city"><br>
<textarea id='other' type="text" name="other"> </textarea><br>
<input id='premieInfo' type="text" name="premieInfo"><br>
<input id='mandrillTemplate' type="text" name="template"><br>
<input id='mandrillSubmit' type="submit" value="Submit">
</form>
Everything works great for most of the users but 7% of the posts never reach myfile.php. (I keep track of all the user clicks, and the browsers with a third party Facebook plugin on the canvas page and a log file on my server). It dosen't seems to have anything to do with a specific browser.
I'm using the jQuery .submit() function to send the form.
My question is:
How should I go on debugging to find what causes this 7% loss of cross domain POST requests?
Losing 'traffic' like this is very normal.
You can see it in the advertisements companies. They almost every time losing 10% of the traffic.
But that how the internet works. You just can't catch them all.
Related
I'm trying to create a contact form on my own. I noticed that it can be achieved by placing the form inside an article, instead of a custom html module.
In the client side, it seems to work. I even added a captcha manually (the re-captcha plugin doesn't seem to work for me). The problem is, I set form's action property as "mail.php", and just added this "mail.php" file to the the template root. The "mail.php" supossedly retrieves the data send by post, and finally composes and sends the email, showing a "message send" notification.
Anyway, when I click on submit, the form page is just reloaded. I guess that Joomla! can't find my "mail.php". I guess that this issue is related to the joomla structure and my inability to place the "mail.php". Any help will be wellcome.
This is how my article looks like (wysiwyg editor mode disabled):
<form action="mail.php" method="post" target="_blank">
<p><label for="nombre">Nombre:</label></p>
<p><input maxlength="50" name="nombre" size="30" type="text" /></p>
<p><label for="email">Email:</label></p>
<p><input maxlength="50" name="email" required="required" size="30" type="text" /></p>
<p><label for="asunto">Asunto:</label></p>
<p><input maxlength="150" name="asunto" size="30" type="text" /></p>
<p><label for="mensaje">Mensaje:</label></p>
<p><textarea cols="50" maxlength="700" name="mensaje" required="required" rows="8"></textarea></p>
<div class="g-recaptcha" data-sitekey="6Lefblahblahblahblah"> </div>
<p><input type="submit" /></p>
</form>
I have a simple html code with this form:
<form id="check-user" class="ui-body ui-body-a ui-corner-all" data-ajax="false" method="post" action="./second.php">
<fieldset>
<div data-role="fieldcontain">
<label for="username">Enter your username:</label>
<input type="text" value="" name="username" id="username"/>
</div>
<div data-role="fieldcontain">
<label for="password">Enter your password:</label>
<input type="password" value="" name="password" id="password"/>
</div>
<input type="submit" data-theme="b" name="submit" id="submit" value="Submit">
</fieldset>
</form>
In any browser, even in my phone with the previously code it works fine when I push the submit button, on my php server log it appears
"POST /test/second.php HTTP/1.1" 200 699 ...
and I can get the POST variables in php.
Next, this html code I send it as an email (gmail), and If I push the submit button, on gmail on my desktop browser works fine :)
But If I open this email, through my phone (gmail app for iphone, also android I've tried) I get this from the php server log
GET /test/ HTTP/1.1" 200 1546 ...
Why I'm receiving a GET as the method?? Or how can I make better requests from mobile devices ???
Someone else have to deal with this before ??
Thanks for any answers about this.
I think you may find that forms are not recommended to be embedded in to emails. Most web-based email platforms do not support form functionality. You're best to provide an external link to your form.
Thanks for your response, I've ended using an external link using mailto.
I've also have to say that the reason I was getting a GET response is because the apps in a mobile phone are know as hybrid, they are not fully html, so they have security policies when one calls to another app (which is this case).
In my php i was receiving a GET method, cause the app was just opening the url, which by default is a get...
Thanks you.
I am trying to logged in to drupal site from wordpress using ajax. Scenario is like below:
I have 2 sites one is wordpress and one is in drupal. Right now half of the functionality is in drupal and I am switching to wordpress. But now User needs to be logged in drupal site from wordpress page. I already set all the pages in wordpress if user is logged in drupal. BUt issue I am getting to make users logged in to drupal from the wordpress page.
But I did: I created the sign in page in drupal and set the email & password from get request and auto submitted the page on loading. It is working fine if I opened this page in broser So I am calling this page from wordpress page using ajax. I got 200 response from ajax call but user is not logged in drupal.
Here is the login form from your page
<form action="http://www.seniorsearch.com/content/sign" class="webform-client-form" id="signin">
<div id="webform-component-name">
<input type="hidden" value="0" id="fb_login_id" name="submitted[fb_login_id]">
<input type="hidden" value="" id="redirect_url" name="submitted[redirect_url]">
<input type="text" class="form-text name1" maxlength="128" size="60" value="" name="submitted[name]" id="edit-submitted-name" placeholder="Enter Email">
</div>
<div id="webform-component-pass">
<input type="password" class="form-text pass1" id="password" name="submitted[pass]" placeholder="Enter Password" maxlength="128" size="60" value="" >
<input type="hidden" value="" name="details[sid]" id="sid">
<input type="hidden" value="1" name="details[page_num]" id="page_num">
<input type="hidden" value="1" name="details[page_count]" id="page_count">
<input type="hidden" value="0" name="details[finished]" id="finished">
<input type="hidden" value="form-_OBf1JYKx79Qg5_hsPtYAWmCPrRX6DwFKSODz4M7Wk4" name="form_build_id" id="form_build_id">
<input type="hidden" value="webform_client_form_52" name="form_id" id="form_id">
<input type="hidden" value="webform-ajax-wrapper-52" name="webform_ajax_wrapper_id" id="webform_ajax_wrapper_id">
</div>
<input type="submit" value="" name="op" class="form-submit ajax-processed" id="submit"><span class="termss">I accept Senior Search's Terms of Use.</span>
</form>
You need to send every one of those parameters with your AJAX script if you want the login to work.
I created the signin and signup form in drupal without any header, footer and sidebar, so There is only form there and call that page in wordpress site using iframe. Then refresh the iframe top window in drupal code after successful login.
I have two different websites. One is a non-wordpress website and the other one is blog made from wordpress framework. Is it possible to set up a login form to the non-wordpress site which redirects you to the wordpress blog dashboard if your login information is valid?
I tried creating a form in my website and set the action to my blog wp-login.php but instead of redirecting me to the dashboard it just displays the main wordpress login window but I am already logged in.
Use below form:
<form method="post" action="http://yourdomain.com/blog/wp-login.php" id="loginform" name="loginform">
<p>
<label for="user_login">Username<br>
<input type="text" size="20" value="" class="input" id="user_login" name="log"></label>
</p>
<p>
<label for="user_pass">Password<br>
<input type="password" size="20" value="" class="input" id="user_pass" name="pwd"></label>
</p>
<p class="forgetmenot"><label for="rememberme"><input type="checkbox" value="forever" id="rememberme" name="rememberme"> Remember Me</label></p>
<p class="submit">
<input type="submit" value="Log In" class="button button-primary button-large" id="wp-submit" name="wp-submit">
<input type="hidden" value="http://yourdomain.com/blog/wp-admin" name="redirect_to">
<input type="hidden" value="1" name="testcookie">
</p>
</form>
Note: Replace http://yourdomain.com/blog/ with your actual blog url
I needed the same thing as requested here and the solution of Tahir Yasin works fine but if there is no test cookie('wordpress_test_cookie') then http://yourdomain.com/blog/wp-login.php will give you this error
ERROR: Cookies are blocked or not supported by your browser. You must
enable cookies to use WordPress.
Remove this line will fix the problem: <input type="hidden" value="1" name="testcookie">
You can do this in 2 ways.
Cookies
Sessions
After your login is validated you store the information in an cookie/session, you send the users to your wordpress website. And the login page, checks if the desired session/cookie is available and if yes you skip the login fase.
Just add ?redirect_to=http%3A%2F%2Fsample.net%2Fwp-admin%2F&reauth=1 to the action.
I have a form which submits a php file to an iframe.
Here is the form:
<form action="del.php" method="post" target="output" >
Server: <input type="text" name="server_id" value="" />
Name:<input type="text" name="name" value="" />
Password:<input type="password" name="password" value="" /> <br>
Create Log? <input type="checkbox" name="log" value="" />
Output list of files? <input type="checkbox" name="out" value="" /><br>
<input type="submit" name="delete" value="Delete FTP!" /></td><br>
<iframe id="output" ></iframe>
del.php deletes files on a romote ftp. That recursive funcion takes a while.
Now I want to show a loading image by loading the del.php to the iframe.
I hope this answer helps you or anyone else looking for a solution. This one worked for me.
I'm trying to do the same. I have a page that calculates shipping on an iframe and i want it to show a loading gif image while the shipping cost loads as an xml from my shipping provider.
The IFRAME is covered with a DIV where the loading image (or any image) is found. The image is at the center of the DIV area and its size can be up to 950x633 pixels. When the IFRAME page is loaded, the loading image will be hidden.
What you need to change is the image URL for your site. You might also want to change the DIV background color (currently set to #FFF).
<style>
#loadImg{position:absolute;z-index:999;}
#loadImg div{display:table-cell;width:950px;height:633px;background:#fff;text- align:center;vertical-align:middle;}
</style>
<div id="loadImg"><div><img src="loading.gif" /></div></div>
<iframe border=0 name=iframe src="html/wedding.html" width="950" height="633" scrolling="no" noresize frameborder="0" onload="document.getElementById('loadImg').style.display='none';"></iframe>
This worked for me. It shows a loading Gif animation before the page is loaded in my iframe box. :)