Hey ,

I tried to send some data to different page and want to use it response ...

But the problem i face is the code is working properly on my local host but when i put it over web it always gave me an error ...

catalog_no=$('#srno').val();
        //alert(catalog_no);
        query="select * from new_prod where ccatalog='"+catalog_no+"'";
        alert(query);
            $.ajax({
                 url : 'http://mocktests2011.com/ankur/ajex_sent1.php',
                type : 'POST',
                data : {'queryString': query},
                dataType : 'application/json',
                success : function (result){
                $('#amount').val(result['p_price']);
                $('#pname').val(result['p_name']); // The value of your php $row['adverts'] will be displayed
                },

                error : function () {
                   alert("error");
                }
            });

Here it the live link for the same
http://mocktests2011.com/ankur/bills.php

Recommended Answers

All 11 Replies

What's the error? Its not evident when I click on your link. I dont know how your web app is expected to behave...

This Code always Run this code block on server...

 error : function () {
alert("error");
}

and about the page , first you have to choose order for --- Pawan Sharma,

than the uppar drop list updated through $.post but when i select any catalog from the list .. its name and price must be come automatically from database...

its working properly on localhost but not on server ...

My guess is your ajex_sent1.php fails. Are you sure passing sad for catalog_no is valid?

yes .. as it work properly on the wampserver (localhost)...

and second i also try it for without value still working on localhost but not on server ....

Yes, but pritaeas is correct. The problem seems to be with that page. The console log reports this error when I do the following...

Select Order for: Pawan Sharma, then select Catalog-sad, then the error logs in the console...

POST http://mocktests2011.com/ankur/ajex_sent1.php 503 (Service unavailable)

So what is the solution for that ????

Hmmm.

The 503 Service Unavailable error is an HTTP status code that means the web site's server is simply not available at the moment. I'd contact your provider and report this issue.

then why other ajex working which is for user ???

I suggest you test that script online with well placed echo's to see what is happening.

not working ....

not working ....

What have you tried? Without access to that particular script it's impossible to help you work towards a solution.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.