Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. Cool, I didn't know about that.
  2. <?php function changeName($file) { $path_parts = pathinfo($file); return ucfirst(strtolower(str_replace(array('-', '_', ' '), ' ', $path_parts['filename']))); } ?> Shorter and uses a function which is supposed to get the different parts of a file: pathinfo()
  3. if (($EXP <= 300) AND ($EXP > 100))[code] [/code]
  4. No, it evaluates to true and that is correct. The === (and !==) operator means identical. $Dog['dog_id'] is null and not "" (a empty string). You should use !empty($Dog['dog_id']) or just use != instead.
  5. Try <?php ini_set('display_errors', TRUE); error_reporting(E_ALL); include 'config.php'; include 'opendb.php'; $query = "select * from users WHERE user_id='{$_GET['userid']}'"; $result = mysql_query($query) or die(mysql_error()); var_dump(mysql_num_rows($result)); ?> And see what it says.
  6. None or empty action attribute makes it equal the current page.
  7. Before the if statements, try to echo $ResultQuote to see what it actually is.
  8. Change if($ResultQuote = '$100') to if($ResultQuote == '$100') (the rest of the places too). = is an assignment operator == is a comparison operator
  9. Does the user data come from a form?
  10. Duh... stupid me!! I meant to say error_reporting... Bangs head against wall. In fact it already had error reporting to E_ALL. Even more stupid me >_<
  11. Well, you miss an opening <html> tag and a DOCTYPE declaration. Also, you have content after your closing </html> (the number of seconds it took to generate the page I guess (put it in an HTML comment).
  12. Syntax highlighting would also point a such error out quite easily.
  13. HTTP GET is a "normal" request. It works by using a link too. If you click this link then you'll make an HTTP GET request.
  14. Yes.
  15. To elaborate on what BlueSkyIS said, variables in a string are only parsed when enclosed with double quotes (same goes for control characters like \n or \t). Also, in this case (since you don't need any other data), you'd just pass the variable directly instead of putting it in a string.
  16. If you get "undefined variable 'userid'" then perhaps you have a typo URL or something. You haven't given any GET value with the name 'userid' at least.
  17. <script type="text/javascript"> function toggle_size_fields() { height_obj = document.getElementById('height') width_obj = document.getElementById('width') if(height_obj.disabled == true) { height_obj.disabled = false } else { height_obj.disabled = true } if(width_obj.disabled == true) { width_obj.disabled = false } else { width_obj.disabled = true } } </script> <form> <label><input type='checkbox' name='resize_auto' onclick='toggle_size_fields()' /> Resize automatically?</label><br /> <label>Width: <input type='text' name='width' id='width' /><br /> <label>Height: <input type='text' name='height' id='height' /><br /> </form>
  18. You probably got some error. Try change ini_set('display_errors', '1'); to ini_set('display_errors', E_ALL); and see if there are any.
  19. Find another editor. I'd normally not recommend notepad, but I'd recommend it over MS Word. Anything is better than word. In fact, I'd probably recommend you not to use a WYSIWYG editor for HTML.
  20. Right... suppose you speak like Yoda in Star Wars. Other people might understand what you say, but you are still not using correct syntax. Humans are pretty smart, so they can "automatically" figure out what the person actually meant. Computers are not smart, so the developers of the browsers has to say "hmm... what if the web developer didn't write valid code?!". Neither... image that you wanted to change everything that is red to blue? You'd either have to change .red to have color: blue; or you'd have to go find all the places the class red is used and change the class. You should name the classes after what it is and not how it should look (e.g. title).
  21. setinterval('getBoardsSold()', 5000) Note that the second argument is in milliseconds...
  22. Try to change $result = mysql_db_query("servicemgmt", $query . mysql_error()); to $result = mysql_db_query("servicemgmt", $query); I don't know why you'd put the last error after the query...
  23. <?php print_r(glob("*.{gif|jpg|jpeg|png}", GLOB_BRACE)); ?> ... :-\
  24. You probably has an unclosed curly bracket or something. It means the script ended where PHP did not expect it to.
×
×
  • 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.