amit
amit

Reputation: 10261

$_REQUEST value appearing in \'value\'

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

Answers (3)

Tomas Markauskas
Tomas Markauskas

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

Lucas Oman
Lucas Oman

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

Nicolás
Nicolás

Reputation: 7533

Because you have magic_quotes enabled in your PHP configuration. Disable that horrible feature now! :P

Upvotes: 0

Related Questions