Solved

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

Posted on 2006-10-30
2
480 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article discusses four methods for overlaying images in a container on a web page
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…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

729 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