Page 1 of 1
How to make require( "filename.php" ) load both fr
Posted: Mon Feb 06, 2006 1:45 pm
by crossreference
Let me first apologize for my lack of programming knowledge. I aspire one day to learn enough to qualify myself as a "newbie"
I currently have an if/else statement that includes the line: require( "filename.php" );
This loads filename.php but just in the lower frame. What I need is to reload both frames but I don't know how.
My PHP developer is away on vacation and I'm desperate. Any assistance would be appreciated!
Posted: Mon Feb 06, 2006 1:46 pm
by Chris Corbyn
If you could post the relevant code it'd be easier to understand what's going on

Posted: Mon Feb 06, 2006 2:12 pm
by crossreference
feyd | Please use Code: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Code: Select all
<?php
require( "./functions.php" );
$query = mysql_query( "Select * from aliases, area where aliases.alias='$city' and area.state='$state' and area.ID=aliases.area" );
if( $result = mysql_fetch_array( $query ) )
{
$cralias = $city;
$crstate = $result['state'];
$crarea = $result['ID'];
$crareadesc = $result['description'];
if(!$_COOKIE["crarea"])
{
mysql_query("Update session set crarea='".$crarea."', cralias = '".$cralias."' where SESID='".$sesID."'");
}
else
{
setcookie( "cralias", $cralias, time()+60*60*24*30);
setcookie( "crstate", $crstate, time()+60*60*24*30);
setcookie( "crarea", $crarea, time()+60*60*24*30);
setcookie( "crareadesc", $crareadesc,time()+60*60*24*30);
}
require( "select-city-found.php" );
// Header( "Location: index.php?page=select-city-found.php" );
}
else
{
$url = "select-city-not-found.php?city=" . rawurlencode($city) . "&state=" . rawurlencode($state);
$url = rawurlencode( $url );
// Header( "Location: index.php?page=$url" );
$city = rawurlencode($city);
$state = rawurlencode($state);
require( "select-city-not-found.php" );
}
?>
feyd | Please use Code: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Posted: Mon Feb 06, 2006 2:14 pm
by crossreference
The reference to:
require( "select-city-found.php" );
is the line that I need to open a frameset page so both frames reload.
Posted: Mon Feb 06, 2006 2:44 pm
by Christopher
Since you found and not found pages are both in a frame, you probably need to use javascript to change the other frame. Something like this in your not found page:
Code: Select all
<script>
document.parent.other_frame_name.location = 'new_page_in_other_frame.php';
</script>