Solved

osCommerce specific PHP question. How to generate osCsid immediately upon entering first page

Posted on 2006-10-30
2
458 Views
Last Modified: 2007-12-19
I have been modifying osCommerce to simply go to an initial page with 2 products, both with an order now button.

The problem is that when clicking the order now button, it goes to a blank page. I then click Back on my web browser and it goes back to the 2 products page.

The difference with seeing it this second time is that the 2 products page now has an osCsid session variable. - I can now click Order Now, and it goes to the cart with the item added.

How can I get this variable to generate upon immediately entering index.php?cPath=0 (Which is the initial page I enter to from an iFrame).

I was hoping there would be a function within osCommerce that will let me generate an osCsid, just by putting gen_osCsid() at the top of the page or something.

0
Comment
Question by:wbstech
2 Comments
 
LVL 7

Accepted Solution

by:
CraigHarris earned 500 total points
ID: 17838047
Frames are ugly and don't work on many platforms - do you really need them? -- there are extremely few justifications for such on today's web.


Sometimes the easiest workarround for buggy session handling is to force a redirect, e.g. from the index page, do:

<?php
  Session_Start();
  // osCommerce-specifc session handling goes here if needed
  Header('Location: /index.php?cPath=0');
?>
0
 
LVL 4

Author Comment

by:wbstech
ID: 17840992
You're certainly right about frames. Although I think iFrames still have a place and a use in some circumstances.

In this one it was the fact that we needed to include a simple osCommerce website inside an existing design. We couldn't incorporate the existing static design into osCommerce because it wasn't cost-effective for the customer. So an iFrame was the only choice.

I did your suggestion above but ran into some small errors. I modified the idea and just used a 1 second meta refresh, which isn't noticeable.

I had to add some PHP to make sure the meta refresh occurs just once, and this works fine.

Certainly not the cleanest way to do it. But time and money are the biggest issues on this project now.

Thanks for the idea.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
mimic google as my ip 11 53
File submission to SQL Server 1 39
Load google maps api into wordpress 5 37
Move wordpress site 3 23
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now