Hi
I have a javascript function to build a table of links, and i need to pass a get variable, ( links[1] = '../link/to.php?client=<?htmlentities($_SESSION[client])?>' ) so i am writing the get string inside the javascript function saved like menu.js :
function menu() {
var bar = new Array(2)
var links = new Array(2)
var i;
var max = 3;
barra[0] = 'Select Date'
barra[1] = 'Admin Acidents'
links[0] = '../link/to.php'
links[1] = '../link/to.php?client=<?htmlentities($_SESSION[client])?>'
for(i=0;i<max;i++) {
document.write("<table>");
document.write("<tr>");
if((i % 2) == 0) {
document.write("<td bgcolor='#EEEEEE'>");
}
else {
document.write("<td bgcolor='#E7E7E7'>");
}
if(links=="")
document.write(barra)
else {
if( (i % 2) == 0 ) {
document.write("<a href="+links+" target='main'>"+barra+"</a>");
}
else {
document.write("<a href="+links+" target='main'>"+barra+"</a>");
}
}
document.write("</td>");
document.write("</tr>");
document.write("</table>");
}
}
menu ()
and i just call this function when needed :
<script language="JavaScript" src="../menu.js"></script>
using from a normal html link it works and pass the right variable
but using from the javascript function above it not pass a get variable and return a link like this:
http://website/link/to.php?client=<?htmlentities($_SESSION[client])?
anybody knows a solution ?
Thank´s in advance