...

View Full Version : shopping cart



kimmyko
05-17-2011, 10:54 PM
ive created my shopping cart but when running it this is what shows up

Parse error: syntax error, unexpected T_INCLUDE in G:\webclient\xampp\htdocs\web\index.php on line 2

this is the code below


<? php
include('book_sc_fns.php');
// the shopping card needs sessions, sostartone
start session();
do_html_header('Welcome to Media-O-RAMA');

echo'<p>Please choose a category:</p>';

//get categories out of the database
$cat_array = get_categories();

// display links to category();
display_categories($cart_array);

//if logged in as admin, show add,delete, edit cat links
if (isset($HTTP_SESSION_VARS['admin_user']))
{
display_button('admin.php', 'admin-menu', 'Admin Menu');
}
do_html_footer();
?>

tracknut
05-17-2011, 11:20 PM
A couple things look odd...<?php should have no space between the ? and the php. Also your "start session" should be "session_start".

Dave

kimmyko
05-18-2011, 02:38 AM
<?php
include('book_sc_fns.php');
// the shopping card needs sessions, so start one
session_start();
do_html_header('Welcome to Media-O-RAMA');

echo'<p>Please choose a category:</p>';

//get categories out of the database
$cat_array = get_categories();

// display links to category();
display_categories($cart_array);

//if logged in as admin, show add,delete, edit cat links
if (isset($HTTP_SESSION_VARS['admin_user']))
{
display_button('admin.php', 'admin-menu', 'Admin Menu');
}
do_html_footer();
?>

i changed it and its now giving me a lot of errors


Warning: include_once(db_fns.php) [function.include-once]: failed to open stream: No such file or directory in G:\webclient\xampp\htdocs\web\book_sc_fns.php on line 3

Warning: include_once() [function.include]: Failed opening 'db_fns.php' for inclusion (include_path='.;G:\webclient\xampp\php\PEAR') in G:\webclient\xampp\htdocs\web\book_sc_fns.php on line 3

Warning: include_once(data_valid_fns.php) [function.include-once]: failed to open stream: No such file or directory in G:\webclient\xampp\htdocs\web\book_sc_fns.php on line 4

Warning: include_once() [function.include]: Failed opening 'data_valid_fns.php' for inclusion (include_path='.;G:\webclient\xampp\php\PEAR') in G:\webclient\xampp\htdocs\web\book_sc_fns.php on line 4

Warning: include_once(output_fns.php) [function.include-once]: failed to open stream: No such file or directory in G:\webclient\xampp\htdocs\web\book_sc_fns.php on line 5

Warning: include_once() [function.include]: Failed opening 'output_fns.php' for inclusion (include_path='.;G:\webclient\xampp\php\PEAR') in G:\webclient\xampp\htdocs\web\book_sc_fns.php on line 5

Warning: include_once(book_fns.php) [function.include-once]: failed to open stream: No such file or directory in G:\webclient\xampp\htdocs\web\book_sc_fns.php on line 6

Warning: include_once() [function.include]: Failed opening 'book_fns.php' for inclusion (include_path='.;G:\webclient\xampp\php\PEAR') in G:\webclient\xampp\htdocs\web\book_sc_fns.php on line 6

Warning: include_once(user_auth_fns.php) [function.include-once]: failed to open stream: No such file or directory in G:\webclient\xampp\htdocs\web\book_sc_fns.php on line 7

Warning: include_once() [function.include]: Failed opening 'user_auth_fns.php' for inclusion (include_path='.;G:\webclient\xampp\php\PEAR') in G:\webclient\xampp\htdocs\web\book_sc_fns.php on line 7

Warning: include_once(admin_fns.php) [function.include-once]: failed to open stream: No such file or directory in G:\webclient\xampp\htdocs\web\book_sc_fns.php on line 8

Warning: include_once() [function.include]: Failed opening 'admin_fns.php' for inclusion (include_path='.;G:\webclient\xampp\php\PEAR') in G:\webclient\xampp\htdocs\web\book_sc_fns.php on line 8

Warning: include_once(order_fns.php) [function.include-once]: failed to open stream: No such file or directory in G:\webclient\xampp\htdocs\web\book_sc_fns.php on line 9

Warning: include_once() [function.include]: Failed opening 'order_fns.php' for inclusion (include_path='.;G:\webclient\xampp\php\PEAR') in G:\webclient\xampp\htdocs\web\book_sc_fns.php on line 9

Fatal error: Call to undefined function do_html_header() in G:\webclient\xampp\htdocs\web\index.php on line 5

tracknut
05-18-2011, 03:22 AM
I have a feeling book_sc_fns.php is trying to include a few things that aren't there. Have you looked at it?

Dave

kimmyko
05-18-2011, 04:12 AM
<?php

include_once('db_fns.php');
include_once('output_fns.php');
include_once('book_fns.php');
include_once('user_auth_fns.php');
include_once('admin_fns.php');
include_once('order_fns.php');

?>

thats book_sc_fns.php

and
<?php

function db_connect()
{
$result = mysql_connect("localhost", "bookorama", "bookorama123");
mysql_select_db("booksr");
if (!$result)
return false;
return $result;
}

function db_result_to_array($result)
{
$res_array = array();

for ($count=0; $row = $result->fetch_assoc(); $count++)
$res_array[$count] = $row;

return $res_array;
}

?>
db_fns.php

tracknut
05-18-2011, 04:58 AM
So are all these files in the same directory on the server as book_sc_fns.php? Your errors are saying it can't find them.

Dave



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum