Jump to content

Session Variables


jgsketch

Recommended Posts

Since my clients come to me already paid, I've managed to get with the other website and have setup session variables to be passed from their site to mine, so that customer will not have to re-enter all their information, the signup form will be prepopulated.

 

I have got it working on a test signup page. The page is basically a duplicate of the signup page. But when I go and transfer the code into the actual signup page, the process no longer works. Very frustrating.

 

Is there any kind of session variable time out setting in WHMCS or in the code on any pages that could be preventing me from using them?

 

Also, I read a little about converting the session variables into smarty variables? I have no clue what that means or where to begin on that subject. Could anyone point me in the right direction? Thanks.

 

Here is a snippet of the signup page and the echo's I'm using:

<tr><td width=120>
{$LANG.clientareafirstname}
</td><td>
<input type="text" name="firstname" size=30 
value="<? echo $_SESSION['FirstName']; ?>">
*</td></tr>

 

Here is the sessions. I put this code on my front page index.php, the landing page from the site that is passing the data from.

<?

@session_start();
$_SESSION['RepID'] = $_REQUEST['RepID']; 
$_SESSION['Company'] = $_REQUEST['Company']; 
$_SESSION['FirstName'] = $_REQUEST['FirstName']; 
$_SESSION['LastName'] = $_REQUEST['LastName']; 
$_SESSION['Email'] = $_REQUEST['Email']; 
$_SESSION['BillStreet1'] = $_REQUEST['BillStreet1']; 
$_SESSION['BillStreet2'] = $_REQUEST['BillStreet2']; 
$_SESSION['BillCity'] = $_REQUEST['BillCity']; 
$_SESSION['BillState'] = $_REQUEST['BillState']; 
$_SESSION['BillPostalCode'] = $_REQUEST['BillPostalCode']; 
$_SESSION['WorkPhone'] = $_REQUEST['WorkPhone']; 


?>

Link to comment
Share on other sites

I've narrowed it down a bit. I added this to the signup page

<? session_start(); ?>

 

However that did not work. I assume because it is not located at the top of the page. So I went to the header.tpl file and added it there. Same thing, nothing. I then went to the order.php page. That is where it got interesting. I was able to echo data, but then also got this after it. "The file order.php is corrupted". Then the rest of the page is blank.

 

So I'm stuck, it allmost works, but I just cannot pass the variables on because of the encrypted order.php file.

 

Since I cannot get this code to work on the header.tpl file, there is nowhere else to put it??

Link to comment
Share on other sites

Maybe my code is wrong. Maybe I need to have $_session[name] = to the form fields, {$clientsfirstname}.

 

Can someone explain the form fields on the signup page. What does {$clientfirstname} do? After looking at it, I would think you would not want to delete this, but rather assign it something??

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated