Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Declaring own session


lostsoulz

Recommended Posts

Hi guys i need help in declaring a session before i enter the /catalog. Selected customers have to verify their identify through a form in http://www.domain.com/verify.php

 

In verify.php a session will be passed to /catalog.

The problem im facing currently is that OSCommerce do not show the session that i had created.

 

Is there anyway i can retrive the session from verify.php?

 

Here's the verify.php code

 

<?php

if ($_POST['cid'] !="")
				{

$username="username";
$password="pass";
$database="db";

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT vid FROM table where vid = '".$_POST['cid']."'";
$result=mysql_query($query);

$num=mysql_numrows($result);

mysql_close();

if ($num <= 0) 
{ 
echo "Sorry, you have entered an invalid number. Please try again<br>";
} 

else {
session_start(); // start session

$_SESSION['abc'] = '10';
$_SESSION['def'] = $_POST['cid'];
session_write_close();
header("Location: http://www.domain.com");
exit;
?>

<?php }

				}
?>
<script language="javascript" type="text/javascript">
<!--
function intOnly(i) {
if(i.value.length>0) {
	i.value = i.value.replace(/[^\d]+/g, ''); 
}
}
//-->
</script>
<form id="creditVerify" name="creditVerify" method="post" action="verify.php">
 Please enter the code:
 <input name="cid" type="text" id="cid" size="10" maxlength="6" onChange="intOnly(this);" onKeyUp="intOnly(this);" onKeyPress="intOnly(this);">
 <label>
 <input name="Submit" type="submit" id="Submit" value="verify" />
 </label>
</form>

 

Any help will be much appretiated. Thanks in advance!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...