Jump to content

fugix

Members
  • Posts

    1,483
  • Joined

  • Last visited

Everything posted by fugix

  1. first, you need to escape the special characters $regex = '/title\=\"Ruler\: (.+?)\"><\/a>.*<\/td>/s'; Edit: as for matching new lines, i have edited the reg ex a little
  2. that's what i mean, if the he has sessions stored for lets say his login credentials the user will be logged out if his login is based off of sessions
  3. just re-read the OP, are you trying to actually use session_destroy() on the variable that holds your $_SESSION value? if so, that wont work...you will need to do something like <?php session_start(); session_destroy($_SESSION['id']); ?> where your index "id" would be whatever you named your session, also, if you wanted to destroy every session you have created you can use redixx method, however be careful, because it will destroy EVERY session that is initialized
  4. make sure you have session_start() at the top of the [age you are using to destroy your session..if you do, please show us your code
  5. firstly, where is you "act" index coming from in your $_GET['act'] declaration. The error states that it is not finding anything with a name of "act"
  6. do you actually have an issue with your code? my first impression was that this was an informative question only. If you are having an issue with something related to this subject, please post your code and we will be glad to help you
  7. can you show a bigger chunk of the code surrounding the second query, e.x where you actually execute the query and echo the results etc.. much appreciated
  8. if foo is not returning any data, either something is wrong with your class declaration or your class-method declaration/coding inside of the method
  9. nooo you are echoing the contents of the array that mysql_fetch_array() outputs. by using the constructor echo() you are converting the array into a string which will always output "Array" do what abra said in order to correctly output your array values
  10. basically the same thing i had wrote for you, glad you got it working though
  11. yes, but the majority of people on here dont bother opening attachments, so he has a better chance of getting his question answered if the script is directly on the thread.
  12. gizmola did a nice ob of explaining, just to simply give it a name, this is one of the two "object operators" along with ::
  13. would you mind posting the code to this thread please
  14. That's how you had time for your 9200 posts. You needed something to do while things were compiling haha, classic
  15. sidenote, I never encourage from validation using javascript, as the user can disable this in their browser settings, which in turn disables your form validation and can lead to unwanted results in your db. I encourage using PHP to validate forms.
  16. As you stated, it depends on how much information is being sent to the $_POST array, you would most likely get unwanted values that would need to be filtered out, causing more work, however this could be a feasible solution as well
  17. for this you would want to use a for loop $i = 0; for ($i = 0;$i < $_POST['num_variables']; $i++) { echo {$_POST['variable']}{$i}
  18. as further information, your script was not working because you were trying to address a string as an array. When using the array syntax on a string, it breaks down each character of a string as values...example $string = "Hello World"; echo $string[0];//outputs H echo $string[3];//outputs l etc. What was happening were there were times when your script would produce use the maximun strlen of your $characters var, so you would have 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY[61]; which would put your pointer one character after the full string, which cant be done, thus the error is triggered for invalid offset
  19. what is the exact error that you receive when using $charinfo="SELECT name from `user_stats` WHERE User='$sname'"; $char=mysql_result(mysql_query($charinfo),0) or die(mysql_error());
  20. try this approach instead mysql_connect("localhost", "username", "pass") or die(mysql_error()); mysql_select_db("database") or die (mysql_error()); $AddNewPlayer = $_POST["PHPnewPlayer"]; $AddNewScore = $_POST["PHPnewScore"]; $fetch = "SELECT * FROM highscores WHERE player = '$AddNewPlayer'"; $result = mysql_query($fetch) or die (mysql_error()); $num_rows = mysql_num_rows($result); if($num_rows > 0){ echo "Profile already in use"; } else{ if($AddNewPlayer == ''){ echo "Please enter a profile name"; } else { mysql_query("INSERT INTO highscores (player, score) VALUES('".$AddNewPlayer."', '".$AddNewScore."') ") or die (mysql_error()); echo "Profile Added -".$AddNewPlayer; } }
  21. links have absolutely nothing to do with file system paths, using $_SERVER['DOCUMENT_ROOT'] as PFM said should be sufficient
  22. where is the file that you are including your require_once() located?
  23. fugix

    Mysql MAX()

    what are the results that you are receiving now?
  24. bottom left hand of this page, its a grayish button
×
×
  • 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.