Jump to content
xisto Community

SystemWisdom

Members
  • Content Count

    118
  • Joined

  • Last visited

Everything posted by SystemWisdom

  1. Thx guys, I'm glad you liked it! I guess I am doing good at writing tutorials (even though I always used to hate writing essays in school), so I will have to keep it up! :lol:Though I guess it isn't really a tutorial for beginners like you both have said (as far as the code goes), but the tool alone would be a good tool for beginners still learning PHP, to know what functionality they have access to! :lol:So for anyone who only wants the tool (ignoring the tutorial), feel free to copy & paste the source code into your own PHP page, place it on your web-server, and away you go!
  2. PHP Installed Modules Dynamic Reference Tool A dynamic tool for referencing PHP modules and their associated routines, which are installed on your web-server. **Note: Uses only 2 functions built-in to PHPs core and should be easy to convert to a later version of PHP. This current version uses PHP4. Example: PHP Installed Modules Dynamic Reference Tool Abstract: ????[/tab]As a PHP Developer, it is nice to know what functionality is available to you, and what you would have to implement yourself. Some of this functionality is provided for you by the PHP core, of which I am sure most of you are familiar with. However, a lot more may be added via Extension Modules installed with the PHP Web-Server (usually installed by your web-server administrator). Once these modules are installed, they provide a rich library of functions for your PHP scripts to access, giving you more flexibility and control as a developer. ????The trick is in knowing what modules are installed with PHP on your web-server, what functionality those modules provide, and how to use that functionality in your scripts. All of this can be provided in the Dynamic Reference Tool we will create in this tutorial, which utilizes PHPs vast Online Documentation with its simple referencing standard! By Rob J. Secord, B.Sc. (SystemWisdom) Intended Audience: Beginner to Advanced PHP Web-Application Developers. Assumed knowledge: -- PHP Basics -- Arrays -- HTML Theory: ????Built-in to PHP are 2 functions that will assist us in creating our Dynamic Reference Tool, and they are: get_loaded_extensions() and get_extension_funcs(). These 2 functions are the heart of this tutorial and the Dynamic Reference Tool, and are rather simplistic to use! ????Furthermore, we have the Official Online Documentation provided by PHP at php.net. The beauty lies within the simple referencing standard they provide, which is a URL in the format php.net/function_name_here. And considering they provide documentation for nearly every published PHP Module, this is a good thing! ????We will start by using the get_loaded_extensions() function, which returns to us an array of all the module names loaded with your web-servers installation of PHP. Using this array, we will build an HTML table to display all of the installed modules. We will then pass the module-name to the get_extension_funcs() function which will return to us an array of all of the function names contained within the module we specify. Again, we will build an HTML table to display all of the Module Functions. Finally, we will link each Module Function to PHPs Online Documentation for quick & easy reference! Implementation: ????We will start off by making our PHP file which we will call 'php_modules.php', you may call it anything you like. Once completed, you will place this file on your PHP web-server and run it as you would run any other PHP page. In page we will lay down a simple HTML/CSS framework to work from. It should look something like the following, refering to it any time during the next section: <html><head><style><!--body { color:#426394; }table { border: 1px solid #426394; }td.Seperator{ border: solid #426394; border-width: 0px 0px 1px 0px;}td.Text, a, a:hover{ padding: 0px 5px 0px 5px; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: normal; font-style: normal; font-size: 8pt; color: #426394;}a:hover{ background-color: #E3E3E3;}//--></style></head><body></body></html>????You will notice a very basic HTML structure, with some simple CSS styles added to give some appeal to our page. If you don't know CSS you can safely omit the CSS completely by removing both 'style' tags and everything in between. ????Moving on, we will now begin adding our PHP code to our page. First we need to think about the layout; one table will hold all of the module names, and for each module name there will be an associated table holding all of the function names (Please view my example posted near the top of this tutorial for a visual indication). ????If you will notice in my example, the Modules Table at the very top has 5 columns, and each table underneath has only 4 columns. This is a personal choice as I feel it looks more appealing, though it may be easily changed in your own scripts. The point to notice is that the PHP script itself only deals with 2 table structures; the 5 column one and the 4 column one (which is repeated). We will hold these values in 2 constant variables, so that they may be easily changed in the future: <?php$table1_cols = 5;$table2_cols = 4;?>????We will also need to create 2 Arrays to hold our lists of Modules and Functions, so we create those immediately as well: <?php$aModules = array();$aModuleFuncs = array();?>????Now before going any further, I would like to first show you the completed code chunk which builds our Modules Table, and then we will walk through it together as I explain each step. Please have a good look at the following: $counter = 1;echo "<br><br><font size=+1><b><u>Listed Modules</u></b>:</font><br><br>\n";echo "<table border=0 cellpadding=0 cellspacing=0 width=100%>";$aModules = get_loaded_extensions();foreach( $aModules as $szModuleName ){ // Check for First Column if( $counter == 1 ) echo "\n <tr>"; // Output Column Data echo "\n <td class=Text><a href=\"#$szModuleName\">$szModuleName</a></td>"; // Check for Last Column if( $counter == $table1_cols ) { echo "\n </tr>"; $counter = 0; } $counter++;}echo "\n</table>\n\n";????The first line from above is a 'counter' variable to keep track of which column we are currently outputting. This helps us determine when to output an opening table row tag (<tr>) and its corresponding closing tag (</tr>). The next 2 lines simply output a title "Listed Modules" and open the Table tag (<table>) with some default attributes. ????The 4th line from above is where we call the get_loaded_extensions() function which then returns to us an array populated with the names of all loaded modules. We store the array in our variable created from above named 'aModules'. Now that we have our array, it is a simple matter of outputting each value it contains via PHPs foreach loop. ????So next we have our foreach() loop which I am sure you are all familiar with. We take each value in the array and assign it to the variable 'szModuleName' which we use to output the module name to HTML. ????Using the 'counter' variable mentioned earlier we will track which column we are currently outputting to; if it is the first column then we need to start by outputting an opening table row tag (<tr>) as in: if( $counter == 1 ) echo "\n <tr>";????Next we get to output the actual module name, which we enclose in Table Data tags (<td>) with a style-class of 'Text' as defined by our CSS at the top. We will also want to link each Module Name with its respective Functions Table somewhere below the Modules Table, so we again enclose the actual module name with an Anchor Tag (<a>) which will be linked to a named-anchor (using the # symbol) elsewhere in our page. We will keep the name of the named-anchor the same as the module name for simplicity. This can all be seen in the following line of the code: echo "\n <td class=Text><a href=\"#$szModuleName\">$szModuleName</a></td>";????Next we will want to check to see if we are outputting to the last column, and if so, we simply output a closing Table Row tag (</tr>) to finish our current row, and reset the counter to 0 to generate a new row in our next pass of the foreach loop. After that, we are safe to increment the 'counter' variable by 1 in order to generate the next column of output. This can be seen in the following lines of code from above: if( $counter == $table1_cols ) { echo "\n </tr>"; $counter = 0; } $counter++;????Finally, to end the table after all of the module names have been output, we simply output a closing Table tag (</table>), as in: echo "\n</table>\n\n"; ????Well, that is that for the Modules Table, but now we need to create a table for each module containing all of its respective functions. This can be achieved in the exact same way as with the table we just created above. However, this time we will need to generate the tables with 4 columns instead of 5, so we would use the constant variable 'table2_cols' we defined at the start when checking for the last column with our 'counter' variable. Also, we will need to wrap all of what we have just done into another loop which will output 1 table for each loaded module. ????We begin by outputting another simple title "Module Functions": echo "<br><br><font size=+1><b><u>Module Functions</u></b>:</font>\n<br><br>\n";????Then we go right back into another foreach() loop of all of the loaded modules, but this time we are not just outputting the module name, we are also passing the module name as a string to the second PHP function called get_extension_funcs() which will return an array of all of the function names within the module. But first we should output a title for the table indicating which module we are listing functions from. This will also server as a location for each named-anchor we are linking to from the Modules Table above. We simply create an Anchor tag (<a>) and give it a name equal to that of the module name. All of this can be seen in the following code, and is considerably straight-forward: // Output Titleecho "<br><br><font size=+1><b><u>Module Functions</u></b>:</font>\n<br><br>\n";// Modules Foreach Loopforeach( $aModules as $szModuleName ){ echo "\n<table border=0 cellpadding=0 cellspacing=0 width=100%>"; echo "\n <tr>\n <td class=\"Text Seperator\" colspan=\"$table2_cols\"><a name=\"$szModuleName\">Functions in <b>$szModuleName</b> Module..</a></td>\n </tr>"; // Loop through functions here.. echo "\n</table>\n<br><br>\n\n";}????As you can see from above, each module will have its own table of functions with a header indicating which module the functions belong to, as well as a named-anchor for use with the named-anchor-links we created in the Modules Table at the beginning. The comment line where I stated "Loop through functions here.." is the spot where we will duplicate our Modules Table code with minor alterations. Again, I will post the whole code chunk first, and explain the differences below (includes the code chunk listed directly above, with the comment line replaced): echo "<br><br><font size=+1><b><u>Module Functions</u></b>:</font>\n<br><br>\n";foreach( $aModules as $szModuleName ){ echo "\n<table border=0 cellpadding=0 cellspacing=0 width=100%>"; echo "\n <tr>\n <td class=\"Text Seperator\" colspan=\"$table2_cols\"><a name=\"$szModuleName\">Functions in <b>$szModuleName</b> Module..</a></td>\n </tr>"; $counter = 1; $aModuleFuncs = get_extension_funcs( $szModuleName ); foreach( $aModuleFuncs as $szFunctionName ) { // Check for First Column if( $counter == 1 ) echo "\n <tr>"; // Output Column Data echo "\n <td class=Text><a href=\"http://php.net/$szFunctionName\" target=\"_new\">$szFunctionName</a></td>"; // Check for Last Column if( $counter == $table2_cols ) { echo "\n <tr>"; $counter = 0; } $counter++; } echo "\n</table>\n<br><br>\n\n";}????First thing to note is that the comment line has been replaced with a new code chunk that looks a lot like the very first foreach() loop we worked with. Again we have our 'counter' variable which servers the exact same purpose as before, but then we have our new function call to get_extension_funcs(). We pass the name of the current module, and it returns an array of function names, as in: $aModuleFuncs = get_extension_funcs( $szModuleName );????We then enter into our nested foreach loop where we will receive the name of each function in the module stored in the 'szFunctionName' variable. With this variable, we can then output the name of the function much like before. The only notable difference this time, is that we enclose the output function name with an Anchor tag (<a>) linking to PHPs Online Documentation! But that's not all, we can even use the function name in the URL of the link to point directly to the documentation on each specific function! All of this can be seen in the following code chunk (as also posted above): foreach( $aModuleFuncs as $szFunctionName ) { // Check for First Column if( $counter == 1 ) echo "\n <tr>"; // Output Column Data echo "\n <td class=Text><a href=\"http://php.net/$szFunctionName\" target=\"_new\">$szFunctionName</a></td>"; // Check for Last Column if( $counter == $table2_cols ) { echo "\n <tr>"; $counter = 0; } $counter++; }????After you have that, you have a working "PHP Installed Modules Dynamic Reference Tool" that you can use and re-use on any PHP web-servers you may be developing on! To put it all together, you should have the following: Final Completed Source Code Example: <html><head><style><!--body{ color:#426394;}table{ border: 1px solid #426394;}td.Seperator{ border: solid #426394; border-width: 0px 0px 1px 0px;}td.Text, a, a:hover{ padding: 0px 5px 0px 5px; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: normal; font-style: normal; font-size: 8pt; color: #426394;}a:hover{ background-color: #E3E3E3;}//--></style></head><body><?php$table1_cols = 5;$table2_cols = 4;$aModules = array();$aModuleFuncs = array();$counter = 1;echo "<br><br><font size=+1><b><u>Listed Modules</u></b>:</font><br><br>\n";echo "<table border=0 cellpadding=0 cellspacing=0 width=100%>";$aModules = get_loaded_extensions();foreach( $aModules as $szModuleName ){ // Check for First Column if( $counter == 1 ) echo "\n <tr>"; // Output Column Data echo "\n <td class=Text><a href=\"#$szModuleName\" style=\"font-weight:bold;\">$szModuleName</a></td>"; // Check for Last Column if( $counter == $table1_cols ) { echo "\n </tr>"; $counter = 0; } $counter++;}echo "\n</table>\n\n";echo "<br><br><font size=+1><b><u>Module Functions</u></b>:</font>\n<br><br>\n";//$aModules = get_loaded_extensions();foreach( $aModules as $szModuleName ){ echo "\n<table border=0 cellpadding=0 cellspacing=0 width=100%>"; echo "\n <tr>\n <td class=\"Text Seperator\" colspan=\"$table2_cols\"><a name=\"$szModuleName\">Functions in <b>$szModuleName</b> Module..</a></td>\n </tr>"; $counter = 1; $aModuleFuncs = get_extension_funcs( $szModuleName ); foreach( $aModuleFuncs as $szFunctionName ) { // Check for First Column if( $counter == 1 ) echo "\n <tr>"; // Output Column Data echo "\n <td class=Text><a href=\"http://php.net/$szFunctionName\" target=\"_new\">$szFunctionName</a></td>"; // Check for Last Column if( $counter == $table2_cols ) { echo "\n <tr>"; $counter = 0; } $counter++; } echo "\n</table>\n<br><br>\n\n";}?></body></html> Working Example: PHP Installed Modules Dynamic Reference Tool Conclusion: ????Well, I hope that you have learned something useful from this tutorial, and maybe even use such a tool when developing your web-based applications in PHP! Remember, this tool uses only 2 built-in PHP functions and should be a very easy conversion to later versions of PHP. ????Please feel free to comment on this tutorial, if you noticed anything wrong or out of place in this tutorial, please don't hesitate to mention it! [tab]I am interested in all feedback really, I'm curious about what you think of my writing, tutorial, methods used, code, effectiveness, layout, etc.. Thanks!
  3. Thx for the input and I'm glad you liked it for the most part, but I have never had the opportunity to test or even view this script on a Mac. I am guessing Safari handles the DOM differently than other browsers... Now that I know there is a problem with Mac's Safari browser processing my script I will look into resolving the issue (and here I thought it worked perfectly! lol). I am glad you pointed out the actual problems for me, which makes fixing it one step easier! I will reply as soon as I figure out a solution. Hopefully you can test it out again for me on your Mac Safari!! I couldn't imagine charging people money for my tutorials (they probably wouldn't get read!), I mainly write them so that I can add them to my Resume/portfolio, maybe they will help land me a job! I'm especially glad to see such positive feedback from this tutorial (makes me want to write more)!
  4. Sorry for double-post, but the Code tags messed up my script above, you should replace the & # 39 ; with a single-quote to fix the script I posted..
  5. I wrote this script for use in a few past projects, and it has worked fine for me ever since, maybe it will suit your needs as well? function OpenSubWin( page, w, h, sb ){ var sw = screen.width, sh = screen.height; var ulx = ((sw-w)/2), uly = ((sh-h)/2); var sbt = (sb==1) ? 'yes' : 'no'; var paramz = 'toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars='+sbt+',width='+w+',height='+h+''; var oSubWin = window.open( "", "SubWin", paramz ); oSubWin.moveTo( ulx, uly ); oSubWin.location.replace( page );} The parameters it accepts are: page --> the URL to the page to open w --> the Width of the Sub-Window h --> the Height of the Sub-Window sb --> if 1 then display Scrollbars in Sub-Window (could be set to 0, or auto) It even centers the Sub-Window for you too.. Example usage: <a href="javascript:OpenSubWin( 'my_page.html', 640, 480, 1 );"> Click Here.. </a> I hope that helps!
  6. No offense, but I just used this service to search Dictionary.com for a word, and it returned my results in a frame that was only about 150 pixels high... I couldn't see barely anything in the dictionary.com frame.. And the stuff in the top frame isn't even useful.. What's worse, is that I couldn't even resize the bottom frame to get a better look at it.. I wouldn't use this site to do my Actual Searching, considering you can barely view the results... In my opinion, make the top frame *Alot* smaller, and give the user the option to resize/remove the top frame from view.. Just my 2 cents!
  7. Have you tried A.V.E.R.T Stinger? It is by a McAfee team and it is free.. It is mainly geared at removing Trojans, so maybe it will help you? Also, you could try NoAdware, but it isn't free, although it is worth the $30 for it..
  8. Well, I haven't seen the video, but I know the song well.. It is a very good song, and deep with emotion.. But that is how alot of Rap is (maybe not all), but when one actually listens to what they say you will notice alot of sincerity in alot of Rap music. Most of the time they talk about real life troubles, and when they combine that with their feelings on their situations it reflects a very emotional picture.I think I first really noticed it when Tupac released his "Dear Momma" song -- also a very good song!I personally can't stand absent-minded rap with meaningless talk about drugs/killing/pimping/etc.., but when the song has a deeper message which one can relate too, it doesn't get any better! :lol:Just me 2.5 cents!
  9. I am not a big fan of poetry personally, but when I hear a good poem it tends to stick with me... Anyway, my favorite poem of all time was written by a friend of mine about 10 years ago, and I somehow still remember it.. I want to share it here with all of you people, and hear your responses. It is such a good poem, I find it hard to believe he wrote it, and therefore if you have ever heard it before, please point me in the direction of the original!! The darker side of man By: David Mezzabotta Can you invision the sanity (or lack there of) of my friend? I hope you have enjoyed it, I find it very powerful!
  10. Very nice! I have incorporated it into my site right away!I have just a couple of questions tho;How do I test it to see that it actually works? Do I need to Download GA and visit my site with it? (I am hoping I don't need to go that route, any other routes?)Assuming some people don't have RewriteEngine installed with their PHP web server, couldn't you just use PHP (or ASP) to check the visitors IP, and if it is within the sub-net '72.14.192.*' then simply redirect the visitor to the forbidden page via HTTP Headers? (Would be more work, but it is another option).I am only asking this because I don't really want to DL the GA and test the proposed solutions right now (somewhat busy), and to raise the same question for others to consider. Especially if others are using another web server which doesn't support the Rewrite Engine.
  11. (Alert: Opinionated topic!) I would definetly go for the Xbox 2.. The Xbox beats the PS2 hands down, and I am sure MS will go all out on the Xbox 2 just as they did with the original Xbox. I think the only reason Sony is trying so hard on the PS3 is because they know Xbox blew the PS2 outta the water! As for the reliability of Sony products, all you PS2 owners should look at the life expectancy of you PS2 in your warranties: 1 year! I have both systems right now, a PS2 and an Xbox and I am always playing the Xbox. For one, I don't have enough Memory Cards for PS2 to save all my game data (no worries there with Xbox), plus I can listen to my own music with my Xbox games, and finally my PS2 is a piece of $#!^@ because the laser lens keeps falling out of focus. I am constantly ripping it open to adjust it manually, which needless to say is very annoying. (No it was never dropped or banged, just old.. and yes, my warranty is now void, but that expired after 1 year anyway! I wonder why?) I could go on and on about the Xbox advantages, but I won't.. Xbox rules the console video game world! Just my 2.5 cents!
  12. I just wanted to point out to others, that if you do not want others to check your site with these types of tools, you can simply disallow them with the use of a 'robots.txt' file in the root of your web directory. I personally disallow all robots from crawling my site, except for Google of course, with a simple robots.txt file that looks like: User-agent: Mediapartners-Google*Disallow:User-agent: *Disallow: / Each user-agent (or robot) can be assigned specific directories which it is NOT allowed to crawl through, and as you can see from above, the first user-agent I specified is Google, and the next line basically says "Disallow nothing", meaning that Google may crawl my entire site.. But the next user-agent I specify is a wild-card (meaning all other user-agents), and the line following that basically says "Disallow root directory and all sub-directories", meaning that all other user-agents are not allowed to crawl any portion of my site. That includes the user-agent (robot) which is used by NetMechanic to gather the statistical information from websites. Simply try using the NetMechanic to gain statistical data from my site: NetMechanic results for SystemWisdom.Trap17.com Alternatively, you could just as easily specify NetMechanic as an acceptable user-agent for crawling your site, by adding another user-agent listing to your robots.txt file: User-agent: Mediapartners-Google*Disallow:User-agent: NetMechanic*Disallow:User-agent: *Disallow: / I hope that helps some people!
  13. Check Dictionary.com yourself Usually anything that is labelled as "Warez" suggests illegal material/software that is generally released to the public via "underground" means. This could be anything like movies, music, pictures (porn), software, games, documents, etc.. Basically, anything digital and illegally obtained could be considered "Warez". I hope that helps!
  14. I would be interested in joining your clan, but I would just like to know first, what is required/expected from clan members?? Where are you located mainly? What servers do you and your clan members frequent? What is the average age (or maturity level) of your clan members?I personally have been playing CS since 1.3, which is almost 5 years now, and have gained alot of knowledge about CS and HL in general. I am currently an admin on a public 24 man pub server running AMXX & WC3FT (but it is not my own server, it is a friends).My experience would bring great benefit to your clan, both in-game and with server administration (although my 16mb Gfx Card may hinder my in-game score ). I have been developing AMX & AMXX plugins for CS for almost 2 years now, and I am the one responsible for creating Proximity Mines in AMX(X) for CS! (As well as several other popular plugins like AIO Admin Menu).If you ever visit the AMX and/or AMXX Forums, you will find me there under the name of "xeroblood".I have also been developing HLSB (Half-Life Server Browser) which allows admins to browse their CS game server statistics via a PHP website. This could be incorporated with your clan site to provide real-time stats of your game server for your visitors!Oh, and I have made plenty of custom maps for CS which could be used on your future clan server as well... I have even dedicated custom maps to clans to help promote both the clan and the server.Anyway, I hope to read your response sometime soon!! I would like to play against your clan for the fun of it at least, maybe post the address to a server you frequent, where I can meet up with you in-game? If not, stop by my friends server and find me there! It is called "LoCk ! Clan :: Frozen Throne (MODS!)" and it is mainly a fun server running alot of custom maps.. The IP is: 69.9.166.157:27015I usually go by the name "LoCk ! xeroblood" or "LoCk ! Achilles" in that server, so look for me!! (Oh, and I where the clan's tag because I am an admin, and some people get confused when the admin doesn't appear to be apart of the clan )
  15. That basically means that the MIME type headers for your website were already sent to the client browser, and therefore any attempts to set cookies will fail, since cookie data must be sent to the client browser as part of the MIME type header.This can happen a number of different ways; such as previous calls to the header() function, or more commonly, white space before the <?php tag..I suggest looking at the source code to your PHP pages (namely init.php, and any other PHP files that are included by init.php) and remove any whitespace from the very beginning of the file, specifically right before the <?php tag..Remember, as soon as the PHP Processor encounters non-PHP code, it assumes it is output and automatically starts sending the non-PHP page data to the client browser, which means it must first send the page headers.I hope that helps.
  16. You should only have one submit button (type="submit") and make the other button a normal button (type="button") which has its own onclick event handler.. Example: <html><head><script language="JavaScript"><!--function doSubmit( e ){ var keyCode = (window.Event) ? e.which : e.keyCode; if( keyCode == 13 ) document.forms[0].submit();}function doSomethingElse(){ alert("Something else");}//--></script></head><body><form name="MyForm"><input type="text" name="blah" value="" onkeypress="doSubmit(event)" /><input type="button" value="Some Button" onclick="doSomethingElse()" /><input type="reset" value="Clear" /><input type="submit" value="Submit" /></form></body></html> I hope that helps!
  17. Hrmm, it seems many people did not get the results they expected.. could this stand to reason that the test is somewhat inaccurate? My results: I've always thought of myself as very independent, maybe I was wrong.. The OC reads as high merely because I am a perfectionist I would imagine.. Well, fun to take none the less..
  18. Well, not straight 5 years, like I said, I have had to shut it down a few times since I got it.. I have moved about 4 times in the last 5 years, and made about 10 upgrades since then too, so it has been shut down a few times.. I think the last time was about 4-5 months ago so I could install a newer graphics card.. It has always been as fast as it ever was (I am the only one who uses it, so no junk gets installed, and I maintain it regularly), and even to this day I use large programs like VS.Net without skipping a beat... I love my computer!! Anyway, no need for it to rest, I keep it cleaned up, with very few processes running so as to keep my RAM free.. I do reboot alot, but my PC is a soldier! It is even so quiet that when I am going to sleep I don't hear it.. Plus a plain-black screen-saver keeps my room dark!!
  19. Yeah, the images take a while to load because there are so many, roughly 100 Images that are preloaded in the sample.But the only reason I didn't show the images afterward is because the images are actually the GUI to my site, and once I get my site online again you will see all of the images in place on my site, instead of the plain text page I have at the end of it now.Sorry 'bout that, I should have my site online soon, and then these links will automatically point o the right preloader and you will see my site!!I hope you enjoy the tutorials when you find the time to read and test them out!
  20. That would be simple enough using the Document Object Model of HTML and JavaScript.. A javascript function could access nearly any element in the page, and at any time, so an image being clicked would be a good time! Basically, how it works is by giving the element you want access to an ID with the id="" attribute. Then you can get a direct reference to that element by using the ID with the getElementById() function that is part of javascript. Once you have access to the element, you can change its Value property to display any text you want. Wrap that in a function, and call it in the onclick event of an image. Here is an example: <html><head><title></title><script type="text/javascript" language="javascript"><!--function ChgText(){ var MyElement = document.getElementById("MyTextBox"); MyElement.value = "If you see this, it worked!"; return true;}//--></script></head><body><br><br><center><img src="my_image.gif" alt="Click Me!" onclick="ChgText()" /><br><br><br><input type="text" size="35" id="MyTextBox" value="" /></center></body></html> I hope that helps!
  21. Glad to hear you guys like it, thanks! I finally have a web host again, Xisto! So I have posted a working sample of this script on my site. The sample is just a rough copy sample, once I get my site integrated with Xisto the sample will be a part of my actual site. View the Sample Progress Bar Here! Enjoy!
  22. Tutorial: Extending the Image Preloader with PHP4, by Rob J. Secord, B.Sc. (SystemWisdom) Second Tutorial in a Series of 2 Tutorials! Be sure to have read the First One here: "Image Preloader With Progress Bar Status" See a working Sample of this Script! (Note: Preloads 100 images, some images are larger than others, and may take awhile for some people.) Description: A Tutorial for Extending the Image Preloader with PHP4 to Dynamically Populate the Array of Preloaded Images. This tutorial is the second in a series of 2 tutorials, and assumes that you have read the first tutorial: "Image Preloader With Progress Bar Status". Intended Audience: Beginner to Intermediate Web Developers. Assumed knowledge: -- Tutorial 1: "Image Preloader With Progress Bar Status" -- Recursion Basics -- Strings, Arrays, Loops -- PHP4 Background: In the last tutorial I wrote about building a Dynamic Real-Time Image Preloader with Progress Bar Status using only Client-Side code (namely JavaScript + HTML). The Preloader worked by creating an Array of Image URLs and passing that array into the Preloader class. The problem is that you have to manually add your Image URLs to the Array, and everytime you add/remove an image, you would have to add/remove it from the Array also. Borrrrring.. In this tutorial, we are going to Extend the ImagePreloader with some Server-Side code (namely PHP4, but you could use any language you want, really). We will be altering the 'index.html' page; renaming it to 'index.php' and adding PHP4 code to search our Image Directory and dynamically build an array of all the Images for us! Now you don't have to worry about editing the Preloader array at all! You could practically forget about it, once you have it installed! Theory: We will start by creating a single directory to hold all of our images on our web server. We will call this the Image-Root folder for the rest of this tutorial. Within this directory you may place all of your images and/or sub-folders with more images. We will then use PHP4 to walk through all of the images in all of the sub-folders for us. You could easily extend this tutorial by restricting certian images/sub-folders from being preloaded, but I will leave that open for you, as that would depend on your images! Within each folder (from the Image-Root folder), we will use PHP4 to check every entry in the folder (this could be an image, a sub-folder, any other file) and then determine what to do with each entry found. If the entry is an image we will add its Path & Filename to our Array of images, which will serve as the Image URL to preload. If it is a sub-folder we will recursively search that sub-folder in the exact same way. Any other file(s) will be ignored, since they will not be preloaded. Once we have completed searching the Image-Root directory for Images and building an Array of Image URLs, we will then output that Array into our Client-Side Preloader code. Since the Client-Side Preloader code also expects an array, we will have to build that array's code dynamically using simple Strings in PHP4. Then it is all ready to go! Your server will then send the completed Preloader Code to the visitors browser, which will then begin preloading all of the Images for your site! To demonstrate the simple recursion, I will be using the following sample directory structure for our example web-server: -- index.php -- ipreload.js -- images ????[/tab]+--- sub_dir1 ????|????|-------- Image1.gif ????|????|-------- Image2.gif ????| ????+--- sub_dir2 ????|????|-------- Image3.gif ????|????|-------- Image4.gif ????| ????|--- Image5.gif ????|--- Image6.gif [tab]|--- Image7.gif The Bold entries are Folders, and the Italic entries are Files. Now, imagine those are the real file and folder names, as I may use some of those names in examples for the rest of this tutorial. Implementation: I will start off, by showing you the completed Source Code to the Progress Bar page from our last tutorial (we will not be editing the 'ipreload.js' file in this tutorial at all, but you still need it as in the last tutorial!). If you recall, our 'index.html' file looked like this: File = index.html <html><head><style type="text/css"><!--.OuterBorder{ border:1px solid #426394; padding: 2px 5px 2px 5px;}.FullDot{ border:1px solid #426394; background-color:#DAE1EB; cursor:default;}.EmptyDot{ border:1px solid #426394; background-color:#F3F6FA; cursor:default;}//--></style><script type="text/javascript" language="JavaScript" src="ipreload.js"></script><script type="text/javascript" language="JavaScript"><!--var g_iStep = 0;function OnImgUpdate( iProgress ){ if( (iProgress >= 1) && (iProgress <= 10) && (iProgress > g_iStep) ) { g_iStep++; var oSpan = document.getElementById( "sDot" + iProgress + "" ); oSpan.className = 'FullDot'; }}function OnCompletion(){ document.location.replace('main.html');}function StartPreload(){ var szImages = new Array( "image1.gif", "image2.jpg", "image3.png", "etc..." ); // Execute Image Preloader var oPreload = new ImagePreload( szImages, OnImgUpdate, OnCompletion );}--></script></head><body onload="StartPreload()"><center><table cellpadding="0" cellspacing="0" border="0" class="OuterBorder"> <tr> <td> <span id="sDot1" class="EmptyDot"> </span> <span id="sDot2" class="EmptyDot"> </span> <span id="sDot3" class="EmptyDot"> </span> <span id="sDot4" class="EmptyDot"> </span> <span id="sDot5" class="EmptyDot"> </span> <span id="sDot6" class="EmptyDot"> </span> <span id="sDot7" class="EmptyDot"> </span> <span id="sDot8" class="EmptyDot"> </span> <span id="sDot9" class="EmptyDot"> </span> <span id="sDot10" class="EmptyDot"> </span> </td> </tr></table></center></body></html> We will be adding only two sections to this code in this tutorial. But first, we must rename the file to 'index.php' without the single-quotes. Now you have a PHP file! Let's add some PHP4 Code to it. We begin by adding a PHP code block to the very top of the page, where we will add the bulk of our code. I will first show you the completed code block and then I will explain how it works, this way you will have reference to what I am writing about. After I explain it, I will add it to the completed code from the first tutorial so you see how it fits in. The PHP4 code block: <?php// Image-Root Directory..$g_szImagesDir = 'images/';// Global Variables used by 'BuildFileList' function...$g_szFileList = array();$g_iFileCount = 0;// Build File List of Imagesfunction BuildFileList( $szDir ){ global $g_iDepth, $g_szFileList, $g_iFileCount; $oDirHandle = opendir( $szDir ); while( false !== ($szFile = readdir( $oDirHandle )) ) { if( $szFile == '.' || $szFile == '..' ) continue; $szCurrPath = $szDir.'/'.$szFile; if( is_dir( $szCurrPath ) ) { BuildFileList( $szCurrPath ); }else { if( (false !== strpos($szFile, '.jpg')) || (false !== strpos($szFile, '.gif')) || (false !== strpos($szFile, '.png')) ) { $g_szFileList[$g_iFileCount++] = str_replace( './', '', $szCurrPath ); } } } closedir( $oDirHandle ); return;}// Start the search for Images!BuildFileList( './' . $g_szImagesDir );?> The first thing you should note, are the 3 globally defined variables; g_szImagesDir, g_szFileList and g_iFileCount. The first one 'g_szImagesDir' will be a string containing the path to and the name of the Image-Root folder. In our sample directory structure from above it would be: 'images/'. This variable will not be used by our 'BuildFileList' function, instead it will be passed into the function as the starting parameter. The 'g_szFileList' variable is our Array which will hold all of our Image URLs to be preloaded. And finally, the 'g_iFileCount' will count how many Images have been found and added to our 'g_szFileList' Array. Next you will notice a PHP4 function called 'BuildFileList' which is the main focus of this tutorial. This function will recursively search our Image-Root directory and build a PHP4 Array of all of the Image URLs. Later on we will use the PHP4 Array to build our JavaScript Array for the visitor to download. The JavaScript Array will then be used on the visitors machine to Preload the images for your site! Now, let's jump into the code for the 'BuildFileList' function. The first thing you should notice about this function is that it accepts 1 parameter indicating the Directory (or Folder) to search in. To start off with, we would pass our Image-Root directory into this function, as you will see later. Knowing that, we can assume the starting value of the 'szDir' variable will be 'images/' and that's where the function will start searching for images. The next line is an important one; it gives the function access to the globally defined variables that our function will require. These variables are not declared within the function because we want the values of those variables to maintain their state with each call to our function. Now that our function is declared and has access to 2 of the previously defined global variables, we can start implementing the function itself. What is important to note before going any further, is that this function will be used "Recursively", meaning it will call itself. If you don't understand recursion I suggest you read up on the subject and come back to this tutorial once you have a good understanding of the concept. There are many good resources on the Internet to learn about recursion. Now, the first thing we will need to do, is open a Directory Handle to the current folder (namely 'szDir' which at first will contain 'images/'). This is acheived with the built-in PHP4 function called 'opendir()'. We simply tell the PHP function what directory to open, and it will return a Directory Handle for us to use. When we are done using the Directory Handle we simpley call the built-in PHP function 'closedir()' to close it. If you are having trouble following from the code above, we open the Directory Handle in this line of code: $oDirHandle = opendir( $szDir ); Now that we have a Directory Handle, we can use that Directory Handle to read the entries found in the Directory using the built-in PHP function 'readdir()' which will return each directory entry with each successive call. What I mean is, every time we call the readdir() function it will return the next entry in the directory, until finally it returns False indicating that there are no more entries in the current directory. So, if we look at the next line of code (starting with 'while') you'll notice we are using the 'readdir()' function which I just mentioned. First, we call the 'readdir()' function passing it the Directory Handle we created earlier. The 'readdir()' function then returns an entry in the directory which we store as 'szFile'. If this entry is Not Equal to Boolean False, then it is a valid entry, and the code continues inside of the 'while' loop. If however, the entry IS equal to Boolean False, then the 'while' loop quits, and the Directory Handle gets closed. The function then returns control to the calling statement. Now, assuming the entry was valid (and from my sample directory structure given above it would be 'sub_dir1'), we would then check to see if the entry is equal to either "." or ".." which are Virtual Directories that point to the Current Directory and the Parent Directory respectively. If the entry is a Virtual Directory to either of the Current or Parent directories then we consider them invalid directories for our search, calling the 'continue' statement to search again. The code for this looks like: if( $szFile == '.' || $szFile == '..' ) continue; If at this point, the directory entry is still valid, then it is either a sub-folder or a file. In either case, we append the entry name to the current directory name in proper format (resulting in either a sub-directory or a filename + path) as seen in the following code: $szCurrPath = $szDir.'/'.$szFile; Next we can determine whether the entry is really a sub-folder using the built-in PHP function 'is_dir()' which returns True if the entry is a Directory and False if the entry is not a Directory. If the entry IS a directory, then we simply call ourself through the method of recursion, which will go through the whole process again, but in the newly found sub-folder. This can be seen here: if( is_dir( $szCurrPath ) ) { BuildFileList( $szCurrPath ); // <---- Recusive call.. }else { // [...ignore for now...] } As you can see, the 'BuildFileList' function is calling itself! But this time, it is passing a new directory (a sub-folder within the current directory) as the Directory to search from. When this happens, the script starts executing the whole function again, but with a new directory to search from. And when the function is done, it comes right back to this point in itself and continues executing the rest of the orignally called function. However, if the entry we found is NOT a sub-folder then the 'is_dir()' function would have returned False and we would have entered the 'else' block of the if statement, which looks like: if( is_dir( $szCurrPath ) ) { // [...ignore for now...] }else { if( (false !== strpos($szFile, '.jpg')) || (false !== strpos($szFile, '.gif')) || (false !== strpos($szFile, '.png')) ) { $g_szFileList[$g_iFileCount++] = str_replace( './', '', $szCurrPath ); } } At this point, we know that the entry we found is not a Virtual Directory or even a Physical Directory, so we proceed to assume it is a valid file. But we don't know what type of file it is, and so we check the File Extension to determine if the file is an Image File used on websites.Since the 'szFile' variable is a string containing the entry name, we can search that string using PHP4 to find and compare the file extension. We use the built-in PHP function 'strpos()' to server this purpose. We tell the 'strpos()' function what string to search, and what string to search for (in this case, a file extension), and if the function returns Boolean False then the file extension we searched for was not found. Otherwise, the 'strpos()' function will return spot (or starting index) that the extension was found in the search string. The fact that it doesn't return False is enough for us to proceed. For example, we are searching the 'szFile' string for the File Extension '.jpg' and if the result is Not Equal to Boolean False then the File Entry is a Jpg Image File: if( false !== strpos($szFile, '.jpg') ) { // [...ignore for now...] } Hence, if the File Entry is a valid Image File (.jpg, .gif or .png), then the full path and filename are added to our Image URL Array ('g_szFileList') which we created globally. We also increment (add 1 to) our 'g_iFileCount' variable, to keep track of how many Image URLs we have.A good point to note is the removal of any unneccessary Virtual Current directory entries that may have been added to the file path using, before adding the Image URL to the Array. Our end result for the File Extension Test: if( (false !== strpos($szFile, '.jpg')) || (false !== strpos($szFile, '.gif')) || (false !== strpos($szFile, '.png')) ) { $g_szFileList[$g_iFileCount++] = str_replace( './', '', $szCurrPath ); } And finally, once the function is ready to exit, the 'closedir()' function is called to clean up our Directory Handle that we used, as in: closedir( $oDirHandle ); And that concludes the 'BuildFileList' function. To recall; We pass in the Image-Root directory to search and the function recursively searches all sub-directories building an Array of valid Image File entries found. Now that we have our Global Variables and our Function declared, we can call the function passing in our Image-Root directory, and when the function is done we will have an Array of Image URLs, which is done in one line of code: BuildFileList( './' . $g_szImagesDir );The './' denotes that the Image-Root directory resides in the Current Directory from which this script is executed. Now that we have completed the first section of this tutorial, I will show you a sample of the 'index.php' up to this point so far. We will use this as reference for the last part of the tutorial, which fortunately is alot shorter! File = index.php <?php// Image-Root Directory..$g_szImagesDir = 'images/';// Global Variables used by 'BuildFileList' function...$g_szFileList = array();$g_iFileCount = 0;// Build File List of Imagesfunction BuildFileList( $szDir ){ global $g_iDepth, $g_szFileList, $g_iFileCount; $oDirHandle = opendir( $szDir ); while( false !== ($szFile = readdir( $oDirHandle )) ) { if( $szFile == '.' || $szFile == '..' ) continue; $szCurrPath = $szDir.'/'.$szFile; if( is_dir( $szCurrPath ) ) { BuildFileList( $szCurrPath ); }else { if( (false !== strpos($szFile, '.jpg')) || (false !== strpos($szFile, '.gif')) || (false !== strpos($szFile, '.png')) ) { $g_szFileList[$g_iFileCount++] = str_replace( './', '', $szCurrPath ); } } } closedir( $oDirHandle ); return;}// Start the search for Images!BuildFileList( './' . $g_szImagesDir );?><html><head><style type="text/css"><!--.OuterBorder{ border:1px solid #426394; padding: 2px 5px 2px 5px;}.FullDot{ border:1px solid #426394; background-color:#DAE1EB; cursor:default;}.EmptyDot{ border:1px solid #426394; background-color:#F3F6FA; cursor:default;}//--></style><script type="text/javascript" language="JavaScript" src="ipreload.js"></script><script type="text/javascript" language="JavaScript"><!--var g_iStep = 0;function OnImgUpdate( iProgress ){ if( (iProgress >= 1) && (iProgress <= 10) && (iProgress > g_iStep) ) { g_iStep++; var oSpan = document.getElementById( "sDot" + iProgress + "" ); oSpan.className = 'FullDot'; }}function OnCompletion(){ document.location.replace('main.html');}function StartPreload(){ var szImages = new Array( "image1.gif", "image2.jpg", "image3.png", "etc..." ); // Execute Image Preloader var oPreload = new ImagePreload( szImages, OnImgUpdate, OnCompletion );}--></script></head><body onload="StartPreload()"><center><table cellpadding="0" cellspacing="0" border="0" class="OuterBorder"> <tr> <td> <span id="sDot1" class="EmptyDot"> </span> <span id="sDot2" class="EmptyDot"> </span> <span id="sDot3" class="EmptyDot"> </span> <span id="sDot4" class="EmptyDot"> </span> <span id="sDot5" class="EmptyDot"> </span> <span id="sDot6" class="EmptyDot"> </span> <span id="sDot7" class="EmptyDot"> </span> <span id="sDot8" class="EmptyDot"> </span> <span id="sDot9" class="EmptyDot"> </span> <span id="sDot10" class="EmptyDot"> </span> </td> </tr></table></center></body></html> Now, you should be able to notice that the new code block we have just added doesn't interact with the old page from the previous tutorial in any way! Not yet, at least. We will now use our PHP Array of Image URLs to populate the JavaScript Array of Image URLs, completing the Dynamic Image Preloader with Progress Bar Status! We start, by adding another PHP code block to our 'index.php' page, but not at the top like before, rather, in the middle of our JavaScript Array! Since PHP outputs text to the source code of your HTML file, we will output our Array as text into our JavaScript source code for the visitor to download. We will start this last section by looking at the completed code block all alone so that you may reference it as I go along: <?php for( $i = 0; $i < $g_iFileCount; $i++ ) { if( $i == ($g_iFileCount - 1) ) echo '"' . $g_szFileList[$i] . '"'; else echo '"' . $g_szFileList[$i] . '",'; }?> You will notice it is a simple FOR Loop that iterates through all of the Image URLs in the PHP Array 'g_szFileList'. It is for this purpose that we kept track of how many Images we had in the Array using the global variable 'g_iFileCount'. Now before we look at how this is implemented, it is good to understand what we are trying to output, which is basically a series of comma-seperated quoted strings, as in: "sting1", "string2", string3", "etc" Of course, the strings themselves are the Image URLs, so all we have to do issurround each Image URL in Quotes ("...") and seperate them with commas! So for each iteration of the FOR loop, we could just output either: A quoted string + a comma; OR: A comma + a quoted string. Now, if you choose to output A quoted string + a comma, then the very lasted quoted string should NOT have a comma following it, right? (look at example just above..). But, if you choose to output A comma + a quoted string, then the very first quoted string shouldn't have a comma in front of it, right? (again, look at example just above..). So, we will choose (for this tutorial) to output: A quoted string + a comma, during each iteration. Which means (as previously stated) that we must take care NOT to output a comma after the very last quoted string. We achieve this with a simple IF statement that checks whether the current Array Index is Equal to the Total Number of Image URLs in our Array (which is stored in the 'g_iFileCount' variable. But don't forget, Arrays are indexed starting from 0 not 1, so we must minus 1 from the 'g_iFileCount' variable when comparing, as in: if( $i == ($g_iFileCount - 1) ) This checks to see if the current Array Index is equal to the Total Number of Image Files minus 1. If so, then we just output the quoted string, otherwise we output the quoted string + a comma, as in: for( $i = 0; $i < $g_iFileCount; $i++ ) { if( $i == ($g_iFileCount - 1) ) echo '"' . $g_szFileList[$i] . '"'; else echo '"' . $g_szFileList[$i] . '",'; } You may have to look carefully at the quotes in the above example; the single quotes are PHP and the double-quotes are the output. Now that we know what we are outputting and how we are outputting it, we can place this PHP code block in the correct spot in our 'index.php' page. Looking at the examples provided above, I am sure you could figure out where that spot would be, but in either case, I shall show you: function StartPreload(){ var szImages = new Array( <?php for( $i = 0; $i < $g_iFileCount; $i++ ) { if( $i == ($g_iFileCount - 1) ) echo '"' . $g_szFileList[$i] . '"'; else echo '"' . $g_szFileList[$i] . '",'; } ?> ); // Execute Image Preloader var oPreload = new ImagePreload( szImages, OnImgUpdate, OnCompletion );} Notice it is placed directly inside of the 'Array()' function as its parameters, thus creating the required JavaScript Array used to Preload the images on the visitors machine! Putting it all together, we have: File = index.php <?php// Image-Root Directory..$g_szImagesDir = 'images/';// Global Variables used by 'BuildFileList' function...$g_szFileList = array();$g_iFileCount = 0;// Build File List of Imagesfunction BuildFileList( $szDir ){ global $g_iDepth, $g_szFileList, $g_iFileCount; $oDirHandle = opendir( $szDir ); while( false !== ($szFile = readdir( $oDirHandle )) ) { if( $szFile == '.' || $szFile == '..' ) continue; $szCurrPath = $szDir.'/'.$szFile; if( is_dir( $szCurrPath ) ) { BuildFileList( $szCurrPath ); }else { if( (false !== strpos($szFile, '.jpg')) || (false !== strpos($szFile, '.gif')) || (false !== strpos($szFile, '.png')) ) { $g_szFileList[$g_iFileCount++] = str_replace( './', '', $szCurrPath ); } } } closedir( $oDirHandle ); return;}// Start the search for Images!BuildFileList( './' . $g_szImagesDir );?><html><head><style type="text/css"><!--.OuterBorder{ border:1px solid #426394; padding: 2px 5px 2px 5px;}.FullDot{ border:1px solid #426394; background-color:#DAE1EB; cursor:default;}.EmptyDot{ border:1px solid #426394; background-color:#F3F6FA; cursor:default;}//--></style><script type="text/javascript" language="JavaScript" src="ipreload.js"></script><script type="text/javascript" language="JavaScript"><!--var g_iStep = 0;function OnImgUpdate( iProgress ){ if( (iProgress >= 1) && (iProgress <= 10) && (iProgress > g_iStep) ) { g_iStep++; var oSpan = document.getElementById( "sDot" + iProgress + "" ); oSpan.className = 'FullDot'; }}function OnCompletion(){ document.location.replace('main.html');}function StartPreload(){ var szImages = new Array( <?php for( $i = 0; $i < $g_iFileCount; $i++ ) { if( $i == ($g_iFileCount - 1) ) echo '"' . $g_szFileList[$i] . '"'; else echo '"' . $g_szFileList[$i] . '",'; } ?> ); // Execute Image Preloader var oPreload = new ImagePreload( szImages, OnImgUpdate, OnCompletion );}--></script></head><body onload="StartPreload()"><center><table cellpadding="0" cellspacing="0" border="0" class="OuterBorder"> <tr> <td> <span id="sDot1" class="EmptyDot"> </span> <span id="sDot2" class="EmptyDot"> </span> <span id="sDot3" class="EmptyDot"> </span> <span id="sDot4" class="EmptyDot"> </span> <span id="sDot5" class="EmptyDot"> </span> <span id="sDot6" class="EmptyDot"> </span> <span id="sDot7" class="EmptyDot"> </span> <span id="sDot8" class="EmptyDot"> </span> <span id="sDot9" class="EmptyDot"> </span> <span id="sDot10" class="EmptyDot"> </span> </td> </tr></table></center></body></html> Conclusion: Well, I hope that you have learned something from this tutorial, and maybe even use such a preloader in your web sites! Please feel free to comment on this tutorial, if you noticed anything wrong or out of place in this tutorial, please don't hesitate to mention it! I am interested in all feedback really, I'm curious about what you think of my writing, tutorial, methods used, code, etc.. Thanks! See a working Sample of this Script!
  23. I have always been a huge fan Counter-Strike..And now that HL2 is out, CS:Source just rules!I love playing against other people online, it makes the gameplay different each time!I also like being able to modify CS with AMX and AMXX, so you can make the game so much more than it already is!!Anyway, that's my vote.. Ever since I started CS, I haven't played many other games.. GTASA is cool, but not on the same level as Online FPS' in my opinion..
  24. I love my car as well, but on long distance it is just mean to my car! I love the Train most though.. The scenery can't be beat, but it is limited to continents (if only they could span oceans!)If I do have to cross the ocean (I never have, but if) I would prefer to take a boat of some sort, but if that's not reasonable then I would suffer in a plane.I have been in a plane before (but only a 4 hour flight, which I could've taken a train for ) and I didn't like it too much.. I felt like a sardine! Needless to say, I watched to flight movie :(But, in the future *cough* teleports will be the best!
  25. What you are looking for is possible, but it is not JavaScript.. Rather, it is part of the HTML standard. Just use simple anchor tags (<a>) but instead of using the href attribute, you use the name attribute. That creates an anchor to a page spot (like half way down a long page).. then, when you want to link to that page AT the anchored spot you would use: index.html#named_anchor The pound sign '#' is a directive that says "look for an anchor in this page with the same name.." or something of the sort.. An example would be: Filename = mypage.html: <html><head></head><body><a name="pageTop"></a><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><a href="mypage.html#pageTop">Go To Top of Page</a></body></html> I hope you could follow that.. it is pretty simple really.. And you don't have to direct to the top of a page, it could be anywhere, wherever you put the <a name="pageTop"></a> tag(s) you can link to.. I hope that helps!
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.