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?
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(){
Viewing 15 lines of 108 lines. View entire code block.
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.
thanks for the quick answer, but how i said outside concrete server is works fine.
where are you trying it that it works fine? Plane php file?
can you explain in more detail what your trying to do?
can you explain in more detail what your trying to do?
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....
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....
If you remove the connection to the databaee on the c5 it should work.
Also are you getting some kind of error?
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...
and removing the connection dindt work
Also now i can see its something about the ajax. its not loading data to the select...
no1 can help?
im now able to load external js and css. however the function is not working right. something about the .ajax
im now able to load external js and css. however the function is not working right. something about the .ajax