Jump to content
xisto Community

TavoxPeru

Members
  • Content Count

    865
  • Joined

  • Last visited

Everything posted by TavoxPeru

  1. Its because of the server, however i always see this hidden files with my ftp client. Best regards,
  2. Php have a lot of fuctions that works with image formats, including gif, png, jpg, wbmp, and xpm and by using the GD Library you can be able to create and manipulate images. Also you can enhance the GD library to deal with fonts. Take a look to the PHP Image Functions for more information. Best regards,
  3. Well for example if you have a table that store some attributes of any image like its filename, URL, Xposition, Yposition, width and height and by a html form someone selects an image you only need something like this code: <?php// the id of the selected image$id=$_POST["id"]; // database settings and connectioninclude("db.php");// data selection$query="select * from ImageTable where id=$id";$rs = mysql_query($query) or die("Erro No: ".mysql_errno() . "<br />Description: " . mysql_error());$row=mysql_fetch_array($rs);?><!-- Image display --><div style="top:10px; left:10px; z-index:1; position:absolute"> <!--Bottom layer --><img src="BottomImagesource.jpg" width="" height="" /> <!-- Image to be displayed bottom --></div><div style="top:<?php echo $row["Xposition"]; ?>; left:<?php echo $row["Yposition"]; ?>; z-index:2; position:absolute"> <!--Top layer --><a href="<?php echo $row["URL"]; ?>"> <!-- Url for the top Image --><img src="<?php echo $row["filename"]; ?>" width="<?php echo $row["width"]; ?>" height="<?php echo $row["height"]; ?>" /> <!-- Image to be displayed on top --></a></div>Also note that its not necesary to store the width and height of the image because you can obtain it directly with the get_imagesize() function. Best regards,
  4. I use CuteFtp, it's very complete but sometimes -especially with big files- looses the connection, right now i'm testing a new one called FreshFtp 3.40, is very quick and also it is free take a look at: http://forums.xisto.com/no_longer_exists/ Best regards,
  5. Your site is up right now, i just access it and view all your folders and files Best regards,
  6. how do i count the number of records of a table group by a foreign key??? Here are my tables:a. table situation:CREATE TABLE `situation` ( `id_situation` tinyint(3) NOT NULL auto_increment, `situation` varchar(20) NOT NULL default '', PRIMARY KEY (`id_situation`)) TYPE=MyISAM ;b. table documents:CREATE TABLE `document` ( `id_document` int(8) unsigned NOT NULL auto_increment, `id_situation` tinyint(3) unsigned NOT NULL default '1', `regdate` date NOT NULL default '0000-00-00', `notes` text NOT NULL, PRIMARY KEY (`id_document`)) TYPE=MyISAM ;What i need is to show for each record of the table situation how many records exists in the table documents, i try this SELECT:select situation.id_situation, situation.situation, count(document.id_situation) as totdocs from situation, documents where situation.id_situation=document.id_situation group by situation.id_situation order by situation.situation;but it does not show the correct values.Best regards,
  7. I agree with ginginca its a nice idea and also very cool , but it only works in FF & NS????? do you know why??? Also, thanks for the share, i will visit it later. Best regards,
  8. the addslashes() function simply escapes with a backslash the single quote ('), double quote ("), backslash (\) and NUL (the NULL byte) and runs automatically on all GET, POST, and COOKIE data when the PHP directive magic_quotes_gpc is on -by default is on- not only with queries. By the other hand, mysql_real_escape_strings escapes the following characters: \x00, \n, \r, \, ', " and \x1a, another difference is that this function takes into account the current character set of the connection if it is supported by the database. As i read a time ago this function must be use if binary data is to be inserted to the database. Best regards,
  9. Thanks for visiting my site and sorry for not posting that my problem was corrected BTW, i forgot to change the old index.html basically because i use my site for testing my work, i wanna do this soon and yes, you are right i have some content, check this: Trivia Online Inti Voyage Best regards,
  10. Simply add AND to your qUery string like this: $result = mysql_query("SELECT * FROM table_products WHERE (cat='" . mysql_real_escape_string($specific_value) . "' AND sub_cat='fittings' ");Now, if you want a more general functionality, for example, when the values you want to qUery comes from a submited form you can do this: <?php$specific_value1=mysql_real_escape_string($_POST['cat']);$specific_value2=mysql_real_escape_string($_POST['sub_cat']);$result = mysql_query("SELECT * FROM table_products WHERE (cat='$specific_value1' AND sub_cat='$specific_value2')") or die(mysql_error());while($row = mysql_fetch_assoc($result)) { echo $row['desc'] . ' ' . $row[other] . '<br />';}?> You must use the mysql_real_escape_string function to avoid sql injection attacks, to escape the following characters: \x00, \n, \r, \, ', " and \x1a and to guarantee that the data is safe before you send your query. Best regards,
  11. I hope that the following code help you, is a registration and activation page, its very simple and self explanatory, if you dont understand something please send me a PM. <?php /*** Generate an activation code* @param int $length is the length of the activation code to generate* @return string*/function generateCode($length = 10){ $password=""; $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; srand((double)microtime()*1000000); for ($i=0; $i<$length; $i++) { $password .= substr ($chars, rand() % strlen($chars), 1); } return $password; } // config file with database info (db, host, user, password) and connection functions.require("config.php");?><HTML><HEAD><TITLE>Registration http://forums.xisto.com/no_longer_exists/ HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"><style type="text/css">body { background-color:#131313; font-family:Verdana, Arial; font-weight:bold; font-size:9px; color:#FFFFFF;}.register_box { border: 1px solid #323232; background-color: #202020; font-family: Verdana, Arial; font-weight: bold; font-size: 9px; color: #FFFFFF; } </style></head><body><?php$action = (isset($_REQUEST['action'])) ? $_REQUEST['action'] : "new";switch($action) { //-------------------------------------- // [New Registration] //-------------------------------------- case "new": if(!isset($_POST['register'])) { echo " <form action='registration.php' method='POST'> Name: <br /> <input type='text' name='name' class='register_box'> <br /> Email: <br /> <input type='text' name='email' class='register_box'> <br /> Nickname: <br /> <input type='text' name='nickname' class='register_box'> <br /> Password: <br /> <input type='password' name='password' class='register_box'> <br /> <input type='submit' name='register' value='New Registration!' class='register_box'> <input type='hidden' name='action' value='new'> </form>"; } elseif(isset($_POST['register'])) { $name = mysql_real_escape_string($_POST['name']); $email = mysql_real_escape_string($_POST['email']); $nickname = mysql_real_escape_string ($_POST['nickname']); $password = mysql_real_escape_string($_POST['password']); $activation_code = generateCode(25); $nameq = "SELECT name FROM registration WHERE name = '$name'"; $emailq = "SELECT email FROM registration WHERE email = '$email'"; $nickq = "SELECT nickname FROM registration WHERE nickname = '$nickname'"; //put errors into an array I need to change these if I change the db $errors = array(); if(empty($name)) { $errors[] = "The name field was blank! <br />"; } $reg=mysql_query($nameq) or die(mysql_error()); if(mysql_num_rows($reg) > 0) { $errors[] = "The name given is already in use! Please try another one! <br />"; } if(empty($email)) { $errors[] = "The email field was blank! <br />"; } $reg=mysql_query($emailq) or die(mysql_error()); if(mysql_num_rows($reg) > 0) { $errors[] = "The email given is already in use! Please try another one! <br />"; } if(empty($nickname)) { $errors[] = "The nickname field was blank! <br />"; } $reg=mysql_query($nickq) or die(mysql_error()); if(mysql_num_rows($reg)>0) { $error[] = "That nickname is already taken. Please try another one.<br />"; } if(empty($password)) { $errors[] = "The password field was blank! <br />"; } if(count($errors) > 0) { foreach($errors as $err) { echo $err; } } else { $sqlq = "INSERT INTO registration (name, email, nickname, password, is_activated, activation_code)"; $sqlq .= " VALUES ('$name', '$email', '$nickname', '".md5($password)."', '0', '$activation_code')"; mysql_query($sqlq) or die(mysql_error()); echo "Thanks for registering! You will recieve an email shortly containing your validation code, and a link to activate your account!"; mail($email, "New Registration, gigasoft.astahost.com;, "Thanks for registering on TRIVIA at GIGASOFT.\n\nHere are your login details:\n\nNickname: ".$nickname."\n\nPassword: ".$password."\n\nIn order to login and gain full access, you must validate your account.\n\nClick here to validate:\n\nhttp://forums.xisto.com/no_longer_exists/trivia/registration.php?action=activate&nickname;; } } break; case "activate": //-------------------------------------- // [Activate Account] //-------------------------------------- if(isset($_GET['nickname']) && isset($_GET['code'])) { $nickname = mysql_real_escape_string($_GET['nickname']); if(mysql_num_rows(mysql_query("SELECT email FROM registration WHERE nickname = '$nickname'")) == 0) { echo "That username is not in the database!"; } else { $activate_query = "SELECT is_activated FROM registration WHERE nickname = '$nickname'"; $is_already_activated = mysql_fetch_object(mysql_query($activate_query)) or die(mysql_error()); if($is_already_activated->is_activated == '1') { echo "This user is already activated!"; } else { $code = mysql_real_escape_string($_GET['code']); $code_query = "SELECT activation_code FROM registration WHERE nickname = '$nickname' LIMIT 1"; $check_code = mysql_fetch_object(mysql_query($code_query)) or die(mysql_error()); if($code == $check_code->activation_code) { $update = "UPDATE registration SET is_activated='1', regdate=NOW(), last_login=NOW() WHERE nickname = '$nickname'"; mysql_query($update) or die(mysql_error()); echo "User $nickname has been activated! Thanks!"; echo "<br />Please <a href=\"login.php\">Click here to Login</a> and enter the site."; } else { echo "The activation code was wrong! Please try again!"; } } } } else { echo "No ID or user given to activate!"; } break; }?> </body></html> Best regards,
  12. WeaponX: I can't borrow a video card because i'm not a hardware techy and also this pc isn't mine too, it is of a friend, but thanks for your suggestions. Xisle: While a pc turns on 1 beep means that everything is correct and pass all of the POST's tests. Best regards, and again thanks to every body.
  13. The syntax to putting a background image property in a css sheet is: background-image: url('full_or_relative_url_of_the_image');Take in mind that this is the most simple syntax to put an image as a background, the full syntax covers: background-attachment background-color background-image background-position background-repeat BTW, the 'background' property is a shorthand property for setting the individual background properties at the same time ('background-color', 'background-image', 'background-repeat', 'background-attachment' and 'background-position'). Take a look to the official CCS2 specification at: Offical W3C CCS2 Specification Best regards,
  14. Yes, the power is ok, and i hear the fan spinning and also the hard drive, so the last option is to verify the video card but i'm almost sure that the problem is with the motherboard as you and Grafitti says. Thanks a lot,
  15. Thanks for the site link very useful, now, I'm not 100% sure but i think that the bios manufacter is AMI and the exact model of the motherboard is K7S41GX. I just visit the ASRock website and found some info about this, according to this info the problem is with the Base 64K memory, tell me something this Base memory refers to the RAM memory or refers to other memory??? Best regards,
  16. I just see the problem with your code, simple replace the ',' with a ';' like this: len=urls_array.length;for ( var i=0; i<len; ++i )And also i suggest to complete your script tag. Best regards,
  17. I have a problem with a pc that dont boot it only produces a series of 3 short beeps, does anybody knows what means these beeps???? i'm sure that this sounds means something but i dont find any good advise or technical article about. If helps, the only specs i know of this PC are: ASRock Motherboard AMD Processor 40GB Hard Disk 256 MB RAM DDR Best regards,
  18. You are welcome, and BTW i really dont think how easy is to edit these templates, really awesome, and i'm almost 100% sure that these are the most easy editable templates i find ever. best regards,
  19. Well as everybody know in these forums people posts a lot of code snippets that could be organized in a simple page or whatever, my question is if someone is interested to do it or if exists something like that here at Xisto.I think it would be very helpful for everybody as well to keep things more organized.Best regards,
  20. As i say, its very simple and yes, you can change the layouts very easy, if you want to add a image or picture in the header simply add an img tag in the html div header tag like this: <div id="header"><img src="logo.jpg"></div>Best regards,
  21. In this site you can find some excellent CSS layouts and code snipets, its very simple but more important its very EFFECTIVE. So dont waiste time and visit : Code-Sucks Best regards,
  22. I wanna share this link that i found, this is an excellent article for those people who works with MySql and are concern about security risks: 10 steps to fortify the security of your MySQL installation Best regards,
  23. Yeah, excellent share, never know about this resource, almost because i'm a big fan of sourceforge and always research in it. best regards,
  24. Thanks a lot, i just search and replace and run it, and everything works fine. best regards,
×
×
  • 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.