I changed all double quotes to singles like you said and I’m still getting the errors. To add, I used some code to see if the array is an array:
[php]
if(is_array($server)) echo ‘$server IS AN ARRAY’; else echo ‘$server IS NOT A VALID ARRAY!!!’;
if(is_array($g_type)) echo ‘$g_type IS AN ARRAY’; else echo ‘$g_type IS NOT A VALID ARRAY!!!’;
if(is_array($g_tick)) echo ‘$g_tick IS AN ARRAY’; else echo ‘$g_tick IS NOT A VALID ARRAY!!!’;
if(is_array($g_slot_pub)) echo ‘$g_slot_pub IS AN ARRAY’; else echo ‘$g_slot_pub IS NOT A VALID ARRAY!!!’;
[/php]
When I used that block of code, it told me that none of the four were arrays! Not even $server! Here is all of my code. Some it’s not all of it because it’s all not done; but what is done so far should allow me to do a certain action.
idf.general.php
[php]
function disp_game_form()
{
// This is activated when the customer wants a game server
?>
Game:
<option value=“order.php?process=packages” <?php if(!$_SESSION['game']) echo 'selected="selected"' ?>>Choose Game
<?php
if(is_array($server)) echo ‘$server IS AN ARRAY’; else echo ‘$server IS NOT A VALID ARRAY!!!’;
if(is_array($g_type)) echo ‘$g_type IS AN ARRAY’; else echo ‘$g_type IS NOT A VALID ARRAY!!!’;
if(is_array($g_tick)) echo ‘$g_tick IS AN ARRAY’; else echo ‘$g_tick IS NOT A VALID ARRAY!!!’;
if(is_array($g_slot_pub)) echo ‘$g_slot_pub IS AN ARRAY’; else echo ‘$g_slot_pub IS NOT A VALID ARRAY!!!’;
foreach($g_game as $key => $value)
{
echo ‘<option value="order.php?process=packages&game=’.$value.’"’;
if($_SESSION[‘game’] == $value) echo ‘selected=“selected”’;
echo ‘>’.$key.’’;
}
?>
|
<?php
if($_GET[‘game’] || $_SESSION[‘game’])
{
if($_GET[‘game’])
$_SESSION[‘game’] = $_GET[‘game’];
?>
Tick:
<option value=“order.php?process=packages” <?php if(!$_SESSION['tick']) echo 'selected="selected"' ?>>Choose Tickrate
<?php
foreach($g_tick as $key => $value)
{
echo ‘<option value="order.php?process=packages&tick=’.$value.’"’;
if($_SESSION[‘tick’] == $value) echo ‘selected=“selected”’;
echo ‘>’.$key.’’;
}
?>
|
<?php
if($_GET[‘tick’] || $_SESSION[‘tick’])
{
if($_GET[‘tick’])
$_SESSION[‘tick’] = $_GET[‘tick’];
?>
Type:
<option value=“order.php?process=packages” <?php if(!$_SESSION['type']) echo 'selected="selected"' ?>>Choose Server Type
<?php
foreach($g_type as $key => $value)
{
echo ‘<option value="order.php?process=packages&type=’.$value.’"’;
if($_SESSION[‘type’] == $value) echo ‘selected=“selected”’;
echo ‘>’.$key.’’;
}
?>
|
<?php
if($_GET[‘type’] || $_SESSION[‘type’])
{
if($_GET[‘type’])
$_SESSION[‘type’] = $_GET[‘type’];
switch(@$_SESSION[‘type’])
{
case “public”:
?>
Slot:
<option value=“order.php?process=packages” <?php if(!$_SESSION['slot']) echo 'selected="selected"' ?>>Choose Slot Amount
<?php
foreach($g_slot_pub as $key => $value)
{
echo ‘<option value="order.php?process=packages&slot=’.$value.’"’;
if($_SESSION[‘slot’] == $value) echo ‘selected=“selected”’;
echo ‘>’.$key.’’;
}
?>
|
<?php
break;
case “private”:
?>
Slot:
<option value=“order.php?process=packages” <?php if(!$_SESSION['slot']) echo 'selected="selected"' ?>>Choose Slot Amount
<?php
foreach($g_slot_priv as $key => $value)
{
echo ‘<option value="order.php?process=packages&slot=’.$value.’"’;
if($_SESSION[‘slot’] == $value) echo ‘selected=“selected”’;
echo ‘>’.$key.’’;
}
?>
|
<?php
break;
default:
break;
}
if($_GET[‘slot’] || $_SESSION[‘slot’])
{
if($_GET[‘slot’])
$_SESSION[‘slot’] = $_GET[‘slot’];
if($_SESSION[‘type’] == “private”)
{
if($_GET[‘s_pass’])
$_SESSION[‘s_pass’] = $_GET[‘s_pass’];
?>
Server Password: [When you are done, press enter](10 Character Max)
|
<?php
}
if($_SESSION[‘type’] == “private” && $_SESSION[‘s_pass’] || $_SESSION[‘type’] != “private”)
{
if($_GET[‘r_pass’])
$_SESSION[‘r_pass’] = $_GET[‘r_pass’];
?>
Rcon Password: [When you are done, press enter](10 Character Max)
|
<?php
}
if($_SESSION[‘r_pass’])
{
// The following doesn’t turn into $_SESSION unless the customer chooses yes then selects their mods
?>
Do you want to add MODs to your server?
No
Yes
|
<?php
}
if($_GET[‘mods’] == “yes”)
{
?>
Select all MODs that you would like installed: |
<?php
$counter = 0;
foreach($g_mod as $key => $value)
{
echo ‘’.$key.’ ’;
$counter++;
}
?>
|
<?php
if($_POST[‘mods’]) // WARNING! ‘mods’ is an array
$_SESSION[‘mods’] = $_POST[‘mods’];
}
?>
|
|
<?php
if($_GET[‘mods’] == “no” || $_SESSION[‘mods’])
{
?>
|
|
<?php
}
?>
<?php
}
}
}
}
}
[/php]
order.php
[php]
<?php
// Name: order.php
// Desc: This file is designed to allow customers to order service. This file is a holder file which calls include files for forms, functions, and situations based on what is selected from the switch statement.
// These are the global functions for this website
include("../include/idf.general.php");
// Start a session
session_start();
// THE switch statement
switch($_GET['process'])
{
case 'account':
include_once('include/idf.contactform.php');
break;
case 'packages':
include_once('include/idf.packageform.php');
break;
case 'payment':
include_once('include/idf.paymentform.php');
break;
default:
include_once('include/idf.agreement.php');
break;
}
?>
[/php]
idf.packageform.php
[php]
<?php
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Name: idf.packageform.php //
// Desc: This file displays options of packages that customers can choose from and based on what the customer chooses, the //
// form will then display secondary options that correspond with the options chosen. This form uses the $_GET array //
// and the $_SESSION array to allow the customer to fully choose his/her plan. //
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Start a session
session_start();
// These are the include files
include("idf.general.php");
include("idf.forminfo.php");
// Display the begining HTML for this portion of the form
do_html_header("Hosting Order Form -> Packages");
do_html_style();
?>
Please read carefully before you choose your package. |
This page allows you to choose your packages desired. As you choose options, more options will apear that you can choose from. If you want to get another game, voice, or web server, click Add Another Server and do the process over again. At any time, you can calculate the order by pressing the Calculate Total button. When you are done and satisfied with what you want to order, press the Continue button. |
<?php
// WARNING!!! The following uses JumpMenus to alternate the options available to the customer based on what is chosen. DO NOT change anything below unless you want
// to change the entire form.
if(is_array($_SESSION['server']))
{
// Insert block of code that displays previous order if customer clicked Add Another Server
}
?>
Server Type:
>Choose Server Plan
<?php
foreach($server as $key => $value)
{
echo ''.$key.'';
}
?>
|
<?php
if($_GET['server'] || $_SESSION['server'])
{
if($_GET['server'])
$_SESSION['server'] = $_GET['server'];
switch(@$_SESSION['server'])
{
case "game":
disp_game_form();
break;
case "voice":
disp_voice_form();
break;
case "web":
disp_web_form();
break;
default:
break;
}
}
?>
[/php]
I don’t know why it’s not working. Your way, in theory, should have worked but it didn’t.