Jump to content
xisto Community

TavoxPeru

Members
  • Content Count

    865
  • Joined

  • Last visited

Posts posted by TavoxPeru


  1. First of all congrats, excellent topic, especially the one related with the variables variable. Now, i just test your code and it have an error because it doesnt shows the table with the submited data when you fill both fields, but dont worry its as simple as add an ! symbol :P.

    Simply change this line:

    if (empty($$name))
    with this one:
    if (!empty($$name))
    Best regards,

  2. You are correct both of them are good ftp programs, another free one is Fresh FTP, you can find it http://www.freshwebmaster.com/
    '>here.

    Fresh FTP (File Transfer Protocol) is a tool for webmaster to upload or download files (html, picture, web log, etc) from a remote server. It supports multithreading for simultaneous transfer, file and directory upload, resume, and more. This software is 100% free, no charge, no spyware.


    Best regards,

  3. To complete what seec77 says i recommend that you also http://dev.mysql.com/downloads/workbench/
    '>download the MySql Gui Tools.

     

    The MySql Gui Tools is a set of applications for administering MySQL Server and working with data, this includes in a single bundle all the GUI tools developed by MySql:

    MySQL Administrator: Tool for administer and monitor your MySql environment, database management and maintenance.

    MySQL QueryBrowser: Tool for working with your database data, such as creating, executing, and optimizing SQL queries.

    MySQL MigrationToolkit: Tool for migrate proprietary databases to MySQL.

    MySQL Workbench: Tool for database modeling, such design and create schemas.

    I'm not 100% sure that this bundle works with MySql versions prior to 5.

     

    Best regards,


  4. Hello Tavox,Thanx for the reply. A line in your reply ($query=mysql_query("select serialnumber, other_info from table_name order by serialnumber"); suggests that I want the serial numbering to come from the sql table. This is not so...I want the serial numbering to be exclusive of the sql table. A code done in PHP that will just loop through all the records echoed out. Further help needed pls. Thanx.

    Let me see if i understand correctly, what do you want is to show a serial number where begins at 1 and the last serial number is equal to the total number of rows of your table????? well if it is what you want, you almost get it with my previous code.

    Simply change the variable $Total to starts at 1 and echoes it in the loop, then after the loop and before the table footer substract 1 to the variable $Total to show the correct number of rows of your table.

    $Total=1; // query to the database, you must change it to work.$query=mysql_query("select serialnumber, other_info from table_name order by serialnumber");// loop to store the datawhile($row=mysql_fetch_array($query)) {	$data.=$StartRec;	$data.="S/N: " . $Total . " Data: " . $row["serialnumber"] . " " . $row["other_info"] . "\n";	$data.=$EndRec;	$Total++;}$Total--;

    Let me know if i'm correct, and change the variable names to whatever you want.

    Best regards,

  5. Thanks everybody for take the time to reply my post, i confirm that the use of frames is the problem. I test the solutions made by saint-michael and Quatrux and it works perfect when i set the target property to _top or _parent, and when it is set to _blank it works too but the new window remains open, never works when it is not set or when it is set to _self or the name of the frame.

     

    And with the code of saint-michael if the file is under a folder like foldername/filename.ext it works but the Save File dialog assumes that the name of the file to download is the name of the script without the extension.

     

    BTW, i dont try the solution of vujsa because i'm not an expert with htaccess files. :P

     

    Best regards,


  6. Hello there,
    I'm looking for some education. How would you show the serial numbering for outputted contents of mysql database. I used a table created in PHP to output content (i.e. an alumni database) and I created a column for S/N, so that at a glance anyone can tell how many members have registered. Thanks house.

    Neyoo

    Well if i understand correctly your post, try this:
    <?php// Extra variables$StartRec="<tr>\n<td width='100%'>\n";$EndRec="</td>\n</tr>\n";$End="</td>\n</tr>\n</table>\n";// Table Heading$data='<table width="100%" align="center" valign="top" border="1" cellspacing="0" cellpadding="0">' ."\n";$data.="<tr>\n";$data.='<td width="100%" style="text-align:center; font-weight:bold; padding:5px">'."\n";$data.="Your Table Title";$data.=$EndRec;// Total number of records in your table, is optional, use it if you want// this one can be calculated with the mysql_num_rows() function$Total=0; // query to the database, you must change it to work.$query=mysql_query("select serialnumber, other_info from table_name order by serialnumber");// loop to store the datawhile($row=mysql_fetch_array($query)) {	$data.=$StartRec;	$data.="Data: " . $row["serialnumber"] . " " . $row["other_info"] . "\n";	$data.=$EndRec;	$Total++;}// Table Footer$data.="<tr>\n";$data.='<td width="100%" style="text-align:left; font-weight:bold; padding:5px">'."\n";$data.="Total: " . $Total . " Records.\n";$data.=$End;// Show your table infoecho $data;?>
    As you see, it is very simple and also I don't include the code that connects to your database, and remember to modify the table name and the columns names that you want to show in your query, in this case, the $query variable.

    Best regards,

  7. try this:

    <a href="download.zip">Download File</a>
    as a link on the original page.
    That was the first thing i have, but since that don't work i try to force the download with the header function as mention in my previous post.

    I make another test using your suggestion and the link still dont work, so i make another test -yes another :P- but this time by adding the target property to the link and it works fine :P the file is downloaded. I dont know why it works but i guess that it is because the original html file is loaded in an iframe. So the solution is this:

    <a href="download.zip" target="_blank">Download File</a>
    Best regards,

  8. Hi, i have a problem with a zip file that i want to be force downloaded by any client, i know that with the header function it can be achieved but dont know why it doesnt works. I have two files, the first one is a simple html file with an a tag and the second is a php file, here is my code:
    html file:

    <body><a href="downpos.php">Download File</a></body>
    Php file:
    <?phpheader('Content-Type: application/zip');header('Content-Disposition: attachment; filename="file.zip"');readfile('downloads/file.zip'); ?>
    May be i forgot something, does it is necessary to include a call to the exit function as the last code????

    Best regards,

  9. So I started taking a tutorial on PHP DOMXML which is said to be part of the PHP Core. However, when I tried it out in Xisto server (I used the exact script and file so I know it should work) It didn't work...
    Is DOM XML part of the PHP Core of Xisto because I see it in the phpinfo().

    Must I enable something in the php.ini file?

    Yes it is part of the PHP Core as you see it in the phpinfo() result page, also you dont need to enable anything in the php.ini file.

    Now, this extension should no longer be used instead the official php site recommends to use the DOM extension, that is the replacement for the DOM XML extension from PHP 4.

    Best regards,

  10. Hi. I'm being automatically logout by Xisto. Been experiencing this now and also the last time I log in, which is like last week. Not a major serious problem, as in I can always log in back again. But it is kinda like a nuisance, so I would like to know whether it is just me or is there now a new policy in place in Xisto?

    Seems that it only happens to you, i dont have any trouble at all, check your cookies also.

    Best regards,

  11. :P That's EXACTLY what I meant! Thank you! Damn, I'm not clearly minded these days. It's so simple and even can't think of this! Hmm maybe I was thinking a bit too much the difficult way! :P
    Anyway thanks, if I need it I know how to :P ... Although those posts earlier from m^e and jlhaslip kinda discouraged me to do this. But I might be handy sometime!

    Bakr_2k5

    Yes it is so simple and efective and works perfect, but, it only works if your column id is not a foreign key in another table, but dont worry, if you have such case simply add another SQL statement that deletes the rows referenced:
    <?phpmysql_query("DELETE FROM news WHERE id=$n");mysql_query("DELETE FROM table_with_fk WHERE table_with_fk.id=$n");// $n = id to delete?>
    Also don't forget to complete the code to update all the rows with the foreign key column in the second table when id is not equal to $i.

    You can also use ALTER TABLE to reset the AUTO_INCREMENT value:
    <?phpmysql_query("ALTER TABLE news AUTO_INCREMENT=$n");// $n = row count plus 1?>
    Best regards,

  12. What browser are you using? I am sure the pop-up box works in Firefox and customizing it for other browsers will be sorted out later on.

    Basically I use IE 6 and Firefox 1.5x, when i view it with IE nothing happens as i said and right now i just view it with FF and works fine.

    When you say to overlap everything do you mean to overlap all the text that appears on your page, for example overlapping your sidebar???? May be you can use the z-index property to do that.

    Best regards,

  13. That 2 function TIME_TO_SEC/SEC_TO_TIME is actually very useful for calculating interval. Divide by 60, then you get minute and so on. Really flexible, can get into anything you want to do with date/time
    I have both the 1st and 2nd edition of the Php Cookbook. The 1st targeting 3.x and 4.x while the 2nd targeting 5.x. Am i allowed to upload pirated/illegal item in this forum? I don't mind to upload. If i'm not allowed to, then i can email to you

    The posibilities that offers these functions are very helpul, i think that can be used in a lot of cases involving time and date calculations, such as adding or substracting date/time intervals, etc. and most important is that they are backward compatibility.

    I don't mind to upload either but we are not allowed to upload such things to the forum, so please email me or send me a PM.

    Best regards,

  14. I dont have any trouble, every thing works fine by my side, but something i notice is that next to the time showing the time of the last reboot of the server appears a new text, this is what cPanel shows:

    Last reboot 4:33, 4usersmin

    so, the last reboot of the server was made 4:33 hours ago, ok, but what means the text 4usersmin?????

    Best regards,

  15. Hi,
    I've found the way to do what i wanted in the first place.

    TIMEDIFF(t1, t2) can be replace with

    SEC_TO_TIME(TIME_TO_SEC(t2) - TIME_TO_SEC(t1))
    simple as that. Never thought of it that way

    Found that in O'Reilly: MySQL Cookbook. The O'Reilly's series is really good, very thoughtful and well suited problem/solution type of book for programmers.

    Just have to replace all occurrences of TIMEDIFF with the above. At least that solved part of my problem, now my code can run on MySQL older that 4.1.1. Will have to remember to stick to the lowest possible denominator all time, for portability.

    Hooray!!!!!
    Well first time i listen about this 2 mysql functions, that's because when i found a solution for something only sometimes i continue searching another solution :P

    And about the O'Reilly's Cookbook series i agree with you, there are really good, right now i'm reading the PHP Cookbook but i'm not sure which PHP version was used, i guess 4.x, could someone share an updated version of this book????

    Best regards,

  16. Thanks, that sure helps.

     

    Actually I was also looking for a way to do it in mysql itself, cause my query involve some recursive calculation on date/time. If it were to read the result then process by php, performance will be greatly reduce. Well, if there's no alternative, then that might have to be the only way out.

     

    Thanks again

     

    You are welcome, and if you want a way to do it in mysql well you can check the store procedures and functions -it works since version 5.0- or you can create your own functions using the UDF interface or also you can add functions as native (built in) mysql functions, this what i found at the mysql manual:

    You can add functions through the user-defined function (UDF) interface. User-defined functions are compiled as object files and then added to and removed from the server dynamically using the CREATE FUNCTION and DROP FUNCTION statements. See Section 24.2.2, “CREATE FUNCTION Syntax”.

    You can add functions as native (built-in) MySQL functions. Native functions are compiled into the mysqld server and become available on a permanent basis

    Best regards,


  17. Believe it, the search industry giants Google, MSN, and Yahoo works together to bring us a new SEO tool, sitemaps.org, this is a webmaster protocol that is attempting to introduce a web standard for these documents.

    You know it, sitemaps are simple XML documents that webmasters use on their sites, this documents simply tells search engines which pages on their sites are available for crawling, remember, this doesnt means that your sites are included in search engines but it can helps search engine web crawlers do a better job when crawling your website.

    For more information please visit: sitemaps.org

    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.