473,385 Members | 1,329 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to load files to a web page using PHP

I have a web page that is currently using 2 frames. The left frame has buttons to select what appears in the right frame. I need to stop using frames, and was told PHP would do that.

I have done some studying at w3schools.com and I think something like this would work, but I am missing something major.

<?php
if ($_GET["page"] == "home")
include("home.php");
else if ($_GET["page"] == "info")
include("info.php");
?>

I want to use CSS and think it should look somethign like

#select {
float: left;
margin-left: 2px;
width: auto;
}
#display {
float: right;
width: auto;
}

At this point, I am stuck. I need to get my buttons on the left, and make something display on the right.

This newbie will appreciate any pointers.

Bill
May 6 '07 #1
17 2952
pbmods
5,821 Expert 4TB
I need to stop using frames, and was told PHP would do that.
Dunno why you were told that; PHP and frames are like apples and celery.

At this point, I am stuck. I need to get my buttons on the left, and make something display on the right.

This newbie will appreciate any pointers.
This is really a CSS question. You have the right idea using the float property, though.

Here are a couple of resources you might find helpful:
http://www.saila.com/usage/layouts/
http://www.glish.com/css/
May 7 '07 #2
You probably want to look into using SSI - Server Side Includes. They work like a charm and they are much better than frames. I recently made the switch and I'm not looking back.
May 8 '07 #3
drhowarddrfine
7,435 Expert 4TB
The problem lies in setting the width to auto which is setting them to the width of the screen. Give that some actual dimension and that will solve it.
May 8 '07 #4
You probably want to look into using SSI - Server Side Includes. They work like a charm and they are much better than frames. I recently made the switch and I'm not looking back.
I am already using SSI to load things that appear on all pages of the site.

What I need is a way to eliminate frames and select a file from a left column and have it appear in the right column.
May 8 '07 #5
The problem lies in setting the width to auto which is setting them to the width of the screen. Give that some actual dimension and that will solve it.
I have set the left most division to 170PX, but the right division still drops to below the left division.

I want the right division to have an automatic width so various window sizes will have proper word wrap.
May 8 '07 #6
drhowarddrfine
7,435 Expert 4TB
Then there must be more going on here than what we see. After rethinking this, the div should not be dropping below the other even when width is set to auto. You're going to need to post the complete code or a link.

As far as copying stuff form one div to the other, that's only accomplished with a programming language and you would have to ask about that on the appropriate programming board.
May 8 '07 #7
Then there must be more going on here than what we see. After rethinking this, the div should not be dropping below the other even when width is set to auto. You're going to need to post the complete code or a link.

As far as copying stuff form one div to the other, that's only accomplished with a programming language and you would have to ask about that on the appropriate programming board.
First, here is the link http://www.roberson-family.com

Second, I posted the original message in the PHP forum, and it was moved here. I will try again in the PHP forum.

Bill
May 9 '07 #8
drhowarddrfine
7,435 Expert 4TB
Your doctype is incomplete and puts IE into quirks mode. See the sticky at the top of this board. Use html4.01 strict. Then validate both your html and css for your list of errors that need correcting.
May 9 '07 #9
Your doctype is incomplete and puts IE into quirks mode. See the sticky at the top of this board. Use html4.01 strict. Then validate both your html and css for your list of errors that need correcting.
I have validated the page as is, and the only thing that does not validate is a bit of script from Accuweather.com.

I agree that the doctype is not the latest, but it does validate. I just now ran it past the validation, and it passed.

I actually have some code that will not work with html4.01 strict, so the page will have to remain transitional until I find a solution for that code.

I have also validated the CSS file.

Bill
May 10 '07 #10
drhowarddrfine
7,435 Expert 4TB
It doesn't matter that the validator uses your doctype. Browsers, particularly IE, go into quirks mode when the doctype is incomplete and yours is incomplete.

You have one CSS error but at least 13 html errors. Some aren't even reported by the validator. For example, you are using <span> on block level elements but span is for inline. Your css at the top is also missing an identifier.

If you wish to use some of that deprecated code, then transitional is necessary but you still must use the appropriate one. See the sticky at the top of this board.
May 10 '07 #11
It doesn't matter that the validator uses your doctype. Browsers, particularly IE, go into quirks mode when the doctype is incomplete and yours is incomplete.

You have one CSS error but at least 13 html errors. Some aren't even reported by the validator. For example, you are using <span> on block level elements but span is for inline. Your css at the top is also missing an identifier.

If you wish to use some of that deprecated code, then transitional is necessary but you still must use the appropriate one. See the sticky at the top of this board.
I have redone my home page so that everything works in Firefox, except the layout of the two columns using DIV and CSS. I think what I need to understand is how to get the CSS correct. The code in my CSS reads:

#weather{
float: left;
margin-left: 2px;
width: 170px;
}
#announcement {
float: left;
margin-left: 2px;
width: auto;
}

I then have in my HTML code the DIVs:

<div id="weather">

<?php include($DOCUMENT_ROOT . "/incl/weather.php"); ?>

</div>

<div id="announcement">

<!-- announcements located here -->

</div>

When viewing with Firefox 2.0.0.3, the announcements are below the weather. What do I need to change in the CSS file to make it work properly?

Bill
May 12 '07 #12
drhowarddrfine
7,435 Expert 4TB
You still need to fix these errors and this error which I mentioned above.
May 12 '07 #13
Several of the errors seem to be caused by the use of an ampersand (&). The line refers to a page named J&JBaby.PHP

Is the ampersand something I should avoid?

Bill
May 15 '07 #14
pbmods
5,821 Expert 4TB
Several of the errors seem to be caused by the use of an ampersand (&). The line refers to a page named J&JBaby.PHP

Is the ampersand something I should avoid?
In general, yes, because ampersands are used to separate variables in a query string (e.g., page.php?mode=view&id=5&orderby=name&orderdir=asc) .

As a way of ensuring that your content will work as intended in all browsers, you should either remove ampersands from your file names, or encode them as '%26'.
May 15 '07 #15
In general, yes, because ampersands are used to separate variables in a query string (e.g., page.php?mode=view&id=5&orderby=name&orderdir=asc) .

As a way of ensuring that your content will work as intended in all browsers, you should either remove ampersands from your file names, or encode them as '%26'.
I have removed ampersands from the file names on my site and fixed all the code except for locations where I am describing something like "fast & quick" in text. Do I need to replace those with "%26" or is this an acceptable use?

Bill
May 15 '07 #16
drhowarddrfine
7,435 Expert 4TB
In html, & should be replaced with &amp;
May 15 '07 #17
In html, & should be replaced with &amp;
Thanks. I will get to work changing my pages.

Bill
May 16 '07 #18

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Ray in HK | last post by:
What are the differences between LOAD DATA INFILE and LOAD DATA LOCAL INFILE ? I found some web hosting company do not allow using LOAD DATA INFILE but allow LOAD DATA LOCAL INFILE. The reason...
1
by: jen_designs | last post by:
Can you load 2 xml files on an html page via javascript? I can get one xml file to load, using the following code. How about two. I need to combine 2 xmls files on the client. Any other way to...
1
by: Jim Heavey | last post by:
Hello, I am walking through the ASP.Net book by Dino Esposito. I created a new project and used the "add existing" option to add the files to my new project. He had all of the code on a single...
2
by: John Alesse | last post by:
Hi, I've created a very simple winforms control using the c# wizard in VS .net 2003 that is nothing but a System.Windows.Forms.UserControl. There are no other controls on the form It takes IE 12...
4
by: Don Wash | last post by:
Hi All! I'm getting the following Error: No DLLs has been compiled yet and nothing in the \bin directory. So it is not the versioning problem or anything like that. And here are the...
10
by: GeekBoy | last post by:
Okay, I have two identical web servers running Windows 2003 web server. I have an ASP.NET application which runs great on one of them. Dedicated IP address, behind our firewall, etc. Everyone's...
2
by: Sascha | last post by:
Hi there, I searched carefully through the web before finally deciding to post this message, because I could not find a solution for my problem. Hopefully someone will have a hint or explanation...
6
by: sylcheung | last post by:
Hi, How can I be notified when the document load is complet in JavaScript? I am referring to the whold document load is complete, mean all images/external files/frame/iframes have been loaded. ...
2
by: Jim McGivney | last post by:
In Web Developer Express I make a very simple aspx page. The page name is Hoho.aspx. The page has a label, the label text is "Hello World". To test the page on my computer, I press CTRL-F5 and the...
4
by: joshuaRR | last post by:
Hello all. I am trying to load a page using CSS, because the website does not allow script to be used on thier site. I was trying to enter sounds files using onmouseover on certain texts & images...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.