PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
crossreference
Forum Newbie
Posts: 4 Joined: Mon Feb 06, 2006 12:59 pm
Post
by crossreference » Mon Feb 06, 2006 1:45 pm
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!
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098 Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia
Post
by Chris Corbyn » Mon Feb 06, 2006 1:46 pm
If you could post the relevant code it'd be easier to understand what's going on
crossreference
Forum Newbie
Posts: 4 Joined: Mon Feb 06, 2006 12:59 pm
Post
by crossreference » Mon Feb 06, 2006 2:12 pm
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]
crossreference
Forum Newbie
Posts: 4 Joined: Mon Feb 06, 2006 12:59 pm
Post
by crossreference » Mon Feb 06, 2006 2:14 pm
The reference to:
require( "select-city-found.php" );
is the line that I need to open a frameset page so both frames reload.
Christopher
Site Administrator
Posts: 13596 Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US
Post
by Christopher » Mon Feb 06, 2006 2:44 pm
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>
(#10850)