wilna Posted June 16, 2011 Share Posted June 16, 2011 Hi, I've been pulling out my hair already. Please can someone help me. I' using Joomla and installed JCE Editor & DirectPHP to be able to use PHP & Javascript. I don't know anything about Java. I've created a dropdown form and then an onchange event is called so that if the value in the form is selected it calls the php. This works fine (I got an example form w3schools). The problem is I wanted to change the form to get the values form a table but it doesn't work. Example I used: http://www.w3schools.com/PHP/php_ajax_database.asp The code I changed is just the part about the form: <?php $con = mysql_connect('localhost', 'root', ''); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("metnet", $con); $sql="SELECT * FROM newsletter"; $result = mysql_query($sql); echo "<form method='post'>"; $dropdown = "<select name='users' onchange='showuser(this.value)'>"; while($row = mysql_fetch_assoc($result)) { $dropdown .= "\r\n<option value='{$row['id']}'>{$row['name']}</option>"; } $dropdown .= "\r\n</select>"; echo $dropdown; ?> The result I get in my article: [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/239523-php-java-in-joomla/ Share on other sites More sharing options...
trq Posted June 16, 2011 Share Posted June 16, 2011 Java and JavaScript are two completely different beats, but neither of them are related to PHP. Why would you post this in the PHP Help forum? Quote Link to comment https://forums.phpfreaks.com/topic/239523-php-java-in-joomla/#findComment-1230384 Share on other sites More sharing options...
wilna Posted June 16, 2011 Author Share Posted June 16, 2011 Sorry, I'm struggling to get the php to work with the javascript. Quote Link to comment https://forums.phpfreaks.com/topic/239523-php-java-in-joomla/#findComment-1230391 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.