Old script trying to make current

Hello,

I found this old script that connects to the data base but will not post anything. Need help making it current please. The site shows up but when I try to add anything I get a blank page http://www.slaterlittleleague.com/stats/admin I unpassworded it for you can see what I mean here is one page from the file. Add Season page

[php]
include(’…/include/config.inc.php’);
if($submit)
{
if($name)
{
$insert = “INSERT INTO season (name) VALUES (’$name’)”;
$result = mysql_query($insert);
echo “Thank You, That information has been entered.
\n
If you are not re-directed to the Admin page in 3 seconds
Click Here”;
echo “<META HTTP-EQUIV=Refresh CONTENT=“3; URL=index.php”>”;
}
else
{
echo “Please type a season name.
Go Back”;
}
}
else
{
echo $PHP_SELF;
}
[/php]

Thank you so much for your help
Chris

Instead of if($name) use if(isset($name))

Sorry that did not work. Thanks tho. I know that it is trying to connect to the database because if i change the database name is says connection error. in dream weaver i don’t not see any kind of errors ether. Also I check the database it self just to see if it was adding just not showing and that’s not the case.

here is a link to download the whole script if you want to look @ it

http://www.slaterlittleleague.com/stats.zip

Thanks Again

gimme some time to look it over maybe I can get a better idea

got it, try this

[php]include(’…/include/config.inc.php’);
if(isset($_POST[‘name’])){
$name = $_POST[‘name’];
$insert = “INSERT INTO season (name) VALUES (’$name’)”;
$result = mysql_query($insert);
echo “Thank You, That information has been entered.
\n
If you are not re-directed to the Admin page in 3 seconds
Click Here”;
echo “<META HTTP-EQUIV=Refresh CONTENT=“3; URL=index.php”>”;
}
else
{
echo “Please type a season name.
Go Back”;
}
ini_set(‘display_errors’,1);
error_reporting(E_ALL);

[/php]

Yes that worked but the other admin pages also error
thank you so much for the help

just the whole script is out dated

ok Add player is done :slight_smile:

went from this

[php]
include (’…/include/config.inc.php’);
if($addnew)
{
if($first && $last)
{
$insert = “INSERT INTO players (last, first) VALUES (’$last’,’$first’)”;
$result = mysql_query($insert);
echo “Thank You, That information has been entered.
\n
If you are not re-directed to the Admin page in 3 seconds
<a href=index.php?seasonID=$seasonID>Click Here”;
echo “<META HTTP-EQUIV=Refresh CONTENT=“3; URL=index.php?seasonID=$seasonID”>”;

}
else
{
	echo "you must enter a player's name";
}

}
elseif($addexisting)
{
if($playerID)
{
$insert = “INSERT INTO playersinseason (playerID, seasonID) VALUES (’$playerID’,’$seasonID’)”;
$result = mysql_query($insert);
echo “Thank You, That information has been entered.
\n
If you are not re-directed to the Admin page in 3 seconds
<a href=index.php?seasonID=$seasonID>Click Here”;
echo “<META HTTP-EQUIV=Refresh CONTENT=“3; URL=index.php?seasonID=$seasonID”>”;
}
else
{
echo “you must select a player”;
}
}
else
{
echo “error”;
}
[/php]

To This

[php]
include (’…/include/config.inc.php’);
if(isset($_POST[‘last’ ])){
$last = $_POST[‘last’];

if(isset($_POST[‘first’ ])){
$first = $_POST[‘first’];

	$insert = "INSERT INTO players (last, first) VALUES ('$last','$first')";
    $result = mysql_query($insert);
    echo "Thank You, That information has been entered.<br>\n
          If you are not re-directed to the Admin page in 3 seconds
          <a href=index.php?seasonID=$seasonID>Click Here</a>";
    echo "<META HTTP-EQUIV=Refresh CONTENT=\"3; URL=index.php?seasonID=$seasonID\">";

}

{
	echo "you must enter a player's name";
}

}
elseif($addexisting)
{
if($playerID)
{
$insert = “INSERT INTO playersinseason (playerID, seasonID) VALUES (’$playerID’,’$seasonID’)”;
$result = mysql_query($insert);
echo “Thank You, That information has been entered.
\n
If you are not re-directed to the Admin page in 3 seconds
<a href=index.php?seasonID=$seasonID>Click Here”;
echo “<META HTTP-EQUIV=Refresh CONTENT=“3; URL=index.php?seasonID=$seasonID”>”;
}
else
{
echo “you must select a player”;
}
}
else
{
echo “error”;
}
[/php]

Hope the rest fix this easy

OK so they are not :). As you have noticed i am not a php freak but the help on this code is truly appreciated and goes towards our youth :slight_smile:

Thanks
Chris

i just noticed that this:
[php]$result = mysql_query($insert);[/php]

is their yet your not doing anything with it, so the code can be:

[php]mysql_query($insert);[/php]

and it will work just fine if not a little faster.

OK I will switch those have you had a chance to look @ the other pages? I can post them 1 by 1 if you want I really do appreciate this.

That’s quite a lot of work, usly you pay someone or do it or your self when you need to rewrite an entire program, sorry bud, I only help small things for free :stuck_out_tongue:

The wholes script doesn’t need to be re written just the connection where it send data to the database. but hey thanks for the help

How much would you charge just to ask

well its just updating it and it looks like small typo’s need to be fixed, along with url’s and I think one page needs to be fully rewritten but prob $5 for the whole thing, $6 if any problems pop up (say its calling system functions that no longer exist, and their fore need to write a custom replacement.)

Tell you what I will pay you $10 I will PM you my phone number are you in the US? first of all and payment through paypal?

sent you a txt msg

here is the url for you to test everything to make sure it works

http://71.197.250.25/stats/

I will give you the login for the admin page through txt

here is the paypal thing

http://the.deepsky.it/payment.html

Sponsor our Newsletter | Privacy Policy | Terms of Service