Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

works on local dev, but not when I upload to production server

Status
Not open for further replies.

sd0t1

IS-IT--Management
Mar 14, 2007
131
US
I'm using WAMP in my dev enviornment and everything is fine. When I upload to production server (hosted on Mediatemple.net) my app doesn't work.

The part that doesn't work is the AJAX. I use AJAX to break up a 100+ question application into 8 sections. Basically the user loads the main page, and I rotate each section into a DIV. They fill out the form fields and clicks "Next".

Each time they click Next, they are calling an AJAX function that sends the form data to a PHP page to be validated and inserted, then load the next step of the application into the div

In developement this works fine and all 8 sections load one after another until complete. When I upload to the production server (LAMP) the AJAX gets an error when called on step two.
I included the ajax code for step two.

Any help would be greatly appreciated.

function stepTwo(str)
{
if (str=="")
{
document.form1.case_no.value = "";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById('stepDiv').innerHTML = xmlhttp.responseText;
}
}

var ccfn = document.getElementById('cc_fname').value;
var ccln = document.getElementById('cc_lname').value;
var ccrc = document.getElementById('cc_relation_claimant').value;
var ccn1 = document.getElementById('cc_num1').value + document.getElementById('cc_num1a').value;
var ccn2 = document.getElementById('cc_num2').value + document.getElementById('cc_num2a').value;
var ccn3 = document.getElementById('cc_num3').value + document.getElementById('cc_num3a').value;
var cce = document.getElementById('cc_email').value;
var ccma = document.getElementById('cc_mail_address').value;
var ccc = document.getElementById('cc_city').value;
var ccs = document.getElementById('cc_state').value;
var ccz = document.getElementById('cc_zip').value;
var pq_id = document.getElementById('pq_id').value;


xmlhttp.open("GET","ajax/stepTwo.php?ccfn="+ccfn+"&ccln="+ccln+"&ccrc="+ccrc+"&ccn1="+ccn1+"&ccn2="+ccn2+"&ccn3="+ccn3+"&cce="+cce+"&ccma="+ccma+"&ccc="+ccc+"&ccs="+ccs+"&ccz="+ccz+"&pq_id="+pq_id,true);
xmlhttp.send();
}
 
Thanks Dan, good suggestion, but unfortunately that wasn't it.

Can you think of anything else?

I normally work with all Window enviornment and don't know much about Linux at all.
 
Wow... I just tried it again today and it's working.

I haven't modified it, but I get no errors.

Extremely wierd. I guess I just need to hope it doesn't happen again.

Thanks anyway Dan.
 
I guess I just need to hope it doesn't happen again.

Why not write some continuous integration tests?

The Selenium ( forum1652 ) IDE for Firefox is a good place to start learning TDD...



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Snippets & Info:
The Out Atheism Campaign
 
I've never looked into OpenQA or any integration testing.

I think your right though, "hoping it doesn't happen again" sounds silly and with a little research probably can be avoided.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top