Page 1 of 1

Session Problems

Posted: Tue Apr 25, 2006 12:05 pm
by xbase
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


ok this is what i am working on [url=http://www.nmlco.com/secure/]http://www.nmlco.com/secure/[/url]. I am still having trouble printing any of the session data. please if you can help me at all either reply or message me or pm me.

here is my new index.php

Code: Select all

<?
// INCLUDE SESSION FILE
require('includes/sessions.php');

// SET THE CONFIGURATION
include('includes/config.php');

?>

<html>

<head>
  <title><? echo $conf['name'],' - ',$app['name']; ?></title>
  <link rel="stylesheet" type="text/css" href="includes/styles/main.css">
</head>

<body>
<?php


if(isset($step))
{
  if($step == '1') // Gets from the variable $step the section number
  {
	$step = "1";
  }
  include("includes/part/section".$step.".php"); // Include the file associated with the variable $step
}
else
{
  include("includes/part/section1.php");
}

?>
</body>

</html>
HERE is my sessions.php file

Code: Select all

// START THE SESSION
		session_start();
		
		// SET VARIABLES
		extract($_POST);
		foreach($_POST as $k => $v)
				 if ($k != 'submit')
		if (!isset($_SESSION[$k])) $_SESSION[$k] = $v;
Here is my section1.php file

Code: Select all

if ($step > 0) {
	$var = $step + 1;
} else {	
	$step = '1';		
	$var = $step + 1;
}

echo "<form action=\"?step=$var&sid=$PHPSESSID\" method=\"post\">
 <table border=\"0\" cellspacing=\"2\" cellpadding=\"2\" width=\"600\" align=\"center\">
		<tr>
				<td colspan=\"3\" id=\"header\">SECTION 1 - TYPE OF MORTGAGE AND TERMS OF LOAN</td>
		</tr>
		<tr>
				<td id=\"field\" width=200 valign=\"middle\">Mortgage Type</td>
				<td width=5></td>
				<td id=\"input\">
				<select name=\"morgage_type\">
						<option value=\"\">Select A Mortgage Type
						<option value=\"VA\">VA
						<option value=\"FHA\">FHA
						<option value=\"Conventional\">Conventional
						<option value=\"USDA/Rural Housing Service\">USDA/Rural Housing Service
						<option value=\"Other\">Other
				</SELECT>
				</td>
		</tr>
		<tr>
				<td id=\"field\" width=200 valign=\"middle\">Loan Amount</td>
				<td width=5></td>
				<td id=\"input\"><input type=\"text\" value=\"\" size=\"15\" name=\"loan_amount\"></td>
		</tr>
		<tr>
				<td id=\"field\" width=200 valign=\"middle\">Loan Term</td>
				<td width=5></td>
				<td id=\"input\">
				<select name=\"loan_term\">
						<option value=\"\">Select A Loan Term
						<option value=\"5 Year\">5 Year
						<option value=\"10 Year\">10 Year
						<option value=\"15 Year\">15 Year
						<option value=\"20 Year\">20 Year
						<option value=\"25 Year\">25 Year
						<option value=\"30 Year\">30 Year
				</SELECT></td>
		</tr>
		<tr>
				<td id=\"field\" width=200 valign=\"middle\">Amortization Type</td>
				<td width=5></td>
				<td id=\"input\">
				<select name=\"amortization_type\">
						<option value=\"\">Select Amortization Type
						<option value=\"Fixed Rate\">Fixed Rate
						<option value=\"GPM\">GPM
						<option value=\"ARM\">ARM
						<option value=\"Other\">Other
				</SELECT>
				</td>
		</tr>
		<tr>
				<td id=\"input\" align=\"center\" colspan=\"3\">
				<input type=\"submit\" value=\"Submit\"></td>
		</tr>
</table>";

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Tue Apr 25, 2006 12:37 pm
by Christopher
It seems like you should be using $_SESSION['step'] rather than $step. (lose the extract too ... ugh)