[PHP] Help needed
Hi All, I am new to PHP world. Could any body tell me how to call any function(written in PHP) from Java script. Actually my PHP function return a string value which i need to access in my java script code. Thanks in Advance.. Nirmala ___ Click below to experience Sooraj Barjatya's latest offering 'Main Prem Ki Diwani Hoon' starring Hrithik Roshan, Abhishek Bachchan Kareena Kapoor http://www.mpkdh.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help needed
Hi All, I am new to PHP world. Could any body tell me how to call any function(written in PHP) from Java script. Actually my PHP function return a string value which i need to access in my java script code. Thanks in Advance.. Nirmala ___ Click below to experience Sooraj Barjatya's latest offering 'Main Prem Ki Diwani Hoon' starring Hrithik Roshan, Abhishek Bachchan Kareena Kapoor http://www.mpkdh.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help needed
Hi list, This time i am pasting my code could any body tell where wrong I am ? ? function LangItem($field,$lang) { $db = mysql_connect(localhost, root); /*Check For Connection to local host*/ if(!$db) echo(Connect to localhost mysql database failed); if(!mysql_select_db(eshop,$db)) echo (Selection of eshop failed on MySQL database); $Sql = SELECT . $field . FROM language where LangCode = .'.$lang.'; $result = mysql_query($Sql,$db); if($result) { $myrow = mysql_fetch_array($result); $value = $myrow[$field]; } else echo (h1 No Record Found/h1); return($value); } ? script language=JavaScript FieldName = Material; LangName = E; alert(? LangItem(FieldName,LangName)?); /script Loking for help.. Nirmala ___ Click below to experience Sooraj Barjatya's latest offering 'Main Prem Ki Diwani Hoon' starring Hrithik Roshan, Abhishek Bachchan Kareena Kapoor http://www.mpkdh.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Help needed
Hi Pete Morganic , Thanks for reply. But the code is not solving my problem. May be I did not epress my problem clearly. Actually I wanted to store the returned value so that I can write it on page like { test = ?php LangItem(FieldName,LangName)?'); document.write(test); } and moreover the value I am passing is material and E is not getting parsed to PHP function. PHP function input for $field and $lang will be FieldName and LangName only. looking for help regards Nirmala P. On Mon, 30 Jun 2003 Pete Morganic wrote : Nirmala P wrote: Hi list, This time i am pasting my code could any body tell where wrong I am ? ? function LangItem($field,$lang) { $db = mysql_connect(localhost, root); /*Check For Connection to local host*/ if(!$db) echo(Connect to localhost mysql database failed); if(!mysql_select_db(eshop,$db)) echo (Selection of eshop failed on MySQL database); $Sql = SELECT . $field . FROM language where LangCode = .'.$lang.'; $result = mysql_query($Sql,$db); if($result) { $myrow = mysql_fetch_array($result); $value = $myrow[$field]; // return valus return($value); } else echo (h1 No Record Found/h1); } ? script language=JavaScript FieldName = Material; LangName = E; // included in quotes and php tag alert('?php LangItem(FieldName,LangName)?'); /script Loking for help.. Nirmala ___ Click below to experience Sooraj Barjatya's latest offering 'Main Prem Ki Diwani Hoon' starring Hrithik Roshan, Abhishek Bachchan Kareena Kapoor http://www.mpkdh.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ___ Click below to experience Sooraj Barjatya's latest offering 'Main Prem Ki Diwani Hoon' starring Hrithik Roshan, Abhishek Bachchan Kareena Kapoor http://www.mpkdh.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php