Jump to content
xisto Community

jlhaslip

Members
  • Content Count

    6,070
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by jlhaslip

  1. I can't see where you are re-setting the txt1stnumber or the txt2ndnumber variables, so they are probably producing the result and the result is being echo'd out each time.Maybe re-post the current code here.
  2. I imagine that the scripts would not be run on the server, ie: not demo'd, until the members have reviewed the scripts and tested them on their own install of php/mysql ( a local version of XAMMP or similar ). Possibly then a test on their own Xisto account? or a Xisto dot net account? If it is all good, then the demo could be hooked up to the site and a review published. Reading the script would let you know if there is anything potentially disabling in there. Part of the review would be to confirm that user input is 'cleansed'. We would need to standardize that code and process. Just a few random thoughts.
  3. Congratulations on getting 'botted'. As you mentioned above, all bots seek out a file named robots.txt which contains the permissions and restrictions that most Bots adhere to, but it isn't 'required' that Bots even stop to read the file. Bot visits can be good for indexing your site on the search engines, but you run the risk of a Bot picking up information which you don't want made public. One trick is to store your 'personal files' in a folder "above" the public_html folder on your site. Apache servers don't allow unauthorised access to these files if the user isn't specificly allowed access.
  4. Three rules of Security on php pages are as follows: Never trust user input Never trust user input Never trust user input A common method is to set the variables using the following techique: ... code to input the value from the User ...$my_variable = stripslashes(trim($_POST['user_input']));... rest of code uses $myvariable ... trim() removes white-space before or after the data in $_POST['user_input']and stripslashes() removes any backslashes found in $_POST['user_input']
  5. As reported in another posting, there is an Image Gallery named Hoverbox from the Sonspring site which is a pretty cool display method using CSS to have Thumbnail pictures double their size by hovering over them. I liked the css included in the original Tutorial as found on the Sonspring site, but I knew there was more than one use for the Hoverbox and took it upon myself to explore the use of the Hoverbox on a site I webmaster. One thing that wasn't right was having to hardcode the image tags, so the first version I wrote used php to fill the Hoverbox by reading the Image filenames from the Image folder and inserting them into the html.Another was the use of the anchor (<a>) tag to trick Internet Explorer into activating the on-hover event, so I included the filename as the target of the anchor tag so that the on-click event actually does something. It opens a window and displays the full sized picture in your browser.The website I wanted to use the Image Gallery on is for a Minor Hockey program and I also wanted a 'randomization' of the pictures so that each time you viewed the page a different selection of pictures was displayed. This avoids the possibility of suspicious selection methods (Why isn't little Johnny's picture on the site?)and lastly, I wanted this code to be flexible in terms of the number of pictures displayed on the page, so I have a 'maximum number' variable which displays, well, a maximum number of pictures. This raised the possibilty of there not being enough Images, so a check is made to display the lesser of the max_num or actual_num of pictures.I leave it to you to visit the Sonspring site to check out the actual Hoverbox code. In this Tutorial, I will focus on the php coding for the Hoverbox which my script enhances as per the list of features above. // Hoverbox Image Gallery - adapted//// Original Hoverbox code by Nathan Smith // [url="http://sonspring.com/journal/hoverbox-image-gallery"] http://sonspring.com/journal/hoverbox-image-gallery[/url]////'>http://sonspring.com/journal/hoverbox-image-gallery[/url]//// PHP script adaptation by Jim Haslip jlhaslip@yahoo.ca//// A main feature in the original Hoverbox was a method for the thumbnail // Images to grow to double the thumbnail size when hovered over. // The Hoverbox swap of Images is entirely CSS-based. No javascript was injured in // the making of this display.//// Added in this script are :// - an on-click event to display the Images full size// - added the php scripting to load the contents from a directory// - added a max number of images to be displayed// - added a random feature for selecting the Images to be displayed//// There could be several versions adapted from this script. ie: remove the full size // on-click feature, change the maximum number to display, remove the randomness. // I will eventually have each of these versions available, but at present, // you will have to Mod the script yourself. // // //<?phpecho '<ul class="hoverbox">';//// set some variables used in the script//$max_num = 15; // maximum images displayed in the Hoverbox$j=0; // a counter variable$narray = array(); // declare an array containing the file-names of the images//// set directory paths here.// There are Bandwidth issues with loading the 'full-size' pictures for use as thumbs // and mid-size, however, there is a time-delay issue on-click when the full-size // picture must then be downloaded. Your call on that one. The Demo uses three Folders.// To minimize the bandwidth usage, use only one directory of optimized pictures, // but be sure to alter the paths accordingly.// All occurences of a picture MUST have the SAME NAME whether in one or three directories.// The filenames don't appear to be case-sensitive. ( PIC001 = pic001 = PiC001 = pIc001 )//$dir = "images/"; // name of the folder where the Thumbnail images are stored$mid_dir = "mid_images/"; // name of the folder where the Mid-sized images are stored$full_dir = "full_images/"; // name of the folder where the Full-sized images are stored//// check to confirm the directories exist and can be opened//if (is_dir($dir) && (is_dir($mid_dir)) && (is_dir($full_dir)) ) { $dh= @opendir($dir) or die("Unable to open $path please notify the administrator. Thank you."); // // loop while you read the entire directory listing selecting only files which // 1. are not the * or (..) directories // 2. are jpeg ( or as specified in the file type below ) // 3. exist in both the mid-size and full-size directories named in the path variables // while (($file = readdir($dh)) !== false) { // // ignore the directory entries and only select the .jpg file extension files // alter the '.jpg' to suit your format // if (($file != '.') && ($file != '..') && (stristr($file,'.jpg'))) { // // confirm the file exists in both the mid and full directories // if ((file_exists($mid_dir . $file)) && (file_exists($full_dir . $file))) { // // add them to an array if all is good so far // $narray[]=$file; // // increase counter when a file is added to the array // $n++; } } }//// reset the max_num if not enough pictures meet the criteria//if ($n < $max_num) { $max_num = $n; }//// randomize the array for presentation//shuffle( $narray);//// echo the correct html as per the Hoverbox Tutorial found at // [url="http://sonspring.com/journal/hoverbox-image-gallery"]http://sonspring.com/ while ( $j <= $max_num-1) { echo "t" . '<li><a href="' . $full_dir . $narray[$j] . '" alt="full-size"> <img src="' . $dir . $narray[$j] . '" alt="' . $dir . $narray[$j] . '" > <img src="' . $mid_dir . $narray[$j] . '" alt="mid-size" class="preview" /></a></li> ' . "nrt"; $j++; }} // // report an error on the directory confirmation // else { echo 'There is a problem with the directories. Please Notify the Administrator. Thank You.';} closedir($dh);echo '</ul>';?>
  6. By the way, I would kick-in some hours, too.By the way: one problem that I foresee is having the ?correct? version of php available. Since there are several versions out there, ie: Xisto uses ver. 4.4.2, is there a way to have multiple versions on the server to test against? Could we test them in a php4 and also a php5 version and report which versions worked and which ones don't?
  7. Open Source Web Design dot Org has an excellent selection of Site Templates for web sites (http://www.oswd.org/), but I think that if you are going to host a Clan or group, you might be better off with a Content Management System. They can be 'skinned' to suit your Clan and the game you are using.Samples of Content Management Systems include Mambo, Joomla, Drupal.Or Forums can be skinned, too. Try phpbb.com. Download version 2 and check in their community about skins or themes.
  8. Try squeezing a Tennis Ball for an hour or so each day.Swap hands regularly and often.Get a job swinging a hammer, rake leaves, do anything you can think of to build-up your wrists.
  9. Nice clean code now.Try setting the $result = 0; in the line where you have $result = ''; at the top of the page.Also, watch for division by zero if the rad1=divide.XAMPP provides Apache, MySQL,Perl, Php, Mercury Mail, an FTP client, phpadmin and even more. It is very easy to install. A default install will handle most situations. It should NOT be used in a live web situation, though, due to security factors without changes to its security. You need to know what settings to change on the server, etc.
  10. What exactly do they support and why do you support them?I live in North America and have not heard anything about them, but I would not tend to be supportive of them unless they also supported things I believe were right and true. Racial equality and equal rights for women, education for all, free and democratic votes, freedom of speech, and seperation of Church and State to name a few of the things I believe.
  11. I use notepad and write my own css files.
  12. reference to this posting at the start off the thread. http://forums.xisto.com/topic/858-creating-a-pop-up/
  13. jlhaslip

    Image Links

    Yes. Using the code from above: <a href="URL OF THE LINK"><img src="URL OF PICTURE" border="0"></a> change the "URL OF THE LINK" to the page which you want to link to. Example: <html>< ... etcetera ... ><div><a href="http://your_ I_want_to_Link_to.html"><img src="URL OF PICTURE" border="0"></a></div>< ... etcetera ... ></html> Change : "your_account.trap17" to "your actual subdomain at the trap Change : "/folder/subfolder/page_ I_want_to_Link_to.html" to the path and file name of the actual file you which to go to. (remove the quotation marks) For a page named "test_page.html on my site in the "checking" folder, I would have a link like this: <div><a href="http://forums.xisto.com/no_longer_exists/ src="image.gif" border="0"></a></div> Check out the following link for a good tutorial about 'anchor' or '<a>' tags: http://www.w3schools.com/ Hope this helps you.
  14. Typically, I would've handled this differntly than you have done. Check the following code which includes an input form for calculating the value of a purchase. Notice the difference in the logical structure?The first thing this form does is check for a previously 'submitted' value and then handle the form or else present the form and include the 'hidden' field which is what is used in the first logic block above it. <title>Widget Cost Calculator</title></head><body> <?php // Check if the form has been submitted.if (isset($_POST['submitted'])) { // Cast all the variables to a specific type. $quantity = (int) $_POST['quantity']; $price = (float) $_POST['price']; $tax = (float) $_POST['tax']; // All variables should be positive! if ( ($quantity > 0) && ($price > 0) && ($tax > 0)) { // Calculate the total. $total = ($quantity * $price) * (($tax/100) + 1); // Print the result. echo '<p>The total cost of purchasing ' . $quantity . ' widget(s) at $' . number_format ($price, 2) . ' each is $' . number_format ($total, 2) . '.</p>'; } else { // Invalid submitted values. echo '<p><font color="red">Please enter a valid quantity, price, and tax rate.</font></p>'; } } // End of main isset() IF.// Leave the PHP section and create the HTML form.?><h2>Widget Cost Calculator</h2><form action="calculator.php" method="post"> <p>Quantity: <input type="text" name="quantity" size="5" maxlength="10" value="<?php if (isset($quantity)) echo $quantity; ?>" /></p> <p>Price: <input type="text" name="price" size="5" maxlength="10" value="<?php if (isset($price)) echo $price; ?>" /></p> <p>Tax (%): <input type="text" name="tax" size="5" maxlength="10" value="<?php if (isset($tax)) echo $tax; ?>" /> (optional)</p> <p><input type="submit" name="submit" value="Calculate!" /></p> <input type="hidden" name="submitted" value="TRUE" /></form></body></html> There is always 'another way to do things, so check this page to see if you can recognize the difference in structure. As to what is wrong with your form? I don't know. I had a terribly diffifult time when I read it. Tables and div's all mashed in together? No hidden field to see if the form had been submitted? Multiple uses of the same 'name'. The best thing I can do about your problem is to show you a sample of code which I would've used and perhaps you can learn from it and find the error. Besides, it is late at night and I need some sleep. Might have another look in the morning.What version of php are you running on the XAMMP set-up? Might be a version problem. And the reset button doesn't clear a calculated value when I tried to use the page you posted.Good effort for the first page, at least you got a result. Besides, the messages are 'Notices', not errors. Keep learning.
  15. Topic resolved.Pm a Mod to re-open it if required.
  16. I found out the hard way that the upgrade cost the same as a fresh start, so if you want to eventually end up with the 150Meg package, save your credits until you have 30 - 35 then apply.
  17. to quote the Xisto Readme file: As far as I know, the files and account contents remain intact until the account reaches minus 30 credits and then they are purged from the system. (termination) If your account went to minus 30 credits, assume they are gone. Just a reminder that the back-up of a member's account files are the member's responsibility. The cpanel includes a backup script which can download your files and / or databases to your own computer in a "zipped" format. It is reccomended that member's do their back-ups on a regular schedule so as to not be diappointed due to the account suspension and termination or in case of a Server error. All Web space is subject to abuse by Hackers or errors or act of {MicroSoft} and Data should be stored "off-site" from the Server in case of an incident. Okay, that's the lecture for today.
  18. Trap17 Hosting is better than most PAID Hosting Services.The posting is a small price to pay.Of course, the option remains with you to post or not.
  19. Use Relative addressing by inserting "../" in the link paths to "go back one folder". I wrote a small test for doing this once and I still have it uploaded, so here is the URL: http://forums.xisto.com/no_longer_exists/. Do a view source of each page to see how the "../" can be used. The "../" takes you back one directory on the path, but then you need to add the folder names to travel down towards the target file. Only other way is to use php coding, or another scripting language.
  20. Anybody smell any smoke? Where there is Flaming, there should be smoke.I moved two posts to Spam. We don't tolerate Flaming and/or prejudicial comments on this Board. Credits will be reduced accordingly by the script.
  21. Hoverbox is an Image Gallery which I found some time ago. The feature I like the most about it is the effect of the "on-hover" state which changes the image from a small thumbnail size to a "mid-size" image. Essentially, it doubles the size of the picture when your mouse hovers on it. The Hoverbox uses CSS for the size change and needs no javascript to perform. In fact, it works the same without javascript. And... it apparently works in IE. The CSS method used includes 'hiding' the larger image until the 'on-hover' state is reached. As you know, IE's 'on-hover' state doesn't work on anything except an anchor tag, so the trick is to include a named anchor (value="#") to affect the 'on-hover' display. Pretty cool. The Author's Tutorial is here: http://sonspring.com/journal/hoverbox-image-gallery
  22. It comes set-up with a 'typical' assortment of settings, so I assume you mean "after you get them correctly set up according to your preferences". The Permissions matrix needs to set to your liking and User groups defined, of course. The Forum I would be replacing is a private one, so, no guests allowed. The phpbb Beta 2 will allow you to lock the guests out completely, or let them read/post to specific topics, as you determine. The flexibility includes several different type of Member groups, so that some can create Polls or some can edit their postings, etc. These same attributes can also be assigned on a User level. I am thinking that there is almost "too much" flexibility in the permissions, but if you set them properly at the beginning, it would be good to have the flexibility the Forum allows.
  23. Past tense. I wanted to know if it would start up in Safe mode at present. I suggest you follow the instructions found in rvalkass's post and focus on helping your friend rather than flaming those willing to assist you.
  24. XAMMP by itself is more than enough to set up for learning php. As you mentioned, it includes everything you are going to need except a good book and lots of tutorials as found here at the Xisto Forums. I would suggest you download the PHP Manual from php.net and use it as a local reference. Same with the MYSQL Manual. Both are very detailed and technical, however, they are invaluable when you are pulling your hair out looking for the missing commas, syntax errors, etcetera.Another pointer: learn php alone before you get involved with the Database stuff. Attempting to learn both at the same time can be overwhelming. Learn to use the core PHP functions and 'flat files' before trying out the MYSQL stuff. The Database is a whole language by itself, so walk before you fall on your face running into too much at one time.I further reccomend becoming familiar with PHPAdmin on the XAMMP facility. It does some terrific things for you when you get to the MYSQL stuff. Very useful tool to have some experience with when you have DB problems. (and you will)I look forward to seeing your Tutorials and scripts posted up here on the Trap.Good luck with your efforts.
×
×
  • 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.