I know we can call php script from jquery, with parameters, as given below.
$('.likelink').click(function() {
$.get("testapache1.php", { dom: "<?php echo $_GET['dom']; ?>" , link: $(this).text() , pro: $(this).attr('name') }, function(resp) {
alert(resp);
});
});
I am getting error as given below on click event.
GET http://lsdom.qbc.uws/testapache1.php?dom=10.3.2.0&link=acer%0A&pro=acer 404 Not Found 4ms
I just want my link this
GET http://lsdom.qbc.uws/testapache1.php?dom=10.3.2.0&link=acer&pro=acer
What could be the error in my jquery script ? Please help me.
It seems that you have a new line character in your link
object, which gets encoded as %0A
(link=acer%0A).
If you just wont to pass the data don't use separate java script function.It's way more complected.
you can do as folow,
<a href="lsdom.qbc.uws/testapache1.php?dom=<?php echo $_GET['dom'];>
&link=<?php echo $GET['you'r variable'] ?>&pro=<?php echo $_GET['your variable']?>></a>
(make sure you add a form to you'r page & set it action as GET