Click here to Skip to main content
15,921,941 members
Home / Discussions / Web Development
   

Web Development

 
QuestionHelp needed..to Describe Table information from Ms Access in ASP.NET 2.0 Pin
NileshUpadhyay11-Dec-06 22:46
NileshUpadhyay11-Dec-06 22:46 
AnswerRe: Help needed..to Describe Table information from Ms Access in ASP.NET 2.0 Pin
Bradml11-Dec-06 23:10
Bradml11-Dec-06 23:10 
Questionopen source file share site Pin
xoxoxoxoxoxox11-Dec-06 14:21
xoxoxoxoxoxox11-Dec-06 14:21 
QuestionHow do I get my custom web component's Absolute Position information from the VS.Net 2003 Designer? Pin
howardjr11-Dec-06 13:54
howardjr11-Dec-06 13:54 
AnswerRe: How do I get my custom web component's Absolute Position information from the VS.Net 2003 Designer? Pin
howardjr13-Dec-06 16:52
howardjr13-Dec-06 16:52 
QuestionProblem with XMLHttpRequest in Firefox browser Pin
JimmyRopes11-Dec-06 6:20
professionalJimmyRopes11-Dec-06 6:20 
QuestionSchedule report with oracle stored procedure Pin
mammoty10-Dec-06 23:17
mammoty10-Dec-06 23:17 
QuestionHelp with shopping cart in PHP Pin
Heylow10-Dec-06 10:21
Heylow10-Dec-06 10:21 
Hi
I am making a shopping cart for my web site. But I have problems deleting items from the cart. When i try to delete a item, only the carttable item gets deleted and the all items from cartID gets deleted and it will be converted from an array to a variable with the value of cartid from the url.

Here is the entire code i have written up till now.
___________My shopping cart_____________

<?php
$pat = "_^[\d]*\$_";// nothing else but decimals here

/*Chcking if every thing is filled out*/
//inserting product
if (isset($_GET['cartfunc']) && $_GET['cartfunc'] == 1 &&
isset($_GET['cartID']) &&
isset($_GET['carttable']) && preg_match($pat, $_GET['cartID']) &&
preg_match($pat, $cartfunc) &&
$_GET['carttable'] == 'Dansk' $_GET['carttable'] == 'Engelsk'
$_GET['carttable'] == 'Svensk')
{

$_SESSION['cartID'][] = $_GET['cartID'];

$_SESSION['carttable'][] = $_GET['carttable'];

// using print__r to see the contens of array
print_r($_SESSION['cartID']);
print_r($_SESSION['carttable']);

// Calculating amount and price of products

$i = 0;
$price = 0;
$total = 0;
foreach ($_SESSION['cartID'] as $productID)
{
$session = $_SESSION['carttable'][$i];

$result = mysql_query("SELECT Price FROM $session WHERE ID
= $productID");
if (!$result)
{
echo 'Could not execute request. Problem is: ' .
mysql_error();
exit;
}

while($row = mysql_fetch_assoc($result))
{
$total = $total + 1;
$price = $price + $row['Price'];
} // while

$i++;
} // foreach
$_SESSION['vognprice'] = $price;
$_SESSION['total'] = $total;

} // if

//Deleting 1 product
else if (isset($_GET['cartfunc']) && $_GET['cartfunc'] == 2 &&
isset($_GET['cartID']) &&
isset($_GET['carttable']) && preg_match($pat, $_GET['cartID']) &&
preg_match($pat, $cartfunc) &&
preg_match($pat, $_GET['cartarraynum']) && $_GET['carttable'] ==
'Dansk' $_GET['carttable'] == 'Engelsk' $_GET['carttable'] ==
'Svensk')
{

$num = $_GET['cartarraynum'];
intval($num);
$lang = $_SESSION['carttable'][$num];

$cartID = $_GET['cartID'];
$result = mysql_query("SELECT Price FROM $lang WHERE ID =
$cartID");

if (!$result)
{
echo 'Could not execute request. Problem is:
'.mysql_error();
exit;
}

while($row = mysql_fetch_assoc($result))
{

$_SESSION['total'] = $_SESSION['total'] - 1;
$_SESSION['vognprice'] = $_SESSION['vognprice'] -
$row['Price'];

}
unset($_SESSION['carttable'][$num]);
unset($_SESSION['cartID'][$num]);

print_r($_SESSION['cartID']);
print_r($_SESSION['carttable']);
}

else
{
echo 'You forgot to set some values.';

}
?>

On before hand
Thank you for your help


-- modified at 7:22 Monday 11th December, 2006
QuestionThreads in ASP or ASP . NET Pin
adnanmalik10-Dec-06 5:13
adnanmalik10-Dec-06 5:13 
AnswerRe: Threads in ASP or ASP . NET Pin
Guffa10-Dec-06 8:36
Guffa10-Dec-06 8:36 
GeneralRe: Threads in ASP or ASP . NET Pin
Bradml11-Dec-06 0:09
Bradml11-Dec-06 0:09 
QuestionPrinting a page from JavaScript Pin
happyheartcs9-Dec-06 23:28
happyheartcs9-Dec-06 23:28 
AnswerRe: Printing a page from JavaScript Pin
Bradml9-Dec-06 23:34
Bradml9-Dec-06 23:34 
GeneralRe: Printing a page from JavaScript Pin
happyheartcs10-Dec-06 0:44
happyheartcs10-Dec-06 0:44 
GeneralRe: Printing a page from JavaScript Pin
Bradml11-Dec-06 0:09
Bradml11-Dec-06 0:09 
QuestionWeb Service blocked??? Pin
Kschuler8-Dec-06 9:08
Kschuler8-Dec-06 9:08 
AnswerRe: Web Service blocked??? Pin
Pete O'Hanlon11-Dec-06 1:05
mvePete O'Hanlon11-Dec-06 1:05 
GeneralRe: Web Service blocked??? Pin
Kschuler15-Dec-06 4:50
Kschuler15-Dec-06 4:50 
QuestionDesigner property window doesn't show my component's style settings. Pin
howardjr8-Dec-06 8:36
howardjr8-Dec-06 8:36 
QuestionWhere is my component's Style?!?!? Pin
howardjr8-Dec-06 8:33
howardjr8-Dec-06 8:33 
QuestionA cheeky favour to ask Pin
Waldermort8-Dec-06 8:07
Waldermort8-Dec-06 8:07 
AnswerRe: A cheeky favour to ask Pin
Bradml8-Dec-06 16:27
Bradml8-Dec-06 16:27 
GeneralRe: A cheeky favour to ask Pin
Waldermort8-Dec-06 20:57
Waldermort8-Dec-06 20:57 
GeneralRe: A cheeky favour to ask Pin
Bradml8-Dec-06 21:24
Bradml8-Dec-06 21:24 
QuestionHTA files Pin
haggenx8-Dec-06 8:05
haggenx8-Dec-06 8:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.