Jump to content

mikesta707

Staff Alumni
  • Posts

    2,965
  • Joined

  • Last visited

Everything posted by mikesta707

  1. if its on, I suppose you could try using add_slashes on the user input, but to be completely honest, i'm not entirely sure. I have read about similar issues to yours, and the problem came from magic quotes being on.
  2. you can echo the PHP in the value attribute of the text. For example <input type="text" value="<?php echo $someVariable; ?>" /> Note the variable has to be defined before you do that. may seem obvious but a lot of people forgot about that part
  3. Plus, if you have 1 huge file that you need to load, splitting it into 2 smaller files isn't going to magically make you not have to load the entire script anyways. It just (potentially) increases readability, and makes the code easier to navigate. Not that splitting up huge files is bad, but it won't really increase the speed of the script more than smart coding would
  4. do you have magic_quotes_gpc off or on in your php.ini? that could be causing the problem
  5. No i meant, it would cut words off in the middle. like long text is loooooooong might become: long text is looo... Read More. Not terrible, but just letting you know in case you didnt
  6. well unserialize it and use print_r on it so I can see that the array looks like. post an example of good data also (both the serialized string, and the unserialized array)
  7. in this example $crank = $rank[$row['rank']]; $result = mysql_query("SELECT * FROM users"); while($row = mysql_fetch_assoc($result)){ echo "<br>Name:".$row['username']; echo "<br>Rank: "; echo $crank; } ; the crank is only set once. Perhaps you meant to do $result = mysql_query("SELECT * FROM users"); while($row = mysql_fetch_assoc($result)){ $crank = $rank[$row['rank']]; echo "<br>Name:".$row['username']; echo "<br>Rank: "; echo $crank; }//why was there a semi colon here?
  8. $text = "some really long text"; $subText = substr($text, 0, 200); $subText .= (str_len($text) > 200) ? "... Read More" : ""; You should realize that this will cut off words too
  9. perhaps there was an error in serializing/unserializing the data. However, without an example of good and bad data, I can't be of much assistance
  10. right here switch($act){ case 1: if($acode == $code){ // success! $sql2 = "UPDATE `emails` SET `activated` = 1 WHERE `email`='".mysql_real_escape_string($_GET['email'])."'"; probably want that update to set activated=2 instead of 1
  11. if you are using variables or functions from those pages than yes
  12. Yeah I saw that, I was just letting him know.
  13. have you tried cURL?
  14. By the way, using mime types to verify file type can be a bad idea. Mime types can be spoofed, and not all browsers send them. Some browsers even send different types for the same file type. You may run into issues later on
  15. you can use regex to extract that specific line, and use eval to run it, but I would be very careful if you go this route
  16. you should be able to schedule CRON jobs through some control panel that your host provides. If you can't find it I suggest you contact your host about it. Surely they will be able to help you. http://clickmojo.com/code/cron-tutorial.html they even have something that shows you how to schedule a tast every 5 minutes
  17. why do you need a main function to use OOP? Python is OO but doesn't require a main function. In any programming language you have to create an instance of an object outside of the class definition. Having an object of the class inside the class doesn't really make any sense. When you include a class file in PHP, if all the code is inside the class definition, than no code is going to be run. (until you instantiate the class) by the way, there is nothing stopping you from making a main() function in PHP. Just make it somewhere on the page (or in the include) and call it in the page.
  18. where is $baby_id defined
  19. um.... what context is it in? drop down? what does each of those words represent? a sub menu? a link? your question is very confusing. I don't see how this has anything to do with PHP either
  20. if you want to make a text box a certain color, you can use CSS, IE <input type="text" style="background-color:#000000" ...etc /> that would make the background color black. Obviously, you could set the background-image attribute, as well as any other attribute you wanted. BTW this is a CSS problem, not really a PHP problem
  21. what is it supposed to say?
  22. this is how you combine all three $Campus = array($Campus1, $Campus2, $Campus3); did you check out the tutorial?
  23. ah sorry. Yeah I meant should not have to. Generally variables and methods that are accessed without instantiating a class are set as static. at least in my experience
  24. btw if you want to access the function like that in the class, you need to make the method static
  25. oh i see. get_all_subjects() defines sel_subject. it sets it as a global variable, which is terrible, but im not going to get into that. you may just have to call get_all_subjects before you call the other function
×
×
  • 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.