瀏覽代碼

can now add account names, still need to view current names

pull/16/head
mauirixxx 7 年之前
父節點
當前提交
bf0ba8cf3b
共有 1 個檔案被更改,包括 21 行新增1 行删除
  1. +21
    -1
      addaccounts.php

+ 21
- 1
addaccounts.php 查看文件

@@ -1,6 +1,26 @@
<?php
$pagetitle = "Add a Guild Wars account to track";
include_once ('header.php');
echo 'Return to your <a href="index.php" class="navlink">user</a> page';

if (!empty($_POST['accemail'])) {
$addacc = $con->prepare("INSERT INTO gwaccounts (userid, accemail) VALUES (?, ?)");
$addacc->bind_param("is", $_SESSION['userid'], $_POST['accemail']);
$addacc->execute();
$addacc->close();
echo 'New account added, returning to editor.';
header ("Refresh:1; url=addaccounts.php");
exit();
}

echo '<form action="addaccounts.php" method="post"><table>';
echo '<caption>Add a new Guild Wars account e-mail</caption>';
echo '<tr><td><input type="text" name="accemail" size="35" autofocus required></td></tr>';
echo '</table><input type="submit" value="Add account"></form>';

echo '<table border="1"><caption>Current Guild Wars accounts</caption>';
echo '<tr><th>Account name</th></tr>';
// grab account name from database and loop it in here as a read only bit

echo '<br />Return to your <a href="index.php" class="navlink">user</a> page';
include_once ('footer.php');
?>

Loading…
取消
儲存