Jump to content

urgent.plz help.how to access javascript variable in mysql!


Recommended Posts

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.