This may be hard to help me with but I'm out of options and have no hair left so here goes;
I have this simple part in my program where if a check box is disabled and the user is using the site on a device like an iPad they will get an alert box popup if they touch the check box. The problem that I'm having is that it works as expected on one domain but then on another domain it just flashes very quickly then goes away.
Because I don't have a Mac computer I can't use the Safari Web Console installed to see if any errors are coming up.
Here's the code to generate the alert;
if ($device == 'TAB') {
echo "<div id='" . preg_replace('/[^a-zA-Z0-9]/', '', $menu_name) . "OV'
class=\"overlay\" onClick=\"alert('My message');\"></div></div>";
} else {
echo "</div>";
}
Any ideas of why this would work in one place and not the other and anything that I can do to try to get the iPad to give me more info to what's going on here?
Here is where it works, interactive-floor-plan dot com/ifp.php?width=633&ProductID=1
and here is where it doesn't
plangator dot com/demo/ifp.php?width=633&ProductID=1
Your code seems completely fine to me, although your echo is a little bit unclear, because it's on one line. The problem should be somewhere else on your page. Try to find out what's happening with firebug. Here's a SO post about it.
iPad firebug lite or similar
Both links on that page seem useful to me.
Good luck!
Related
Before anyone tells me to look at other similar posts, I already have and I cannot find any solution to my problem.
I am building a questionnaire for a project, and I am using php 5.6, xampp, phpmyadmin, Phpstorm 2017.1.2 and of course the usual languages html css javacript.
In order to write less code, I used the masterpage method to build my website for the questionnaire.
I therefore have a do-test.php where I put my questionnaire alone and an index.php where I have the main skeleton of the page.
I have my questionnaire form with various fieldsets and their inputs. Lastly I have a input type=submit button that I click and the form is supposed to be submitted. However my $_POST method is not working at all.
The following code does all the work. Unfortunately for reasons yet unknown to me, when the if statement runs, it doesn't even look at the isset or !empty method.
Using an IDE debugger
Debugging the do-test.php without the master-page.: My xdebug (installed in phpstorm), jumps directly from the breakpoint in if statement to the bottom of the page. I tried using an else with a message that "submit is not set" and it shows it before and after submitting the form.
if(isset($_POST['Submit']) && !empty($_POST['Submit'])) {
$results = new Results();
$results->ProcessRequest();
if ($results->isSuccessful()) {
echo "<script type='text/javascript'>
alert('Your data is sent to the server');
</script>";
} else {
echo "<script type='text/javascript'>
alert('Something went wrong.');
</script>";
}
}
My http raw post data is visible but the post array is empty.
Debuggin the do-test.php with the master-page: Gets me 502 bad gateway error
Debug using localhost
Using this code snippet here I tried to see what is going on.
Submitting the form from the master-page or the simple do-test page, gives me the following result:
which means that my post array has all the right variables. All that remains is for the method to be executed and for the data to pass into the db.
My post_max_size and variables_order (advise taken from here) are correct.
magic_quotes_gpc (from this post) are off in php.ini.
Could it be the http modules that interfere with POST as told by GeorgeMillo
here??? If so how do I tamper with those?
Could there be something wrong with my version of phpstorm or the php version?
Any suggestion is welcome. Thank you in advance.
I may have written one thing wrong so I gave the wrong impression. I wrote "when the if statement runs", when in fact, the debugger runs and tries to execute the if statement but it doesnt. Sorry for my bad explanation.
The member "Alive or Die" gave me the simple solution of using
if(count($_POST)>0)
and it works!! So I will stick with that.
Thanks to everyone for your fast comments and for pointing out the obvious when one cannot see it!!
I dont know how to explain my need, and neither which key words to use to find a solution on google, so i'll give an url to be more clear:
check an IP (click on: Check your current IP address)
I'ld like, by using this website for example, getting somes informations after all the processus are terminated.
I tried with "file_get_contents" and with "cURL functions" but i did not find a way to do it, i always get the original source code.
Any idea ?
EDIT:
<body onLoad="setTimeout('get_my_blacklist()', 60000)">
...
...
<?php
echo '<iframe id="my_iframe" src="http://multirbl.valli.org/lookup/'.$ip.'.html">';
?>
...
...
<script>
function get_my_blacklist()
{
//function to get the content after somes secondes.
}
</script>
Here is the new code i tried thank to #Ludovic for is iframe idea.
Still working on it, i'll tell you if its working or not to solve my issue.
Edit2: Whatever how i try, i didnt find a way to get the containt of my frame window.. And even if i'ld succeed, i dont know how i can update my database if do it with JQuery/Javascript
First the page should have been construct by server script like PHP, at this step you have all IP requested then the page is modified by JQuery script who seems to query each IP.
The second step is an asynchronous script so you can't know when the page is effectively finished to construct.
The Disqus SSO actually works great for me, but the problem is that it is working only intermittently. Sometimes the user is logged in, and the Disqus comment box works fine, but other times, it doesn't log my user in..it is pretty much ignoring the code below, or that is not working correctly:
<script type="text/javascript">
var disqus_config = function() {
this.page.remote_auth_s3 = "<?php echo "$message $hmac $timestamp"; ?>";
this.page.api_key = "<?php echo DISQUS_PUBLIC_KEY; ?>";
}
</script>
I'm sure I have everything configured correctly, having used this below my disqus comment box:
https://github.com/disqus/DISQUS-API-Recipes/blob/master/sso/php/sso.php
The error I get in the Chrome console when my user is not automatically authenticated in the Disqus comment box is below:
> http://disqus.com/api/3.0/embed/threadDetails.json?thread=___…1&api_key=___404 (NOT FOUND) lib.js:162 send lib.js:162 e.extend.ajax lib.js:157 d
> client.js:27 g.call client.js:28 u.extend.fetch client.js:85
> Backbone.View.extend.fetchSession client.js:122
> Backbone.View.extend.initSession client.js:118
> Backbone.View.extend.bootstrap client.js:113 w lib.js:216
> n.Events.trigger lib.js:215 messageHandler
However, when this error does show, and I refresh the page, oftentimes, it goes away and the user is authenticated. Really not sure what it can be. I've tried moving the javascript for the sso around, such as putting it into the document head, but I'm getting nowhere now.
I'm sure I have everything configured correctly, having used this below my disqus comment box:
Disqus php api example
After I left the whole thing alone...the problem went away. If you have this same problem, don't waste your time trying to fix it, give it a day or 2 first
I have an unsual problem. I am developing an website witch is behind a load balancer. We have 4 frontends. For some reason, in Internet explorer, session is lost. We are using database session and it is working in all other browsers. After days of debugging, i eliminate the following lines from a JS file:
$('div').each(function(){
console.log($(this));
if($(this).attr('role') == 'dialog') {
$(this).addClass('callmenow_wrapper');
}
if($(this).attr('class') == 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix') {
$(this).addClass('callmenow_title');
}
if($(this).attr('class') == 'ui-dialog-buttonpane ui-widget-content ui-helper-clearfix') {
$(this).removeClass('ui-widget-content');
}
$('button').addClass('button-call-popup');
});
Now everything is working as expected. If i put back this lines in IE, the session will be lost. If anyone has experienced something wired like this, please advice.
Thank you.
PS: I read tons of documentations and similar problems. I've set P3P headers, etc. Nothing worked until i removed this lines.
I'm having issues with a application that I am writing that uses Dojo and Zend Framework. The issue only effects Internet Explorer 6, other versions of IE, ff, chrome and safari work fine with no issues.
When IE6 lands on the login page it crashes with the send details to microsoft dialog box. The login script uses dojo to provide some validation for the users to ensure that their passwords are formatted correctly etc.
I've seen on some forums that addOnLoad() function call in dojo could be the cause and a window.setTimeout() would help. http://www.dojotoolkit.org/forum/dojo-core-dojo-0-9/dojo-core-support/dom-manipulation-addonload-crashes-ie6
The problem I have is how to manipulate the dojo header that we have in the layout.phtml in the application. We currently have in the file this code in the header.
<?php
$this->dojo()->setLocalPath($this->baseUrl().'/javascript/dojo/dojo.js');
$this->dojo()->addStylesheetModule('dijit.themes.tundra');
echo $this->dojo();
?>
This produces the following in the html.
dojo.require("dijit.form.ValidationTextBox");
dojo.require("dijit.form.Button");
dojo.require("dojo.parser");
dojo.addOnLoad(function() {
dojo.forEach(zendDijits, function(info) {
var n = dojo.byId(info.id);
if (null != n) {
dojo.attr(n, dojo.mixin({ id: info.id }, info.params));
}
});
dojo.parser.parse();
});
var zendDijits = [{"id":"username","params":{"regExp":"[a-z0-9_\\+-]+(\\.[a-z0-9_\\+-]+)*#[a-z0-9-]+(\\.[a-z0-9-]+)*\\.([a-z]{2,4})$","invalidMessage":"Please enter a valid email address","trim":"true","required":"true","dojoType":"dijit.form.ValidationTextBox"}},{"id":"password1","params":{"trim":"true","lowercase":"true","regExp":"^.*(?=.{6,})(?=.*\\d)(?=.*[a-zA-Z]).*$","invalidMessage":"Invalid Password. Password must be at least 6 alphanumeric characters","required":"true","dojoType":"dijit.form.ValidationTextBox"}},{"id":"submit","params":{"label":"Login","dojoType":"dijit.form.Button"}}];
How can I change this to try and add the fixes mentioned in the link, or is there another way to write this without IE6 crashing all the time?? I would prefer to fix this than remove all the client validation, just in case the client is using IE6.
thanks...
Can you reduce it down until you find what is crashing IE6? Save off your output as static html, confirm it still crashes IE and start removing code. Take that addOnLoad out altogether - does it still crash? if not, take out the forEach, and so on. Start removing elements from zendDijits array - is there one in particular that causes the trouble?
Is this a stock IE6? Any plugins/addons?
Your php there should be producing a script element to pull dojo.js. You've got soemthing wierd going on - that Zend code is known to work so we need all the information if you want to solve this.