[PHP-Budget-updates] phpbudget add.php,1.1,1.2
Status: Planning
Brought to you by:
rodrigoh
|
From: <rod...@us...> - 2002-10-21 20:27:09
|
Update of /cvsroot/php-budget/phpbudget
In directory usw-pr-cvs1:/tmp/cvs-serv24031
Modified Files:
add.php
Log Message:
add.php code
Index: add.php
===================================================================
RCS file: /cvsroot/php-budget/phpbudget/add.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** add.php 20 Oct 2002 21:03:02 -0000 1.1
--- add.php 21 Oct 2002 20:27:05 -0000 1.2
***************
*** 6,10 ****
#########################
//Add new budget.
! include_once('./includes/header-inc.php');
echo "<BIG>PHPB</BIG><SMALL>udget</SMALL>";
--- 6,65 ----
#########################
//Add new budget.
! include_once("./includes/db_setup.inc.php");
! include_once("./includes/header-inc.php");
!
! //pre_alpha clean_user_input code, this will become much better
! foreach($_GET as $key=>$value)
! {
! addslashes($value);
! echo "$key: Value: $value<br\n";
! }
! foreach($_POST as $key=>$value)
! {
! addslashes($value);
! echo "$key: Value: $value<br\n";
! }
! //END
!
! //Set some VARS
! $B_Owner=rodde; //temp user for dev.
!
! $U_Table=T_user; //User-Owner table
! $B_Table=T_main; //Budget Table
! $D_Table=T_data; //Data Table
!
!
! //Check if submit is set, if it is go into add_budget code
! //add_budget code needs more and better check for income values
!
! if ($_POST['Abudget'])
! {
! if (empty($_POST['nBname']) OR empty($_POST['nByear']) OR empty($_POST['nMvalue']) OR empty($B_Owner))
! {
! echo "Please fill all the required fields these are marked with an *";
! echo "<a href=\"$PHP_SELF\">Go back</a>\n";
! }
!
! else
! {
! //set userinput vars from POST vars to local VARS, there might be an easier or alt. way to do this
! $nBname = $_POST['nBname'];
! $nByear = $_POST['nByear'];
! $nBdescr = $_POST['nBdescr'];
! $nMvalue = $_POST['nMvalue'];
! $nIncome1 = $_POST['nIncome1'];
! $nIncome2 = $_POST['nIncome2'];
! $nIncome3 = $_POST['nIncome3'];
! $nIncome4 = $_POST['nIncome4'];
! //add new budget
! mysql_query("INSERT INTO B_table(F_b_name, F_b_year, F_b_descr, F_b_month, F_b_income1, F_b_income2, F_b_income3, F_b_income4, F_b_owner) VALUES('$nBname', '$nByear', '$nBdescr', '$nMvalue', '$nIncome1', '$nIncome2', '$nIncome3', '$nIncome3, '$nIncome4', '$B_owner')") OR die("Wops could not add budget");
! echo "<HTML><HEAD>\n";
! echo "<meta http-equiv=\"refresh\" content=\"0;URL=$PHP_SELF\">\n";
! echo "<META HTTP-EQUIV=PRAGMA CONTENT=\"NO-CACHE\">\n";
! echo "</HEAD>\n";
! echo "<body>Done!!! now Wait!</body></html>\n";
! }
! }
!
echo "<BIG>PHPB</BIG><SMALL>udget</SMALL>";
***************
*** 13,17 ****
//ADD_form START
echo "<pre>\n";
! echo "<form name=\"nBudget\" action=\"post\">\n";
echo "<table border=\"1\">\n";
echo "<caption>Add Budget</caption>\n";
--- 68,72 ----
//ADD_form START
echo "<pre>\n";
! echo "<form method=\"post\" action=\"$PHP_SELF\">\n";
echo "<table border=\"1\">\n";
echo "<caption>Add Budget</caption>\n";
***************
*** 39,43 ****
! include_once('./includes/footer-inc.php');
?>
--- 94,98 ----
! include_once("./includes/footer-inc.php");
?>
|