Friday February 10, 2012 @ 21:23:45 GMT+10    ( Weather:  n/a )
Home » Weblog Archives

Powered byD's Bloggie
Weblog Archive browse by category ...
 → Category :
Display order:
Page 2 of 2   ( 13 entries , showing 11 - 13 )
  Previous  1 2    

PHP register_globals - 6:26 pm
Coding , PHP , Security  -  poster 

There are numerous ways and possibility which makes your code unsecure when PHP register_globals directive is set to ON.

Below are few examples:

Unsecure Example 1 [ Hide ]
[ Highlight ] [ Text ]
  1. <?php
  2. $_SESSION['test'] = "original";
  3. $test = "modified";
  4. echo $_SESSION['test'];
  5.  
  6. // this will output "modified" instead of "original"
  7. ?>


Unsecure Example 2 [ Hide ]
[ Highlight ] [ Text ]
  1. <?php
  2. $_SESSION['test'] = $something;
  3. echo $_SESSION['test'];
  4.  
  5. // Point to the file in browser, with query append to the back:
  6. // test.php?something=modified
  7. // The string "modified" will be output
  8. ?>

SQL Joining - 6:42 pm
Coding , SQL  -  poster 

SQL displaying brief info - 3:49 pm
Coding , SQL  -  poster 

This is how you display the first 100 characters of a string in your DB and add '...' at the back.

Display excerpt from a long string [ Hide ]
[ Highlight ] [ Text ]
SELECT CONCAT(SUBSTRING(acol, 1, 100), IF(LENGTH(acol) > 100, '...', '')) AS brief
FROM atable
Page 2 of 2   ( 13 entries , showing 11 - 13 )
  Previous  1 2    
$ view_blog.php 2009.09.17 18:16:41 $
Lost? | XML/HTML sitemap | Contact
38.107.179.240 , 21 queries , 0.1047s
Gzip enabled , CSS compressed , JS compressed
Copyright © 2005-2011 Darren's Outpost