Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Dec 7th, 2004, 1:41 PM   #1
eggsy
Newbie
 
Join Date: Dec 2004
Posts: 5
Rep Power: 0 eggsy is on a distinguished road
Hi all much help needed??

I have had to develop a site in Perl that acts as a very basic e-commerce system whihc tracks items ordered in Cookies.

Code for adding cookies is shown below:

$cookie_value = $query->cookie('cycle');
#cookie value is called 'cycle'

$cycle_to_add = $query->param('cycleid');

if ($cookie_value)
{

$cookie_value = $cookie_value . ',';

}


$cookie_value = $cookie_value . $cycle_to_add;


$cookie_to_set = $query->cookie (-name => 'cycle',

-value => $cookie_value,

-expires=> '',

-path=> '/');

print $query->header(-cookie => $cookie_to_set);[/b]

What I am also looking to do is make it so that people can remove items from their shopping basket?
and having real problems in how to go about this.

Code for area of the shopping basket is shown below:

$sql = qq{SELECT name FROM stock WHERE item_id = ?};



$sth = $dbh -> prepare($sql);



@cycle_list = split /,/, $cookie_value;

print "<FORM METHOD=post ACTION=\"redirect.pl\">\n\n";
print "<CENTER><FONT FACE = \"arial, helvetica, sans\"><TABLE COLS=3>";


foreach $cycleid (@cycle_list)
{



$sth -> execute($cycleid);



($name) = $sth->fetchrow_array;



print "<TR><TD>$name</TD><TD></TD><TD><A HREF=remProduct.pl?id=$cycleid>REMOVE</A></TD></TR>\n";

}

print "</TABLE>\n";[/b]

So it will pass the Cycle ID to the remProduct Perl file I just dont know where to go from there?

If anyone can help would be really useful thanks all for reading, any more info needed please let me know??
eggsy is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:36 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC