Jump to content

$_SESSION


Renlok

Recommended Posts

Make sure when you move from page to page, you use Relative links and not Absolute.  If you set the session on say mysite.com and then navigate them to www.mysite.com, that is considered another domain and the session isn't passed.  So see if that is the problem.

Link to comment
https://forums.phpfreaks.com/topic/151256-_session/#findComment-794610
Share on other sites

its something to do with the function

function addauction(){
global $DBPrefix, $_SESSION, $userrec, $a_starts, $a_ends, $payment_text, $system;

return "INSERT INTO " . $DBPrefix . "auctions VALUES (NULL, " . $userrec['id'] . ", '" . $system->cleanvars($_SESSION['SELL_title']) . "', '" .  $a_starts . "', '" . addslashes($_SESSION['SELL_description']) . "', '" . $system->cleanvars($_SESSION['SELL_pict_url']) . "', " . $_SESSION['SELL_sellcat'] . ", '" . $_SESSION['SELL_minimum_bid'] . "', '" . $_SESSION['SELL_shipping_cost'] . "', '" . (($_SESSION['SELL_with_reserve']=="yes")?$_SESSION['SELL_reserve_price']:"0") . "', '" . (($_SESSION['SELL_with_buy_now'] == 'yes') ? $_SESSION['SELL_buy_now_price'] : 0) . "', '" . $_SESSION['SELL_atype'] . "', '" . $_SESSION['SELL_duration'] . "', " . floatval($_SESSION['SELL_customincrement']) . ", '" . $_SESSION['SELL_shipping'] . "', '" . $payment_text . "', " . (($_SESSION['SELL_international']) ? 1 : 0) . ", '" . $a_ends . "', 0, 0, " . (($_SESSION['SELL_file_uploaded']) ? 1 : 0) . ", " . $_SESSION['SELL_iquantity'] . ", 0, 'n', " . intval($_SESSION['SELL_relist']) . ", 0, 0, 'n', '" . $system->cleanvars($_SESSION['SELL_shipping_terms']) . "', '" . $_SESSION['SELL_buy_now_only'] . "', '" . $_SESSION['SELL_adultonly'] . "')";
}

 

as if i put print_r($_SESSION); before i call the function it displays al the sessions but if i put it inside the function nothing shows.

Link to comment
https://forums.phpfreaks.com/topic/151256-_session/#findComment-795210
Share on other sites

its something to do with the function

function addauction(){
global $DBPrefix, $_SESSION, $userrec, $a_starts, $a_ends, $payment_text, $system;

return "INSERT INTO " . $DBPrefix . "auctions VALUES (NULL, " . $userrec['id'] . ", '" . $system->cleanvars($_SESSION['SELL_title']) . "', '" .  $a_starts . "', '" . addslashes($_SESSION['SELL_description']) . "', '" . $system->cleanvars($_SESSION['SELL_pict_url']) . "', " . $_SESSION['SELL_sellcat'] . ", '" . $_SESSION['SELL_minimum_bid'] . "', '" . $_SESSION['SELL_shipping_cost'] . "', '" . (($_SESSION['SELL_with_reserve']=="yes")?$_SESSION['SELL_reserve_price']:"0") . "', '" . (($_SESSION['SELL_with_buy_now'] == 'yes') ? $_SESSION['SELL_buy_now_price'] : 0) . "', '" . $_SESSION['SELL_atype'] . "', '" . $_SESSION['SELL_duration'] . "', " . floatval($_SESSION['SELL_customincrement']) . ", '" . $_SESSION['SELL_shipping'] . "', '" . $payment_text . "', " . (($_SESSION['SELL_international']) ? 1 : 0) . ", '" . $a_ends . "', 0, 0, " . (($_SESSION['SELL_file_uploaded']) ? 1 : 0) . ", " . $_SESSION['SELL_iquantity'] . ", 0, 'n', " . intval($_SESSION['SELL_relist']) . ", 0, 0, 'n', '" . $system->cleanvars($_SESSION['SELL_shipping_terms']) . "', '" . $_SESSION['SELL_buy_now_only'] . "', '" . $_SESSION['SELL_adultonly'] . "')";
}

 

as if i put print_r($_SESSION); before i call the function it displays al the sessions but if i put it inside the function nothing shows.

at any point in the script are you calling the function addauction()?  becuase yes, if you have "print_r($_SESSION);" before the function it will be printed whether you call the function addauction() or not.

 

just a thought.

Link to comment
https://forums.phpfreaks.com/topic/151256-_session/#findComment-795323
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.