Jump to content

lastkarrde

Members
  • Posts

    165
  • Joined

  • Last visited

    Never

Everything posted by lastkarrde

  1. All PHP frameworks server everything through index.php. Your code is going to get really messy if you have a call to multiple different PHP files (example.com/forum.php, example.com/user.php etc..). I advise you use a framework such as Kohana3 to code your web app. It will result in cleaner and easier to read code in the long run.
  2. Well it all depends on how you design your framework. That is one way to do it. My frameworks dispatch class accepts an instance of a Request object (holds information like $_GET, $_POST and the URI) and a list of URL routes. It then tries to match the URI to the routes, if a match is found it loads and calls the appropriate controller method (which returns an instance of a Response object). Finally it calls the output method on the instance of the Response object. Search github for php framework, look how other people have implemented theirs.
  3. I fail to see a use case where you would need to reload a class. Mayby think abit harder about what exactly your trying to achieve?
  4. Wamp is alot easier to use than XAMPP. You can enable/disable Apache mod_s and PHP extensions via the GUI menu. No need to edit the .ini file yourself.
  5. YQL (and/or Yahoo Pipes) sounds like a perfect choice for this. Let us know how you get on/your experiences with using it.
  6. A good start. You should rename your methods removing the val prefix from them. It's un-necessary and just makes you type more. You could also use filter_var to add some additional validators to your class (IP address, float, URL). You also have some errors: if(count($this->errors !=0)){ if(count($this->errors) !=0){ return $this-errors; return $this->errors;
  7. Thats a SQL error, so theres something wrong with your SQL.
  8. Alter your users table in the database, give it a column for avatar. Store the path to the specific users' avatar in that column.
  9. Sanitise your $_REQUEST inputs with mysql_real_escape_string(). $uname = mysql_real_escape_string($_REQUEST['uname']); $password = mysql_real_escape_string($_REQUEST['password']); Change your SQL query so it searches for WHERE uname='$uname' AND password='$password'
  10. Well for one your include(s) directory is spelled differently in those statements. require_once 'includes/config.php'; require_once '../include/config.php'; Can you show us the directory structure of the application? Knowing the location of the files relative to each other is important.
  11. <?php $id = $_REQUEST['id']; ?> ... <script language="JavaScript"> alert("The new section was added!"); location.href = "a_websiteData.php?id=<?php echo $id; ?>"; </script>
  12. Also, your code is not secure. It is vulnerable to SQL injections. Every time you assign a variable to the value of the $_POST array, wrap the post value in mysql_real_escape_string(). eg $capatcha = $_POST['capatcha']; to $captcha = mysql_real_escape_string($_POST['capatcha']);
  13. If your wanting to implement that because of security concerns, don't. Storing the information in a session is much more secure (as the user cannot edit it). The majority of auth systems work by storing the user id in a session. Your login page should check the username, password and captcha (which it does, I think). If that information matches a user in the database, then set a session of their user id. if(//captcha, username, password are all valid) { $_SESSION['user_id'] = //user id taken from database } $id = $_SESSION['user_id']; $q = mysql_query("SELECT * FROM admin WHERE user_id = '$user_id'"); //limit 1 etc.. //mysql_fetch_array on $q, you then have the current users' information
  14. $foo = 'bar'; ob_start(); include('tos.php'); $parsedFile = ob_get_contents(); ob_clean();
  15. Rather than just echo "Error", why not echo the MySQL error?? echo mysql_error($conns);
  16. Can you share your code? Cookies can be modified by the user whereas sessions cannot. Sessions are almost always more secure than cookies (depending on what your doing of course).
  17. Sounds like your not wanting help with something specific, rather you just want someone to write a script for you?
  18. I've had no problems. Mayby the issue is with your browser?
  19. You could always just change the field type to TEXT or something . It shouldn't affect phpBB (and its a simple switch back if it does).
  20. What field type is the data stored as in the database? - Could be VARCHAR(255)?
  21. echo out via http://php.net/manual/en/function.html-entity-decode.php
  22. I enjoy using Eclipse with PDT. Its a full featured IDE (has everything you want + more) and works exactly the same on Windows, Mac and Linux.
  23. Do what BlueSkyIS said. View (and copy and save) the HTML and CSS source of the page before and after registration. Then run each before and after through a diff program. Then you'll be able to see exactly what the difference was and whats causing the problem.
×
×
  • 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.