Hi there,
I've configured mod_rewrite rules to have pseudo sub domains for
pages.

I discovered that when i try to send a $.post() request to an absolute
path, the function() which needs to be executed after a successful
$.post, doesn't execute. In my code, it stays at "Please wait... "
stage.

After doing some tests i found out post values are not passed into the
target php script.

Also I found out sessions are not working in the target script.

Can't i use jquery's $.post() method for pseudo subdomains?
(this works perfectly in the actual page though)


Here's my code.

 function addContact(id){

   $(document).ready(function(){
                $("#add-con-ok"+id).html("Please wait... <img 
src='images/loading-
small.gif'>");
                $.post("http://domain.com/add-contact.php";, { id: id}, 
function(){
                                                                                
          $("#add-con-ok"+id).html("<small>Request Sent</
small>").animate({ opacity: "hide" }, 2000);
                                                                                
          });
        $("#add-con-box"+id).hide();

});

}

backend:

<?php
session_start();

if(isset($_SESSION['USER_ID'])){

        $c_id = mysql_real_escape_string($_POST['id']);
        //rest of the code
}
?>

Reply via email to