Jump to content

xtopolis

Members
  • Posts

    1,422
  • Joined

Everything posted by xtopolis

  1. CV never says no, never disappoints.
  2. I think you are trying to ask about "how do I include the files easily for multiple classes" for which I will respond: http://nz.php.net/manual/en/language.oop5.autoload.php Perhaps I am misunderstanding however with your use of file names and no class names. People be more clear if this doesn't solve your problem.
  3. Read about data normalization: http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html Basically you will separate the data types and likely use the 1 (user) to many (messages), and 1(user) to many (photos) type relationships for your new tables. Please read and try to understand the article, it will save you many future headaches.
  4. Use single quotes for the VALUES() section. INSERT INTO yourTable (`text`) VALUES ('$written');
  5. Well... this is the current line for displaying the results: echo "<a href='http://".$config_value."/forums/viewforum.php?f=".$forum_id."' target='_blank'>".$row2[forum_name].":</a> <a href='http://".$config_value."/forums/viewtopic.php?f=".$forum_id."&t=".$topic_id."' target='_self'>".$topic_title."</a>,Last Post By: ".$topic_last_poster_name.",Posted On: ".$date."<br><br>\n"; What do you have so far? edit: and does your query(ies) return the data you want? Looking at it, I don't know that it does?
  6. Uhh.. you can checkout: http://www.tizag.com/ajaxTutorial/ AJAX is mainly javascript, so you will need a firm understanding of javascript to do well I think. The only Ajax really is setting/unsetting the server/database value indicating that it's a favorite or not. The rest of it is just using javascript to manipulate the image, and then communicate with the server. You will need a function to change the image between states (bright , dull), and a function as part of the ajax to change the server side variable. That's pretty much it in a nutshell.
  7. http://www.phpfreaks.com/tutorial/php-security This has a good primer for basic PHP security. Read that and then search on those topics if you need more info.
  8. Use a CVS (Concurrent Version System) to track your changes. Use a copy of the live site to do your testing. Backup the live site before you make any changes. Test the changes on the live site. If it doesn't work, restore the backup. If it does work, celebrate. ? ? ? ? Profit. Repeat
  9. Pretend your form doesn't exist, that's how the hackers see it. Javascript is mainly for assisting the user, but certainly not fit for securing a form. Where ever your code is that accepts the values $_POST['username'] etc is where you you want to be secure in your processing. Validate using regex, strlen, etc to ensure you get expected inputs. Also, I notice in your codebox it says "<?php then <script" is this a typo?
  10. This code could be considerably shorter and more manageable if you used PHP instead. If you'd like a PHP implementation, ask in this thread and I'll happily provide an example. Even with your "change every 25 seconds" thing, you could cue up an array that would last however long you wanted it to. Otherwise, you should refactor your javascript functions which do many of the same tasks in order to save code/headaches.
  11. I highly recommend changing all of your short tags (<? ?>) to proper tags (<?php ?>) as using short tags is considered bad practice. I think this block should be modified to: <select name="model"> <option>Select Model</option> <?php while($row=mysql_fetch_array($result)) { echo '<option value="' . $row['car_model'] . '">' . $row['car_model'] . '</option>'; } ?> </select> That may not change anything however, but I also don't see where you call getModel() anywhere? It's defined, but not called in the code you have.
  12. The javascript just switches the images based on the previous state of the button (star). The ajax will communicate with the server adding or removing to your favorites at the onclick event. Simple as that.
  13. How about we combine the ideas! Hot-bodacious chicks being covered by laptops/superimposed source code up front, while in the back, dark, corner it shows a PHP programmer coding away with some the code drifting off screen towards the chick (blending it with the code covering her sexy spots). That way we can be stereotypically realistic. I don't advertise being a programmer lol, I'm only ashamed as so far as when people assume the stereotypes without pursuing further information. ie: most of the "normal" people in the world. Being a geek is getting more popular, but not that popular yet.
  14. I couldn't find my source for this after a few mins of googling.. However, when you have $_POST and $_GET, you should more often than not know what to expect rather than be "flexible" with it. Perhaps someone else can chime in on this, but I'm fairly certain it is bad practice to use $_REQUEST in general.
  15. file_get_contents($query) assuming $query holds a filename.
  16. I think you're referring to using getter and setter methods as better practice than accessing the data directly. By providing a method with 1 course of action (viewing) or (changing) the data, it is usually prone to less mistakes. It's about controlling the integrity of the data afaik.
  17. move_uploaded_file $filename = $_FILES['Filedata']['tmp_name']; $destination = $_GET['imageDir'] . '/' . $_FILES['Filedata']['name']; move_uploaded_file($filename, $destination); Try that, the issue may have been me using "/" instead of '/'. Check to make sure your input variables ($_GET['imageDir'], and $_FILES['Filedata']['name']) are working as expected if that doesn't work.
  18. Look around here http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html
  19. Read this http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html And use a one to many relationship [1 picture -< many comments]
  20. I wouldn't concatenate inside the function, personally. Also, stick with _GET or _POST as _REQUEST is depreciated. $dir = $_GET['imageDir']; move_uploaded_file($_FILES['Filedata']['tmp_name'], $dir . "/" . $_FILES['Filedata']['name']); Maybe that changes something? (no .=)
  21. You are giving it a class of "test" which is not defined in the CSS you provided. Changing "test" to "highlight" works.
  22. Ya.... im going to go with javascript on this one.. especially since you're trying to exec something on the client side.. and I liked to javascript.. .. yaa...
  23. Not personally, I'm sure you could google it. Likewise, you could test the script yourself by setting a variable to pretend to be from google at the top. I don't know off the top of my head, but just check out what the necessary HTTP_REFERER string looks like for the script, and set it at the top of your page to test.
×
×
  • 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.