PHP inside a Framset - Please help!!!!

It doesn't matter if you do all the error checking in the world, or if you have the most beautiful graphics, if your site or application design isn't usable, it's not going to do well. Get input and advice on usability and user interface issues here.

Moderator: General Moderators

Post Reply
mattyb
Forum Newbie
Posts: 4
Joined: Mon Nov 22, 2004 10:05 pm

PHP inside a Framset - Please help!!!!

Post by mattyb »

I'm trying to use PHP inside a frame. The code for my script works perfectly on an open page but as soon as its called inside the frame I lose my paramaters that were passed from the previous pages form.

Here's my code:

<?php

$user_name = $_POST['user_name']; //set variables
$password = $_POST['password'];

$link = mysql_connect("localhost", "rt", "mb") //CHANGE ACCORDING TO PERSONAL DETAILS
or die("Could not connect to database");

mysql_select_db("db") //CHANGE TO YOUR PERSONAL DATABASE
or die("Could not select database");

$query = "SELECT * FROM users WHERE user_name = '$user_name' AND password = '$password'";
$result = mysql_query($query)
or die("Query failed");

$line = mysql_fetch_array($result);

if(mysql_num_rows($result)) {
$valid_user = 1;
}
else {
$valid_user = 0;
}

?>

This may be a really stupid problem as I'm quite new to PHP however I'm ready to tear my hair out... Any help would be appreciated.

Matt
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

set your form target to point inside the frame
Post Reply