Hej alle.
Jeg prøver at lave en opret side, men kan ikke få din til at submit ind i mysql.
Min kode ser sådan her ud:
- if($_POST['submit']) {
- if($ingame != "" && $email != "") {
- $ingame = mysql_real_escape_string(htmlspecialchars($_POST['ingame']));
- $email = mysql_real_escape_string(htmlspecialchars($_POST['email']));
-
- mysql_query("INSERT INTO user (ingame, email) VALUES ('$ingame', '$email')");
- echo "Vi har nu sendt dig en :)";
- $to = $email;
- $subject = 'Oprettelse ved Looms';
- $message = 'Hej '. $username .'.<br>Velkommen til Looms.<br><br><br>- Administrationen Looms';
- $headers = 'MIME-Version: 1.0' . "\r\n";
- $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
- mail($to, $subject, $message, $headers);
- } else {
- echo "<font size='5'><b><u>Opret</u></b></font>";
- echo "<form action='' method='POST'>
- <table width='100%'>
- <tr>
- <td width='20%'>
- Ingame navn
- </td>
- <td width='80%'>
- <input type='text' name='ingame' value='". $ingame ."' size='30'>";
- if($ingame == "") {
- echo "<font color='red'> *</font>";
- }
- echo "</td>
- </tr>
- <tr>
- <td colspan='2'>
- <hr>
- </td>
- </tr>
- <tr>
- <td width='20%'>
- Email
- </td>
- <td width='80%'>
- <input type='text' name='email' value='". $email ."' size='30'>";
- if($email == "") {
- echo "<font color='red'> *</font>";
- }
- echo "
- </td>
- </tr>
- </table>
- </form>";
- }
- } elseif(!$_POST['submit']) {
- echo "<font size='5'><b><u>Opret</u></b></font>";
- echo "<form action='' method='POST'>
- <table width='100%'>
- <tr>
- <td width='20%'>
- Ingame navn
- </td>
- <td width='80%'>
- <input type='text' name='ingame' size='30'>
- </td>
- </tr>
- <tr>
- <td colspan='2'>
- <hr>
- </td>
- </tr>
- <tr>
- <td width='20%'>
- Email
- </td>
- <td width='80%'>
- <input type='text' name='email' size='30'>
- </td>
- </tr>
- </table>
- </form>";
- }
Den sender godt nok mailen
Håber i kan hjælpe mig