drjohn 56 Posting Pro in Training

read up on php scripts and the mail() function.
Be aware that spammers will try to hi-jack your mail form to send out spam to other people, so you need to check the data input and cleanse it of unacceptable data.

drjohn 56 Posting Pro in Training

I think that should be an OR not an AND between the two bracketed conditions.

drjohn 56 Posting Pro in Training

If you are new to html and web site building, then I have to say that this is going to be totally beyond your ability.

drjohn 56 Posting Pro in Training

OMG!!!

It's a miracle anything shows up in a browser!

You really, really need to read up on the absolute basics of html, as your code has some major errors - like no doctype, no html tag, no head tag, no body tag, for starters. And it uses tables (and nested tables at that) for layout.

Try to read Build your website the right way by Ian Lloyd, as a minimum, and the tutorials at www.htmldog.com. Then start all over again building your site.

drjohn 56 Posting Pro in Training

teedoff is right.
It's as simple as that.

drjohn 56 Posting Pro in Training

You need to add a wrapper div around the entire existing content with a defined width which will hold the other divs in place. Otherwise the content in the two divs will do exactly what you are showing when the viewport is less than their combined widths.

you can set a min-width and max-width restraint on the outer wrapper div for better control.

drjohn 56 Posting Pro in Training

Did you actually upload it to your site? It is not embedded in the page and has to be uploaded separately.

Can you give us a live url to look at?

Also you don't have a doctype in your code, and that is a very risky way to build your pages.

PS I agree that it is a bad idea to use a reserved word like body for anything purpose other than its intended reserved purpose. It's just good working practice in all computing to treat reserved words with respect.

drjohn 56 Posting Pro in Training

At the start of your css file, i.e. the very first line, set the margin and padding for the body to zero. You should always do this to get rid of browser inconsistencies. But note that it may make a few other parts of your layout look wrong, if you have styled things a lot and accidentally required the browser to use its default settings. Different browsers have different defaults for things, you see, and taking advantage of them in one browser can break a design in another browser.

drjohn 56 Posting Pro in Training

Put it in a div, give the div a width, and centre the div.

drjohn 56 Posting Pro in Training

Install web developer toolbar (Firefox and Chrome) and ask it to show the passwords, under forms.

drjohn 56 Posting Pro in Training

Does the problem involve more than one centre? Or is it one centre running many courses? If the later, you would not need the centre entity.

Do teachers teach at more than one centre? If so, you need a linking table for that.
Is a student attending more than one centre (probably not).
If a student takes more than one subject, you need a linking table for that.

currently your erd is too simple. Work on the many to many relations first.

drjohn 56 Posting Pro in Training

Code away as normal for css3, then do what it says here http://css3pie.com/
I've just used this on a couple of sites and it works very well. When it goes wrong, the usual solution is to add position:relative to the div in question. Several other css3 bits of code now work as well once I tried this.

drjohn 56 Posting Pro in Training

no idea, as no web page url to look at.

drjohn 56 Posting Pro in Training

SQL is the query language used by many relational databases.
MySQL and Oracle are relational databases produced by different companies.

drjohn 56 Posting Pro in Training

When you zoom in the text gets bigger and the confines of the div the main text is in make it wrap, as you'd expect. Your logo on the other hand just gets bigger, and as the div it is in has no constraint on size, that two gets bigger. Try applying a max and min width to the header div, the same as the container div.

drjohn 56 Posting Pro in Training

Create a div, give it a class name, a width equal to the four icons plus any padding between them, and margin :auto
float the img / icon in the div left.
add the text in another div below this (same class name)
add the next set of icons in another div below this. (same class name)

drjohn 56 Posting Pro in Training

Lemur, you code is totally invalid - you have an empty ul (no li inside it), with instead an img inside it.
Then you have li tags not inside an ul.

Please learn some basic html before posting code like that.

drjohn 56 Posting Pro in Training

Or a simpler way.

create a file index.php, that is your normal home page. Upload it.
create a second one called index.html that contains the just words "site off line"

upload the index.html when the site is off line.
Delete it when it is on line.
no need to touch the index.php, as the index.html will be shown in preference to the index.php whenever it is present.

no need for a database, no need to write code. Just too simple for words.

drjohn 56 Posting Pro in Training

mysql uses the following date format
yyyy-mm-dd

you will have problems until you format your date correctly.

drjohn 56 Posting Pro in Training

If you view the source code as delivered to the browser, you can see that the doctype has not been used. So follow the earlier advice about placing the doctype declaration outside the php part of the page.

Also there are a few oddities about your page

There are THREE occurrences of the <html> tag. And two of the <body> tag.

And the style sheet is loaded twice, once in the usual place and once halfway down the source code.

You can find these using firefox, view source and then the edit>find option

drjohn 56 Posting Pro in Training

Have you heard of google?
it works.
About 209,000 results

Ole Raptor commented: No help just being a jerk -1
drjohn 56 Posting Pro in Training

of course, select whatever you want from a table, and put in as many or few order by bits as you need.

select col1, col2, col3, col4, col5, col5
from mytable
order by col2 desc, col5 asc;

or whatever suits you

drjohn 56 Posting Pro in Training

the concept of sorting the data in the table is meaningless, as you can only see the data when you query the table. so use an order by clause and for all practical purposes, you will image that your table is sorted.

When you delete a few rows and then insert new ones, they could go anywhere in the table, but you'd never know.

What purpose do you imagine that a "sorted" table would server?

drjohn 56 Posting Pro in Training

as has heidiSQL and SQL manager lite from ems. In fact almost every database management application that I've used has it.

drjohn 56 Posting Pro in Training

You need a php uploader, password controlled, and preferably only those who do the uploading know the page even exists. If they upload to a folder with no index page and your server shows the folder contents when there is no index page, then everyone can see the documents to download them, so everything becomes available to everyone. You could separate things on a topic by topic basis by having the destination folder dependant on who does the uploading, or rather who they say they are. I wrote such a script for a client a while ago.

drjohn 56 Posting Pro in Training

totally agree

drjohn 56 Posting Pro in Training

I don't think your use of iFrames is appropriate for your site. You're building and styling the site the way things were done in 1996. Look around the web a bit and you'll not see many sites build the way yours is. iFrames are generally only used on an odd page or two where it helps to keep all the data in the one place.

eg http://thehamblintrust.org.uk/events.htm (this is a very old site)
see how it uses the iframe, and why it helps. But that's the only page with an iframe

Using them for general page and site layout is a long forgotten and generally disused technique. May it rest in peace.

drjohn 56 Posting Pro in Training

Your browser stats look VERY different from those reported by wikipedia or any of the other global sources - you've gone to a techy web site that makes it data available, haven't you? All techy web sites show a distinct bias to firefox that does not translate to the general public.

check a more reliable,less biased source
http://en.wikipedia.org/wiki/Usage_share_of_web_browsers
they include stats from several big sources

Ah, I see where you got your dodgy stats from now - w3schools. A single web site's stats, very biased stats indeed, showing the usage among web designers who think they will learn coding from that source! Not exactly representative of the general public, is it?

However, design and test in firefox, then adjust for IE, is the way most people work.

PS Like you, I strongly recommend Webdeveloper Toolbar

drjohn 56 Posting Pro in Training

Okay, some of the more obvious errors in your code.

There is no such thing as float:center; float is either left or right. So that bit will simply not work. Next, if you'd chosen float;left or float:right, it still would not have worked as you have to set a width of less than 100% for #nav (which you are trying to float:center), otherwise you would see no difference whether or not the float code was used.

So what is happening is that all browsers have some error detection code built in and they then try to guess at the best solution to what you thought you were doing. They detect different errors and correct them in different ways, and Firefox is either not detecting/ignoring these errors or guessing a correction that is .different to IE's guess (remember the code is just wrong, so they have to guess). Or one is ignoring the float code completely and the other is trying to guess what you meant.

Also, you're using text-shadow, which is not supported in IE, but is supported in Firefox (it's css3, and only a few parts of css3 are supported and it varies from browser to browser which bits are supported, but we have high hopes for IE9 supporting some more css3).

Try visiting www.cssbasics.com and www.htmldog.com to learn a bit more about css (which might upset one new member...)

Using tables for layout, incidentally is just soooo last century, …

drjohn 56 Posting Pro in Training

It's usually easy to start testing in firefox, then alter things if necessary to work in IE. But when you say IE, which version are you using?

drjohn 56 Posting Pro in Training

Where is the data you want displayed coming from? A database? If so how are you extracting the data?

drjohn 56 Posting Pro in Training

Thanks for your kind words.
Such a nice introductory post from a new member.

My answer to the above thread, about 15 weeks ago, was correct.

Encouraging someone to learn css is always good advice. www.cssbasics,com is one of the sites I often recommend to people seeking to learn about css, so it was nice to see that the original poster had been there. They've had a face lift to their own css. They set the body background to one colour, and the main div background to a different colour, but that would not be the correct solution for the original poster's question, of course, for the obvious reasons.

Oh, and yes with an IQ measured at 154, I don't need to worry about your opinion on my intellect. And you spelt crawl wrongly. ;)

But if you have any problems, do just ask for help, and I'll see if I can find a solution for you. Or give help, of course.

drjohn 56 Posting Pro in Training

Create a style called #current and apply that to the link that refers to the page you are on. Style the link as appropriate - in your case text-decoration:underline;

#current {text-decoration:underline;}

<a id="current" href="thispage.htm">This Page</a>

You'd do this on each page of the site.

drjohn 56 Posting Pro in Training

typical inaccurate stuff from w3schools !

have a quick look at www.w3fools.com and learn why you should treat that site's lessons with care.

What your code does is just a typical way to style your menu, which you should create as an unordered list.

Arkinder commented: Very nice link. +1
drjohn 56 Posting Pro in Training
drjohn 56 Posting Pro in Training

It is a BAD idea to make your web site as wide as the viewer's screen. It makes reading text tricky - when the reader gets to the end of a long line of text, they have to sweep their eye back along it and drop down one line to find the next new line. This gets trickier the wider the screen or browser viewport to be more accurate.

So choose a sensible width for your content, say 1000px or so, and use a wrapper div to centre the entire content (not text-align: center; of course as that is even harder to read!)

So if you want a magic snippet of code, try this.

<body>
<div id="wrapper">

The rest of your page is in here

</div>
</body>

Next, include this in your css
body { margin:0; padding:0}
#wrapper {width:1000px; margin:auto;}

Without seeing your site, I've just used 1000px as an example. Perhaps your site is a little bit wider than that, or a little bit narrower. But please remember that many people do NOT work with their browser fully maximised - the main reason to have a wide screen is so that several apps can be open and visible at the same time. For example, working from a word doc a client sent with the content/text for a new web site, you'd have the word doc open next to your web editor, which avoids jumping back and forth between two documents both set at …

drjohn 56 Posting Pro in Training

Where on earth do you get this total rubbish from??

Most people set their screen resolutions at 640x480.

Are you someone from 1995 who has accidentally been timewarped to 2011? Someone who has met Doctor Who and left the Tardis by accident?

drjohn 56 Posting Pro in Training

A clever trick is to make one image the background for the ul or the div it is in (your #nav-main), and another image as the background for the link. Then on hover you just remove the link's image and you get an instant response.

css

#nav-main {
.
.
.
background:transparent url(images/your.gif) repeat-x top left;

}

#nav-main ul li a {
.
.
.
background:transparent url(images/otherimage.gif) repeat-x top left;

}

#nav-main ul li a:hover {
.
.
.
background:transparent url();

}

where
.
.
. are any other styles you use.

drjohn 56 Posting Pro in Training

And remember that google can't read your images, so if there is any text in them, google can't read that. You get a bonus from google if the words used in a link are the words the searcher is looking for. If there are no words, you've thrown away something useful.

It is MUCH better to use text for links, with an image as the background. If it is the same single image every time, the page loads faster, something google also gives a bonus for.

A background image for a link can be made very narrow and tiled horizontally, further increasing the speed with which the page loads. Users and google are both happy now.

drjohn 56 Posting Pro in Training

I use tab delimited files, not csv, so much easier, as I too have a comma in the middle of some fields. I also use some software (SQL Manager Lite for MySQL, from EMS or HeidiSQL) for remote connection, so I don't even have to upload the file in advance.

load data local infile "C:/Documents and Settings/dr john/My Documents/logpile/AccountDataExport_2011-01-29.txt" into table accounts;

the keyword local tells it to take the file from my PC's drive.

csv is overrated, tab delimited is so much easier to work with. Spreadsheets can save as tab delimited if that's where your data comes from, mine comes from an extraction app running on a desktop's database.

drjohn 56 Posting Pro in Training

that makes more sense now

drjohn 56 Posting Pro in Training

A good first step would be to re-write it and use html, you know, things like h1, h2, h3, p, perhaps a few ul, li and the like.

You site is almost totally lacking in html tags, apart from the div tag, link tags and img tags - there isn't even the standard beginners favourite tags (<br> and &nbsp; ). It is all plain body text, the least used and also the least useful thing on a web page.

You could also try a css reset (although with the distinct lack of html, I'm not sure if it will improve things much, but you should have a reset anyway) so try adding margin:0; padding:0; to your body's css.

But until you do that, it will be tricky to give much advice.

this is the most extreme case of divititis I've ever seen. ;)

PS how do you imagine people will feel when you tell them to update their browser? Pleased? Or annoyed that you are insulting them. Especially as you give the same message to IE9, IE8 and IE7 users, and all of these are still supported...
In fact one hasn't even been released yet (IE9). I'm not interested in your anti-MS propaganda and anti-MS attitude, I don't like it and yet I don't even use IE (I use firefox). So how would someone who liked IE8, or IE9 feel - would they stay on your site, or would they go???

Remember, you …

drjohn 56 Posting Pro in Training

Go on, someone send him a 600mb file of plain text...
Might fill and close his mail box...

Ah, just noticed he wanted it to gmail, so it wouldn't.
unless we ALL sent him a file

drjohn 56 Posting Pro in Training

You'd have to use the html entities instead of the < and >
eg 1&lt;br&gt;2&lt;br&gt;3&lt;br&gt;
which the browser will then display as 1<br>2<br>3<br>

&lt; means the less then symbol, <
&gt; means the great than symbol, >


to get a new line from pressing the enter key, you'd have to use a PHP function, nl2br(), to process the data entered. It turns a new line into a <br> tag.

You could of course write a script which did a search and replace on < and > to change then to the required entities, which might be much more convenient as you'd be less likely to have a typo in the data in your textbox. So the script would process the <s and >s first, then the output would be passed to the nl2br() function

drjohn 56 Posting Pro in Training

It would be interesting to see some typical values for movie_title, to see how that gives you movie_release_year

drjohn 56 Posting Pro in Training

this bit is weird

WHERE movie_title IN (SELECT * FROM (SELECT movie_title FROM movie_temp) AS TEMP);

You are using a sub-sub-query to select movie_title, then using a sub-query to select * from the sub-sub-query, which will give you the exact same result as the sub-sub query - every single movie_title in the entire database
Why????

WHERE movie_title IN (SELECT movie_title FROM movie_temp);
will give you the exact same result.

you've also used an alias for the result of the sub-sub-query, then made no use of it what so ever.

and there is one final itty bitty thing - the entire line five
WHERE movie_title IN (SELECT * FROM (SELECT movie_title FROM movie_temp) AS TEMP);
is not needed anyway....

you've already told it to use movie_temp on the opening line on the first line

UPDATE movie_temp

So then all you have to do is tell it the field to be updated and how to work out the new value,
SET movie_release_year = (
SUBSTRING_INDEX(movie_title,')',1)
)

which reduces the overall query to just

UPDATE movie_temp
SET movie_release_year = (
SUBSTRING_INDEX(movie_title,')',1)
);

you would only use a WHERE condition when only some of the records were to be updated, but you are updating them all. So no need for the WHERE.

smantscheff commented: I smelled some fishy here, too, but you pinpointed it exactly. +1
drjohn 56 Posting Pro in Training

Upload the image again. It could have been corrupted the first time.

PS Chrome and Safari use the same engine, so usually give the same results.

drjohn 56 Posting Pro in Training

If you give the first item in each drop-down a class of .first and set the styles
.first {margin-top:10px;}
it will move that item down a bit for you.

If you try applying it to the hpmenu ul, it makes a gap between ALL the items in the drop-down, which is not good. Remember it is perfectly legal to give something two classes, so change the first item in each drop-down (the one below the one with class="top") from class="item" to class="item first"

If this helps, why not visit my sites, I need visitors

drjohn 56 Posting Pro in Training

Before you start following what they "teach" at w3schools, it pays to know a few things.
It's run by just a couple of guys. It has ABSOLUTELY NO CONNECTION WHAT SO EVER with W3C / w3.org at all. It is NOT run by w3.org . It's owners are cashing in on having a similar sounding name that makes you think it is related.

It has such a bad reputation among professionals that a group of people have created a site you really should visit, called http://w3fools.com/

Read it and weep.
Especially if you thought you'd learned to code correctly from it or recommended it to someone...

drjohn 56 Posting Pro in Training

sorry but without an auto-incrementing numerical id, it doesn't look as if sorting will work. It looks like the primary key is PersonID varchar(8),

so id 9a would be rated as a bigger id than id 88888a wouldn't it? That's how it goes with varchar, it's an alphabetical sort, not a numerical one.

How are these varchar ids assigned?? Can they be changed to be auto-incrementing numerical?

And of course this antique thread has been revived by a signature spammer, and the posts should be deleted.