www.webdeveloper.com

Search:

Type: Posts; User: gvre

Page 1 of 4 1 2 3 4

Search: Search took 0.03 seconds.

  1. Replies
    5
    Views
    909

    I think that the error message is pretty clear....

    I think that the error message is pretty clear. There is no id field in table users.
  2. You are right but it is not difficult to...

    You are right but it is not difficult to implement some words' exceptions/fixes to the code.
  3. You could use preg_replace_callback to replace...

    You could use preg_replace_callback to replace only the wholly uppercase words.

    $string = preg_replace_callback('#\b([A-Z]+)\b#s', function($m) { return ucwords(strtolower($m[1])); }, $string);
  4. Replies
    2
    Views
    853

    Use swiftmailer. It is a very well-written...

    Use swiftmailer. It is a very well-written library with many features and great documentation.
  5. Thread: good code or bad

    by gvre
    Replies
    15
    Views
    1,519

    As I can see, your html and php code are in the...

    As I can see, your html and php code are in the same file. You should move all classes to their own files (e.g. user.php for class User).

    Globals are the easy way, but not the right way. Each...
  6. Thread: good code or bad

    by gvre
    Replies
    15
    Views
    1,519

    Actually, this code is not good for many reasons...

    Actually, this code is not good for many reasons (some of them are the following):

    - No html-php separation
    - You rely on globals for db connection
    - Echo usage inside the class methods
    - You...
  7. Replies
    15
    Views
    2,308

    Try this (not very well-tested) code. ...

    Try this (not very well-tested) code.


    function GetImages($dir, $basedir = null, array $extensions, $recursive = true)
    {
    $dir = rtrim($dir, '/') . '/';
    $images = array();

    ...
  8. Replies
    15
    Views
    2,308

    You should check the log files for error...

    You should check the log files for error messages.

    Btw, I made some small changes to the code.


    function GetImages($dir, array $extensions, $prefix = '')
    {
    $images = array();
    ...
  9. Replies
    15
    Views
    2,308

    RecursiveDirectoryIterator throws an...

    RecursiveDirectoryIterator throws an UnexpectedValueException if the path cannot be found or is not a directory. I suppose that the dir was not found when you added /trophy. Try this


    function...
  10. Replies
    15
    Views
    2,308

    Did you wrap the code in tags?

    Did you wrap the code in <?php ?> tags?
  11. Replies
    15
    Views
    2,308

    You don't need to change the $dir and $prefix if...

    You don't need to change the $dir and $prefix if the script is inside the wordpress root dir. The $images contains an array with all images' paths. You should add a foreach construct to iterate over...
  12. Replies
    15
    Views
    2,308

    function GetImages($dir, array $extensions,...

    function GetImages($dir, array $extensions, $prefix = "")
    {
    $images = array();
    $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir,...
  13. Replies
    15
    Views
    2,308

    Could you post your code and the path of the...

    Could you post your code and the path of the script?
  14. Replies
    6
    Views
    942

    Why don't you use NogDog's answer?

    Why don't you use NogDog's answer?
  15. Replies
    3
    Views
    562

    One query is better. You should always try to...

    One query is better. You should always try to reduce the number of SQL queries.
  16. Replies
    5
    Views
    1,851

    I don't now. I use the oldschool technique :) You...

    I don't now. I use the oldschool technique :) You may find a solution in one of the following pages.

    http://nicolasgallagher.com/micro-clearfix-hack/...
  17. Replies
    5
    Views
    1,851

    You should uncomment the clearfix div.

    You should uncomment the clearfix div.
  18. Thread: Arrays

    by gvre
    Replies
    2
    Views
    582

    $array1 = array(1, 2); $array2 = array(3, 4, 5);...

    $array1 = array(1, 2);
    $array2 = array(3, 4, 5);
    $final = array();
    foreach($array1 as $a1)
    foreach($array2 as $a2)
    $final[] = $a1 . $a2;
    print_r($final);
  19. Thread: Need help

    by gvre
    Replies
    3
    Views
    769

    You should check, using is_array function, if a...

    You should check, using is_array function, if a variable is an array before passing it to foreach. e.g

    if (is_array($items))
    {
    foreach($items as $item)
    {

    }
    }
  20. Replies
    3
    Views
    646

    Check this...

    Check this
  21. Replies
    1
    Views
    632

    Check php sessions manual page...

    Check php sessions manual page. There are many examples there.
  22. Replies
    1
    Views
    1,143

    You mail server requires authentication. I...

    You mail server requires authentication. I suggest you to use a library like swiftmailer
  23. Replies
    1
    Views
    1,007

    Check Campaign Monitor guide to css in email...

    Check Campaign Monitor guide to css in email
  24. Replies
    5
    Views
    1,356

    From mysql_fetch_object...

    From mysql_fetch_object manual page

    So, you need to check the value of $autorRow

    if ($autorRow === false)
    PageNotFound();
  25. Replies
    5
    Views
    1,356

    Create a 404.html page and use the following code...

    Create a 404.html page and use the following code (not tested). When an id record is not found, call PageNotFound() function.


    function PageNotFound()
    {
    header("HTTP/1.1 404 Not...
Results 1 to 25 of 81
Page 1 of 4 1 2 3 4
HTML5 Development Center



Recent Articles