Session Values not being triggered
I cannot seem to find a trigger to work for my session values. I would like them set on Submit but it is not working.
Page attached.
I cannot seem to find a trigger to work for my session values. I would like them set on Submit but it is not working.
Page attached.
At the top of the page (above any recordsets etc.) you are redirecting to after the database insert
$WA_redirectURL = "sequent_confirm.php";
put this code
<?php
//=Enable Sessions=============
if (!isset($_SESSION)) {
session_start();
}
?>
your sessions should then be available to you to use.
Sorry, put it where?
I placed it just before my Session setup,directly after the include files at the top of the page.
I would normally place it above the database connection file i.e.
<?php
//=Enable Sessions=============
if (!isset($_SESSION)) {
session_start();
}
?>
<?php require_once('Connections/connDB.php'); ?>
Still no luck.
Frustrating, this works fine with ASP.
You need to move the code that is creating the sessions as well and put it just below the code I gave you i.e.
<?php
//=Enable Sessions=============
if (!isset($_SESSION)) {
session_start();
}
?>
<?php
if (!session_id()) session_start();
if(isset($_POST["Insert_x"])) {
$_SESSION["Installer"] = "".((isset($_POST["wInstaller"]))?$_POST["wInstaller"]:"") ."";
}
?>
<?php
if (!session_id()) session_start();
if(isset($_POST["Insert_x"])) {
$_SESSION["Email"] = "".((isset($_POST["wInstEmail"]))?$_POST["wInstEmail"]:"") ."";
}
?>
<?php
if (!session_id()) session_start();
if(isset($_POST["Insert_x"])) {
$_SESSION["City"] = "".((isset($_POST["wInstCity"]))?$_POST["wInstCity"]:"") ."";
}
?>
<?php
if (!session_id()) session_start();
if(isset($_POST["Insert_x"])) {
$_SESSION["Type"] = "".((isset($_POST["wStyle"]))?$_POST["wStyle"]:"") ."";
}
?>
<?php
if (!session_id()) session_start();
if(isset($_POST["Insert_x"])) {
$_SESSION["Owner"] = "".((isset($_POST["wOwner"]))?$_POST["wOwner"]:"") ."";
}
?>
you will also need the session start code on the page that is using the sessions.
on any page that you want to display session data, put this code at line 1:
<?php if (!session_id()) session_start(); ?>
I am still unable to do this.
With the above code in place here is what I get:
Warning: Cannot modify header information - headers already sent by (output started at ________________\sequent_noncert_Insert.php:2) in ________________\sequent_noncert_Insert.php on line 68
this means that there is out put to the page around line 2:
sequent_noncert_Insert.php:2
if you need help finding the problem, please send a copy of the page in a zip archive.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.