Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Easy question

Status
Not open for further replies.

omega2red

IS-IT--Management
Jan 13, 2005
3
NL
can somebody provide me a code sample witch can make an table with a inputbox for server, username, password and the name of the new table.

thanks
 
This forum is not a script compendium, so you're many here, myself included, post code only when it is the most efficient means of explaining an answer.

Also, your question is simply too vague to be answered clearly.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Easy question" .... hmmmm!?!

TABLE like in a database table or HTML table or wooden table?! You're not being very clear.

And, like sleipnir214 says -we provide help in here -not cut'n'paste scripts. If that's what you're looking for then google for it :)

-if not .... then be specific, thank you.

However, I will provide one free tip - if there's reply to your posts it often means that the the title (exactly like the one on this thread) OR your question is too vague.

Regards


Jakob
 
yes i aleady search on google but i dident find anything.

i will try to explain the question better.

Inputbox1: Username.
Inputbox2: Passw.
Inputbox3: MYSQL name.
Inputbox4: New table name.
Button1: Send.

ive tried this but it doenst function well:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form method="POST" action="doit.php">
<!--The hidden fields are provided to maintain state. They are used to pass the username and password from script to script.-->
<input type="hidden" name="server" value="<? print $_POST['server']?>">
<input type="hidden" name="gebruiker" value="<? print $_POST['gebruiker']?>">
<input type="hidden" name="wachtwoord" value="<? print $_POST['wachtwoord']?>">
<?php
$server=$_POST['server'];
$gebruiker=$_POST['gebruiker'];
$wachtwoord=$_POST['wachtwoord'];
$link = mysql_pconnect(server, gebruiker, wachtwoord)
or exit("Kan geen verbinding maken: " . mysql_error());
if (mysql_create_db("my_db")) {
print ("Database succesvol gemaakt\n");
} else {
printf ("Error bij het maken van database: %s\n", mysql_error());
}
?>

<?
print "Enter Server Name: <input type=text name=server size=20><br>\n";
print "Enter Username: <input type=text name=gebruiker size=10><br>\n";
print "Enter Password: <input type=text name=wachtwoord size=10><br>\n";
print "<br>\n";
print "<input type=submit value=Submit><input type=reset>\n";
?>
</form>
</td></tr></table>
</body>
</html>


doit.php:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>


<?php
$server=$_POST['server'];
$gebruiker=$_POST['gebruiker'];
$wachtwoord=$_POST['wachtwoord'];
$link = mysql_pconnect(server, gebruiker, wachtwoord)
or exit("Kan geen verbinding maken: " . mysql_error());
if (mysql_create_db("my_db")) {
print ("Database succesvol gemaakt\n");
} else {
printf ("Error bij het maken van database: %s\n", mysql_error());
}
?>

<body>

</body>
</html>
 
Try and post some more details - I reliase it may be difficult to get the correct Ebglish, but for a start:
the line
Code:
 $link = mysql_pconnect(server, gebruiker, wachtwoord)
try
Code:
 $link = mysql_pconnect($server, $gebruiker, $wachtwoord);
Also
You seem to have the hidden fields and the <input fields with the same name, which is possibly unwise.
In general your code is confused by using two scripts both attempting to create the database for example.
Try to at least get the scripts to run without compile faisl and we'll try from there


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top