I need to run php to get street from mysql database.Then test the street
variable in javascriptif street is emty,javascript will pop up alert window
Here are my thoughts:
<?php
//connection to server,database
$q = "select street from apt where username = '$user'";$result =
mysql_query($q) or die(mysql_error());while($row = mysql_fetch_array($result)){
$street=$row['street']; }?>
<script LANGUAGE="JavaScript">st=<?=$street?>;if(st) alert("miss street");
</script>
Can I run st=<?=street?> in javascript?I'm not sure here.
Thanks!
chad
_________________________________________________________________
In a rush? Get real-time answers with Windows Live Messenger.
http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_Refresh_realtime_042008_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com
Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php