Benim PHP oturum HostGator üzerinde tasarruf olmaz

0 Cevap php

Kafamdan. Bu bir düzeltmek için nasıl. Benim oturum hostgator sunucu üzerinde çalışmıyor. Ancak diğer sunucu üzerinde de gayet iyi çalışıyor.

İşte bir örnek kod.

<form action="/payment-select/" method="post">
 <select name="payment" onchange="this.form.submit()">
 <option value=""<?php if(empty($_SESSION['payment'])) { echo ' selected="selected"'; } ?>><?php echo $lang_please_select; ?></option>
 <?php 
  $sp = 'SELECT * FROM payment';
  $qp   = $db->rq($sp);
  while($payment = $db->fetch($qp)) {
  ?>
 <option value="<?php echo $payment['bank']; ?>"<?php if($_SESSION['payment'] == $payment['bank']) { echo ' selected="selected"'; } ?>><?php echo $payment['bank']; ?></option>
 <?php } ?>
 </select>
 </form>

/payment-select/

include_once('includes/connection.php'); // session_start() here
include_once('includes/formatting.php');

$_SESSION['payment'] = strip_html_tags($_POST['payment']); 

header("location:/payment/");
exit();

Update

  1. All required pages have session_start() on the top.
  2. I server A çalışma cezasına komut dosyası yüklemek. Sonra server B ince .. Ama hostgator aynı phpinfo ile $_SESSION['payment'] /payment/ sayfaya yönlendirme başlığından sonra tasarruf olmaz.

I'm not share the session between server. It's something like I install wordpress on server A ok, Server B ok and Server C problem. ( the situation by example )

0 Cevap