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
- All required pages have
session_start()on the top. - I
server Açalışma cezasına komut dosyası yüklemek. Sonraserver Bince .. Amahostgatoraynı 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 )