Solved

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

Posted on 2006-10-30
2
476 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

737 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