Jump to content
xisto Community

slacware

Members
  • Content Count

    3
  • Joined

  • Last visited

Everything posted by slacware

  1. Download the latest version of MySQL.Choose the latest stable release and, from the stable release page, choose the option under "Source Downloads" marked "tarball (.tar.gz)". Download the file into a directory where files can be created and there is sufficient disk space. A good location is /tmp. Change directory to this location using: 1. % cd /tmp Note that the % character should not be typed in; this represents the Linux shell prompt and indicates that the command should be entered at the shell prompt. 2. Uncompress the package in the new installation directory by running: % gzip -d mysql-<version>.tar.gz If MySQL 3.23.42 has been downloaded, the command is: % gzip -d mysql-3.23.42.tar.gz 3. Un-tar the tape archive file by running: % tar xvf mysql-<version_number>.tar A list of files that are extracted is shown. If the version downloaded is MySQL 3.23.42, the command is: % tar xvf mysql-3.23.42.tar 4. Change directory to the MySQL distribution directory: % cd mysql-<version> If the version is MySQL 3.23.42, type: % cd mysql-3.23.42 5. Add a new Unix group account for the MySQL files: % groupadd mysql 6. Add a new Unix user who is a member of the newly created Unix group mysql: % useradd -g mysql mysql 7. Decide on an installation directory. Later, we recommend that PHP and Apache be installed in /usr/local/, so a good choice is /usr/local/mysql/. We assume throughout these steps that /usr/local/mysql/ is used; if another directory is chosen, replace /usr/local/mysql/ with the alternative choice in the remaining steps. 8. Configure the MySQL installation by running the configure script. This detects the available Linux tools and the installation environment for the MySQL configuration: % ./configure --prefix=/usr/local/mysql 9. Compile the MySQL DBMS: % make 10. Install MySQL in the location chosen in Step 7 by running the command: % make install 11. MySQL is now installed but isn't yet configured. Now, run the mysql_install_db script to initialize the system databases used by MySQL: % ./scripts/mysql_install_db 12. Change the owner of the MySQL program files to be the root user: % chown -R root /usr/local/mysql 13. Change the owner of the MySQL databases and log files to be the mysql user created in Step 6: % chown -R mysql /usr/local/mysql/var 14. Change the group of the MySQL installation files to be the mysql group: % chgrp -R mysql /usr/local/mysql 15. Copy the default medium-scale parameter configuration file to the default location of /etc. These parameters are read when MySQL is started. The copy command is: % cp support-files/my-medium.cnf /etc/my.cnf 16. Edit the configuration file and adjust the default number of maximum connections to match the default value for the maximum Apache web server connections. Using a text editor, edit the file /etc/my.cnf, and find the section beginning with the following text: # The MySQL server [mysqld] In this section, add the following line, then save the file, and exit the editor: set-variable = max_connections=150 17. The MySQL configuration is now complete, and MySQL is ready to be started. Start the MySQL DBMS with the following command: % /usr/local/mysql/bin/safe_mysqld --user=mysql & 18. Check that the MySQL DBMS is running with the mysqladmin utility. The following command reports statistics about the MySQL DBMS version and usage: % /usr/local/mysql/bin/mysqladmin version 19. Choose and set a password for root user access to the MySQL DBMS. To set a password of secret, use: % /usr/local/mysql/bin/mysqladmin -uroot password secret Record the password for later use. 20. The MySQL server is currently running. However, when the machine is rebooted, MySQL doesn't restart automatically. After reboot, the command in Step 17 can be used to restart MySQL or, alternatively, this process can be made automatic. To make the process automatic, find the file rc.local (normally either in or below the directory /etc). This file is used to list locally installed software that should be run on startup. Using an editor, add the following line to the bottom of the rc.local file: /usr/local/mysql/bin/safe_mysqld --user=mysql & The installation of MySQL is now complete. Notice from BuffaloHELP: Copied from cached page Warning.
  2. This tutorial will show you how to make a basic math CAPTCHA validtion form. This requires that you have the GD library for PHP installed to work. This tutorial requires 2 files, login.php and action.php. The first step is to create a sub-folder to store the temporary images, for the purposes of this tutorial,this folder should be called images. Now upload a image in there called verify.php and chmod just that image(not the folder) to 777 so that image can change as our functions generate new images. Ok, after you've done that, we can get to the code: in login.php: Code: <?php//the first number$im = ImageCreate(200, 40); //create image$white = ImageColorAllocate($im, 0,0, 0);$black = ImageColorAllocate($im, 120, 200, 68);srand((double)microtime()*1000000); $string = rand(1,10); //the first number$string2=rand(1,10); //the second number$string3="$string + $string2";$verification = $string3;$thevalue=$string+$string2;ImageFill($im, 0, 0, $black);ImageString($im, 4, 70, 10, $verification, $white);Imagejpeg($im, "images/verify.jpeg");ImageDestroy($im);print "<form action='action.php' method='post'>";print "Please enter the answer to the math question below to verify your not an evil bot:<br>";print "<input type='hidden' value='$thevalue' name='hiddenvalue'>";print "<input type='text' name='yourcode' size='20'><br>";print "<img src='images/verify.jpeg' border='0'><br><br>";print "<input type='submit' name='submit' value='submit'></form>";?> The first step is to create the image, the ImageCreate function in php does just that. The 200 and the 40 are the dimensions of the image created. The image created is stored in $img. $white and $black define the text color of the numbers and the background color of the image respectively. In this tutorial, the background color is greenish and the text is black for easy contrast. Next we set the random seed with the srand function. We do this by time so when we do call the random function, we get a different number each time. Then we generated two numbers between one and ten with the rand() function and store them in $string and $string2. In $string3, we combine them to make the actual text on the image. $string3 is not actually the sum of the numbers, it is just the text string and is not numeric. $thevalue is the actual sum of the two numbers when they are added. There's no real reason to set $verification equal to $string3 because we can just directly use $string3 but I do it by habit. Then these lines of code: Code: ImageFill($im, 0, 0, $black);ImageString($im, 4, 70, 10, $verification, $white);Imagejpeg($im, "images/verify.jpeg"); Fill the image with our defined ours and stores the image into images/verify.jpeg. Now we have to write the form. Its a pretty basic form. We store the actual value of the answer in the form field 'hidden value', which is a non-visible hidden field. The answer to the math question the user types in is $yourcode. Of couse we have to display images/verify.php so people can actually see what the math question really is. Now we move to action.php: Code: <?phpif(isset($_POST['submit'])){ $yourcode=$_POST['yourcode']; $hiddenvalue=$_POST['hiddenvalue']; if($yourcode==$hiddenvalue) { print "Correct, put your content here"; } else { print "You verification code is not right. Please go back and try again."; }}?> This is a very simple file that basically gets the two variables from the two input fields from login.php and compares them to see if they are equal. If they are equal, it goes to the "You are correct" case, if they are not equal, it goes to the "your code is incorrect case". In a real application, you would put your actual content in the "You are correct" case and a redirect back to some other page in the "You are incorrect" case. Notice from BuffaloHELP: It is imperative that you use the proper BBcode when listing a programming language. Copied from source Warning.
  3. What were makingIn this tutorial, we will be creating a web page that can be used for a gallery, an easy way of showing your portfolio of works or photography, etc.The page will be coded in XHTML 1.0 Strict and CSS3 valid, our CSS won't even have any warnings on them apart from one.So the first thing we need to do is set up a base structure for the XHTML. Below is the code for this. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://forums.xisto.com/no_longer_exists/ xmlns="http://forums.xisto.com/no_longer_exists/ http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>XHTML & CSS Gallery</title><link href="style.css" rel="stylesheet" type="text/css" /></head><body><div id="container"> <div id="heading"></div> <div id="main"> <div id="left"> </div> <div id="right"> </div> <div id="clear"><!-- --></div> </div></div></body></html> As you can see, our DOCTYPE tells the browser that we are using XHTML 1.0 strict. What's the difference between HTML and XHTML? XHTML coding is a lot more clearer then HTML, since it all needs to be lowercase, it's horrible seeing uppercase tags such as these <META HTTP-EQUIV... nasty eh?Our CSS will be styling divs, our main base structure will all be used with id in mind, because we are only using them once. So what do these divs do for us?ContainerThis will contain everything in one, a simple way of keeping everything in order.headingThis will be our heading. For this tutorial, we'll just do a simple text heading which will come later.mainThe main area of our content, just will keep our content areas in order.leftThe left area of our content, we can add large previews of the images here.rightThe right area of our content, where we will add the thumbnails of our images.clearThis gets rid of any outstanding floating divs, it's crucial for floating divs to have this. Notice from BuffaloHELP: Please use proper BBcode when showing a programming code.
×
×
  • 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.