Hello all!
I have a PHP page that assigns a value to a variable named $gui_txt as a result of a SQL query.
What I am trying to do is create a link that will open a new web browser window and display the value of $gui_txt on that new window.
The code I have currently is a javascript function and PHP echo to create the link, something is going really wrong. It is displaying the value of the variable where the link is supposed to be.
Here is my code:
[CODE]<script language=”javascript” type=”text/javascript”>
function getGuidelines(which)
{
window.open(“http://localhost/guidelinestexttest.php?which_guidelines=” + ‘”‘ + which + ‘”‘);
}
</script>
Here is the echo code:
[CODE]echo”<a href=”javascript:getGuidelines(“$gui_txt”)”>Test</a>”;
I have also tried this echo code:
[CODE]echo”<a href=’#’ onclick=’getGuidelines(“$gui_txt”);’>Testing</a>”;
Neither work, the first echo code dumps all the variable data as some huge link that does nothing and the second echo code just appends a # at the end of the URL and goes to the top of the page.
I been struggling with this for hours…your help is greatly appreciated