Jump to content

Alex

Staff Alumni
  • Posts

    2,467
  • Joined

  • Last visited

Everything posted by Alex

  1. Your directory structure is like this, correct? include connection.php content file1.php If so to access connection.php the correct path would be ../include/connection.php
  2. You should check out some basic mysql tutorials. Take a look at http://www.phpfreaks.com/tutorial/php-basic-database-handling
  3. require '../include/connection.php'; - ../ is used to go up a level in a directory structure.
  4. mysql_query returns false on failure. You're also using a lot of unnecessary single quotes. $result = mysql_query("INSERT INTO memtable (name, password) VALUES('$username1','$password1')"); if(!$result) { echo "There was an error!: " . mysql_error(); }
  5. foreach(scandir($dir) as $folderItem) { if(is_dir($folderItem) && substr($folderItem, 0, 1) == '_') continue; // First character in the folder name is _, so skip to the next iteration of the loop } is_dir substr You were using substr() wrong, the way that you were using it would return everything but the first character, see the manual for more information.
  6. If you want to allow both lower and uppercase you can use the i modifier to enable case insensitivity. $newgroupname = preg_replace('/[^a-z0-9]/i', '', $groupname);
  7. Well the parse error is probably because you're missing a ; at the end of this line: $comp = $_GET['comp'] To check if a variable is set you should use isset Ex: if(isset($_GET['comp'])) { // .. } else { // .. }
  8. Do you only want the color to be a word like 'red', 'green', etc? If so you can use use \+)\](.+)\[\/color\]
  9. Alex

    WHICH?

    Frameworks have their purpose, but personally I don't like them so much. They include a lot of stuff that you'll never use, and I don't like how you need to use a framework for at least a few months to actually be proficient in it. I've tried several frameworks, but I like using and developing my own minimalistic framework. You might argue that I'm reinventing the wheel, but I highly prefer spending the small amount of time reinventing to my specifications and understanding all the ins and outs of it instantaneously rather than having to study something unfamiliar for months. With frameworks you'll always have complaints, which is really why I decided to create my own.
  10. Check the manual, isset. Simply put it allows you to check if a variable is..well set without throwing a notice if it isn't.
  11. isset Example: if(isset($_POST['myHiddenField'])) { // ... }
  12. The only thing I could think of is if you have an array in the $_POST superglobal, then you'll get that error message. Like if you have a form with something like this: <input type="text" name="var[]" /> <input type="text" name="var[]" /> Where $_POST['var'] would be an array and would throw E_NOTICE Array to string conversion when you try to run it through stripslashes()
  13. We really can't offer much help without seeing code. Most likely it's some kind of uncaught exception that is caused by a bot being able to access some file in a way that you would not normally have anticipated.
  14. That's HTML/CSS, not PHP. Example: echo "<span style='color: red;'>Red Text!</span>";
  15. By the way, there's a topic solved feature, you can mark your topic as solved with the button at the bottom left of the page.
  16. What in that code do you think is clashing?
  17. Something like this should do (Just make sure you replace the table name with your own): $result = mysql_query("SELECT option_name, option_value FROM table"); while($row = mysql_fetch_assoc($result)) { $config[$row['option_name']] = $row['option_value']; } You can then access your configuration details in the associative array $config like such: $config['site_title'], $config['site_slogan'], etc..
  18. Change $Name = $col[0]; to $Name = $col[$i];
  19. Yea, those two lines aren't supposed to be there. When I posted the query before that's all that was supposed to be in it, you can completely remove those lines. (Again) Based on that screenshot all I see is 1 record with the Name 'Eric_Wright', and do you even have a column named 'Linked'? I can't tell from the screenshot.
  20. Based on that screenshot it doesn't look like you have a record with the Name 'PN', so of course no records will be updated.
  21. A record is just a row in the database, you do have rows already inserted, right?
  22. Are you sure the column names in the query are correct (they are case sensitive), and that there is actually a record with the Name 'PN'?
  23. You're also not using the correct syntax for updating (I edited my last post already).
  24. You're missing a $ for the variable $sql on this line: mysql_query(sql); You're also using wrong syntax for updating a database. Try: $sql = "UPDATE players SET Linked='1' WHERE Name='PN'";
×
×
  • 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.