Jump to content

Archived

This topic is now archived and is closed to further replies.

scheols

Text Replace Form. humm Database Install Page

Recommended Posts

Well im still working on my Bulletin Board.

Now i want to make a form to replace the database name,uname,upass

So say i got:



[code]
<form action="checksubmit.php"method="post">
DataBase Name:          <input type="text" name="username"><br>
User Name:    <input type="text" name="password"><br>
DB User Password:<input type="text" name="password2"><br>
<input type="submit" value="Register" name="submit"><br>
</form>
[/code]

how could i make it so that when you click submit the input text changes the text thats in here:
[code]
$db_connection = mysql_connect("localhost", "username", "password");[/code]

and heres database thing
[code]
@mysql_select_db(databasename) or die( "unable to select database");
[/code]

like when you click submit everything on the Form u intered Replaces the Database stuff.

Share this post


Link to post
Share on other sites
$db_connection = mysql_connect("localhost", $_POST["username"],$_POST[ "password"]);

@mysql_select_db($_POST['databasename']) or die( "unable to select database");


try that

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.