Hi all, im trying to use this method: http://community.actinic.com/showthread.php?t=38957
of including a file into my layout
To give some background it creates a double drop down menu (using ajax so theres no page load) which I hopefully once working will modify into a jump menu. It pulls info from two fields in a sql database. Example here: http://www.plus2net.com/php_tutorial..._down_list.php
The file is called dd.php (which calls on a config file for the DB) and im calling it like this: <script type="text/javascript" src="dd.php"></script>
The content of this file is:
<div id="cat">
<form name="drop">
<select name=cat onchange="AjaxFunction(this.value);">
<option value=''>Select Manufacturer</option>
<?
require "config.php";// connection to database
$q=mysql_query("select * from category ");
while($n=mysql_fetch_array($q)){
echo "<option value=$n[cat_id]>$n[category]</option>";
}
?>
</select></div><!--end of manufacturers cat-->
<div id="subcatid"></div>
</form>
which should output something like this:
<div id="cat">
<select name=cat onchange="AjaxFunction(this.value);">
<option value=''>Select Manufacturer</option>
<option value=1>option1</option>
<option value=2>option2</option>
</select></div><!--end of manufacturers cat-->
<div id="subcatid">other data appears here</div>
</form>
But im getting the following error in Actinic: A javascript error has been found on the page ('syntax error').
My heads gone.what am I doing wrong? What should I check?
Or.....should I be calling the file like this:
<actinic:block php="true">
include_once 'dd.php';
</actinic:block>
or
<actinic:block php="true">
<? include("dd.php") ;?>
</actinic:block>
TIA from a confused design person
of including a file into my layout
To give some background it creates a double drop down menu (using ajax so theres no page load) which I hopefully once working will modify into a jump menu. It pulls info from two fields in a sql database. Example here: http://www.plus2net.com/php_tutorial..._down_list.php
The file is called dd.php (which calls on a config file for the DB) and im calling it like this: <script type="text/javascript" src="dd.php"></script>
The content of this file is:
<div id="cat">
<form name="drop">
<select name=cat onchange="AjaxFunction(this.value);">
<option value=''>Select Manufacturer</option>
<?
require "config.php";// connection to database
$q=mysql_query("select * from category ");
while($n=mysql_fetch_array($q)){
echo "<option value=$n[cat_id]>$n[category]</option>";
}
?>
</select></div><!--end of manufacturers cat-->
<div id="subcatid"></div>
</form>
which should output something like this:
<div id="cat">
<select name=cat onchange="AjaxFunction(this.value);">
<option value=''>Select Manufacturer</option>
<option value=1>option1</option>
<option value=2>option2</option>
</select></div><!--end of manufacturers cat-->
<div id="subcatid">other data appears here</div>
</form>
But im getting the following error in Actinic: A javascript error has been found on the page ('syntax error').
My heads gone.what am I doing wrong? What should I check?
Or.....should I be calling the file like this:
<actinic:block php="true">
include_once 'dd.php';
</actinic:block>
or
<actinic:block php="true">
<? include("dd.php") ;?>
</actinic:block>
TIA from a confused design person
Comment