Reputation: 10261
i am trying this to pass a value to the next PHP page:
$("#see_comments").attr({href: "comments.php?aid='"+imgnum+"'"});
and in the PHP file I am using:
$aid = $_REQUEST[aid];
echo $aid;
but this is displaying the output like this:
\'9\'
why is this happening? //9 is the value i am passing.
Upvotes: 1
Views: 119
Reputation: 11596
If the aid
parameter is supposed to be an integer, why are you using quotes? Why not just write it like this:
$("#see_comments").attr({href: "comments.php?aid="+imgnum});
Upvotes: 0
Reputation: 15882
Your webserver has magic quotes turned on. They're a terrible thing, and if you can turn them off, I highly recommend you do.
Also, quoting values in your query string is unnecessary. Try this:
$("#see_comments").attr({href: "comments.php?aid="+imgnum});
Upvotes: 1
Reputation: 7533
Because you have magic_quotes enabled in your PHP configuration. Disable that horrible feature now! :P
Upvotes: 0