Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. Post your code.
  2. PHP has a perfectly good garbage collection mechanism, so unset() really isn't required.
  3. This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=305801.0
  4. What does you json look like?
  5. Some browser won't send that information. It's safe to use the hidden form or check for a field you know exists.
  6. Yeah, I vaguely remember that. Can't remember what it was though, but I remember it being a pretty big deal.
  7. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=305797.0
  8. You have no form element named 'submit'. <form id="myform" enctype="multipart/form-data" action="test.php" method="POST"> <input type="hidden" name="submit"> <input type="submit" value="Upload" /> </form>
  9. trq

    Leaving

    Were going to miss you obviously. You have made such a massive contribution around here and all). This is your first post besides your introduction and the one you are crying about being deleted. Anyone going to most any forum and making there very first post a blatant add for a personal project is bound to be suspected of spamming. Sure, your project might be interesting, thats not the point. We have rules. Now, had you been a long standing member or someone who had made some contribution to our community we may have cut you a little slack, maybe let your post slide, maybe even taken some notice downloading your project and then blogging about it on a front page. But no, you expect to take from our community (buy gaining free advertising) without any giving (I'm sure you may think that giving us a link to your wonderful project is giving, but its not. I'm sure if it where that groundbreaking a project we would have heard about it anyways.). Im afraid it just doesn't work like that.
  10. $_FILES['images']['type'] is NOT an array or an object. $_FILES['images'] is.
  11. You'll need to write a start-up script if one doesn't already exist. See actual examples within /etc/init.d. ps: This is no longer a php question (we have a Linux board).
  12. 1) Yes, even using something like mysqli you should probably build your own wrapper around it based on a concrete interface. You actually design the interface first, and then make your actual database class implement that interface. Another of php's built in database objects (PDO) is something that you should look at. It actually provides all this for you. It can connect to multiple database types and provides the same interface to all of them. In this case, you don't really need to write your own interface. Of course to keep to your own class naming convention you might like to make a wrapper that simply extends the PDO object. 2) Yes its proper to have classes for specific functionality. You need to think carefully about what fits where however. A User for instance would simply be used to describe a User of your application. It might simply store infomation about the user. Logging in and out is likely the job of an authentication object or similar. I guess, this is the hardest part, deciding what goes where. Keep this in mind though. Classes should be as specific as possible. If you find yourself putting too much into one class, its likely it needs to be broken down into more. 3) Its generally fine to have client code programmed procedurally. Though after a while, you may find yourself with such a robust framework that even client logic ends up in classes. Don't try and force things into a class just for the hell of it though, you'll know what I mean (in the previous sentence) when you get there.
  13. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=305781.0
  14. I don't think you read my previous reply.
  15. Looks like this other machine may have IIS installed. it needs to be either removed or switched off..
  16. The error is pretty self explanatory. each expects an array or object, none of the arguments you are supplying are. Try passing just: $_FILES['images'] ps: Notice also that indexes are strings and string need to be surrounded by quotes.
  17. Or simply... echo implode(' ', $_SESSION['words']);
  18. Every time you hit submit you make a new request. data does not persist over multiple requests. A few ways you can do it. The easiest being to use the $_SESSION array, this does persist. At the VERY top of your file place this.... <?php session_start(); ?> Then.... <?php // save the word from the form into a new spot within the session array $_SESSION[] = $word; // make the contents of the $_SESSION array into a string and echo it. echo implode(" ", $_SESSION); ?>
  19. You generate the divs as you output your data from the database. Really not sure where you are stuck.
  20. Well, firstly. Associative array indexes are strings. Strings need quotes in php. $name = $_POST['name']; $group = $_POST['group']; $age = $_POST['age']; $usernameid = $_SESSION['id']; You should then wrap all your code in an if statement that checks that the form submission was successful. if (isset($_POST['submit'])) { // rest of code } else { echo "No form data sent"; } Make sure you have a hidden field within your form named "submit"
  21. if ($num == 0) { $sql = "INSERT INTO avatars (id, usernameid, name, group, age, xp) VALUES ('', '$usernameid', '$name', '$group', '$age', '0')"; if (mysql_query($sql) { header( 'Location: me/' ); } else { trigger_error(mysql_error() . "<br />$sql"); } } else { echo 'Sorry, please pick a new name'; } Any output?
  22. svn, its comes standard with subversion.
  23. Where are $username, $password', $email, $dob & $realname defined?
  24. Assuming there all in /etc/apache/vhosts (which they may not be). let x=$(ls -l /etc/apache/vhosts | wc -l)-1 ; echo $x This can be executed through php via exec.
  25. You simply don't need notification. The data is already there. Say I'm user 13, and Ive commented on article 44. I now go and view article 44 and see a list of all users who have also commented on article 44..... How do you get this list? SELECT user_id from tbl WHERE post_id = 44 and user_id != 13
×
×
  • 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.