Search results

  1. marshian

    Beginner help using FTP

    You should put the files in /www or /public_html (they're the same). Then you can access them from freebbt.x10hosting.com So if you create a file /public_html/test.php, it'll be visible at http://freebbt.x10hosting.com/test.php
  2. marshian

    fibonacci series and factorial

    #include <iostream> using namespace std; int main() { unsigned int factorial = 1; unsigned int number; cout << "Calculate the factorial of a number." << endl; cout << "Enter a positive integer." << endl; cin >> number; for(int i=1; i <= number; i++) { factorial *= i; } cout << "The...
  3. marshian

    pb with mysql_connect

    See http://be2.php.net/manual/en/function.mysql-connect.php : On your own machine you have a default user and no password, which works fine there. On x10hosting this is impossible and therefore you need to fill in the username and password to be able to connect to the mysql server.
  4. marshian

    Cron Job Problems

    If I remember correctly the syntax to run a php page as cron was something like "php -q /path/to/php/file.php"
  5. marshian

    Export Sql database with php

    Use queries with limit and offset to receive your data. Same works too for uploading large databases, if they are in the sql format.
  6. marshian

    Can i redirect pages automatically?

    Just use headers the way they're supposed to be used, before any other output. <?PHP header('Location: http://redirectpage.html') ?> Will work perfectly, if you make sure there is NO OUTPUT BEFORE THE HEADER. A newline character or space before the <?php does count as output too.
  7. marshian

    How to create Cookies by using PHP???

    $_COOKIE["name"] contains the data in a cookie with the name "name". This information is not available when the cookie has just been set. In other words, the page has to be reloaded for $_COOKIE to be updated.
  8. marshian

    Redirect.

    HTTP 301 Permanently Moved would be the right thing to use, it shouldn't confuse any well-written bot. Take a look at this page: http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=93633
  9. marshian

    Making a sub-domain for htaccess

    Subdomains aren't made using .htaccess , they're part of the httpd.conf if I'm not mistaking. You can set them up for your x10 in the control panel under Domains > Subdomains.
  10. marshian

    no directory exist

    It's done with .htaccess Add this to the .htaccess file in the directory you want to change: ErrorDocument 404 file.php You can replace 404 with other status codes and of course change file.php into the url for the error document.
  11. marshian

    Java

    You could, but it's much more mathematical to do it with logarithms ;)
  12. marshian

    Learning PHP

    * cough * No steal my ideas pl0x? (= Don't steal my ideas please.) http://forums.x10hosting.com/tutorials/66161-dynamic-images-php.html (Very) old post ^^
  13. marshian

    Learning PHP

    Fibonacci is too easy =/ Prime numbers are more of a challenge, because there's no way to determine whether a number is a prime number based on the previous number... The only way I can see to do that is brute force... But... numbers are boring, it's always the same ^^ It's much more...
  14. marshian

    Java

    proof=(a*100+b*10+c)%square; If I understand what you mean. It's only that easy because you're working with numbers between 0 and 9. Otherwise you should use logarithmic stuff to determine the length of the numbers etc.
  15. marshian

    Learning PHP

    Hey vigge, haven't seen you in a while... *cough* long while *cough* If you don't say what you already know in php it's quite hard for anyone to give you an idea of something to do. Just think of something you might be able to make (or maybe it's more fun if you think you won't be able to make...
  16. marshian

    Need help with php mail

    Most of what dickey writes is right, but he made a very important mistake: the headers have to be separated by \r\n, or nobody will ever know what you're trying to say... The code has to be: $to="user@server.com"; $subject="Mail Topic"; $message="The mail contents.... blah blah blah..."...
  17. marshian

    MySQL MASS insert

    Just read line by line, explode() it on " " and repeat until you reach the end of the file.
  18. marshian

    open source tools

    I'ld say Java, it's cross-platform, for almost every platform is a JRE. Open source doesn't have to do a lot with the language, compiled C++ isn't revertable to the source, but if you just put the source online, it's an open-source program. In Java you can actually decompile the program from...
  19. marshian

    [PHP]: Having a problem with fwrite()

    Just a syntax problem, you forgot to backslash the single quotes in the declaration of $fileData. Assuming all single quotes in the declaration were ment to be escaped, this is the code: <?php $forumName = $_POST['forumName']; if(!$forumName){ echo "fail"; }...
  20. marshian

    Header Output Errors

    headers have to be the first thing to be send! eg. <?php echo "a"; header("Content-type: text/html"); ?> = fail <?php header("Content-type: text/html"); echo "a"; ?> = good <?php header("Content-type: text/html"); echo "a"; ?> = fail (there's an enter before the <?php tag, which is also...
Top