php Problem while loading second menue from my sql

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

“I have found the following script That i have modded it for my needs”

First, this is script is full of security holes, code that can’t possibly ever work and second in my opinion is a very bad way in learning PHP (or any computer language).

There’s is nothing wrong in tinkering around with another person’s code as long as you know what you are doing and are just seeing how things work. An not to sound rude, but people who come here to help out people don’t come here to write another person’s script for them. I would start from scratch, maybe read a current book on PHP or a watch a current tutorial on PHP (This code uses mysql - which is depreciated. http://us1.php.net/manual/en/intro.mysql.php).

Sponsor our Newsletter | Privacy Policy | Terms of Service