Jump to content

markvaughn2006

Members
  • Posts

    108
  • Joined

  • Last visited

Everything posted by markvaughn2006

  1. thats good to know! but thats not what is causing this error, i tried different columns also, this is the error... Duplicate entry '0' for key 1
  2. I know this has to be easy, but I am having trouble figuring out how to make this insert into the next empty row... The primary key is a not null auto increment integer, so I don't want to have to enter the value for that. mysql_query("INSERT INTO events (type, from, to) VALUES('sale', '$you', '$me' ) ") any help?? Thanks!
  3. I'm not asking for actual code just a point in the right direction and to see if this is even possible... Is there a way to refresh an iframe for user A and B if user C updates a particular field in a DB?? Thanks for any help with the mystical dark art of AJAX
  4. is there any validity to not putting php files in a web accessible directory?? How would someone be able to download php files? I thought it converted to html before they could get a hold of it...thanks again
  5. I know this is a dumb question I just need to make sure about this... I keep reading that you should never put "sensitive" php files or pages in your root directory. I'm a little unclear of what that means, I have Godaddy, so the root directory is /html or something like that. So if I put my php files in /html/another_folder is that still in my root directory?? Thanks for any info!!
  6. would this also work? $var = "<a href='$link'>$title</a>"; echo $var;
  7. Is there a way to echo a variable in a way that it can also be a link?? Thanks!
  8. Is there a way to set a maximum number in a field that is an integer?? example - Field name is Energy, every 15 minutes 1 is added to Energy until 100 is reached. Thanks for any help!!
  9. and basically the problem I'm having now is... $result = mysql_query("SELECT * FROM users_tbl WHERE location='Burger Queen'") or die(mysql_error()); $row = mysql_fetch_array( $result);} while ($row = mysql_fetch_array($result)) { echo '<form target="actions" method="post" action="attack.php"><input type="submit" value="Attack" />'.$row['user_name']." - ".$row['location_message'].'<input type="hidden" name="attackee" value="'.$row['user_name'].'" /></form>'; //Supposed to list everyone that has the location "Burger Queen" and it worked fine last night now today it is only showing 3 people that have that location instead of the 5 that I see have that location in the DB... It just seems like there is some kind of inconsistent errors happening. Also I can only log in with 2 of the 5 user names for some reason, there is nothing different about them, this is the error I'm getting You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE user_name='Bob'' at line 1 Once again, this all worked fine yesterday thats why I was wondering if my shared Godaddy hosting might be causing some random problems or if there was some little quirk like editing the php.ini file to make it not be so flaky or something...
  10. hence the term "general question" chill out! it's all cool!!
  11. This is a general question, has this happened to any of you and how did you fix it?? Last night I programmed a crapload of php, and everything I did worked flawlessly, tonight I feel like I'm going backwards, stuff that worked last night is now returning errors and once I fix one thing, another thing breaks. Does having godaddy shared hosting have anything to do with this?? Is it just a misplaced } or ' somewhere throwing everything off??? Thanks for any help, i feel like I'm going insane!
  12. i hope thats true, i don't really know either though
  13. do you have to put the exit statement on every single php page? and where would it go, first thing on the page or after the session start?? Thanks!
  14. Just curious as to how secure this is... <?php session_start(); if(!$_SESSION['islogged'] ){ header('Location:login_index.php');}?> <?php Is there an easy way a to prevent a fake session or cookie from being created and sent to the server?? Thanks, this board rocks!
  15. cool thanks guys!! i didn't realize the difference between = and == really either, now i know
  16. Think this would work for my game? (Guy gets attacked and sent to hospital for 5 minutes) <?php $time=time(); //Setting variable to current time plus 5 minutes $timeinhospital == $time+ 300; //update db $result = mysql_query("UPDATE example SET time='$timeinhospital'") or die(mysql_error()); ?> <?php if ( $timeinhospital < $time ) { echo "Ok you are healed or whatever Leave the hospital now!<br />"; } else { echo "You are still in hospital" } ?>
  17. Can you do the following with the sleep function?? And it "sleeps" for 5 minutes, what happens if they go to another page before the 5 minutes? will it still do the UPDATE? Thanks guys!! <?php echo "You were attacked and lost!" //sleep for 5 minutes sleep(300); $result = mysql_query("UPDATE example SET injured='0' WHERE injured='1'") or die(mysql_error()); ?>
  18. Is there a way to make an iframe source conditional? Something like..(I know the syntax isn't exactly correct but you get the idea) If $condition == "Example" { iframe src ="example.php" } Else { iframe src ="different.php" } Thanks!!
  19. didn't work...can you help me with that line of logic though.. the header('Location: Hospital.php'); line. I would love for it to be that easy, it totally ignored that line, is there another way of acheiving this?? thanks!
  20. God I hope that works!...i'll let you know the result
  21. i basically tried exactly that Mike, but i guess i really need to the reload the page and send it hospital.php, is there a way to do that without that crazy ajax stuff?? thanks for helping
×
×
  • 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.