Ok here are the contents of the three files I use,
add.php
<?php
$filename = 'odb.txt'; // edit this
function addlink($homepage,$name,$tag,$email,$leader,$empire,$server,$recruiting) {
global $filename;
$html = "<TABLE cellSpacing=0 cellPadding=2 width='100%' border=0><TBODY><TR class=content><TD width='5%'>$empire</TD><TD width='20%'><A href='$homepage'>$name</A></TD><TD width='20%'>$tag</TD><TD width='20%'><A href='mailto:$email'>$leader</A></TD><TD width='15%'>$server</TD><TD width='20%'>$recruiting</TD></TR></tbody></table> \n";
$fp = fopen($filename, 'a+');
fputs($fp, $html) or die("Could not open file!");
print "<center>Your Outfit was added successfully.</center>";
}
function showlinks() {
global $filename;
$html = implode(file($filename));
echo $html;
}
If (!$name){
print "<center>You must enter an Outfit Name</center><br>";
} elseif (!$tag){
print "<center>You must enter an Outfit Tag</center><br>";
} elseif (!$leader){
print "<center>You must enter an Outfit Leader Name</center><br>";
} elseif (!$email){
print "<center>You must enter an Email Address</center><br>";
} else {
addlink($homepage,$name,$tag,$email,$leader,$empire,$server,$recruiting);
print "<center><A href='index.php'>Back to Outfit Index</A></center>";
}
?>
index.php
<?php
$filename = "odb.txt"; // Edit This
function showlinks() {
global $filename;
$html = implode(file($filename));
print $html;
}
?>
and odb_add.php
<form method="POST" action="add.php">
Outfit Name: <br><input type="text" name="name" size="25"><br><br>
Outfit Leader: <br><input type="text" name="leader" size="25"><br><br>
Outfit Tag: <br><input type="text" name="tag" size="15"><br><br>
Empire: <br><SELECT name="empire">
<OPTION value="<img src=ud.bmp>">Undecided</OPTION>
<OPTION value="<img src=tr.bmp>">Terran Republic</OPTION>
<OPTION value="<img src=nc.bmp>">New Conglomerate</OPTION>
<OPTION value="<img src=vs.bmp>">Vanu Sovereignty</OPTION>
</SELECT><br><br>
Server: <br><SELECT name="server">
<OPTION value=Johari selected>Johari</OPTION>
<OPTION value="Markov">Markov</OPTION>
<OPTION value="Emerald">Emerald</OPTION>
<OPTION value="Konried">Konried</OPTION>
<OPTION value="Werner">Werner</OPTION>
<OPTION value="Undecided">Undecided</OPTION>
</SELECT><br><br>
Outfit Homepage: <br><input type="text" name="homepage" value="
Http://www.Planetside.com" size="35"><br><br>
Outfit E-mail: <br><input type="text" name="email" size="35"><br><br>
Recruiting: <br><SELECT name="recruiting">
<OPTION value=Yes selected>Yes</OPTION>
<OPTION value=No>No</OPTION>
</SELECT><br><br>
<p><input type="submit" value="Submit" name="Add"></p>
</form>
So far I don’t have the ability for users to log in just to add to the text file. I want them to log in I could find a set of code easy for that just get one that stores users in a mysql database which I have access to. but then how would I go about setting it up so that when a user logs in and goes back to odb_add.php it fill out the form with what they put in automatically.