Jump to content
xisto Community

TavoxPeru

Members
  • Content Count

    865
  • Joined

  • Last visited

Everything posted by TavoxPeru

  1. The \n means a newline and is simply use to code formatting. Now to add the background color to the table cell you need to modify my code, because as you see it first echoes the TD tag and then echoes the data, also, check your type data, i assume that it is a string data, so, try this instead: <?php $nRows=mysql_num_rows($result)/4;$i=0;echo "<table summary='myTable summary'>\n";while($i<$nRows){ echo "<tr>\n"; for ($h = 0; $h < 4; $h++) { $cbkgd="#fff;"; echo "<td style='width:25%;background-color:"; if($row = mysql_fetch_array($result)) { if($row['type'] == 'off') { $cbkgd="#f00;"; } elseif($row['type'] == 'def') { $cbkgd="#48d1cc;"; } echo $cbkgd . "'>"; echo "XKingdom Member:" . $row['user'] . "<br />Name of victim:" . $row['victim'] . "<br />Attack turns:" . $row['turns'] . "<br />Side of attack:" . $row['side'] . "<br />Gold stolen:" . $row['gold'] . "<br />Units lost:" . $row['lost'] . "<br />Units killed:" . $row['killed'] . "<br />MXP Gained:" . $row['mxp'] . "<br />Victim's points:" . $row['points_b'] . "<br />Your points:" . $row['points_a'] . "<br />Type of battle:" . $row['type'] . "<br />Battle power:" . $row['power']; } else echo $cbkgd . "'>Â "; echo "</td>"; } echo "</tr>\n"; $i++;}echo "</table>\n";?>Best regards,
  2. First of all change your select statement to the following: $result = mysql_query("SELECT * FROM myField1 ORDER BY myField2 DESC limit 12");What this will do is to select only the last 12 or whatever number of records from your table. Now for echoing correctly your data something like this will work: <?php$nRows=mysql_num_rows($result)/4;$i=0;echo "<table summary='myTable summary'>\n";while($i<$nRows){ echo "<tr>\n"; for ($h = 0; $h < 4; $h++) { echo "<td style='width:25%'>"; if($row = mysql_fetch_array($result)) { echo "XKingdom Member:" . $row['user'] . "<br />Name of victim:" . $row['victim'] . "<br />Attack turns:" . $row['turns'] . "<br />Side of attack:" . $row['side'] . "<br />Gold stolen:" . $row['gold'] . "<br />Units lost:" . $row['lost'] . "<br />Units killed:" . $row['killed'] . "<br />MXP Gained:" . $row['mxp'] . "<br />Victim's points:" . $row['points_b'] . "<br />Your points:" . $row['points_a'] . "<br />Type of battle:" . $row['type'] . "<br />Battle power:" . $row['power']; } else echo "Â "; echo "</td>"; } echo "</tr>\n"; $i++;}echo "</table>\n";?>Best regards,
  3. Maybe in your firefox the javascript support is inactive, simply check your preferences and active it, also, if you dont post your code we can not be able to see if the problem is your code and not your browser. Best regards,
  4. Yes HTML is easier than XHTML but i reccomend you to start coding with XHTML because is the future, as everything that is new to someone its required a bit of practice to learn it but when you catch it you will noticed that it is not difficult at all.Best regards,
  5. Well i never mind the ads and never bother me because i think that it is a true way to support the site, only to say THANKS FOR THE CHANGE and the new forum interface is really cool.Best regards,
  6. I just visit the site and only to say that every thing works fine, it starts inmediately when click the play button. Best regards,
  7. The way i prefer to do this kind of stuff is to first store the submited file to a specific folder at the server with the correct permissions, if it is a *nix system you must set this folder to be 777 or 775 both works fine, if it is a win system you must set this folder to be read/write, then send a notification email to any email account you use, and finally use any ftp client to your upload folder to check the submitted file. Something like this will work: if($_FILES['file']['size'] == 0) { die("Error... Any file was submitted" . "<br /><br /><a href=\"java script:history.back();\">Go back and try again</a>" ); exit();}else { $nomfile=$_FILES["file"]["name"]; move_uploaded_file($_FILES['file']['tmp_name'], "your_folder_name/" . $nomfile); $file = $_SERVER["DOCUMENT_ROOT"] . "/your_folder_name/" . $nomfile; @chmod($file, 0755); // is enough if you chmod 644}Other considerations you can use are to limit the size of the submitted files, its file type, etc. You can see more info related to this at the php.net manual for file-upload functionallity Best regards,
  8. To use right to left languages you must add to your html documents the following: <html lang="lang_iso_code" dir="text_dir"><head><meta http-equiv="Content-Type" content="text/html; charset=text_charset"> Where: lang_iso_code is the language iso code for example for United Arab Emirates you use ae, for Saudi Arabia you use sa, and so on. text_charset is the encoding of the document for your case -arabic- you use iso-8859-6-i text_dir is the direction of your text, for your case you use rtl (for rigth to left), you can use also ltr(left to right) for other languages like english, spanish, etc. Best regards,
  9. It's correct what you said but it is not absolutely necesary the use of the id use it if you want, just use the name property and do the same with your hyperlinks as Jimmy post below. Best regards,
  10. I just read this interesting article PHP6 -evolution or revolution where shows some new features of the next upcoming version of php, PHP 6. According with this article there will be some new features and some things will be deprecated like: Unicode support Var will be the same as Public Register globals will be deleted Magic Quotes will be deleted Safe mode will dissapear Return by reference will give an error The zend.ze1 compatibility mode and the freetype 1 and Gd 1 will be deleted Fastcgi will be activated always Register Long Arrays deleted too, only $_PUT, $_GET, etc. will be supported. I'm happy that at last the register globals, maquic quotes and the safe mode will be deleted as well that the long arrays will not be supported any more, this issues cause a lot of problems everytime, especially if someone can't access the php.ini file. Best regards,
  11. I have the same problem, and also i can't connect to my cpanel, with internet explorer 6 it shows the server can not be find error message and with firefox 2.0.1 shows Problem loading page Unable to connect error message. Maybe the Xisto's support team are performing and upgrade or alike task. Best regards,
  12. Thanks a lot, i found this solution too after a small research but also i found other problem related with this, especially if you send your forms with the POST method, because the server include a hidden input with the PHPSSID value to every form included in the page. Now, i found that there is two easy ways to solve this problem. You must use the ini_set php function to set the url_rewriter.tags and the arg_separator.output in every php page that you want to be valid xhtml1.1 as the following code: <?phpini_set("arg_separator.output","&");ini_set("url_rewriter.tags","a=href,area=href,frame=src,input=src");?> To the htaccess file that Quatrux post you must add the following line: php_value url_rewriter.tags "a=href,area=href,frame=src,input=src" So the complete htaccess file will be: <IfModule mod_php4.c> php_value arg_separator.output "&" php_value url_rewriter.tags "a=href,area=href,frame=src,input=src"</IfModule>And in every form of every php page that you want to be valid xhtml1.1 you must include a hidden input: <input type="hidden" name="PHPSESSID" value="<?php echo session_id();?>" />I dont test this solution with PHP5 but i think it would work too, so i will test it and edit this post with the results very soon.Finally, i recommend the use of the second option, because it this way you only have to include the hidden input to your pages. BTW, this problem was a recognized PHP bug as noticed in the PHP website: Bug #13472 input type=hidden should be in a fieldset if there is one (XHTML and trans sid) Best regards,
  13. Thanks for the information, i just read the topics page and found that it is an excellent online course, so i register myself and begin to download some material.Best regards,
  14. Hi, i have a problem when i try to validate a php page that includes a litlle form and use sessions as a strict xhtml 1.1 page with the W3C XHTML VALIDATOR, the problem consists that everytime i send it to the validator it creates a hidden input with the PHP PHPSESSID in the form and also adds to the href attribute of every link this PHPSESSID, so if you have for example a link like this: <a href="page.php?sessionvar=1">page with session var equal 1</a>it results in this: <a href="page.php?sessionvar=1&PHPSESSID=Some_Value">page with session var equal 1</a>and as you know it is recommended that always replace & with & to make your page valid XHTML 1.1 Can someone knows a solution for this???? Best regards,
  15. yeah thanks again and i think that help and be helped by people is one of the best things of this forum, specially because ALWAYS ARE CORRECT . BTW, if someone needs the php filemanager i installed to resolve this problem please let me know to send it by mail. Best regards,
  16. Following your suggestion i install a filemanager and finally i could solve the problem and be able to delete all the problematic directories and files. The reason i could not be able to do it before was because the ftp program that i use don't show some htaccess files that were left behind, i dont know why it happens because with this same ftp program i can see this files in other sites. Best regards,
  17. Yes, i'm pretty sure that it is possible, but as you, i am a newbie in this especific area of development -never work with it -, so, i recommend you to visit the php classes website where you can find a lot of php classes that will help you to do it. Best regards,
  18. Hi, I hope that the following links will be useful in the case you need an online quick reference of HTML, CSS, Javascript, etc. just visit these websites: CSS Examples: Some cascading style sheet examples. HTML Tags: Complete HTML tags with attributes and values for XHTML 1.1, also known as HTML 4.01. Javascript: JavaScript quick reference. Regular Expressions: Regular Expressions for client-side JavaScript quick reference. Characters: HTML Characters (Numeric and Alpha),Webdings and Web ASCII codes. Country Codes: Internet Country Codes with phone prefixes. Best regards,
  19. Great job pyost, first i try directly the code and nothing works, after make the corrections you give it works perfectly. Now, if you plan to validate your website to be xhtml 1.1 you need to remove the comment tags because if you dont your page do not pass the validation process and also, if you plan to be a valid xhtml 1.0 then you need to do some little modifications to conform the validation. The first modification you need to perform is to declare correctly the DOCTYPE because it is not correctly typed, you need to change this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN https://w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd xmlns="https://w3.org/1999/xhtml/;to this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; <html xmlns="https://w3.org/1999/xhtml/;" lang="en" xml:lang="en">BTW, m^e thanks for your code, i will modify it to use on another website, but dont worry, i will only use your page structure because is very simple and clean, not your data Best regards,
  20. I dont know if it is posible to do with MySql-Front, what i know is that it is possible if you use Sqlyog Enterprise Edition using a Use HTTP Tunneling connection. To perform a remote access with this software is very simple, and it only consists to upload a php file to your webserver and then configure a new connection in the software. Best regards,
  21. Some months ago i have the same trouble with phpFormGenerator and with phpGenie at other sites i mantain and never found the solution, so, all the problematic files and directories remain at that servers, i jUst read the solution and try the cleanup script, it seems to work but nothing happens and also the script dont show anything.It is very strange, because in one of the servers with trouble i can chmod 777 the directory but i cant delete it after that.Best regards,
  22. First of all thanks everybody for your help, well, after a complete cleaning of my PC including my mouse of course, the problem is resolved 99% i think, because there still is a little issue when i move the mouse horizontally. I got this problem because i dont uninstalls the optical mouse in the correct way, i simply detach it.Hopefully the HDD, RAM and Mainbord are not the problem, i rolling back all the drivers and then i install the new ones from the genius website.The optical led is clean but this mouse is not the one with trouble, this mouse i installed a few weeks ago and when i do it it also installs some drivers and services. These services and drivers were left behind -as i say above- so i manually proceed to uninstalls and deletes these from my system because are part of the problem, after that the problem was solved in a 90%. I also check my task manager and everything is fine, there are the usual processes. The other 9% is related with the complete cleaning of my PC, i removed a lot of dust from my hardware.Also, i run a complete scanning with S&D with good results, no presence of troyans or spyware, only some cookies and logs were reported and cleared.The only things i dont do are to perform an online scan for virus and spyware, that i will do in a few moments.Best regards,
  23. Hi, i have a problem with my mouse -a genius netscroll ps/2-, it is very strange because whatever i do with my pc like downloading, use any software, listen to music, read mail, etc. it freezes for a very very short time, i'm not pretty sure but i guess that this problem is happening because a couple of weeks ago i install a mini optical wheel usb mouse to test it or maybe its because i have a problem with my hard disk.Best regards,
  24. Thanks, i just downloaded the delsrv command line tool and test it, and only to say that it works perfectly, the only problem with it is the html page that came with it, it's outdated and show wrong examples. Anyway, the important thing here is that it WORKS BTW, some time ago i downloaded a fine tool to get all the services installed in my pc, its name is serviwin, this tool not only shows the services, it also shows all the drivers you have installed, you find it at http://www.nirsoft.net/. Best regards,
  25. A few months ago i had the same problem and i found the solution in the forum of the Apache 2 on Windows - Apache Lounge Website, i dont remember exactly if it is by simply replace some files of php, but you dont loose anything visiting this site, that BTW is very useful. Check this topics for more info: Apache and PHP - A Fast, Reliable, and Proven Setup Apache 2.2.2 and PHP 5.1.4 Installation Issues and Questions Install Instructions Apache223, Php520, MySql5027 (update) And also, visit the Downloads area, i just check it and notice that there are some interesting things to download. Another issue is how you install and configure your php, i don't agree with the solution given by seec77 because according to the oficial PHP5 install notes that came with the php zip file, the recommended way to install it is to do a manual installation of PHP5, take a look: 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.