0

Can you pls let me know how can this be achieved

 $(document).ready(function(){
 id = "user";
 $( '#login' ).html( "<a href = http://localhost/Misc/Receive.php? 
id=+id>Test </a>" );

Receive.php $val = $_GET['id'];

echo($val);

want to pass the value stored in variable id to receive.php

asked Feb 25, 2017 at 5:52
2
  • Thank You Suchit. It works now. Commented Feb 25, 2017 at 6:11
  • then you can accept the answer by checking the checkmark. Commented Feb 25, 2017 at 7:39

1 Answer 1

2

Quotes are not proper,change your string to this:

$( '#login' ).html( "<a href = http://localhost/Misc/Receive.php?id="+id+">Test </a>" );
answered Feb 25, 2017 at 5:54
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.