dipsnaik Posted April 3, 2003 Share Posted April 3, 2003 hi alll... my prob is how to assecc a php variabl;e in a java script funtion e.g in the below code we have populated a drop down menu with values given... this value we want to access in the javascript function.. in mssql query... i know that i can access that varianble using document.formname.varaibe;.value... but how to access this form\'s drop down menu.. in the mssql query... <html> <head> <? echo \"<script type=text/Javascript> n\"; echo \"function rent()n\"; echo\"{n\"; require(\'deep_function.inc\'); db_conn_select(); echo \"alert(document.ganapati.ss1.value)n\"; // this value is prnitng fine $sho=$ss1; $res=mysql_query(\"select login from user_details where user_id=\'$sho\'\"); $row=mysql_fetch_array($res); $t1=$row[login]; echo \"document.ganapati.t.value=\"$t1\";n\"; echo \"alert(document.ganapati.t.value)n\"; echo \"} n\"; echo \"</script>n\"; ?> </head> <body> <form name=\"ganapati\" method=\"post\"> <select name=\"ss1\" onchange=\"rent();\"> <option value=\"1001\"> Ha </option> <option value=\"1006\"> Dhapni </option> <option value=\"1002\"> Brown SHirt </option> </select> <input type=\"text\" name=\"s\"> <input type=\"text\" name=\"t\"> </form> </body> </html> whenever we hard code the where clause \'s value.. its gving the output correctly... how to access java script varable in the MySQL query?????????? plzzzzzzzzzzzzzzz help.... thanx in advance.... Deepali Quote Link to comment https://forums.phpfreaks.com/topic/298-urgentplz-helphow-to-access-javascript-variable-in-mysql/ 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.