[PHP] Problem with the code

2004-09-09 Thread Mulley, Nikhil
Hi All,
 
I have a problem...with my code ,can any one please guide or correct me.
 
[BLUE]
My main aim is to develop a php(or php in html) ,in which Login is there ,after 
appropriate login ,User must get the 
Option of selecting available databases ,Upon selecting databases,user must get to 
select the appropriate tabl from Selected database,
 
Can I have that code.
Please do the needful.
[BLUE]
Please find the questions in blue format 
authenticate.php (should be login.php no probs but)
 
?php
include(phpscripts/draw_table.php);
$hostname=xxx;
$usrname=$_POST['username'];
$usrname=root;
$pswd=$_POST['password'];
$db_selected;
$db_list;
$row;
$dbconnlink=mysql_connect($hostname,$usrname,$pswd);
 if($dbconnlink) {
  echo h4bConnected to the MYSQL Server :  $hostname /bh4br;
  $db_list = mysql_list_dbs($dbconnlink);
  echo h4The Databases available in $hostname are :/h4;
  while ($GLOBALS[row]  = mysql_fetch_object($db_list)) {
// echo $row-Database . \n;
  echo  form METHOD=\POST\ action=?php show_table($row-Database); ?p
input type=\radio\ name=\Database_Selection\ value=\$row\ $row-Database
  /p
 [BLUE] I am listing the available databases here present in the mysql server 'xxx'
I want the user to select the database available ,upon the submit of selection of 
database,User must be able to see the available tables in that selected database
Again in the same format of Radio Options to select the table,He must be able to 
select the table,Upon selecting particular available table,he must be able to see the 
Values in it.
[BLUE]
br ;
  echo Testing;
  $selectcat=$row[category];
  echo option value=\$selectcat\$selectcat/option br;
 
  //To List all the Databases present in $hostname
  }
echoBRINPUT TYPE=\reset\ VALUE=\Clear\
INPUT TYPE=\submit\ VALUE=\Select\  ;
[BLUE]Can I have here to put the value as dynamic database.[/BLUE]

  mysql_free_result($row);
 } else {
  echo bError :  .mysql_error()./bbr.b
  pre
Go Back and type the Exact User ID and Password   Which mySQL Admininistrator Gave You,
  
 
if not available,Please contact a href = \[EMAIL PROTECTED] [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] 
/pre
  script language=\javascript\
  javascript.alert(\Go Back and type the Login Information Correctly\);
  /script
  br
  /b;
 }
function show_table() {
 $tableselected='';
 $tableselected= $_POST[$row-Database];
}
 
?
Thanks,
Nikhil.


[PHP] Problem with the code

2004-09-09 Thread Mulley, Nikhil
Hi All,
 
I have a problem...with my code ,can any one please guide or correct me.
 
[BLUE]
My main aim is to develop a php(or php in html) ,in which Login is there ,after 
appropriate login ,User must get the 
Option of selecting available databases ,Upon selecting databases,user must get to 
select the appropriate tabl from Selected database,
 
Can I have that code.
Please do the needful.
[BLUE]
Please find the questions in blue format 
authenticate.php (should be login.php no probs but)
 
?php
include(phpscripts/draw_table.php);
$hostname=xxx;
$usrname=$_POST['username'];
$usrname=root;
$pswd=$_POST['password'];
$db_selected;
$db_list;
$row;
$dbconnlink=mysql_connect($hostname,$usrname,$pswd);
 if($dbconnlink) {
  echo h4bConnected to the MYSQL Server :  $hostname /bh4br;
  $db_list = mysql_list_dbs($dbconnlink);
  echo h4The Databases available in $hostname are :/h4;
  while ($GLOBALS[row]  = mysql_fetch_object($db_list)) {
// echo $row-Database . \n;
  echo  form METHOD=\POST\ action=?php show_table($row-Database); ?p
input type=\radio\ name=\Database_Selection\ value=\$row\ $row-Database
  /p
 [BLUE] I am listing the available databases here present in the mysql server 'xxx'
I want the user to select the database available ,upon the submit of selection of 
database,User must be able to see the available tables in that selected database
Again in the same format of Radio Options to select the table,He must be able to 
select the table,Upon selecting particular available table,he must be able to see the 
Values in it.
[BLUE]
br ;
  echo Testing;
  $selectcat=$row[category];
  echo option value=\$selectcat\$selectcat/option br;
 
  //To List all the Databases present in $hostname
  }
echoBRINPUT TYPE=\reset\ VALUE=\Clear\
INPUT TYPE=\submit\ VALUE=\Select\  ;
[BLUE]Can I have here to put the value as dynamic database.[/BLUE]

  mysql_free_result($row);
 } else {
  echo bError :  .mysql_error()./bbr.b
  pre
Go Back and type the Exact User ID and Password   Which mySQL Admininistrator Gave You,
  
 
if not available,Please contact a href = \[EMAIL PROTECTED] [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] 
/pre
  script language=\javascript\
  javascript.alert(\Go Back and type the Login Information Correctly\);
  /script
  br
  /b;
 }
function show_table() {
 $tableselected='';
 $tableselected= $_POST[$row-Database];
}
 
?
Thanks,
Nikhil.