Jump to content

matthew9090

Members
  • Posts

    135
  • Joined

  • Last visited

    Never

Everything posted by matthew9090

  1. Thanks for your feedback, i will add more features over time, this is just the starting point really.
  2. It's simple, you cannot have a check outside the parenthasis while ($row = mysql_fetch_assoc($result) !== false){ $users[] = $row; }
  3. You should put the functions in a new php file and include at the top of every page you need them in. This way is more efficient as you save space.
  4. The sites not made in flash, the games are.
  5. Try checking that your form has the right submitting method (GET/POST).
  6. What are we meant to do with that? Tell us what errors you get and what happens when you run the script.
  7. My new website 'Massive Games' is now almost finished. Please can you tell me what you think of the design and what it looks like in the different screen resolutions. Also do your best to hack it Url: http://massivegames.co.uk
  8. I could do with some advice because i am thinking of game programming. I already know php, html, javascript but they aren't for games. But i'm thinking of either c, c#, c++ or lua and maybe java. Does anyone know which one is best? I know java can be slow and lua is not normally for the actual game code .I'm thinking c++. Also i could do with some books as well which will be good if it covers graphics and how to use graphic libraries. I'm only 13 but i would like to start learning now.
  9. but now if i do <?php while (($files = readdir($dir2)) !== false) { if (is_dir($files)) { if ($files != "." && $files != "..") { echo $files . "<br />"; } } elseif (is_file($files)) { echo $files . "<br />"; } } ?> then it only comes up with 1 directory and 1 file, but last time it came up with everything
  10. how would you display folders on top of files part of my code: while (($file = readdir($dir)) !== false) { if (!strstr($file, ".")) //get folders { echo "<a href='index.php?dir=$dir/$file'>" . $file . "</a><br />"; } if ($file!="." && $file!=".." && strstr($file, ".")) { echo $file . "<br />"; }
  11. lets say i have this string: dir/dir/dir/dir/dir how would i remove everything after the last '/' sign so it outputs this: dir/dir/dir/dir (and removes the '/' symbol aswell) <?php //something like this $str = "dir/dir/dir"; $replace = //do something echo $replace; ?> EDIT: i found the solution <?php $str = "dir/dir/dir"; $replace = dirname($str); ?>
  12. search on google for php tutorials. like w3schools or tizag
  13. go into phpmyadmin or whatever you use and see what the database name is then do this: mysql_connect("hostname", "user", "pass") or die("could not connect"); mysql_select_db("database_name") or die("could not connect to the database"); if your using a local server the connect normally looks like this: mysql_connect("localhost", "root", "");
  14. just do something like this: <html> <head> <script type="text/javascript"> //ajax function function ajaxFunction() { } </script> </head> <body onload="ajaxFunction()"> </body> </html>
  15. i thought you could store the buisiness days in the database and use pagination to display the next lot of them
  16. does it diplay and errors? and does it output anything?
  17. there is a tutorial: part 1 part 2 part 3
  18. thanks for the replies but i fixed it now. i just change title to a different function name.
  19. i've got this javascript code <script type="text/javascript"> function show(str) { document.getElementById('div').innerHTML=str; } </script> and html code: <a href='http://link.com' onMouseOver="show('text')">text</a> <div id="div"> </div> i'm using the google chrome browser and it doesn't come up with anything. when i go to the inspect element on chrome it comes up with: index.php:103Uncaught TypeError: string is not a function. What does it mean!
  20. does the text need to be in quotes <?php $fileHandler = fopen("someFile.txt", 'w') or die ("could not create file"); $text = "<<<END what the heck? this should work! _END"; fwrite($fileHandler, $text) or die ("could not write to file"); fclose($fileHandler); echo "File 'someFile.txt' written successfully"; ?>
  21. lol. i want a manision and all the money in the world foreach($human as $matthew) { $matthew->give->alltheremoney; } $matthew->mansion;
  22. use google first!!!!!!! i just typed in php online quiz and look what i found p.s. i wants never gets p.s.s. make your question more obvious. are you looking for a test on php and mysql or how to code a php and mysql script
  23. this might work which i quickly wrote: <?php $chars = "123456789"; //numbers 1-9 and copy as many times as you want for dublicate numbers $chars .= "123456789"; $chars .= "123456789"; $chars .= "123456789"; $chars .= "123456789"; $chars .= "123456789"; $chars .= "123456789"; $chars .= "123456789"; $chars .= "123456789"; $chars = str_shuffle($chars); $chars = substr($chars, 0, ; //connect here mysql_connect("host", "user", "pass"); mysql_select_db("db"); $sql = mysql_query("SELECT * FROM table WHERE number='$chars'"); //change the table name to fit your db if (mysql_num_rows($sql)>0) { header("Location: this_page.php"); } else { //insert } ?>
  24. i looked at the page but when you select of the other schools it doen't go away. so you would use that jquery script again to check if it not selected.
×
×
  • Create New...

Important Information

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.