Hi,
My issue is that the MySQL script won't add any data to my database. I know the script works if it's not used in
echo "script";
so I really don't know where the wrong is. Here is the script:
<?php
if (isset($_POST['username']) and trim($_POST['username'])!='') {
echo "<?php
$con=mysql_connect('','',''); # Information removed
$condb=mysql_select_db('', $con); # Information removed
$name='$_POST[username]';
$password='$_POST[password]';
$sendinfo=mysql_query('INSERT INTO `members`(`User`,`Pass`) VALUES (\'$name\', \'$password\')') or die('request - ' . mysql_error());?>
<h1>Takk. Du kan nå logge inn </h1>"; }
else { echo "<h2>Registrer deg her: </h2>
<form action='#' method='post'>
<li><label>Brukernavn:</label>
<input tabindex='1' type='text' name='username' value='' maxlength='32' /><br /><br /></li>
<li><label>Passord: </label>
<input tabindex='2' type='password' name='password' maxlength='32' /><br /><br />
<input type='submit' value='Send inn'/></li>
</form>";}
?>
Any help is greatly appreciated. Thanks!