Hi thanks for reading my first post. I'm having trouble with a checkout form processor that is working but throwing WARNINGS that my sales team (and later direct customers) should not get.
I am trying to grab customer cart information (one or more rows), grab it as an array, convert all to string, replace the double shipping (if it exists), and store it in final variable $prodfinal. Here is the code:
// BTG Product Inserting Code
$result_products = mysql_query("SELECT name, name2 FROM cart WHERE invoice_id=$invoice_id");
while($products[]= mysql_fetch_array($result_products,MYSQL_ASSOC));
$prod3=" ";
foreach($products as $prod2) { $prod3.=" ".(implode(" ",$prod2)); }
$prod2=(implode(" ",$products));
$prodfinal=str_replace('Shipping Shipping','& Shipping',$prod3);
// BTG code end
This code executes successfully but throws:
Warning: implode() [function.implode]: Invalid arguments passed in /home1/beatth13/public_html/cms/customer_orders_list32.php on line 42
Warning: Cannot modify header information - headers already sent by (output started at /home1/beatth13/public_html/cms/customer_orders_list32.php:42) in /home1/beatth13/public_html/cms/customer_orders_list32.php on line 180
line 42 is the -- foreach($products as $prod2) { $prod3.=" ".(implode(" ",$prod2)); }
I tested this code segment on its own php test page and it runs fine, no warnings... when I embed it in the larger form processing page the implode function...well...implodes.
ALSO it throws the "output started" error from line 42 except I REALLY do not see where I am sending any output... It does not appear to me that I am sending any HTML output at this point but apparently I am wrong.
Thank you in advance for your help!
BTG