Not sure if this the right place, as the code is in a php file although it's html I recently moved servers, and for some reason one of my scripts has encountered a problem. When you type in text in the text field of a form element and click submit, the inputted text isn't being recognized as being present; instead the script thinks the field is empty. Now, I have another variant of the same program running elsewher, and that's not having the same problem, and it also ran fine on my old server. What on earth is going wrong here?
lets see the code for the form and the php file Is the form data posting to a database or just being carried over to the next page? Also, there might be something conflicting in your php.ini....
Your new server probably has register globals turned off for security. This is standard on newer versions of php. Access the variable as follows: $variablename=$_POST['fieldname']; or $variablename=$_GET['fieldname'];
This server does use a slightly newer version of PHP. The (I think) relevant PHP code is below: include("config.php"); include("languages/$lang"); updatecookie(); $title="Administration"; include("header.php"); connectdb(); bigtitle(); function CHECKED($yesno) { return(($yesno == "Y") ? "CHECKED" : ""); } function YESNO($onoff) { return(($onoff == "ON") ? "Y" : "N"); } $module = $menu; if($swordfish != $adminpass) { echo "<FORM ACTION=admin.php METHOD=POST>"; echo "Password: <INPUT TYPE=PASSWORD NAME=swordfish SIZE=20 MAXLENGTH=20> "; echo "<INPUT TYPE=SUBMIT VALUE=Submit><INPUT TYPE=RESET VALUE=Reset>"; echo "</FORM>"; } PHP: There is more code after that, but it needs the form to work first. And this is from another, similar, script, that's working fine include("config.php"); include("languages/$lang"); updatecookie(); $title="Administration"; include("header.php"); connectdb(); bigtitle(); function CHECKED($yesno) { return(($yesno == "Y") ? "CHECKED" : ""); } function YESNO($onoff) { return(($onoff == "ON") ? "Y" : "N"); } $module = $menu; if($swordfish != $adminpass) { echo "<FORM ACTION=admin.php METHOD=POST>"; echo "Password: <INPUT TYPE=PASSWORD NAME=swordfish SIZE=20 MAXLENGTH=20> "; echo "<INPUT TYPE=SUBMIT VALUE=Submit><INPUT TYPE=RESET VALUE=Reset>"; echo "</FORM>"; } PHP: Now I can't see any difference here, so why should one work and not the other
If the second script you posted is on another server, mad4 could be right, it's just one machine has register_globals off and the other doesn't. Echo out phpinfo() on your machines to find out (unless you have access to the server's php.ini file).
They are both on the same server, which is why I am more than somewhat confused. Looking at it, both scripts are accessing header.php, which is substantially different SKT <? function emu_getallheaders() { foreach($_SERVER as $h=>$v) if(ereg('HTTP_(.+)',$h,$hp)) $headers[$hp[1]]=$v; return $headers; } $headers = emu_getallheaders(); $userAgent = $headers["User-Agent"]; if ($userAgent == "") { $userAgent = $headers["user-agent"]; } $isHiptop = false; $browser = ""; if($userAgent != null && strpos($userAgent, "Danger") && strpos($userAgent, "hiptop")) { $isHiptop = true; $browser = "hiptop"; } if($userAgent != null && strpos($userAgent, "Blazer")) { $browser = "treo"; } // This covers the Treo but might get other Palms too. if($userAgent != null && strpos($userAgent, "240x320")) { $browser = "treo"; } //header("Cache-Control: no-cache, must-revalidate"); // Comment out the line below if you are running php 4.0.6 or earlier ob_start("ob_gzhandler"); ?> <!doctype html public "-//w3c//dtd html 3.2//en"> <html> <head> <META NAME="HandheldFriendly" content="True"> <title><? echo $title; ?></title> <style type="text/css"> <!-- <? if($interface == "") { $interface = "main.php"; } if($interface == "main.php") { echo " a.mnu {text-decoration:none; font-size: 8Pt; font-family: Geneva, Arial, Helvetica, san-serif; color:white; font-weight:bold;} a.mnu:hover {text-decoration:none; font-size: 8Pt; font-family: Geneva, Arial, Helvetica, san-serif; color:#3366ff; font-weight:bold;} div.mnu {text-decoration:none; font-size: 8Pt; font-family: Geneva, Arial, Helvetica, san-serif; color:white; font-weight:bold;} span.mnu {text-decoration:none; font-size: 8Pt; font-family: Geneva, Arial, Helvetica, san-serif; color:white; font-weight:bold;} a.dis {text-decoration:none; font-size: 8Pt; font-family: Geneva, Arial, Helvetica, san-serif; color:silver; font-weight:bold;} a.dis:hover {text-decoration:none; font-size: 8Pt; font-family: Geneva, Arial, Helvetica, san-serif; color:#3366ff; font-weight:bold;} table.dis {text-decoration:none; font-size: 8Pt; font-family: Geneva, Arial, Helvetica, san-serif; color:silver; font-weight:bold;} table.dis:hover {text-decoration:none; font-size: 8Pt; font-family: Geneva, Arial, Helvetica, san-serif; color:#3366ff; font-weight:bold;} .portcosts1 {width:7em;border-style:none;font-family: Geneva, Arial, Helvetica, san-serif;font-size:12pt;background-color:$color_line1;color:#c0c0c0;} .portcosts2 {width:7em;border-style:none;font-family: Geneva, Arial, Helvetica, san-serif;font-size:12pt;background-color:$color_line2;color:#c0c0c0;} .headlines {text-decoration:none; font-size:8Pt; font-family:geneva,Arial,san-serif; font-weight:bold; color:white;} .headlines:hover {text-decoration:none; color:#3366ff;} .faderlines {background-color:$color_line2;}"; } echo "\n body {font-family: Geneva, Arial, Helvetica, san-serif; font-size: x-small;}\n"; ?> --> </style> </head> <? if(empty($no_body)) { if($interface=="main.php") { echo "<body background=\"images/bgoutspace1.gif\" bgcolor=\"#000000\" text=\"#c0c0c0\" link=\"#00ff00\" vlink=\"#00ff00\" alink=\"#ff0000\">"; } else { echo "<body background=\"\" bgcolor=\"#000000\" text=\"#c0c0c0\" link=\"#00ff00\" vlink=\"#808080\" alink=\"#ff0000\">"; } } echo "\n"; ?> PHP: BNT <? header("Cache-Control: no-cache, must-revalidate"); // <!doctype html public "-//w3c//dtd html 3.2//en"> ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Pragma" content="no-cache"> <title><? echo $title; ?></title> <style type="text/css"> <!-- <? if($interface == "") { $interface = "main.php"; } if($interface == "main.php") { echo " a.mnu {text-decoration:none; font-size: 8Pt; font-family: Verdana, Arial, sans-serif; color:white; font-weight:bold;} a.mnu:hover {text-decoration:none; font-size: 8Pt; font-family: Verdana, Arial, sans-serif; color:#3366ff; font-weight:bold;} div.mnu {text-decoration:none; font-size: 8Pt; font-family: Verdana, Arial, sans-serif; color:white; font-weight:bold;} span.mnu {text-decoration:none; font-size: 8Pt; font-family: Verdana, Arial, sans-serif; color:white; font-weight:bold;} a.dis {text-decoration:none; font-size: 8Pt; font-family: Verdana, Arial, sans-serif; color:silver; font-weight:bold;} a.dis:hover {text-decoration:none; font-size: 8Pt; font-family: Verdana, Arial, sans-serif; color:#3366ff; font-weight:bold;} table.dis {text-decoration:none; font-size: 8Pt; font-family: Verdana, Arial, sans-serif; color:silver; font-weight:bold;} table.dis:hover {text-decoration:none; font-size: 8Pt; font-family: Verdana, Arial, sans-serif; color:#3366ff; font-weight:bold;} .headlines:hover {text-decoration:none; color:#3366ff;} .headlines {text-decoration:none; font-size:8Pt; font-family: Verdana, Arial, sans-serif; font-weight:bold; color:white;} .portcosts1 {width:7em; border-style:none; font-family: Verdana, Arial, sans-serif; font-size:12pt; background-color:$color_line1; color:#c0c0c0;} .portcosts2 {width:7em; border-style:none; font-family: Verdana, Arial, sans-serif; font-size:12pt; background-color:$color_line2; color:#c0c0c0;} .faderlines {background-color:$color_line2;}"; } echo "\n body {font-family: Verdana, Arial, sans-serif; font-size: x-small;}\n"; ?> --> </style> <LINK REL="SHORTCUT ICON" HREF="favicon.ico"> </head> <? if(empty($no_body)) { if($interface=="main.php") { echo "<body background=\"images/bgoutspace1.gif\" bgcolor=\"#000000\" text=\"#c0c0c0\" link=\"#00ff00\" vlink=\"#00ff00\" alink=\"#ff0000\">"; } else { echo "<body background=\"\" bgcolor=\"#000000\" text=\"#c0c0c0\" link=\"#00ff00\" vlink=\"#808080\" alink=\"#ff0000\">"; } } echo "\n"; include ("promote2.inc"); ?> PHP:
I don't see any of the variables you posted in the first 2 scripts being used in the 2nd 2 scripts. Can you show us where those variables are coming from?
Probably from the config files (below). The config_local files are identical SKT <? /************************************************************************* config.php - Preset configuration for the game Copyright (c)2003-2004 Ben Gibbs Copyright (c)2001-2002 Ron Harwood This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ***************************************************************************/ // This piece of code will hopefully go away in the future to be replaced // by the config table in the database. For now though it still holds a lot // of game information. include("config_local.php"); include("$ADOdbpath" . "/adodb.inc.php"); /* Main scheduler variables (game flow control) -----------------------------------------------*/ /* Set this to how often (in minutes) you are running the scheduler script. */ $sched_ticks = 1; /* All following vars are in minutes. These are TRUE minutes, no matter to what interval you're running the scheduler script! The scheduler will auto-adjust, possibly running many of the same events in a single call. Note: Some of the scheduled items do not have their own settings (like furangees for example. They steal other settings. Once the game is going though you can change the scheduler database table entries to get them to run at a different rate. This though needs to be improved! */ $sched_turns = 1; //New turns rate (also includes towing, furangee) $sched_ports = 2; //How often port production occurs $sched_planets = 2; //How often planet production occurs $sched_IGB = 2; //How often IGB interests are added /* Here's a tip - try not to have the ranking done that often. Any particular player's score will be updated when they log off or at particularly key evens anyway. This scheduled score generator is there just to cover the in-between times. The problem is that with a 4 week old game and hundreds of players, this can take a long time and skew your 2 minute per tick scheduler. So, don't run it every 2 minutes unless you have a very fast server. */ $sched_ranking = 10; //How often rankings will be generated $sched_news = 2; //How often news is generated $sched_degrade = 6; //How often sector fighters degrade when unsupported by a planet $sched_apocalypse = 15; // How often the plasma storms or plagues occur $doomsday_value = 90000000; // number of colonists a planet needs before being affected by the apocalypse, typically set to 90% of the maximum planet value. $sched_mooring = 2; // Check for mooring fee payments every n minutes /* Scheduler config end */ /* GUI colors */ $color_header = "#005000"; $color_line1 = "#003000"; $color_line2 = "#004000"; /* // Old BNT ones $color_header = "#663399"; $color_line1 = "#300030"; $color_line2 = "#333399"; */ /* Localization (regional) settings */ $local_number_dec_point = "."; $local_number_thousands_sep = ", "; $language = "english"; /* game variables */ $fed_dock_max = 20000; // Maximum score allowed to use the dock in Sector 0 $ip = getenv("REMOTE_ADDR"); $mine_hullsize = 8; //Minimum size hull has to be to hit mines $ewd_maxhullsize = 15; //Max hull size before EWD degrades $sector_max = 5000; // Number of sectors in the universe $link_max=10; // Maximum number of links allowed per sector. Note that 'naturally' made links may exceed this number. $universe_size =10000; // This is the 'physical' size of the universe and really sets how big your real space engines have to be before they are useful. Raising this will force players to buy bigger engines and result in more energy scooped per trip. Recommend not to change unless you are sadistic. $game_name = "Starkick Traders 5.0 GPL"; // Call it what you will. $fed_max_hull = 8; // Maximum hull allowed in the Federation Zone $maxlen_password = 16; // I do not think this is used. $max_rank=50; // Used on ranking page but not used right now. $rating_combat_factor=.8; //ammount of rating gained from combat // These next three are now in the config database table. Right now a row in this table has to be created manually - sorry! $server_closed=false; //true = block logins but not new account creation $account_creation_closed=false; //true = block new account creation $force_subscription=false; // true = block access from PC's unless subscribed /* newbie niceness variables */ $newbie_nice = "YES"; $newbie_extra_nice = "YES"; $newbie_hull = "8"; $newbie_engines = "8"; $newbie_power = "8"; $newbie_computer = "8"; $newbie_sensors = "8"; $newbie_armour = "8"; $newbie_shields = "8"; $newbie_beams = "8"; $newbie_torp_launchers = "8"; $newbie_cloak = "8"; /* specify which special features are allowed */ $allow_fullscan = true; // full long range scan $allow_navcomp = true; // navigation computer $allow_ibank = false; // Intergalactic Bank (IGB) $allow_genesis_destroy = true; // Genesis torps can destroy planets // iBank Config - Intergalactic Banking // Trying to keep ibank constants unique by prefixing with $ibank_ // Please EDIT the following variables to your liking. $ibank_interest = 0.0003; // Interest rate for account funds NOTE: this is calculated every system update! $ibank_paymentfee = 0.05; // Paymentfee $ibank_loaninterest = 0.0010; // Loan interest (good idea to put double what you get on a planet) $ibank_loanfactor = 0.10; // One-time loan fee $ibank_loanlimit = 0.25; // Maximum loan allowed, percent of net worth // Information displayed on the 'Manage Own Account' section // I don't think this is used any more $ibank_ownaccount_info = "Interest rate is " . $ibank_interest * 100 . "%<BR>Loan rate is " . $ibank_loaninterest * 100 . "%<P>If you have loans make sure you have enough credits deposited each turn " . "to pay the interest and mortgage, otherwise it will be deducted from your ships acccount at <FONT COLOR=RED>" . "twice the current Loan rate (" . $ibank_loaninterest * 100 * 2 .")%</FONT>."; $IGB_min_turns = $start_turns; //Turns a player has to play before ship transfers are allowed 0=disable $IGB_svalue = 0.15; //Max amount of sender's value allowed for ship transfers 0=disable $IGB_trate = 1440; //Time (in minutes) before two similar transfers are allowed for ship transfers.0=disable $IGB_lrate = 1440; //Time (in minutes) players have to repay a loan $IGB_crate = 2880; $IGB_tconsolidate = 10; //Cost in turns for consolidate : 1/$IGB_consolidate // end of iBank config /* port pricing variables */ $ore_price = 13.8; $ore_delta = 2; $ore_rate = 75000; $ore_prate = 0.25; $ore_limit = 100000000; $organics_price = 6; $organics_delta = 1; $organics_rate = 5000; $organics_prate = 0.5; $organics_limit = 100000000; $goods_price = 19; $goods_delta = 3; $goods_rate = 75000; $goods_prate = 0.25; $goods_limit = 100000000; $energy_price = 4; $energy_delta = 1; $energy_rate = 75000; $energy_prate = 0.5; $energy_limit = 200000000; $inventory_factor = 1; $upgrade_cost = 1000; $upgrade_factor = 2; $level_factor = 1.5; // Special port prices $dev_genesis_price = 10000000; $dev_beacon_price = 100; $dev_emerwarp_price = 1000000; $dev_warpedit_price = 100000; $dev_minedeflector_price = 10; $dev_escapepod_price = 100000; $dev_fuelscoop_price = 100000; $dev_lssd_price = 10000000; $fighter_price = 50; $fighter_prate = .01; $torpedo_price = 25; $torpedo_prate = .025; $torp_dmg_rate = 10; $armour_price = 5; $colonist_price = 5; // Furangee related variables $furangee_price = 0.5; // The discount that a Furangee special trader sells at compared to a Special Port $furangeeMin = 0.5; // The lowest percentage of furangee that can exist in the universe before more are created. The total number is in the config database table // Planet variables $credits_prate = 0; // No credits made by colonists in this game $basedefense = 1; // Additional factor added to tech levels by having a base on your planet. All your base are belong to us. $colonist_production_rate = .005; $colonist_reproduction_rate = 0.0005; $colonist_limit = 250000000; $organics_consumption = 0.00; $starvation_death_rate = 0.01; // Not used // Planet interest rate $interest_rate = 1.0005; // default planet production percentages $default_prod_ore = 20.0; $default_prod_organics = 20.0; $default_prod_goods = 20.0; $default_prod_energy = 20.0; $default_prod_fighters = 10.0; $default_prod_torp = 10.0; // What is needed to build a base on a planet: $base_ore = 10000; $base_goods = 10000; $base_organics = 10000; $base_credits = 10000000; $base_modifier = 1; // Initial ship compliment $start_fighters = 10; $start_armour = 10; $start_credits = 1000; $start_energy = 100; $start_turns = 1000; $max_turns = 3000; $max_emerwarp = 10; $fullscan_cost = 1; $scan_error_factor=20; $max_planets_sector = 5; $max_traderoutes_player = 80; $min_bases_to_own = 3; $default_lang = 'english'; // SKT only support English now $avail_lang[0][file] = 'english'; $avail_lang[0][name] = 'English'; $avail_lang[1][file] = 'german'; $avail_lang[1][name] = 'Deutsch'; $avail_lang[2][file] = 'french'; $avail_lang[2][name] = 'Français'; $avail_lang[3][file] = 'romanian'; $avail_lang[3][name] = 'Romanian'; $avail_lang[4][file] = 'czech'; $avail_lang[4][name] = 'Cesky'; $corp_planet_transfers = 0; //If transferring credits to/from corp planets is allowed. 1=enable $min_value_capture = 0; //Percantage of planet's value a ship must be worth to be able to capture it. 0=disable - Not used AFAIK $defence_degrade_rate = 0.05; $energy_per_fighter = 0.10; $bounty_maxvalue = 0.15; //Max amount a player can place as bounty - good idea to make it the same as $IGB_svalue. 0=disable $bounty_ratio = 0.10; // ratio of players networth before attacking results in a bounty. 0=disable $bounty_minturns = 500; // Minimum number of turns a target must have had before attacking them may not get you a bounty. 0=disable $display_password = false; // If true, will display password on signup screen. Not used $space_plague_kills = 0.20; // Percentage of colonists killed by space plague $sched_type = 0; // 0 = Cron based, 1 = player triggered. $max_credits_without_base = $base_credits; // Max amount of credits allowed on a planet without a base $sofa_on = true; $ksm_allowed = false; // Original true // Space dock fees $mooringFee = 200; // 200 credits per tick include("global_funcs.php"); ?> PHP: BNT <? error_reporting(0); //ini_set('display_errors', 0); include("db_config.php"); include("$ADOdbpath" . "/adodb.inc.php"); /* Main scheduler variables (game flow control) -----------------------------------------------*/ /* Set this to how often (in minutes) you are running the scheduler script. */ $sched_ticks = 5; /* All following vars are in minutes. These are TRUE minutes, no matter to what interval you're running the scheduler script! The scheduler will auto-adjust, possibly running many of the same events in a single call. */ $sched_turns = 2; //New turns rate (also includes towing, xenobe) $sched_ports = 2; //How often port production occurs $sched_planets = 2; //How often planet production occurs $sched_igb = 2; //How often IGB interests are added $sched_ranking = 30; //How often rankings will be generated $sched_news = 15; //How often news are generated $sched_degrade = 6; //How often sector fighters degrade when unsupported by a planet $sched_apocalypse = 15; $doomsday_value = 90000000; // number of colonists a planet needs before being affected by the apocalypse /* Scheduler config end */ /* GUI colors (temporary until we have something nicer) */ $color_header = "#500050"; $color_line1 = "#300030"; $color_line2 = "#400040"; /* Localization (regional) settings */ $local_number_dec_point = "."; $local_number_thousands_sep = ","; $language = "english"; /* game variables */ $ip = getenv("REMOTE_ADDR"); $mine_hullsize = 8; //Minimum size hull has to be to hit mines $ewd_maxhullsize = 15; //Max hull size before EWD degrades $sector_max = 5000; $link_max=10; $universe_size = 200; $game_name = "Default Game Name"; $fed_max_hull = 8; $maxlen_password = 16; $max_rank=100; $rating_combat_factor=.8; //ammount of rating gained from combat $server_closed=false; //true = block logins but not new account creation $account_creation_closed=false; //true = block new account creation /* newbie niceness variables */ $newbie_nice = "YES"; $newbie_extra_nice = "YES"; $newbie_hull = "8"; $newbie_engines = "8"; $newbie_power = "8"; $newbie_computer = "8"; $newbie_sensors = "8"; $newbie_armour = "8"; $newbie_shields = "8"; $newbie_beams = "8"; $newbie_torp_launchers = "8"; $newbie_cloak = "8"; /* specify which special features are allowed */ $allow_fullscan = true; // full long range scan $allow_navcomp = true; // navigation computer $allow_ibank = true; // Intergalactic Bank (IGB) $allow_genesis_destroy = true; // Genesis torps can destroy planets // iBank Config - Intergalactic Banking // Trying to keep ibank constants unique by prefixing with $ibank_ // Please EDIT the following variables to your liking. $ibank_interest = 0.0003; // Interest rate for account funds NOTE: this is calculated every system update! $ibank_paymentfee = 0.05; // Paymentfee $ibank_loaninterest = 0.0010; // Loan interest (good idea to put double what you get on a planet) $ibank_loanfactor = 0.10; // One-time loan fee $ibank_loanlimit = 0.25; // Maximum loan allowed, percent of net worth // Information displayed on the 'Manage Own Account' section $ibank_ownaccount_info = "Interest rate is " . $ibank_interest * 100 . "%<BR>Loan rate is " . $ibank_loaninterest * 100 . "%<P>If you have loans Make sure you have enough credits deposited each turn " . "to pay the interest and mortage, otherwise it will be deducted from your ships acccount at <FONT COLOR=RED>" . "twice the current Loan rate (" . $ibank_loaninterest * 100 * 2 .")%</FONT>."; // end of iBank config // default planet production percentages $default_prod_ore = 20.0; $default_prod_organics = 20.0; $default_prod_goods = 20.0; $default_prod_energy = 20.0; $default_prod_fighters = 10.0; $default_prod_torp = 10.0; /* port pricing variables */ $ore_price = 11; $ore_delta = 5; $ore_rate = 75000; $ore_prate = 0.25; $ore_limit = 100000000; $organics_price = 5; $organics_delta = 2; $organics_rate = 5000; $organics_prate = 0.5; $organics_limit = 100000000; $goods_price = 15; $goods_delta = 7; $goods_rate = 75000; $goods_prate = 0.25; $goods_limit = 100000000; $energy_price = 3; $energy_delta = 1; $energy_rate = 75000; $energy_prate = 0.5; $energy_limit = 1000000000; $inventory_factor = 1; $upgrade_cost = 1000; $upgrade_factor = 2; $level_factor = 1.5; $dev_genesis_price = 1000000; $dev_beacon_price = 100; $dev_emerwarp_price = 1000000; $dev_warpedit_price = 100000; $dev_minedeflector_price = 10; $dev_escapepod_price = 100000; $dev_fuelscoop_price = 100000; $dev_lssd_price = 10000000; $fighter_price = 50; $fighter_prate = .01; $torpedo_price = 25; $torpedo_prate = .025; $torp_dmg_rate = 10; $credits_prate = 3.0; $armour_price = 5; $basedefense = 1; // Additional factor added to tech levels by having a base on your planet. All your base are belong to us. $colonist_price = 5; $colonist_production_rate = .005; $colonist_reproduction_rate = 0.0005; $colonist_limit = 100000000; $organics_consumption = 0.05; $starvation_death_rate = 0.01; $interest_rate = 1.0005; $base_ore = 10000; $base_goods = 10000; $base_organics = 10000; $base_credits = 10000000; $base_modifier = 1; $start_fighters = 10; $start_armour = 10; $start_credits = 1000; $start_energy = 100; $start_turns = 1200; $max_turns = 2500; $max_emerwarp = 10; $fullscan_cost = 1; $scan_error_factor=20; $max_planets_sector = 5; $max_traderoutes_player = 40; $min_bases_to_own = 3; $default_lang = 'english'; $avail_lang[0][file] = 'english'; $avail_lang[0][name] = 'English'; $avail_lang[1][file] = 'german'; $avail_lang[1][name] = 'Deutsch'; $avail_lang[2][file] = 'french'; $avail_lang[2][name] = 'Français'; $avail_lang[3][file] = 'romanian'; $avail_lang[3][name] = 'Romanian'; $avail_lang[4][file] = 'czech'; $avail_lang[4][name] = 'Cesky'; $IGB_min_turns = $start_turns; //Turns a player has to play before ship transfers are allowed 0=disable $IGB_svalue = 0.15; //Max amount of sender's value allowed for ship transfers 0=disable $IGB_trate = 1440; //Time (in minutes) before two similar transfers are allowed for ship transfers.0=disable $IGB_lrate = 1440; //Time (in minutes) players have to repay a loan $IGB_tconsolidate = 10; //Cost in turns for consolidate : 1/$IGB_consolidate $corp_planet_transfers = 0; //If transferring credits to/from corp planets is allowed. 1=enable $min_value_capture = 0; //Percantage of planet's value a ship must be worth to be able to capture it. 0=disable $defence_degrade_rate = 0.05; $energy_per_fighter = 0.10; $bounty_maxvalue = 0.15; //Max amount a player can place as bounty - good idea to make it the same as $IGB_svalue. 0=disable $bounty_ratio = 0.75; // ratio of players networth before attacking results in a bounty. 0=disable $bounty_minturns = 500; // Minimum number of turns a target must have had before attacking them may not get you a bounty. 0=disable $display_password = false; // If true, will display password on signup screen. $space_plague_kills = 0.20; // Percentage of colonists killed by space plague $sched_type = 0; // 0 = Cron based, 1 = player triggered. $max_credits_without_base = $base_credits; // Max amount of credits allowed on a planet without a base $sofa_on = false; $ksm_allowed = true; $game_version = "BlackNova Traders v0.50"; // Please do not change this. Doing so will cause problems for the server lists, and setupinfo, and more. include("global_funcs.php"); ?> PHP:
Still not seeing the variables from the first script. Look for whatever is the last file to handle the $swordfish variable. After re-reading this thread mad4 is right, if you're passing variables from one script to another, you'll have to use $_POST['variablename'] to reassign the values. Try that.
I don't think it's anything to do with $swordfish, as the problem is occuring in all text forms of the script, not just the admin ones (swordfish is admin password). I'm sure it is just a minor difference somewhere that is doing it. How do I do what mad4 suggested; anyone got any links to tutorials on using POST?
You'll have to reassign the values to the variables... so if script #1 is sending $swordfish, script #2 will have to go: $swordfish = $_POST['swordfish']; Whatever $variable you're passing will be passed as $_POST['variable'] (or $_GET if using the "get" method). It's a pain, but for security reasons it has to be done. Or you could just use $_POST['variable'] directly. You can learn more about $_GET and $_POST and all the other superglobals at http://us3.php.net/manual/en/reserved.variables.php
You could also do an extract ($_POST) or extract ($_REQUEST); near the top of the script. This will import all post or all request variables into the global namespace. I don't recommend this for security purposes, but it will at least tell you if your problem is with register_globals being off.
I think it must have been a problem with register globals. I took some code out of the script that was working and added it to the one that wasn't <?php //----- Start register_globals fix ---- // reg_global_fix,0.1.1,22-09-2004,BNT DevTeam if(!defined('reg_global_fix'))define('reg_global_fix', True, TRUE); $reg_globals_on = (bool) ini_get('register_globals'); if ($register_globals_safe != 1 && !$reg_globals_on) if (1==1) { foreach ($_POST as $k=>$v) { if (!isset($GLOBALS[$k])) { ${$k}=$v; } } foreach ($_GET as $k=>$v) { if (!isset($GLOBALS[$k])) { ${$k}=$v; } } foreach ($_COOKIE as $k=>$v) { if (!isset($GLOBALS[$k])) { ${$k}=$v; } } } //------ End register_globals fix PHP: