Jump to content

Recommended Posts

I have a index page. It checks to see if a cookie value exists if so then carry on doing what it does.

I have a resolution page checker. It gets the users resolution then allows a link to the index page with that resolution sent via GET. which then creates a cookie to allow the index page to carry on usual

 

This all works fine in Internet explorer

 

However in firefox it just keeps re-directing back to the resolution page as if the cookie doesn't exist.

 

Any ideas

 

Its an SSL Server

Link to comment
https://forums.phpfreaks.com/topic/96735-firefox-and-cookies-with-ssl/
Share on other sites

I don't know if its conflict with SSL or Firefox but Ajax requests don't work even when my code snifs the browser type and makes a request ocordingly.

 

The cookie works fine on index page and yet on the page on the SSL server doesn't display the propper page?

Ok now i have the cookie working but, The Ajax request works on on page but not another yet works on both in IE

 

here is the code for the page that doesn't work...

 

 

//Create a boolean variable to check for a valid Internet Explorer instance.
var xmlhttp = false;

//Check if we are using IE.
try {
	//If the Javascript version is greater than 5.
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
	//If not, then use the older active x object.
	try {
		//If we are using MS.
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	} catch (E) {
		//Else we must be using a non-IE browser.
		xmlhttp = false;
	}
}

//If we are using a non-IE browser, create a javascript instance of the object.
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
	xmlhttp = new XMLHttpRequest();
}


/*
var xmlhttp;

//If, the activexobject is available, we must be using IE.
if (window.ActiveXObject){
	xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} else {
	//Else, we can use the native Javascript handler.
	xmlhttp = new XMLHttpRequest();
}
*/

function makerequest(serverPage, objID) {

	var obj = document.getElementById(objID);
	xmlhttp.open("GET", serverPage);
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			obj.innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.send(null);
}


function display_album_box() {

var theselectbox = document.getElementById("album_selection").value;

makerequest("album_viewing_page.php?album_ident=" + theselectbox,"album_viewer");

var thealbumbox = document.getElementById("album_viewer");
thealbumbox.style.visibility="visible";

}

 

and then the page

 

<div id=album_viewer></div><div class=main_mid><center><table width=100% align=center><tr><td colspan=2 class=title_bar width=100%>
<center><font class=title_font>Album Browser</font></center></td></tr>
<tr><td> </td></tr>
<tr><td>Please choose an album $album_listing <input type=submit name=submit value=Go onclick=\"display_album_box()\"</td></tr></table></div>";

 

and the page being requested works fine

 

 

in firefox, have you checked for Javascript errors?

 

Tools > Error Console

 

for debugging ajax on the PHP side, i typically send an email to myself for debug. it can be a lot of emails. another alternative is to write debug to a log file on the server so you can see what (if anything) is going on in PHP.

Sorry yes...

 

<select name=album_selection><option value=N>Choose</option>

 

That is a dropdown box.

 

When the button is pressed it goes to the javascript function stated above.

 

This function attempts to get the value of the dropdown box option selected, which it does in IE say for example N like above.

It then uses this in GET method making a request AJAX style to another php page which works fine in either IE or FIREFOX.

 

Yet firefox is saying there is no property of album_selection ?

 

Do i have to use another method to get the value of the drop down box ?

 

 

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.