Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Declaring own session


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



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


@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT vid FROM table where vid = '".$_POST['cid']."'";



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'];
header("Location: http://www.domain.com");

<?php }

<script language="javascript" type="text/javascript">
function intOnly(i) {
if(i.value.length>0) {
	i.value = i.value.replace(/[^\d]+/g, ''); 
<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);">
 <input name="Submit" type="submit" id="Submit" value="verify" />


Any help will be much appretiated. Thanks in advance!

Link to comment
Share on other sites


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

  • Create New...