I do not know how to do this, or enough php code to get even close. I do know enough, however, to insert the code if someone could help me out. If anyone can help me with this, I will give you full credit and as thanks I can give you $10 via paypal. I know its not a lot, but its all that I can spare. I dont make much money from sites.
Here's more detail:
Problem 1:
Here is the "add admin" script. I can run this script fine I think, becuase after adding an admin and trying to add them again, it gives me a message that that name was already taken.
Code: Select all
<?PHP
session_start();
$page = "addadmin";
require('./../variables.php');
require('./../variablesdb.php');
require('top2.php');
?>
<?php
$sql="SELECT * FROM $admintable WHERE name = '$username' AND password = '$password'";
$result=mysql_query($sql,$db);
$number = mysql_num_rows($result);
if ($number == "1") {
?>
<p class="header">Add admin.</p>
<?php
if ($submit) {
$sql="SELECT * FROM $admintable WHERE name = '$name'";
$result=mysql_query($sql,$db);
$samenick = mysql_num_rows($result);
if ($samenick < 1) {
$sql = "INSERT INTO $admintable (name, password) VALUES ('$name','$password')";
$result = mysql_query($sql);
echo "<p class='text'>Thank you! Information entered.<br><br><a href='$directory/Admin/addadmin.php'><font color='$color1'>Add another admin</font>.</a></p>";
}
else {
echo "<p class='text'>The name you entered already exist.</p>";
}
}
else{
?>
<form method="post" action="<?php echo $PHP_SELF?>">
<table border="0" cellpadding="0">
<tr>
<td><p class="text">Name:</p></td>
<td><input type="Text" name="name" style="background-color: <?php echo"$color5" ?>; border: 1 solid <?php echo"$color1" ?>" class="text"></td>
</tr>
<tr>
<td><p class="text">Password:</p></td>
<td><input type="password" name="password" style="background-color: <?php echo"$color5" ?>; border: 1 solid <?php echo"$color1" ?>" class="text"></td>
</tr>
</table>
<p align="left">
<input type="Submit" name="submit" value="Submit." style="background-color: <?php echo"$color5" ?>; border: 1 solid <?php echo"$color1" ?>" class="text"><br><br>
</form>
</p>
<?php
}
?>
<?php
}
else {
echo "<p class='header'>You are not allowed to view this part of the site.<br><br>
<p class='text'><a href='$directory/Admin/index.php'><font color='$color1'>Login.</font></a></p>";
}
require('bottom2.php');
?>Code: Select all
<?PHP
session_start();
$page = "login";
require('./../variables.php');
require('./../variablesdb.php');
require('top2.php');
?>
<p class="header">Admin section.</p>
<?php
$sql="SELECT * FROM $admintable WHERE name = '$username' AND password = '$password'";
$result=mysql_query($sql,$db);
$number = mysql_num_rows($result);
if ($number == "1") {
session_register("password");
session_register("username");
?>
<p class='text'>You are logged in as <b><?php echo "$username" ?></b>.</p>
<?
}
else {
if($submit) {
$error = "";
?>
<p class='text'>Login failed.</p>
<?php
}
?>
<form name="form1" method="post" action="<?php echo $PHP_SELF?>">
<table border="0" cellpadding="0">
<tr>
<td><p class='text'>Name:</p></td>
<td><input type="text" name="username" size="20" style="background-color: <?php echo"$color5" ?>; border: 1 solid <?php echo"$color1" ?>" class="text"></td>
</tr>
<tr>
<td><p class='text'>Password:</p></td>
<td><input type="password" name="password" size="20" style="background-color: <?php echo"$color5" ?>; border: 1 solid <?php echo"$color1" ?>" class="text"></td>
</tr>
<tr>
<td><input type="submit" value="Log in." name="submit" style="background-color: <?php echo"$color5" ?>; border: 1 solid <?php echo"$color1" ?>" class="text"></td>
</tr>
</table>
</form>
<?php
}
?>
<?php
require('bottom2.php');
?>Each time a user plays a game, they enter the results in this page:
http://www.gunzfactor.com/ladder/report.php
I want to add another field to the report results page, where the user uploads the replay file for that game, and then the replay file will be downloadable from the "recently played games" page.
Here is the "recently played games" page:
http://www.gunzfactor.com/ladder/played ... hplayed=20
Thanks!
JCART | Please use
Code: Select all
tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]