|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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(); } } ?> |
|
#2
|
|||
|
|||
|
try to put your session_start() on the very top of code. right after <?php.
wink, Less than $1 / month web hosting URL |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Problems with shopping cart. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|