Hello
Dear support team
Good Day
I have found the following script That i have modded it for my needs
[php]
[/php]
the second script to supoort it is as follow
[php]
<?php
//include "select_type.php";
class SelectList
{
protected $conn;
public function __construct()
{
$this->DbConnect();
}
protected function DbConnect()
{
// include "config.php";
$this->conn = mysql_connect("localhost","root",/*"ascent"*/"ascent") OR die("Unable to connect to the database");
mysql_select_db("xxxxxxx",$this->conn) OR die("can not select the database $db");
return TRUE;
}
public function ShowCategory()
{
$sql = "SELECT * FROM ince_categories";
$res = mysql_query($sql,$this->conn);
$ince_categories = 'choose...';
while($row = mysql_fetch_array($res))
{
$ince_categories .= '' . $row['name'] . '';
}
return $ince_categories;
}
public function ShowType()
{
$sql = "SELECT * FROM ince_type WHERE id_cat = $_POST[id] ";
$res = mysql_query($sql,$this->conn);
$ince_type = 'choose...';
while($row = mysql_fetch_array($res))
{
$ince_type .= '' . $row['name'] . '';
}
return $ince_type;
}
}
$opt = new SelectList();
?>
[/php]
and my problem is with the third script that shows or displays the ince type
if i make just as follow
[php]<?php
include(“ince-form.class.php”);
echo $opt->ShowType();
?>[/php]
It does show the second drop menu but no way for it to save the data to mysql
on the other hand if i add supporting user and id to it as follow
[php]<?php
include(“config.php”);
include(“ince-form.class.php”);
if(isset($_SESSION[‘user’][‘id’])) {
header(“Location:index.php”);
}
echo $opt->ShowType();
?>[/php]
in this way it does save but no way for it to show the drop menu
Please need your help to solve this issue
Best Regards
rami