Little HTML help...

truckingpete

On a Stark Trek
Joined
Oct 25, 2003
Messages
1,757
Location
North Dakota, USA
I making a website and I have one question..well a couple:

I want to make my picture links (buttons) so when a mouse goes over the picture, it would make the button pushing in but your not pushing it in. You know what I mean?? Or here is a better example: When you put your mouse over the picture it gets highlighted or something.

Another question: Where can I find a program or code or something to make login pages and everything for HTML?? I would like to have a login page.

Thanks!

- TP
 
You need JavaScript.

Please visit [ www.buttongenerator.com ]. You can make there your buttons
and then download them,
including HTML-Code and JavaScript-Code.

If you want an example, see my website [ www.sethos.gmxhome.de ].
Have a look on the menu on the left. JavaScript must be activated.
Perhaps it's that what you desired.

HTML is NOT a programming language.
For login pages you need PHP. This is a programming language that works together with a webserver (e.g. Apache, MS PWS, Xitami etc) program. It's used to build dynamic web pages.

You can download XAMPP (Apache-Mysql-Pearl-PHP) for Windows
at [ www.apachefriends.org ]. Installation is easy. Unzip the files
and run "xampp_start.exe".

I develop my web pages on my PC and then I upload them.
 
You don't necessarily need to download anything. I simply upload to my webspace to see if it works. ;)
 
Thrawn said:
You don't necessarily need to download anything. I simply upload to my webspace to see if it works. ;)
or you can just save the page to your desktop and run it to see if it works. :D

its quite simple to do this. you just need to create a simple function such as:

function pushDown() {
pic1.src.onmouseover="http://...."
pic1.src.onmouseout="origional src"
}

then in your body tag type <BODY OnLoad="pushDown()"> and in your IMG tag for the pic type <IMG ID="pic1">

Replace "pic1" with whatever you want but make sure to replace it in the function as well.
 
Do you want the color to change, or have another picture? If it was a color, that can easily be done by CSS. Javascript should be avoided whenever possible because 11% of Internet users (Military, government, screen-readers, text-browsers) don't have it. There's also a lot of people who turn off Javascript.

If you're intersted, you could also try Pure CSS Popups.
 
why would the military and government disable or remove Javascript support from their machines? :confused:
 
Thrawn said:
That doesn't work when you don't have php installed. :p
why would you need that? If he is primitive enough not to know how to do a mouseover trick then I seriously doubt he is using php. (no offense intended, pete!)

@hbdragon88
Those arent really pop-ups. They are just another way to do OnMouseOver without javascript.
 
the100thballoon said:
why would the military and government disable or remove Javascript support from their machines? :confused:

Even though it's a client-side script (And doesn't write to your hard drive), there are still scripts that can cause your computer to crash, or stealthly move a popup ad so that you wind up clicking it whenever you click on the webpage. I've seen a few popup ads do that.

There's also code (javascript, too I think) that downloads itself onto your computer without you knowing it. For example, it could download something to the c:\windows\system32 directory (putting it into the PATH -- old DOS term for directories that the OS looks in for a file). The client side javascript could then open the file. Suppose the government had an old computer in a backroom. Why not replace it? Well, there might be some old data left on tape backup that might only be compatible with that system.

Let's say it's a Win 3.1 system with a VERY primative Internet Explorer browser that just got javascript. An employee decides to visit their local news site and checks out some links in the Games & Techs section. One of those links goes to a website forum. Someone posts a link there, and the employee clicks on it, thinking it's about some technology (maybe the link was misleading).

The employee clicks on it, and it has a stealth-download script. It downloads to c:\windows\system32. Now, the script then runs the program. Turns out, it's a trojan that garbles the network, and makes the harddrives/RAID systems work extra hard, as well as taking up memory. The entire system goes down.

This is why some might disable their javascript all together.

Or, it could be that they just want to cut down on spam. (spam 'servers' can be transmitted via those stealth downloads, too.)

As for the military, A stealth download could install a program to upload top secret information to another computer, and maybe do a few computations at the same time. You never know when the military might be stealth attacked via email asking users to click a link.

Here's a situation:

Spy Agency A in rouge country X sets up a spam server to (lightly - it would have to be some common names, or a known name, and at the same time, seperate "from" addresses, since a bunch of emails that bounce back (and are from the same address/IP) would look suspicious) send emails to a government agency (say it's the army). The email contains a link to a perfectly legitimate sounding website (maybe it's g0-army - with a 0 instead of an o), or it's some other military themed site. The site has some javascript code that downloads a program to your computer. (maybe there's a way to overwrite the file without prompting - I never tried it). The next time the user (or computer) uses that file, it sets up camp and starts scanning the computer, sending information to some computer (probably not at the rouge nation's spy agency). Now, it would have to be smart enough to not be detected (i.e., suspiscious bandwidth, 100 instances of the same program on each computer - i.e., same name, a program with a cryptic name like z1jx0e8e28.exe, etc.). With javascript on, the security was easily comprimised without anyone knowing it.

hbdragon88 said:
Do you want the color to change, or have another picture? If it was a color, that can easily be done by CSS. Javascript should be avoided whenever possible because 11% of Internet users (Military, government, screen-readers, text-browsers) don't have it. There's also a lot of people who turn off Javascript.

If you're intersted, you could also try Pure CSS Popups.

Even still, some browsers (Netscape 4.8 and lower) have problems with CSS. Any CSS menu would 'fall back' to an item list. In fact, this is how it will appear in some printers when the user goes to print. (This is why some sites have Print Friendly versions of the page).
 
Chieftess said:
Even though it's a client-side script (And doesn't write to your hard drive), there are still scripts that can cause your computer to crash, or stealthly move a popup ad so that you wind up clicking it whenever you click on the webpage. I've seen a few popup ads do that.

There's also code (javascript, too I think) that downloads itself onto your computer without you knowing it. For example, it could download something to the c:\windows\system32 directory (putting it into the PATH -- old DOS term for directories that the OS looks in for a file). The client side javascript could then open the file. Suppose the government had an old computer in a backroom. Why not replace it? Well, there might be some old data left on tape backup that might only be compatible with that system.

Let's say it's a Win 3.1 system with a VERY primative Internet Explorer browser that just got javascript. An employee decides to visit their local news site and checks out some links in the Games & Techs section. One of those links goes to a website forum. Someone posts a link there, and the employee clicks on it, thinking it's about some technology (maybe the link was misleading).

The employee clicks on it, and it has a stealth-download script. It downloads to c:\windows\system32. Now, the script then runs the program. Turns out, it's a trojan that garbles the network, and makes the harddrives/RAID systems work extra hard, as well as taking up memory. The entire system goes down.

This is why some might disable their javascript all together.

Or, it could be that they just want to cut down on spam. (spam 'servers' can be transmitted via those stealth downloads, too.)

As for the military, A stealth download could install a program to upload top secret information to another computer, and maybe do a few computations at the same time. You never know when the military might be stealth attacked via email asking users to click a link.

I understand now but I still dont see the problem with implementing some very basic Javascript functions in a personal web site. So the government wont see the cool effect when they move the cursor over your picture.... who cares? Most people will and think, "Sweet! I wish I could do that!" haha :lol:
 
the100thballoon said:
why would you need that? If he is primitive enough not to know how to do a mouseover trick then I seriously doubt he is using php. (no offense intended, pete!)

None taken ;)

Plus I dont think military people are going to view my site..well I dont see why. I am doing pretty basic layout right now. I mean basic... I have been working with HTML roughly..umm...2 - 3 years...I think... I create my own images and everything for my site. So its a homemade site..:D

Thanks for all your help..:D

- TP
 
truckingpete said:
None taken ;)

Plus I dont think military people are going to view my site..well I dont see why. I am doing pretty basic layout right now. I mean basic... I have been working with HTML roughly..umm...2 - 3 years...I think... I create my own images and everything for my site. So its a homemade site..:D

Thanks for all your help..:D

- TP
no prob! I try to help when I can because others on the forum have helped me so much in the past. (Thanks, Chieftess!)
 
truckingpete said:
None taken ;)

Plus I dont think military people are going to view my site..well I dont see why. I am doing pretty basic layout right now. I mean basic... I have been working with HTML roughly..umm...2 - 3 years...I think... I create my own images and everything for my site. So its a homemade site..:D

Thanks for all your help..:D

- TP

Give us a link and we can help even more. :p If not, still, good luck, hope you learn a lot!
 
the100thballoon said:
I understand now but I still dont see the problem with implementing some very basic Javascript functions in a personal web site. So the government wont see the cool effect when they move the cursor over your picture.... who cares? Most people will and think, "Sweet! I wish I could do that!" haha :lol:

Government agencies (Federal, State and local) use Microsoft products, which means they'll be using ASP.NET. ASP.NET can handle most of the basic Javascript functions (like setting focus to a textbox by reading from a session variable after a postback). You can't make a browser use "basic javascript functions" unless you actually programmed a browser to do that. So, it's either on, or off.
 
I couldn't be bothered to read the whole thread, but for the first two questions...

1. You can use DHTML which would look something like the following. Hopefully it is self explanatory; you need to create two styles ... <img onmouseover="this.classname='one';" onmouseout="this.classname='two';" class="two" />

2. Because your questions are fairly basic, I assume you haven't yet got onto server-side scripting. Why do you want a login? An unprofessional password solution that works without server side checking goes something like the following. This code may not work because it's late in the evening and I am actually sleeping :p

<form action="http://mywebsite.com">
Enter password:
<input name="password" type="text">
<input value="Go" type="submit" onclick="document.forms[0].action+=document.forms[0].password.value+'.html';">
</form>

... so it tries to open a page with the name of your password. Enter the wrong password and get a 404 error. You could use a frame to catch the 404 and bounce them back, add username in the same way, hide the secret page in your site index, and tell search robots not to read it. Pretty cheap trick, but it has some novelty value and it's actually more secure than some server-side solutions :rolleyes:

***

Javascript is almost always enabled. It is much more common to find Macromedia Flash disabled (or missing) than it is to find Javascript switched off, and many commercial sites (and adverts) use Flash! If the professionals can't be bothered to target all browsers then why should you? Also, Flash itself supports embedded Javascript so at the end of the day, Javascript is the very last thing that is ever disabled in a browser.

Javascript is harmless: It has no means of writing to the local machine. The worst thing it can do is enter an infinite loop (bad scripting) but MSIE will ussually notice before it crashes and prompt you with "a script on this page is causing your system to slow down, do you want to exit the script?" ... or the script might cause lots of problematic popups, but FireFox (or Netscape) can block those. There are third party utilities (i.e. Webwasher.com) that will remove popups from pages displayed in other browsers. Javascript DOM can do some visuals that trick some people into doing stupid things but the risks are small.

Java is something completely different and you should not confuse it with Javascript. Several Java implementations are packed with security problems and Java scripts (two words: scripts containing Java, not Javascript) commonly harbour malicious code. It is much more common that Java support is disabled (or missing) but nobody has suggested using that evil :)

I suspect Chieftess has confused Java with Javascript, because the stealthiest thing Javascript can do is silly stuff like the following. When you hover over the link, the browser status bar displays a safe URL, but when your mouse button depresses that URL changes. Scarey huh? *I'm quaking in my boots* :)

<a href="http://somewheresafe.com" onmousedown="this.href='http://somewherenaughty.com';">Visit my website</a>

****

Javascript is a programming language; actually, it's core is ECMAscript 262 but nobody cares about that.

Like most programming languages, Javascript is implemented in many different places. Each implementation has the same core, meaning the same syntax but implementations vary in other respects. The implementation in MSIE (called JScript) is very slightly different. I already mentioned that it is implemented in Macromedia Flash. It is also implemented in the Windows Scripting Host (WScript) where it has different features.

WScript can do quite a lot on a local machine, like launch executables. However, WScript objects are not supported in MSIE and vice versa. There is little risk of scripts crossing from one environment to the other...

If I were to explore the possibilities, I might have a WScript in a webpage: It would fail to do anything, but any browser would store the file in it's cache anyway... then I might have instructions on the webpage telling the user to look through their browser cache and open the file called *.js and the WScript would be launched locally and do something malicious. Having said that, disabled JavaScript support would not change anything because I can still use <img src="*.js"> with the exact same result. I could do the same with <img src="*.exe"> ... Do you think anyone would actually follow the instructions and open that file?
 
Ginger_Ale said:
Give us a link and we can help even more. :p If not, still, good luck, hope you learn a lot!

No..not yet..:D Maybe I could give out my Forum?? My site has a place were you can download Midis, game reviews reviewed by..ME! :D And advertising area where you can advertise YOUR site..:D But its going to have ads :(

Also the background music is cool..it's a Midi..:D

Theres a little background on my site...:D

Thanks again! I think I'll have more questions sooner or later..:D

- TP
 
I perfer div tags. (Apparently, text-align isn't in a span tag).
 
Div tags and span can do pretty much the same thing, but I too use div tags.

But for the question you are asking: adding the "width:100%" tells it to span the entire width of the page, and the height will stay a normal height.

So, the final code:

Code:
<span style="width:100%;background-color:red">Text here</span>

The "red" part you can change to hex, or just regular color words. Using <div ... > instead of <span ... > also works. This works because no matter how long your text is, it'll still go to the end of the page.

Happy HTMLing! :)
 
Back
Top Bottom