jQuery ajax tries to send cross domain and gets 403 foribben but its on the same domain
Im trying to do an ajax call to my php file on the same server. I found a url fetching script similar to Facebook to get links. http://wakeupzee.netai.net/99points/facebook_url_extracting/ Works pretty good actually. Anyway, I want to save开发者_如何学运维 the info it's extracting to the DB. When I pull the src of the img link, somehow Im getting a 403 forbidden and I think it's trying to use the extracted URL even though Firebug show it's submitting my php file. It thinks the other domain is trying to submit against my php file. How can I get it to just recognize all my variable as text in the post?
Here is similar code I'm using.
jQuery("form#submit_ProPost").submit(function() {
var mem_id = jQuery('#mem_id').attr('value');
var per_id = jQuery('#per_id').attr('value');
var comment = jQuery('#procomment').attr('value');
var action = jQuery('#action').attr('value');
var vimg = jQuery('.linkimg').attr('src');
var uval = jQuery('.lurl').html();
var dval = jQuery('.ldesc').html();
var tval = jQuery('.ltitle').html();
var act_id = ('1');
jQuery.ajax({
type: "POST",
url: "/ajax/modify.php",
data: "mem_id="+ mem_id +"& per_id="+ per_id +"& comment="+ comment +"& action="+ action +"& act_id="+ act_id +"& vimg="+ vimg +"& tval="+ tval +"& dval="+ dval +"& uval="+ uval,
success: function(response){
//do stuff here
}
});
return false;
});
});
Set data
as an object
{
"mem_id": mem_id,
"per_id": per_id,
"comment": comment,
// etc
}
Things seem to be in order here ... open up your browser and go directly to that link, see if it is still 403 forbidden. If it is then the problem is with permissions set on your webserver file structure (which is what I suspect is happening). Let us know what happens ...
精彩评论