Jump to content

DEVILofDARKNESS

Members
  • Posts

    502
  • Joined

  • Last visited

    Never

Everything posted by DEVILofDARKNESS

  1. In my browser everything looks fine; but in case you want to be sure, you will need to use css (maybe you already are) w3schools overflow
  2. try to declare the session_cache_limiter before declaring session_start() P.S.: use php/code tags
  3. First: Please use [ php ] or [ code ] tags. Second: If the balance.php includes a function todo the sql query, you can simply call the function and pass the variable to it do_query($memberid); Although I don't know from where the $memberid is comming..
  4. I have a couple of remarks: 1. If you insert a invalid username you get a not that beautifull looking page 2. You show weither the username or the password is wrong, hackers can make easy use of this. You should always show: Incorrect username or password 3. There is nowhere an introduction page that gives you info about the game. A user will not sign up quickly if he does not know what the game is about
  5. Okay but I don't really think it is good to compare php with python and ruby cause the last 2 are not web-based programming languages but system-based ? But my main thread is actually what you think about rails and django..
  6. What do you guys think about ROR and Django? And are they better (in some points) then php?
  7. Can you give the full error please? Is the for loop meant to be in the TKAutomaton Class? If so then it isn't indented right.
  8. If you expect that 2.47 billion people will visit your site: No you could make this int shorter but it will not affect the speed that much I think And just because I'm curious: What will idle do?
  9. You will have todo a query like: $query = "SELECT * FROM messages WHERE userid='$userid'"; $res = mysql_query($query); while($arr = mysql_fetch_array($res)){ print $arr['title'] . "\n"; } <= will give you a list with all message titles is this what you meant?
  10. I have this table(building_lvl): lvl | building_id | region_id And I want to get the region_id for which building_id=3 has lvl 2 and building_id=2 has lvl 5 Help with Code Tags PHP Syntax (Toggle Plain Text) SELECT * FROM building_lvl INNER JOIN regions ON regions.region_id = building_lvl.region_id WHERE ((building_lvl.building_id='3') && (building_lvl.lvl > 1)) && ((building_lvl.building_id='2') && (building_lvl.lvl > 4)) && (regions.nation_id = '17'); but this gives an empty set, why? (and I'm sure there is a region_id which has this conditions)
  11. some use $_SESSION, some use $_COOKIE (I use $_SESSION) session_start() //has to be the first line of your php code if you need sessions $_SESSION['example'] = 'this is an example'; // asigns the string to a session print $_SESSION['example']; // prints This is an example $example = $_SESSION['example']; //asigns the value of the session to a variable
  12. Woohoow I solved it with: self.location="functions.php?func=updateart";
  13. I don't want to go the ajax way because I don't know anything of it, so here a last try: function countdown() { num--; document.getElementById('countdown_ele').innerHTML = num; if(num < 1){ clearTimeout(timer); self.location="functions.php?func=updateart"; } } if($_GET['func']=='updateart'){ session_start(); require './checkuserid.php'; $qry = "SELECT * FROM countdown WHERE (nation_id='$nationid') && (weapbuild='weap')"; $res = mysql_query($qry); $ass = mysql_fetch_assoc($res); $qury = "SELECT ammount FROM region_weapons WHERE (weapon_id='" . $ass['wb_id'] . "') && (region_id='" . $ass['region_id'] . "')"; $resu = mysql_query($qury); if(mysql_num_rows($resu) > 0){ $query2 = "UPDATE region_weapons SET ammount = 'ammount + " . $ass['extra'] . "' WHERE (weapon_id='" . $ass['wb_id'] . "') && (region_id='" . $ass['region_id'] . "')"; $res = mysql_query($query2); }else{ $query3 = "INSERT INTO region_weapons('region_id','weapon_id','ammount') VALUES ('" . $ass['region_id'] . "','" . $ass['wb_id'] . "','" . $ass['extra'] . "')"; $res = mysql_query($query3); } $query4 = "DELETE FROM countdown WHERE (wb_id='" . $ass['wb_id'] . "') && (region_id='" . $ass['region_id'] . "')"; $result = mysql_query($query4); header('location:./nationoverview.php'); } The php is loaded when the timer reaches zero and the script returns to nationoverview because of the header on the last line. No is there one problem, none of the query's is done:f
  14. I found out, that firebug actually gave me an error: the two brackets: () are not in the javascript but were shown in red by firebug, I can though open functions.php?func=updateart manually... document.getElementById('countdown_ele').innerHTML = 'FINISHED'; var head = document.getElementsByTagName('head').item(0); var script = document.createElement('script'); script.setAttribute( 'type', 'text/javascript' ); script.setAttribute( 'src', './functions.php?func=updateart' ); head.insertBefore( script, head.firstChild ); So what is the problem?
  15. Okay I solved it without any ajax I did with javascript: document.getElementById('countdown_ele').innerHTML = 'FINISHED'; var head = document.getElementsByTagName('head').item(0); var script = document.createElement('script'); script.setAttribute( 'type', 'text/javascript' ); script.setAttribute( 'src', './functions.php?func=updateart' ); head.insertBefore( script, head.firstChild ); I know it calls the functions.php,(saw it in firebug) but somehow it just does the delete query and not the insert or update queries :f what have I done wrong? if($_GET['func']=='updateart'){ $qry = "SELECT * FROM countdown WHERE (nation_id='$nationid') && (weapbuild='weap')"; $res = mysql_query($qry); $ass = mysql_fetch_assoc($res); $qury = "SELECT ammount FROM region_weapons WHERE (weapon_id='" . $ass['wb_id'] . "') && (region_id='" . $ass['region_id'] . "')"; $resu = mysql_query($qury); if(mysql_num_rows($resu) > 0){ $query2 = "UPDATE region_weapons SET ammount = 'ammount + " . $ass['extra'] . "' WHERE (weapon_id='" . $ass['wb_id'] . "') && (region_id='" . $ass['region_id'] . "')"; $res = mysql_query($query2); }else{ $query3 = "INSERT INTO region_weapons('region_id','weapon_id','ammount') VALUES ('" . $ass['region_id'] . "','" . $ass['wb_id'] . "','" . $ass['extra'] . "')"; $res = mysql_query($query3); } $query4 = "DELETE FROM countdown WHERE (wb_id='" . $ass['wb_id'] . "') && (region_id='" . $ass['region_id'] . "')"; $result = mysql_query($query4); }
  16. Okay I have this piece of code: <script type="text/javascript"> num = <?= $ned; ?> var timer; function countdown() { num--; document.getElementById('countdown_ele').innerHTML = num; if(num < 1){ clearTimeout(timer); document.getElementById('countdown_ele').innerHTML = 'FINISHED'; <?= update(); ?> } } function init() { document.getElementById('countdown_ele').innerHTML = num; timer = setInterval("countdown()",1000); } </script> The js accepts the $ned that is given by php, but does not start the function update(); Is this because js can only accept vars/strings/... from php but not execute a function.? Or is there an other way that I can solve this? P.S.: this is a piece of a php script.
  17. For the deleting: You should add a button on which people can click and if they click you just have to send the post_id with $_POST. THen you need to do a query which deletes the actual post. $query = "DELETE FROM messages WHERE post_id = '$postid'" $result = mysql_query($query)
  18. Another topic about good mysql tutorials
  19. mysql_query() if(mysql_num_rows() > 0){ mysql_fetch() }else{ // Else } In that order you should do it..
  20. first script: //$serial is the output of the form $query = "SELECT serial_id FROM serials WHERE serial_key = '$serial'" $result = mysql_query($query) if(num_rows($result)<0){ echo "WRONG!" }else{ //actions if you typ the right serial } second script: Use the mail function
  21. Yes I know, the speed has changed by accident, so i wil fix that.
  22. Yes the title used to repeatly showing Nuclear Invasion, like kind of effect, and I made a hover on the content so you could see what is behind, but maybe that's just a stupid effect which doesnt belong there.
  23. There is no users or extra at all. Are you sure you look at the test directory: http://www.ninv.be/test/indexx.php
  24. And what about the background picture I changed it too now?
×
×
  • 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.