[PHP-DB] RE: [PHP] Re: Adding a log file

2003-11-05 Thread Robert Sossomon
Like I said, syntactically bogus, I was trying to write it out fast
while I was away from the actual scripts...  Like I said, for the MOST
part the pieces are working, however on some items it is acting
correctly yet the items are not showing up in the shopping cart or in
the database anywhere.

Here's the script pieces.
//addtocart.php
   $addtocart = insert into store_shoppertrack
values('','$_POST[SESSID]','$_POST[sel_item_id]','$_POST[sel_item_qty]',
'$_POST[sel_item_price]','$item_desc', now());
  
   mysql_query($addtocart);
  
   //redirect to showcart page
   header(Location: showcart.php);

//Additem.php
   $addtocart = insert into store_shoppertrack
values('','$_POST[SESSID]','$_POST[sel_item_name]','$_POST[sel_item_qty]
','$_POST[sel_item_price]','$item_desc', now());
  
   mysql_query($addtocart);

//Addspec.php
   //add info to cart table
   $addtocart = insert into store_shoppertrack
values('','$_POST[SESSID]','$_POST[sel_item_id]','$_POST[sel_item_qty]',
'$_POST[sel_item_price]','$_POST[sel_item_desc]', now());
  
   mysql_query($addtocart);

//Seestore.php
/*
  The following code allows for the addition of a non-stock item.  All
information is added automatically to the quoter for the salesman.
*/

$display_block .= HRInput a new item: form method=post
action=\addspec.php\nbsp;nbsp;nbsp;nbsp;Item ID:input
type=\text\ name=\sel_item_id\BRDescription:input type=\text\
name=\sel_item_desc\BRQuantity: select name=\sel_item_qty\;
$display_block .= option value=\0\0/optionoption value=\1\
selected1/option;
for ($i=2; $i  301; $i++){
 $display_block .= option value=\$i\$i/option;
}
$display_block .= /selectinput type=\hidden\ name=\SESSID\
value=\$PHPSESSID\/tdtdinput type=\hidden\ name=\url\
value=\$_SERVER[PHP_SELF]\BRPrice:input type=\text\
name=\sel_item_price\ size=\5\input type=\submit\
name=\submit\ value=\Add to Cart\/form;

$display_block .= HR;

/*
  The following code allows for the addition of a stocked item.  All
information is added automatically to the quoter for the salesman.
*/

$display_block .= Input item: form method=post
action=\additem.php\nbsp;nbsp;nbsp;nbsp;;
$display_block .= Item ID:input type=\text\
name=\sel_item_id\BRQuantity: select name=\sel_item_qty\;
$display_block .= option value=\0\0/optionoption value=\1\
selected1/option;
for ($i=2; $i  301; $i++){
 $display_block .= option value=\$i\$i/option;
}
$display_block .= /select;
$display_block .= input type=\hidden\ name=\SESSID\
value=\$PHPSESSID\/tdtd;
$display_block .= input type=\hidden\ name=\url\
value=\$_SERVER[PHP_SELF]\BRPrice:;
$display_block .= input type=\text\ name=\sel_item_price\
size=\5\;
$display_block .= input type=\submit\ name=\submit\ value=\Add to
Cart\/form;

//categories.php
$display_block .= trtdform method=post
action=\addtocart.php\nbsp;nbsp;nbsp;nbsp;emstrong$item_name
/strong - $item_desc/em/tdtdselect name=\sel_item_qty\;
$display_block .= option value=\0\0/optionoption value=\1\
selected1/option;
for ($i=2; $i  301; $i++){
 $display_block .= option value=\$i\$i/option;
}
$display_block .= /selectinput type=\hidden\ name=\SESSID\
value=\$PHPSESSID\input type=\hidden\ name=\sel_item_id\
value=\$item_id\/tdtdinput type=\hidden\
name=\sel_item_name\ value=\$item_name\input type=\hidden\
name=\sel_item_desc\ value=\$item_desc\input type=\hidden\
name=\url\ value=\$_SERVER[PHP_SELF]?cat_id=$cat_id\input
type=\text\ name=\sel_item_price\ size=\5\ value=\$price\input
type=\submit\ name=\submit\ value=\Add to Cart\/form/td
~~~
A bachelor can only chase a girl until she catches him.


-Original Message-
From: Bogdan Stancescu [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 11:00 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] Re: Adding a log file


$Addcart() -- is Addcart() a function (in which case you should remove 
the dollar sign) or are you specifically trying to do some magic there 
by running a function whose name is stored in that variable?

Bogdan

Robert Sossomon wrote:

 I am seeing some errors with a program I wrote and I need to write 
 everything to a log file that the program is doing.
 
 The following syntax I KNOW is wrong, but not sure they are important 
 to put here correctly yet. //script addtocart $Addcart (info1, info2)
 Mysqlquey($addcart)
 
 I am seeing random items NOT being added to my shopping cart.  The 
 reason, I have no clue. I can pull another catgory of items and the 
 first 20 will do fine, I go back to the first category I have and the 
 script seems to work correctly but the data is not written to the 
 shopping cart.  Problem with the shopping cart???  I wouldn't think 
 so. Problem with the add page, I don't see how.  So where is the error

 coming from?  No clue, which is why I want to log everything.  I use 3

 different add pages so that each form uses a different way to 

Re: [PHP-DB] RE: [PHP] Re: Adding a log file

2003-11-05 Thread jeffrey_n_Dyke

 if you want actual errors that PHP generates and not logic based errors,
then writing your own error handling function and calling it with
set_error_handler() at the top of your scripts may work for you.  in your
function you'd just need to use $errorstr, $errorfile and $errline and log
it using error_log().


hth
jeff


   
 
  Robert Sossomon
 
  [EMAIL PROTECTED]To:   [EMAIL PROTECTED], [EMAIL 
PROTECTED]
  com cc: 
 
   Subject:  [PHP-DB] RE: [PHP] Re: Adding 
a log file   
  11/05/2003 11:02 
 
  AM   
 
   
 
   
 




Like I said, syntactically bogus, I was trying to write it out fast
while I was away from the actual scripts...  Like I said, for the MOST
part the pieces are working, however on some items it is acting
correctly yet the items are not showing up in the shopping cart or in
the database anywhere.

Here's the script pieces.
//addtocart.php
   $addtocart = insert into store_shoppertrack
values('','$_POST[SESSID]','$_POST[sel_item_id]','$_POST[sel_item_qty]',
'$_POST[sel_item_price]','$item_desc', now());

   mysql_query($addtocart);

   //redirect to showcart page
   header(Location: showcart.php);

//Additem.php
   $addtocart = insert into store_shoppertrack
values('','$_POST[SESSID]','$_POST[sel_item_name]','$_POST[sel_item_qty]
','$_POST[sel_item_price]','$item_desc', now());

   mysql_query($addtocart);

//Addspec.php
   //add info to cart table
   $addtocart = insert into store_shoppertrack
values('','$_POST[SESSID]','$_POST[sel_item_id]','$_POST[sel_item_qty]',
'$_POST[sel_item_price]','$_POST[sel_item_desc]', now());

   mysql_query($addtocart);

//Seestore.php
/*
  The following code allows for the addition of a non-stock item.  All
information is added automatically to the quoter for the salesman.
*/

$display_block .= HRInput a new item: form method=post
action=\addspec.php\nbsp;nbsp;nbsp;nbsp;Item ID:input
type=\text\ name=\sel_item_id\BRDescription:input type=\text\
name=\sel_item_desc\BRQuantity: select name=\sel_item_qty\;
$display_block .= option value=\0\0/optionoption value=\1\
selected1/option;
for ($i=2; $i  301; $i++){
 $display_block .= option value=\$i\$i/option;
}
$display_block .= /selectinput type=\hidden\ name=\SESSID\
value=\$PHPSESSID\/tdtdinput type=\hidden\ name=\url\
value=\$_SERVER[PHP_SELF]\BRPrice:input type=\text\
name=\sel_item_price\ size=\5\input type=\submit\
name=\submit\ value=\Add to Cart\/form;

$display_block .= HR;

/*
  The following code allows for the addition of a stocked item.  All
information is added automatically to the quoter for the salesman.
*/

$display_block .= Input item: form method=post
action=\additem.php\nbsp;nbsp;nbsp;nbsp;;
$display_block .= Item ID:input type=\text\
name=\sel_item_id\BRQuantity: select name=\sel_item_qty\;
$display_block .= option value=\0\0/optionoption value=\1\
selected1/option;
for ($i=2; $i  301; $i++){
 $display_block .= option value=\$i\$i/option;
}
$display_block .= /select;
$display_block .= input type=\hidden\ name=\SESSID\
value=\$PHPSESSID\/tdtd;
$display_block .= input type=\hidden\ name=\url\
value=\$_SERVER[PHP_SELF]\BRPrice:;
$display_block .= input type=\text\ name=\sel_item_price\
size=\5\;
$display_block .= input type=\submit\ name=\submit\ value=\Add to
Cart\/form;

//categories.php
$display_block .= trtdform method=post
action=\addtocart.php\nbsp;nbsp;nbsp;nbsp;emstrong$item_name/strong
 - $item_desc/em/tdtdselect name=\sel_item_qty\;
$display_block .= option value=\0\0/optionoption value=\1\
selected1/option;
for ($i=2; $i  301; $i++){$display_block .= option
 value=\$i\$i/option;
}
$display_block .= /selectinput type=\hidden\ name=\SESSID\
value=\$PHPSESSID\input type=\hidden\ name=\sel_item_id\
value=\$item_id\/tdtdinput type=\hidden\
name=\sel_item_name\ value=\$item_name\input type=\hidden\
name=\sel_item_desc\ value=\$item_desc\input type=\hidden\
name=\url\ value=\$_SERVER[PHP_SELF]?cat_id=$cat_id\input
type=\text\ name=\sel_item_price\ size=\5\ value