Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Okay, so I have a page that consists of several iFrames containing "steps" to a signup process (one is basic info, another education, etc..). Anyway, each iFrame pushes the new information to the mySQL server via jQuery $.post calls and a collection of PHP files.. So, in one iFrame, the information is pushed to a PHP file, which sends it to the server and then stores the user's id in a $_SESSION['userid'] variable. Then, I try echoing this same variable under the education iFrame to see if it can read the session info. However, the value returns blank. After some research, I realized I needed to include a session_start() function, so I stuck this in my parent window before the <HTML> tag. However, it's still not working. I hope you guys can understand me... Any advice? Thanks in advance. What am I doing wrong?
Posted

1 solution

The IFRAME is a html level (client side) element (that you should not use since it is deprecated). Anyway, all iframes refer to some php scripts. That is what you should have known already. Now the lesson: you have to include session_start(); at the beginning of all these php scripts, including the one you call via ajax - indifferent of the workflow you try to implement. The function call will start a new session if does not exist, and it is attaching your script to the existing one.
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900