LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-14-2005, 01:54 AM   #1
poeta_boy
Member
 
Registered: Oct 2003
Location: Mexico
Distribution: Ubuntu
Posts: 223

Rep: Reputation: 31
php, iframes and loading a page


Hello Mina San:

I'm bulding an small site based on php and I have a page Login.php, which in turn has an iframe coming from loginForm.php....

I've managed to get the login info, and check whether or not the user is registered, with something like this:

Code:
<?php

      include("connect.php");

	$sql = "SELECT * FROM users WHERE userName = '" . $user ."' AND 
password = '" . $password . "'";
	$result = mysql_query($sql, $db);

	if($myRow = mysql_fetch_array($result))
	{
			session_register("$user");
	}
	else
	{
		echo "User not registered";
	}
?>
Where connect.php is the database connection.......... the thing is that once the user has been validated, I'd like to load welcome.php in the whole page, not just the iframe where the validation has been done.

Is there a way to do that? I tried something like :

Code:
	if($myRow = mysql_fetch_array($result))
	{
			session_register("$user");
			echo "<script language=JavaScript1.1> 
parent.load(/registro.php); </script>";
	}
But the parent.load won't work any ideas?

thanks
 
Old 03-14-2005, 07:02 PM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,804

Rep: Reputation: 944Reputation: 944Reputation: 944Reputation: 944Reputation: 944Reputation: 944Reputation: 944Reputation: 944
Did you put a session_start(); at the top of your php code
In the main page, not in frames, session has to be started
before any output to browser
 
Old 03-14-2005, 10:35 PM   #3
poeta_boy
Member
 
Registered: Oct 2003
Location: Mexico
Distribution: Ubuntu
Posts: 223

Original Poster
Rep: Reputation: 31
thanks a lot, but the thing is that I'd like to load a whole new page, being triggered by an even in the iframe..... is that possible?

thanks
 
Old 03-15-2005, 03:45 AM   #4
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,804

Rep: Reputation: 944Reputation: 944Reputation: 944Reputation: 944Reputation: 944Reputation: 944Reputation: 944Reputation: 944
I don't know your complete code, but try :
PHP Code:
if(($myRow mysql_fetch_array($result)) !== FALSE) {
    
session_register("user");
    
$_SESSION["user"] = $user;
   echo 
"<script language=\"JavaScript1.1\"> parent.location.replace(\"/registro.php\"); </script>";

 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Page does not stop loading in firefox jackpal Linux - Software 5 04-28-2005 02:49 PM
Hurray almost done but page not loading in crclient ! gopikrish Linux - Networking 0 01-02-2005 10:53 AM
Python: loading page from forum fiomba Linux - Software 13 11-24-2004 09:51 AM
mozzila closes after loading any page... ambelos Linux - Software 5 02-08-2004 11:22 AM
Ms Ie Iframes????? graystarr Linux - Software 0 08-18-2003 12:37 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration