Jump to content
xisto Community

TavoxPeru

Members
  • Content Count

    865
  • Joined

  • Last visited

Posts posted by TavoxPeru


  1. I have successfully setup a MySQL Database with a few tables in it to store user input! ;);) Woohoo!
    Now the problem is displaying the data. I want 4 boxes echoing across with 3 rows down so that makes 12 boxes (12 of the most recent records). I have no clue how to do this because I cannot use the W3Schools example of echoing into a table. Here is the code I used but it echoes the same information across the entire row of 4 boxes.

    <?php$con = mysql_connect("localhost","myDatabase name","myDatabase password");if (!$con)  {  die('Could not connect: ' . mysql_error());  }mysql_select_db("myTable", $con);$result = mysql_query("SELECT * FROM myField1 ORDER BY myField2 DESC");echo "<table summary='myTable summary'>";while($row = mysql_fetch_array($result))  {	echo "<tr>";  echo "<td style='width:25%'>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'] . "</td>";  echo "<td style='width:25%'>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'] . "</td>";	echo "<td style='width:25%'>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'] . "</td>";  echo "<td style='width:25%'>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'] . "</td>";	echo "</tr>";  }echo "</table>";mysql_close($con);?>
    *Field/database information was edited out to protect privacy.

    As you can see, it tells the database to echo one full row of the same info, then loop through the whole thing as many times as there are records. First of all, I only want a total of 12 records being echoed. Second of all, I want the 4x3 boxes layout.

    Could someone please give me some modifications to the code I am using right now? I tried using <div>s also, didn't work.
    I'm designing this site for a major section for a game site.
    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,

  2. Well, I want to learn to code in JavaScript, but when I try to view the page in Firefox, it dosen't work. Can anyone tell me why its not working? Do i need to use a different browser?

    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,

  3. At http://www.3buckaudio.com/ we have added an audio greeting using a different way than we have done in the past.
    I'm wondering it you can visit the site and let me know about the loading time.

    There's no pause/stop buttons yet as we are experimenting with it. But it's only a 60 second greeting.

    Can you let me know if it starts to PLAY immediately when you click the button?

    Kindest thanks for your help!

    I just visit the site and only to say that every thing works fine, it starts inmediately when click the play button.

    Best regards,

  4. 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,

  5. 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,

  6. when making your frameset page (the index page that people goto to see all the frames on one page) you need to add ID's so that you can ID each frame

    <frameset rows="*,80" frameborder="no" border="0" framespacing="0">  <frame src="file:///C|/Program Files/Macromedia/Dreamweaver 8/Untitled-1" name="mainFrame" id="mainFrame" title="mainFrame" />  <frame src="file:///C|/Program Files/Macromedia/Dreamweaver 8/UntitledFrame-2" name="bottomFrame" scrolling="No" noresize="noresize" id="bottomFrame" title="bottomFrame" />
    i have named the mainFrame and bottomFrame in this example

    so the too snippets of code you are adding are

    id="mainFrame"
    and
    id="bottomFrame"

    then when you go to make your hyperlinks, make sure you add a target (the same as your ID before)

    <a href="http://google.com; target="bottomFrame">Link to Frame </a>

    good luck
    -jimmy
    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,

  7. 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,


  8. Hi all,

    Please help me!

    My site was working fine! ( http://www.funlokam.com/ )

    But now, its showing one error message as:

     

    Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/niranvv/public_html/fun/db/mysql4.php on line 48

     

    Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /home/niranvv/public_html/fun/db/mysql4.php on line 330

     

    Warning: mysql_errno(): supplied argument is not a valid MySQL-Link resource in /home/niranvv/public_html/fun/db/mysql4.php on line 331

    phpBB : Critical Error

     

    Could not connect to the database

     

    I didn't changed anything!! ;)

    Why I'm getting this error message!

    Im using phpBB Forum in my site! Whats wrong with the database??

     

    Please help!

     

    ;)

     

    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,


  9. The solution is easy, you need to make the & into & and for your situation I find it very easy to use htaccess files and I recommend to put that file into your account root dir, you need to change the php.ini settings, overdrive them. ;)

    #=====================================\# ARG SEPERATOR OUTPUT value (String) +#=====================================/php_value arg_separator.output "&"

    So this should work, if I understood correctly that the & is created by the server and I also recommend to program in a way, that to avoid the PHPSESSID in the GET. ;)

     

    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,


  10. 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,

  11. i solved that by using a filemanager i installed.. of course you need to make it secure.. the control panel file manager belongs to cpanel user, i guess.. and it cannot erase that rouge file.

    using a filemanager you have installed means that you are telling apache to clean itself up.. since it is apache that put it there.. it is also owned by apache.

    it worked on my side..

    ---

    this situation also occured in the paid hostings.. aside from the ftp rouge temp file when i get those random ftp timeouts.

    it is bother some but i think it is ok.. i already have a use for this "feature"

    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,

  12. I want to send sms to my users through my website ,is there any way to do it with php or any other sofware,what i want is to help my users get their private message alerts on their cell phones, is there anyway to do it without tieing up with the smm providers on the web ,like they tell to pay you few cents per sms ,is there anyway i can do it free, like cani become a provider just like them ,or make a way like, if a user agrees to pay for alerts ,than whenever an alert goes the amount gets deducted from the user's cell phone , i am a newbie ,so dont know much hoe things work in cellphones and web interface ,any help is appreciated
    ;)

    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,

  13. 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,

  14. 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,


  15. 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,


  16. 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,


  17. 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,


  18. Sorry the command above was for WinXP.

     

    If you use Win2K then you'll need delsrv.exe.

     

    You will then have to do:

    delsrv service_name

    To get the lists of services, I think SCLIST was the command, but again these may be in the Resource Kit, which you should get if you administrate the computer.

     

    Cheers,

     

    MC

     

    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,


  19. 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:

     

    Upgrading from a previous PHP version: Previous editions of the manual suggest moving various ini and DLL files into your SYSTEM (i.e. C:\WINDOWS) folder and while this simplifies the installation procedure it makes upgrading difficult. We advise you remove all of these files (like php.ini and PHP related DLLs from the Windows SYSTEM folder) before moving on with a new PHP installation. Be sure to backup these files as you might break the entire system. The old php.ini might be useful in setting up the new PHP as well. And as you'll soon learn, the preferred method for installing PHP is to keep all PHP related files in one directory and have this directory available to your systems PATH.

     

    Best regards,


  20. My site is just currently suspended and it says contact your billing/support of Xisto but i have seen the support and all i se is oyu have ICQ and i do not have ICQ can i talk through here in the forum?Also, maybe you can get a live chat system and talk through there.
    Maybe we can talk through email/MSN if you have it.

    Thanks

    -Lewis

    P.S if i cannot keep my current site can you delete it and ill make another different one.

    I just test my site and every thing is fine, do you have a free or a paid hosting plan??? if it is the first option well you must make some posts to increase your hosting credits, in the other case, i don't know how to help you.

    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.