External form and Ajax

Permalink
hey there,
the following code is working outside concrete, but when i load it to a external form it doenst...
any 1 can help me on this one?
<?php
define('HOSTNAME','localhost');
define('DB_USERNAME','root');  // Change  username, password and database name as you deefined
define('DB_PASSWORD','');
define('DATABASE','Concrete');
$link = mysql_connect(constant('HOSTNAME'), constant('DB_USERNAME'), constant('DB_PASSWORD')) or die("Database connection error, please check!");
mysql_select_db(constant('DATABASE'), $link) or die("Connection to the defined database not possible, please check!");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){

 
aryeh replied on at Permalink Reply
since you are running it within the concrete files you do not need to connect to the database. Its already connected. Just make sure the table is in the same database.
ranonymus replied on at Permalink Reply
thanks for the quick answer, but how i said outside concrete server is works fine.
aryeh replied on at Permalink Reply
where are you trying it that it works fine? Plane php file?
can you explain in more detail what your trying to do?
ranonymus replied on at Permalink Reply
when i test it in plane php the form works great. i have 3 chained selects and i use ajax to populate the last one as you can see.
the ajax function works well in plane php wich means the select its populated. however when open in concrete5 the function doenst run... so the third select inst populated....
aryeh replied on at Permalink Reply
If you remove the connection to the databaee on the c5 it should work.
aryeh replied on at Permalink Reply
Also are you getting some kind of error?
ranonymus replied on at Permalink Reply
no error, the third select just stays blank...
and removing the connection dindt work
Also now i can see its something about the ajax. its not loading data to the select...
ranonymus replied on at Permalink Reply
no1 can help?
im now able to load external js and css. however the function is not working right. something about the .ajax