sbo1 Posted August 13, 2006 Share Posted August 13, 2006 [color=blue]I have an AJAX script that returns a variable from a php script. No problem this next snippet works great. Here it is:[/color][code]<?phpheader("Content-Type: text/xml");echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; ?><!-- here is the XML --><totals> <picture><?php echo $picture; ?></picutre> // returns sun.jpg </totals>[/code][color=blue]I get sun.jpg returned. Now here is the problem I want to insert the $picture (i.e sun.jpg) variable so that the result is a hyperlink like this...[/color][code]<picture> <a href="images/<?php echo $picture; ?>"></a> </picutre> //doesn't work[/code][color=blue]I try replacing the following signs < " and > with codes:[/color][code]<picture><a href="images/<?php echo $picture; ?>"></a> </picutre>[/code][color=blue]but again this does not work. I get nothing returned at all with the above code. I am a newbie at ajax. I have only a cursory knowledge of XML and Javascript. I am sure there is something silly I am doing here. Any clues? Thanks for any help. Steven.[/color](edited by a moderator to clean up the code so it wraps) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.