Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax to load new page 2

Status
Not open for further replies.

Domino2

Technical User
Jun 8, 2008
475
GB
I have a query that if the results are there, I want it to load the bottom frame of two called Main with a new page headlines.php, but I cannot find how to do it.

I have tried header('headlines.php');
main('headlines.php');
header('main": headlines.php');
etc etc. thanks


if ($numrows > 0) {

load page in here

exit();

} else {
 
to redirect to another page you use
Code:
header("Location:[URL unfurl="true"]http://somedomain.com/somepage.php");[/URL]
but that's not going to help you with frames. you will need to generate the frameset page dynamically instead. or - much much better - stop using frames: there is absolutely no need for them anymore.
 
Thanks. I had reduced my frames to 2, having a banner (Top)
If I use a one page format then every page will have to get a frame at the top to replace the banner, etc. I am trying to simulate a network database system presently existing. The use of frames would have made things more logical, the website will be on a secure server for one group of people to use, not public. I gues I will just have to bite the bullet and use individual pages. To try and pick up Ajax in my timescale is a non starter, need to get something off the ground now. Thanks for your advice.
 
You can use PHP to dynamically load the banner page into the single page. as well as have the results displayed. Really no need for ajax or anything else.




----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Many thanks vacunita, I did a search and found the include statement.

<?php
include("/include/banner.php");
?>

That saves a lot of messing about. It adds it to the top of a new form. Is there any way to include a form which can reside to the left of a page, replacing what was a left hand top to bottom frame? Probably not? In addition can you include a form as a page footer. Many thanks
 
Exactly. include, require etc.. many ways to do it.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
And yes. You can include anything. As long as its in a file, you can include it. So create your form file.php with everything you need for the form. minus <html> and<head> and <body> tags, and the just include it where you want it. alternatively you can make it so your includes don't echo out to the screen but into a variable, that way you can have all your includes in one place, and then just echo the corresponding variable where you want the output.




----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Sorry for delay getting back. I have found how to create header and footer files, and a php form that incorporates includes for header and footer, however have not found how to include a side by side type of form, similar to a left hand frame page. I need a left hand pane to show a listbox of records, and have the righthand page respond to records picked from the list. If I can produce the two pages and know how to make the updates against list clicking then I am moving. If not I am stuck. Any suggestions greatly appreciated, thanks
 
Domino2 - please take this post constructively.

i'm concerned that you don't have enough of the basic skills to be undertaking a development project. For example you do not seem sufficiently knowledgeable to be able to differentiate between and html, css, javascript or php issue. if you don't even know how to approach a fix then it's going to be mighty difficult for you to finish the fix.

if this is a commercial venture you're undertaking for yourself or clients i'd advise you to seek some professional assistance at rentacoder or similar. if this is purely a personal project then i would spend some time investigating the basics of html and javascript and then have a look at the basics of server side coding (php, for example).
 
Using PHP you can alter the contents a div based on what you pick from a listbox.
Obviously the Listbox would need to submit a form, so the secondary script can use it and alter the contents accordingly.


Basically just have an area where you check whether the listbox was submitted or not, and then perform the needed actions to display your content accordingly.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Thanks vacunita, I can see the light at the end of the tunnel.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top