0

I'm trying to use some simple AJAX and then passing my variable through a HTML string.

Struggling to get some PHP included to print the value into the string. Been trying like this and the variable prints blank even though there is a value assigned to $user_id.

    xmlhttp.open("GET","update.php?user=<?php $user_id ?>&q="+str,true);

Any suggestions on how I could do this or better solutions.

Thanks

0

1 Answer 1

2

you forgot echo:

xmlhttp.open("GET","update.php?user=<?php echo $user_id; ?>&q="+str,true)

Your Answer

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.