Roger_vbulletin3_import16763
New Member
I'm attempting to put a php variable inside a javascript function and having no luck, here's what I got\[code\]<a class="code" href="javascript:void(0);" onclick="javascript:if(window.dd && dd.elements) d.elements.name1.moveTo(<? echo "$xpos"; ?>, <? echo "$ypos"; ?>); return false;">name1.moveTo(name1.x-20, name1.y+7);</a>\[/code\]`the moveTo() function works perfectly when I send it a javascript variable or simple numbers.the reason its in a php variable at all is because I need the xpos to be inside a session variable to be accessed in other places. Afterwards I assign it as follows\[code\]$_SESSION['productcheck']['x'] = $xpos;\[/code\]I'm kinda new to this, if you haven't already noticed, Thank you ahead of time