Jump to content

Spring

Members
  • Posts

    224
  • Joined

  • Last visited

Everything posted by Spring

  1. I get an error saying call to undefined function. Shouldn't move_uploaded_file() work? (I know I didn't set the size and etc, it's just a practice test) Also, my host's php version is 4.4.9 could that be a problem? <?php session_start(); include "functions.php"; include "database.php"; if(($_POST['upload'])){ $uploadname = $_FILES['avatar']['name']; $tmp_name = $_FILES['avatar']['tmp_name']; if($uploadname){ echo "..."; } else{ die("Please select a file numb nuts!"); } if($uploadname) { $location = "avatars/$name"; move_uploaded_file($tmp_name,"$location"); $query = mysql_query("UPDATE narutorpg SET imagelocation = '$location' WHERE username = '$name'"); $die("Your avatar is uploaded. <a href = 'character.php'> home </a>"); } } echo " <form action = '' method = 'POST' enctype = 'multipart/form-data'> File:<input type = 'file' name = 'avatar'> <input type = 'submit' name = 'upload' Value = 'upload'> </form>"; ?>
  2. "I spent 27 hours on this" Haha.
  3. You should start using <br /> instead of <BR> <BR> is old HTML which is dieing.
  4. Yeah i know. I'll inevitable have to use the database to store the timestamp, but this is a temporary fix until tomorrow.
  5. session_set_cookie_params() worked for me.
  6. I fixed mine by using sessions. session_start(); session_set_cookie_params(84600); if(isset($_POST['submit'])){ $_SESSION['clicked'] = 1; } You should know what to do from here. (:
  7. I fixed by using sessions like suggested, thanks for everyones support.
  8. Still looking for a simpler soultion, this should be possible without having to use the database, how would I check it with sessions? anyone know?
  9. Just 24 hours time. All I want is a 24 hours between clicks on the submit button for each person.
  10. I'm not sure how that would, that's why I wanted an example, how do I use the php time function to check if they clicked within 24 hours?
  11. I have the same question, but I was pretty sure you could some how use a php time function to do this..or maybe javascript? Is going through all that trouble the only way?
  12. Is there a way to use PHP time to only allow a user to press a button in a form (for example a submit button) once a day? If so, could I get an example? Thanks.
  13. mysql_query($insertAdminInfoQuery) or die("ERROR: " .mysql_error()) Forgot a semicolon, though I didn't even really read the whole script, just followed the error. needs to be mysql_query($insertAdminInfoQuery) or die("ERROR: " .mysql_error());
  14. This worked perfectly, thanks a lot.
  15. Hi, I have a field called experience in mysql and I want to add +7 to said field, is it possible using UPDATE or insert? If so, what's the syntax? Here's what I have that doesn't work, it sets experience to 7, but won't add another 7 when clicked again. if(isset($_POST['submit'])){ $query = "UPDATE account_info SET experience = +7 WHERE username = $name"; $result = mysql_query($query) or die(mysql_error()); } don't ask for the whole script, because you won't need it to answer that o.0
  16. Everything is working great now! I figured out what happen! Thanks!
  17. Edit: got this: sql: SELECT * FROM account_info WHERE username = "tony" result: Resource id #3 after mysql_fetch_array 0
  18. <?php include "database.php"; session_start(); $name = $_session['outname']; function output_wins($name){ $sql = "SELECT * FROM account_info WHERE username = '$name'"; $result = mysql_query($sql) or die(mysql_error()); $wins = mysql_fetch_array($result); return $wins['win']; } ?>
  19. I did and this is the error: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
  20. Ah, here's the error: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
  21. Ehh, it seems to work but it's not outputting anything. It's blank.
  22. $sql = 'SELECT * FROM account_info WHERE username ="'.$name.'"'; $result = mysql_query($sql) . mysql_error(); $row = mysql_fetch_row($result); I get Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource I'm trying to output the row "wins" for a certain user.
  23. How do I got about outputing one row that can only hold one value? Any reason why the function below doesn't work? <?php include "database.php"; session_start(); $name = $_session['outname']; function output_wins(){ $sql = 'SELECT * FROM account_info WHERE username ="' . $name .'"'; $result = mysql_query($sql); $wins = mysql_fetch_array($result); echo $wins['win']; } output_wins(); ?> Is there an easier way I can output this one row?
  24. Respect my authority. Jokes. Please don't hurt me. I'd like to give thanks to all of the people who have helped me recently on the problems I have been having with PHP. Sometimes, when I get a question answered, I'll be so excited to try out the solution myself, I forget to give thanks to that person who spent time out of his/her day to help me. I think the website is great and hope that it will be here for the long run. I would have probably given up no php without this site, hell, I predict that soon half of this websites posts will belong to me asking for help.
  25. I fixed by doing this. body{ width: 800px; height: 600px; }
×
×
  • 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.