een fout

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Mads kroes

mads kroes

25/09/2010 00:26:39
Quote Anchor link
Hallo,

Ik ben bezig met e-commerce op mijn site te zetten alleen ik krijg deze fout.

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /customers/??????????.com/??????????.com/httpd.www/webshop/includes/functions/sessions.php:169) in /customers/?????????????.com/?????????????.com/httpd.www/webshop/includes/functions/sessions.php on line 102

En


Warning: session_save_path() [function.session-save-path]: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/customers/??????????.com/??????????.com:/var/www/diagnostics:/usr/share/php) in /customers/??????????.com/??????????.com/httpd.www/webshop/includes/functions/sessions.php on line 169

Vraagtekens heb ik er neer gezet.

dit is het script

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?php
/*
  $Id: sessions.php 1830 2008-01-30 00:58:21Z hpdl $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2008 osCommerce

  Released under the GNU General Public License
*/


  if ( (PHP_VERSION >= 4.3) && ((bool)ini_get('register_globals') == false) ) {
    @
ini_set('session.bug_compat_42', 1);
    @
ini_set('session.bug_compat_warn', 0);
  }


  if (STORE_SESSIONS == 'mysql') {
    if (!$SESS_LIFE = get_cfg_var('session.gc_maxlifetime')) {
      $SESS_LIFE = 1440;
    }

    function
_sess_open($save_path, $session_name) {
      return true;
    }

    function
_sess_close() {
      return true;
    }

    function
_sess_read($key) {
      $value_query = tep_db_query("select value from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "' and expiry > '" . time() . "'");
      $value = tep_db_fetch_array($value_query);

      if (isset($value['value'])) {
        return $value['value'];
      }


      return '';
    }

    function
_sess_write($key, $val) {
      global $SESS_LIFE;

      $expiry = time() + $SESS_LIFE;
      $value = $val;

      $check_query = tep_db_query("select count(*) as total from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "'");
      $check = tep_db_fetch_array($check_query);

      if ($check['total'] > 0) {
        return tep_db_query("update " . TABLE_SESSIONS . " set expiry = '" . tep_db_input($expiry) . "', value = '" . tep_db_input($value) . "' where sesskey = '" . tep_db_input($key) . "'");
      }
else {
        return tep_db_query("insert into " . TABLE_SESSIONS . " values ('" . tep_db_input($key) . "', '" . tep_db_input($expiry) . "', '" . tep_db_input($value) . "')");
      }
    }

    function
_sess_destroy($key) {
      return tep_db_query("delete from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "'");
    }

    function
_sess_gc($maxlifetime) {
      tep_db_query("delete from " . TABLE_SESSIONS . " where expiry < '" . time() . "'");

      return true;
    }


    session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');
  }

  function
tep_session_start() {
    global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS;

    $sane_session_id = true;

    if (isset($HTTP_GET_VARS[tep_session_name()])) {
      if (preg_match('/^[a-zA-Z0-9]+$/', $HTTP_GET_VARS[tep_session_name()]) == false) {
        unset($HTTP_GET_VARS[tep_session_name()]);

        $sane_session_id = false;
      }
    }
elseif (isset($HTTP_POST_VARS[tep_session_name()])) {
      if (preg_match('/^[a-zA-Z0-9]+$/', $HTTP_POST_VARS[tep_session_name()]) == false) {
        unset($HTTP_POST_VARS[tep_session_name()]);

        $sane_session_id = false;
      }
    }
elseif (isset($HTTP_COOKIE_VARS[tep_session_name()])) {
      if (preg_match('/^[a-zA-Z0-9]+$/', $HTTP_COOKIE_VARS[tep_session_name()]) == false) {
        $session_data = session_get_cookie_params();

        setcookie(tep_session_name(), '', time()-42000, $session_data['path'], $session_data['domain']);

        $sane_session_id = false;
      }
    }


    if ($sane_session_id == false) {
      tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));
    }


return session_start();
  }

  function
tep_session_register($variable) {
    if (PHP_VERSION < 4.3) {
      return session_register($variable);
    }
else {
      if (isset($GLOBALS[$variable])) {
        $_SESSION[$variable] =& $GLOBALS[$variable];
      }
else {
        $_SESSION[$variable] = null;
      }
    }


    return false;
  }

  function
tep_session_is_registered($variable) {
    if (PHP_VERSION < 4.3) {
      return session_is_registered($variable);
    }
else {
      return isset($_SESSION) && array_key_exists($variable, $_SESSION);
    }
  }

  function
tep_session_unregister($variable) {
    if (PHP_VERSION < 4.3) {
      return session_unregister($variable);
    }
else {
      unset($_SESSION[$variable]);
    }
  }

  function
tep_session_id($sessid = '') {
    if ($sessid != '') {
      return session_id($sessid);
    }
else {
      return session_id();
    }
  }

  function
tep_session_name($name = '') {
    if ($name != '') {
      return session_name($name);
    }
else {
      return session_name();
    }
  }

  function
tep_session_close() {
    if (PHP_VERSION >= '4.0.4') {
      return session_write_close();
    }
elseif (function_exists('session_close')) {
      return session_close();
    }
  }

  function
tep_session_destroy() {
    return session_destroy();
  }

  function
tep_session_save_path($path = '') {
    if ($path != '') {
      return session_save_path($path);
    }
else {
      return session_save_path();
    }
  }

?>
Gewijzigd op 25/09/2010 00:27:05 door Mads kroes
 
PHP hulp

PHP hulp

24/11/2024 12:30:19
 
Erik Rijk

Erik Rijk

25/09/2010 01:09:47
Quote Anchor link
return session_start() ???

Why?
Dat hoort geheel bovenaan je script te staan als eerste om met sessies te kunnen werken.
Je open basedir heeft naar mijn idee te maken met een bepaald pad wat je probeert aan te roepen waar je niet bij mag
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.