implode function not working - Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Webmaster Tech > Programming > PHP Development

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 10-03-2008, 10:28 AM   #1 (permalink)
Junior Member
 
Join Date: Sep 2008
Posts: 5
Default implode function not working

Hello,

I am trying to combine multiple values in a string to be submitted to a shopping cart. However, I can only get one of the two values to pass through to the cart. Any suggestions? Thanks in advance!

<?php
if(isset($_POST['part'])) {
$checkbox = $_POST['part'];
$string = implode("^",$checkbox);
echo $string;
}
?>

<form name='CartItem' action='https://www.ram-mount.com/RamCart/CartPutItem.php' method='POST'>
<input type='checkbox' name='part' value='RAM-VB-162'>
<input type='checkbox' name='part' value='RAM-VB-154'>
<input type='submit' value='Add To Cart'>
</form>
tonyledenko is offline   Reply With Quote
Sponsored Links
Old 11-13-2008, 03:15 PM   #2 (permalink)
Junior Member
 
Join Date: Nov 2008
Posts: 5
Default Re: implode function not working

Try....

PHP Code:
<form name='CartItem' action='https://www.ram-mount.com/RamCart/CartPutItem.php' method='POST'>
<
input type='checkbox' name='part[]' value='RAM-VB-162'>
<
input type='checkbox' name='part[]' value='RAM-VB-154'>
<
input type='submit' value='Add To Cart'>
</
form
webguy1620 is offline   Reply With Quote
Old 11-22-2008, 07:31 AM   #3 (permalink)
Junior Member
 
amber.long83's Avatar
 
Join Date: Nov 2008
Posts: 6
Default Re: implode function not working

Some Correction

PHP Code:
<?php
if(isset($_POST['part'])) {
$checkbox $_POST['part'];
$string implode("^",$checkbox);
print_r ($string); /* This is now array */
}
?>

<form name='CartItem' action='https://www.ram-mount.com/RamCart/CartPutItem.php' method='POST'>
<input type='checkbox' name='part[]' value='RAM-VB-162'>
<input type='checkbox' name='part[]' value='RAM-VB-154'>
<input type='submit' value='Add To Cart'>
</form>
amber.long83 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 07:26 PM.


Powered by vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2
Webmaster Forums
Web Hosting | Chicago Web Hosting | Web Hosting