General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 6th, 2004, 03:41 AM
Abs Abs is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 1 Abs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Angry Problems with shopping cart.

Notice: Undefined index: action in C:\Program Files\Apache Group\Apache\htdocs\Travel\cart.php on line 5

Warning: session_start(): open(C:\PHP\sessiondata\sess_65aab0458d8fd3bce59d4 3337d10ee33, O_RDWR) failed: No such file or directory (2) in C:\Program Files\Apache Group\Apache\htdocs\Travel\db.php on line 40

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at C:\Program Files\Apache Group\Apache\htdocs\Travel\cart.php:5) in C:\Program Files\Apache Group\Apache\htdocs\Travel\db.php on line 40

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at C:\Program Files\Apache Group\Apache\htdocs\Travel\cart.php:5) in C:\Program Files\Apache Group\Apache\htdocs\Travel\db.php on line 40

Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\Apache Group\Apache\htdocs\Travel\cart.php:5) in C:\Program Files\Apache Group\Apache\htdocs\Travel\db.php on line 41

Here is the code I used in db.php:

<?php
$dbServer = "localhost";
$dbUser = "root";
$dbName = "travel";
function ConnectToDb($server, $user, $database)
{
$s = @mysql_connect($server, $user);
$d = @mysql_select_db($database, $s);
if(!$s || !$d)
return false;
else
return true;
}
function GetCartId()
{
if(isset($_COOKIE["cartId"]))
{
return $_COOKIE["cartId"];
}
else
{
session_start();
setcookie("cartId", session_id(), time() + ((3600 * 24) * 30));
return session_id();
}
}
?>

Reply With Quote
  #2  
Old April 7th, 2004, 12:00 PM
wink wink is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 4 wink User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
try to put your session_start() on the very top of code. right after <?php.

wink,

Less than $1 / month web hosting
URL

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Problems with shopping cart.


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap