Jump to content

Not inserting anything into my database.


colleyboy

Recommended Posts

Hi.

 

Am trying to make an install script but have run into a problem.

 

----

variables.php - holds the variables that I need

install.php - connects to the database and inserts all the values.

 

Now I have a problem.  When I execute the install.php it outputs:

 

Creating tables...

 

Connected to database server

Database webleague is selected

 

Players table

Games table

News table

Rules table

Games table

Vars table

 

Inserting default values

Inserting news

Inserting rules

Inserting themes

Inserting vars

 

Done.

 

but doesnt insert ANYTHING into the database.

 

Can anyone help?

 

Variables.php:

<?php

//start

//configure database info
$databaseserver = "localhost"; //usually localhost
$databasename = "xxxxxxxxx"; //the name of your database
$databaseuser = "xxxxxxxxx"; //the name of the database user
$databasepass = "xxxxxxxxx"; // the password to your database
$directory ="http://xxxxxxxxxxxxxxxxxx" ; //the location of your WebLeague directory (no trailing slash)

//configure the tables in the database
$playerstable = "webl_players"; //the name of the table that contains information about the players
$gamestable = "webl_games"; //the name of the table that stores the played games
$newstable = "webl_news"; // the name of the table that stores the news
$themestable = "webl_themes"; //the name of the table that stores the themes
$varstable = "webl_vars"; //the name of the table that stores various information
$rulestable = "webl_rules"; //the name of the table the stores the rules

//set some general information on your league
$leaguename = "IRC League"; //the name of your league
$title = ".: IRC League :."; //the title of your pages
$favicon = "$directory/WebLeaguefavicon.ico" ; //the location of the shortcut icon
$report = "winner"; //who reports? winner/loser
$pointswin = "3"; //the number of points awarded for a win
$pointsloss = "-1"; //the number of points awarded for a loss

//set the username and password for the admin panel
$LOGIN = "xxxxxxxxxx"; //the username to access the admin panel
$PASSWORD = "xxxxxxxxx"; //the passoword to access the admin panel

// finish

?>

 

 

And this is install.php:

 


Creating tables...<br><br>
<?php
include "variables.php";

$db = mysql_connect($databaseserver, $databaseuser, $databasepass)
or die("Connection Failure to Database Server");
echo "Connected to database server<br>";
        mysql_select_db($databasename, $db) or die ($databasename . " Database not found." . 

$databaseuser);
echo "Database " . $databasename . " is selected<br><br>";
if ($db==false) die("Failed to connect to MySQL server<br>\n");

$sql = "CREATE TABLE $playerstable (player_id int(10) DEFAULT '0' NOT NULL auto_increment, name 

varchar(40) DEFAULT '' NOT NULL, passworddb varchar(10), mail varchar(50), icq varchar(15), aim varchar

(40), country varchar(40), games int(10) DEFAULT '0', wins int(10) DEFAULT '0', losses int(10) DEFAULT 

'0', points int(10) DEFAULT '0', totalwins int(10) DEFAULT '0', totallosses int(10) DEFAULT '0', 

totalpoints int(10) DEFAULT '0', totalgames int(10) DEFAULT '0', penalties int(10) DEFAULT '0', staff 

varchar(10), streakwins int(10) DEFAULT '0', streaklosses int(10) DEFAULT '0', PRIMARY KEY (player_id))";
mysql_query($sql,$db);
$sql = "ALTER TABLE $playerstable ADD UNIQUE(name) ";
mysql_query($sql,$db);

        echo"Players table<br>";

$sql = "CREATE TABLE $gamestable (game_id int(10) DEFAULT '0' NOT NULL auto_increment, winner 

varchar(40), loser varchar(40), date varchar(40), PRIMARY KEY (game_id))";
mysql_query($sql,$db);
        echo"Games table<br>";

$sql = "CREATE TABLE $newstable (news_id int(10) DEFAULT '0' NOT NULL auto_increment, news text, 

PRIMARY KEY (news_id))";
mysql_query($sql,$db);
        echo"News table<br>";

$sql = "CREATE TABLE $rulestable (rules_id int(10) DEFAULT '0' NOT NULL auto_increment, rules 

text, PRIMARY KEY (rules_id))";
mysql_query($sql,$db);
        echo"Rules table<br>";

$sql = "CREATE TABLE $themestable (theme_id int(10) DEFAULT '0' NOT NULL auto_increment, name 

varchar(40), color1 varchar(40), color2 varchar(40), color3 varchar(40), color4 varchar(40), aimthemepic 

varchar(80), bottomleftpic varchar(80), bottommiddlepic varchar(80), bottomrightpic varchar(80), 

headerbgpic varchar(80), headermenuleftpic varchar(80), headermenurightpic varchar(80), sideleftpic 

varchar(80), siderightpic varchar(80), topleftpic varchar(80), topmiddlepic varchar(80), toprightpic 

varchar(80), PRIMARY KEY (theme_id))";
mysql_query($sql,$db);
        echo"Games table<br>";

$sql = "CREATE TABLE $varstable (vars_id int(10) DEFAULT '0' NOT NULL auto_increment, theme varchar(20), 

font varchar(80), fontcolor varchar(40), headerfont varchar(80), numgamespage int(10), numplayerspage int

(10), statsview varchar(10), stats1view varchar(10), stats2view varchar(10), stats3view varchar(10), 

stats4view varchar(10), stats5view varchar(10), stats6view varchar(10), stats7view varchar(10), statsnum 

int(10), rulesview varchar(10), standingsnogames varchar(10), pctnum varchar(10), hotcoldnum varchar(10), 

gamesmaxday int(10), PRIMARY KEY (vars_id))";
mysql_query($sql,$db);
        echo"Vars table<br><br>";

        echo"Inserting default values<br>";

$sql = "INSERT INTO $newstable (news) VALUES ('Welcome to WebLeague<br><br>WebLeague is an automated 

league system, that makes organizing an online league a piece of cake.<br><br>To put your own news here, 

go to the news section in your admin panel<br><br>Have fun using WebLeague')";
       	mysql_query($sql,$db);
        echo"Inserting news<br>";

$sql = "INSERT INTO $rulestable (rules) VALUES ('Insert your rules by going to the rules section in the 

admin panel')";
       	mysql_query($sql,$db);
        echo"Inserting rules<br>";

$sql = "INSERT INTO $themestable (name, color1, color2, color3, color4, aimthemepic, bottomleftpic, 

bottommiddlepic, bottomrightpic, headerbgpic, headermenuleftpic, headermenurightpic, sideleftpic, 

siderightpic, topleftpic, topmiddlepic, toprightpic) VALUES ('blue','#0080FF','#000066', '#FFFFFF', 

'#000099', '/themes/blue/aim.jpg', '/themes/blue/bottomleft.jpg', '/themes/blue/bottommiddle.jpg', 

'/themes/blue/bottomright.jpg', '/themes/blue/headerbg.jpg', '/themes/blue/headermenuleft.jpg', 

'/themes/blue/headermenuright.jpg', '/themes/blue/sideleft.jpg', '/themes/blue/sideright.jpg', 

'/themes/blue/topleft.jpg', '/themes/blue/topmiddle.jpg', '/themes/blue/topright.jpg')";
mysql_query($sql,$db);
$sql = "INSERT INTO $themestable (name, color1, color2, color3, color4, aimthemepic, bottomleftpic, 

bottommiddlepic, bottomrightpic, headerbgpic, headermenuleftpic, headermenurightpic, sideleftpic, 

siderightpic, topleftpic, topmiddlepic, toprightpic) VALUES ('blue2','#66809A','#29293D', '#FFFFFF', 

'#444466', '/themes/blue2/aim.jpg', '/themes/blue2/bottomleft.jpg', '/themes/blue2/bottommiddle.jpg', 

'/themes/blue2/bottomright.jpg', '/themes/blue2/headerbg.jpg', '/themes/blue2/headermenuleft.jpg', 

'/themes/blue2/headermenuright.jpg', '/themes/blue2/sideleft.jpg', '/themes/blue2/sideright.jpg', 

'/themes/blue2/topleft.jpg', '/themes/blue2/topmiddle.jpg', '/themes/blue2/topright.jpg')";
mysql_query($sql,$db);
$sql = "INSERT INTO $themestable (name, color1, color2, color3, color4, aimthemepic, bottomleftpic, 

bottommiddlepic, bottomrightpic, headerbgpic, headermenuleftpic, headermenurightpic, sideleftpic, 

siderightpic, topleftpic, topmiddlepic, toprightpic) VALUES ('red','#FF0000','#660000', '#FFFFFF', 

'#990000', '/themes/red/aim.jpg', '/themes/red/bottomleft.jpg', '/themes/red/bottommiddle.jpg', 

'/themes/red/bottomright.jpg', '/themes/red/headerbg.jpg', '/themes/red/headermenuleft.jpg', 

'/themes/red/headermenuright.jpg', '/themes/red/sideleft.jpg', '/themes/red/sideright.jpg', 

'/themes/red/topleft.jpg', '/themes/red/topmiddle.jpg', '/themes/red/topright.jpg')";
mysql_query($sql,$db);
$sql = "INSERT INTO $themestable (name, color1, color2, color3, color4, aimthemepic, bottomleftpic, 

bottommiddlepic, bottomrightpic, headerbgpic, headermenuleftpic, headermenurightpic, sideleftpic, 

siderightpic, topleftpic, topmiddlepic, toprightpic) VALUES ('red2','#9A666C','#3D2929', '#FFFFFF', 

'#664444', '/themes/red2/aim.jpg', '/themes/red2/bottomleft.jpg', '/themes/red2/bottommiddle.jpg', 

'/themes/red2/bottomright.jpg', '/themes/red2/headerbg.jpg', '/themes/red2/headermenuleft.jpg', 

'/themes/red2/headermenuright.jpg', '/themes/red2/sideleft.jpg', '/themes/red2/sideright.jpg', 

'/themes/red2/topleft.jpg', '/themes/red2/topmiddle.jpg', '/themes/red2/topright.jpg')";
mysql_query($sql,$db);
$sql = "INSERT INTO $themestable (name, color1, color2, color3, color4, aimthemepic, bottomleftpic, 

bottommiddlepic, bottomrightpic, headerbgpic, headermenuleftpic, headermenurightpic, sideleftpic, 

siderightpic, topleftpic, topmiddlepic, toprightpic) VALUES ('green','#00FF00','#006600', '#FFFFFF', 

'#009900', '/themes/green/aim.jpg', '/themes/green/bottomleft.jpg', '/themes/green/bottommiddle.jpg', 

'/themes/green/bottomright.jpg', '/themes/green/headerbg.jpg', '/themes/green/headermenuleft.jpg', 

'/themes/green/headermenuright.jpg', '/themes/green/sideleft.jpg', '/themes/green/sideright.jpg', 

'/themes/green/topleft.jpg', '/themes/green/topmiddle.jpg', '/themes/green/topright.jpg')";
mysql_query($sql,$db);
$sql = "INSERT INTO $themestable (name, color1, color2, color3, color4, aimthemepic, bottomleftpic, 

bottommiddlepic, bottomrightpic, headerbgpic, headermenuleftpic, headermenurightpic, sideleftpic, 

siderightpic, topleftpic, topmiddlepic, toprightpic) VALUES ('green2','#6C9A66','#2D3D29', '#FFFFFF', 

'#446644', '/themes/green2/aim.jpg', '/themes/green2/bottomleft.jpg', '/themes/green2/bottommiddle.jpg', 

'/themes/green2/bottomright.jpg', '/themes/green2/headerbg.jpg', '/themes/green2/headermenuleft.jpg', 

'/themes/green2/headermenuright.jpg', '/themes/green2/sideleft.jpg', '/themes/green2/sideright.jpg', 

'/themes/green2/topleft.jpg', '/themes/green2/topmiddle.jpg', '/themes/green2/topright.jpg')";
mysql_query($sql,$db);
$sql = "INSERT INTO $themestable (name, color1, color2, color3, color4, aimthemepic, bottomleftpic, 

bottommiddlepic, bottomrightpic, headerbgpic, headermenuleftpic, headermenurightpic, sideleftpic, 

siderightpic, topleftpic, topmiddlepic, toprightpic) VALUES ('orange','#FF8000','#662200', '#FFFFFF', 

'#994000', '/themes/orange/aim.jpg', '/themes/orange/bottomleft.jpg', '/themes/orange/bottommiddle.jpg', 

'/themes/orange/bottomright.jpg', '/themes/orange/headerbg.jpg', '/themes/orange/headermenuleft.jpg', 

'/themes/orange/headermenuright.jpg', '/themes/orange/sideleft.jpg', '/themes/orange/sideright.jpg', 

'/themes/orange/topleft.jpg', '/themes/orange/topmiddle.jpg', '/themes/orange/topright.jpg')";
mysql_query($sql,$db);
$sql = "INSERT INTO $themestable (name, color1, color2, color3, color4, aimthemepic, bottomleftpic, 

bottommiddlepic, bottomrightpic, headerbgpic, headermenuleftpic, headermenurightpic, sideleftpic, 

siderightpic, topleftpic, topmiddlepic, toprightpic) VALUES ('orange2','#9A7E66','#3D3129', '#FFFFFF', 

'#664444', '/themes/orange2/aim.jpg', '/themes/orange2/bottomleft.jpg', 

'/themes/orange2/bottommiddle.jpg', '/themes/orange2/bottomright.jpg', '/themes/orange2/headerbg.jpg', 

'/themes/orange2/headermenuleft.jpg', '/themes/orange2/headermenuright.jpg', 

'/themes/orange2/sideleft.jpg', '/themes/orange2/sideright.jpg', '/themes/orange2/topleft.jpg', 

'/themes/orange2/topmiddle.jpg', '/themes/orange2/topright.jpg')";
mysql_query($sql,$db);
$sql = "INSERT INTO $themestable (name, color1, color2, color3, color4, aimthemepic, bottomleftpic, 

bottommiddlepic, bottomrightpic, headerbgpic, headermenuleftpic, headermenurightpic, sideleftpic, 

siderightpic, topleftpic, topmiddlepic, toprightpic) VALUES ('purple','#9900FF','#330066', '#FFFFFF', 

'#660099', '/themes/purple/aim.jpg', '/themes/purple/bottomleft.jpg', '/themes/purple/bottommiddle.jpg', 

'/themes/purple/bottomright.jpg', '/themes/purple/headerbg.jpg', '/themes/purple/headermenuleft.jpg', 

'/themes/purple/headermenuright.jpg', '/themes/purple/sideleft.jpg', '/themes/purple/sideright.jpg', 

'/themes/purple/topleft.jpg', '/themes/purple/topmiddle.jpg', '/themes/purple/topright.jpg')";
mysql_query($sql,$db);
$sql = "INSERT INTO $themestable (name, color1, color2, color3, color4, aimthemepic, bottomleftpic, 

bottommiddlepic, bottomrightpic, headerbgpic, headermenuleftpic, headermenurightpic, sideleftpic, 

siderightpic, topleftpic, topmiddlepic, toprightpic) VALUES ('purple2','#83669A','#32293D', '#FFFFFF', 

'#664466', '/themes/purple2/aim.jpg', '/themes/purple2/bottomleft.jpg', 

'/themes/purple2/bottommiddle.jpg', '/themes/purple2/bottomright.jpg', '/themes/purple2/headerbg.jpg', 

'/themes/purple2/headermenuleft.jpg', '/themes/purple2/headermenuright.jpg', 

'/themes/purple2/sideleft.jpg', '/themes/purple2/sideright.jpg', '/themes/purple2/topleft.jpg', 

'/themes/purple2/topmiddle.jpg', '/themes/purple2/topright.jpg')";
mysql_query($sql,$db);
$sql = "INSERT INTO $themestable (name, color1, color2, color3, color4, aimthemepic, bottomleftpic, 

bottommiddlepic, bottomrightpic, headerbgpic, headermenuleftpic, headermenurightpic, sideleftpic, 

siderightpic, topleftpic, topmiddlepic, toprightpic) VALUES ('black','#666666','#000000', '#FFFFFF', 

'#999999', '/themes/black/aim.jpg', '/themes/black/bottomleft.jpg', '/themes/black/bottommiddle.jpg', 

'/themes/black/bottomright.jpg', '/themes/black/headerbg.jpg', '/themes/black/headermenuleft.jpg', 

'/themes/black/headermenuright.jpg', '/themes/black/sideleft.jpg', '/themes/black/sideright.jpg', 

'/themes/black/topleft.jpg', '/themes/black/topmiddle.jpg', '/themes/black/topright.jpg')";
mysql_query($sql,$db);
$sql = "INSERT INTO $themestable (name, color1, color2, color3, color4, aimthemepic, bottomleftpic, 

bottommiddlepic, bottomrightpic, headerbgpic, headermenuleftpic, headermenurightpic, sideleftpic, 

siderightpic, topleftpic, topmiddlepic, toprightpic) VALUES ('yellow','#FFEF00','#635200', '#FFFFFF', 

'#999900', '/themes/yellow/aim.jpg', '/themes/yellow/bottomleft.jpg', '/themes/yellow/bottommiddle.jpg', 

'/themes/yellow/bottomright.jpg', '/themes/yellow/headerbg.jpg', '/themes/yellow/headermenuleft.jpg', 

'/themes/yellow/headermenuright.jpg', '/themes/yellow/sideleft.jpg', '/themes/yellow/sideright.jpg', 

'/themes/yellow/topleft.jpg', '/themes/yellow/topmiddle.jpg', '/themes/yellow/topright.jpg')";
mysql_query($sql,$db);
$sql = "INSERT INTO $themestable (name, color1, color2, color3, color4, aimthemepic, bottomleftpic, 

bottommiddlepic, bottomrightpic, headerbgpic, headermenuleftpic, headermenurightpic, sideleftpic, 

siderightpic, topleftpic, topmiddlepic, toprightpic) VALUES ('yellow2','#9A9666','#3D3A29', '#FFFFFF', 

'#666644', '/themes/yellow2/aim.jpg', '/themes/yellow2/bottomleft.jpg', 

'/themes/yellow2/bottommiddle.jpg', '/themes/yellow2/bottomright.jpg', '/themes/yellow2/headerbg.jpg', 

'/themes/yellow2/headermenuleft.jpg', '/themes/yellow2/headermenuright.jpg', 

'/themes/yellow2/sideleft.jpg', '/themes/yellow2/sideright.jpg', '/themes/yellow2/topleft.jpg', 

'/themes/yellow2/topmiddle.jpg', '/themes/yellow2/topright.jpg')";
mysql_query($sql,$db);
$sql = "INSERT INTO $themestable (name, color1, color2, color3, color4, aimthemepic, bottomleftpic, 

bottommiddlepic, bottomrightpic, headerbgpic, headermenuleftpic, headermenurightpic, sideleftpic, 

siderightpic, topleftpic, topmiddlepic, toprightpic) VALUES ('pink','#FF00EF','#660066', '#FFFFFF', 

'#990099', '/themes/pink/aim.jpg', '/themes/pink/bottomleft.jpg', '/themes/pink/bottommiddle.jpg', 

'/themes/pink/bottomright.jpg', '/themes/pink/headerbg.jpg', '/themes/pink/headermenuleft.jpg', 

'/themes/pink/headermenuright.jpg', '/themes/pink/sideleft.jpg', '/themes/pink/sideright.jpg', 

'/themes/pink/topleft.jpg', '/themes/pink/topmiddle.jpg', '/themes/pink/topright.jpg')";
mysql_query($sql,$db);
$sql = "INSERT INTO $themestable (name, color1, color2, color3, color4, aimthemepic, bottomleftpic, 

bottommiddlepic, bottomrightpic, headerbgpic, headermenuleftpic, headermenurightpic, sideleftpic, 

siderightpic, topleftpic, topmiddlepic, toprightpic) VALUES ('pink2','#9A6696','#3C293D', '#FFFFFF', 

'#664466', '/themes/pink2/aim.jpg', '/themes/pink2/bottomleft.jpg', '/themes/pink2/bottommiddle.jpg', 

'/themes/pink2/bottomright.jpg', '/themes/pink2/headerbg.jpg', '/themes/pink2/headermenuleft.jpg', 

'/themes/pink2/headermenuright.jpg', '/themes/pink2/sideleft.jpg', '/themes/pink2/sideright.jpg', 

'/themes/pink2/topleft.jpg', '/themes/pink2/topmiddle.jpg', '/themes/pink2/topright.jpg')";
mysql_query($sql,$db);
$sql = "INSERT INTO $themestable (name, color1, color2, color3, color4, aimthemepic, bottomleftpic, 

bottommiddlepic, bottomrightpic, headerbgpic, headermenuleftpic, headermenurightpic, sideleftpic, 

siderightpic, topleftpic, topmiddlepic, toprightpic) VALUES ('greenblue','#00FFEA','#006654', '#FFFFFF', 

'#009999', '/themes/greenblue/aim.jpg', '/themes/greenblue/bottomleft.jpg', 

'/themes/greenblue/bottommiddle.jpg', '/themes/greenblue/bottomright.jpg', 

'/themes/greenblue/headerbg.jpg', '/themes/greenblue/headermenuleft.jpg', 

'/themes/greenblue/headermenuright.jpg', '/themes/greenblue/sideleft.jpg', 

'/themes/greenblue/sideright.jpg', '/themes/greenblue/topleft.jpg', '/themes/greenblue/topmiddle.jpg', 

'/themes/greenblue/topright.jpg')";
mysql_query($sql,$db);
$sql = "INSERT INTO $themestable (name, color1, color2, color3, color4, aimthemepic, bottomleftpic, 

bottommiddlepic, bottomrightpic, headerbgpic, headermenuleftpic, headermenurightpic, sideleftpic, 

siderightpic, topleftpic, topmiddlepic, toprightpic) VALUES ('greenblue2','#679B97','#293D39', '#FFFFFF', 

'#446666', '/themes/greenblue2/aim.jpg', '/themes/greenblue2/bottomleft.jpg', 

'/themes/greenblue2/bottommiddle.jpg', '/themes/greenblue2/bottomright.jpg', 

'/themes/greenblue2/headerbg.jpg', '/themes/greenblue2/headermenuleft.jpg', 

'/themes/greenblue2/headermenuright.jpg', '/themes/greenblue2/sideleft.jpg', 

'/themes/greenblue2/sideright.jpg', '/themes/greenblue2/topleft.jpg', '/themes/greenblue2/topmiddle.jpg', 

'/themes/greenblue2/topright.jpg')";
mysql_query($sql,$db);
        echo"Inserting themes<br>";

$sql = "INSERT INTO $varstable (theme, font, fontcolor, headerfont, numgamespage, numplayerspage, 

statsview, stats1view, stats2view, stats3view, stats4view, stats5view, stats6view, stats7view, statsnum, 

rulesview, standingsnogames, pctnum, hotcoldnum, gamesmaxday) VALUES ('blue','Arial', '#FFFFFF', 'Arial 

Black', '20', '30', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', '10', 'yes', 'no', '10', '5', 

'2')";
       	mysql_query($sql,$db);
        echo"Inserting vars<br><br>";

echo"Done.";
?>


 

Once again... it says its done when i execute the code in the browser but is not inserting anything into my database.

 

Weird...

Link to comment
Share on other sites

Ok changed them all in install.php to:

mysql_query($sql,$db) or die(mysql_error() . " IN $sql");

 

I now get message:

 

Invalid default value for 'player_id' IN CREATE TABLE webl_players (player_id int(10) DEFAULT '0' NOT NULL auto_increment, name varchar(40) DEFAULT '' NOT NULL, passworddb varchar(10), mail varchar(50), icq varchar(15), aim varchar(40), country varchar(40), games int(10) DEFAULT '0', wins int(10) DEFAULT '0', losses int(10) DEFAULT '0', points int(10) DEFAULT '0', totalwins int(10) DEFAULT '0', totallosses int(10) DEFAULT '0', totalpoints int(10) DEFAULT '0', totalgames int(10) DEFAULT '0', penalties int(10) DEFAULT '0', staff varchar(10), streakwins int(10) DEFAULT '0', streaklosses int(10) DEFAULT '0', PRIMARY KEY (player_id))

 

It is because all the tables will contain different bits of info so I create them sepearatly for the different pieces.

Link to comment
Share on other sites

While I was looking at it I realised lol... auto increment... value 0 ... silly me.

 

Although I came across another problem.

 

I am using a login script to make a simple admin area.

 

Although when I log in on the pop up with the correct username and password it is not letting me go any further. hmm.

 

It is part of variables.php in the admin area.

 


$report = "winner"; //who reports? winner/loser
$pointswin = "3"; //the number of points awarded for a win
$pointsloss = "-1"; //the number of points awarded for a loss

//set the username and password for the admin panel
$LOGIN = "USERNAME"; //the username to access the admin panel
$PASSWORD = "PASSWORD"; //the passoword to access the admin panel

// finish


// login checker

function error ($error_message) {
echo $error_message."<BR>";
exit;
}
if ( (!isset($PHP_AUTH_USER)) || ! (($PHP_AUTH_USER == $LOGIN) && ( $PHP_AUTH_PW == "$PASSWORD" )) ) {
header("WWW-Authenticate: Basic entrer=\"Form2txt admin\"");
header("HTTP/1.0 401 Unauthorized");
error("Unauthorized access...");
}
?>

 

Not working though hmm

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.