Jump to content

inactive

Members
  • Posts

    97
  • Joined

  • Last visited

Posts posted by inactive

  1. You could do somedomain.com/clientname and use mod_rewrite (via .htaccess) or some other "friendly" url scheme to push all request to one file, which you use to look up the client's details in the db.

     

    Also consider looking into WordPress, which has multisite functionality, and auto sign-up options as well.

  2. Hey homies,

     

    Is there anyway in the function I set in set_error_handler() to return true, and die?

     

    My code:

    <?php
    set_error_handler('my_error_handler');
    
    function my_error_handler($errno, $errstr, $errfile, $errline) {
    // ... handle error here ... //
    }
    
    echo  1/0; // generates a warning
    trigger_error('Some Other Error', E_USER_ERROR); // generates user error
    
    ?>
    

     

    What the my_error_handler() function does will depend on the error type:

     

    1) In the case of the warning, after handling the error, it will return true, so that the normal PHP error handler will log the error in the normal error log, and then it will let the rest of the script proceed. This works great.

     

    2) In the case of the user error, I need it to handle the error, then return true, so that the normal PHP error handler will log the error in the normal error log, and then exit. I cannot get this to work.  ???

     

    Is there a way to return true, and exit/die?

     

    If I don't exit/die, the rest of the script will continue to run, with detrimental results. If I do exit, then it is not possible to return true, which means the error won't be logged properly by the normal PHP error handler.

     

    I.e:

    <?php
    exit(); // script will exit,
    return true; // but will not return true (obviously, as the script has already terminated)
    ?>
    
    <?php
    return true; // script will return true,
    exit(); // but as it has now jumped out of this function, will now not exit
    ?>
    

     

    Any ideas? Is this even possible?

     

    Thanks in advance.

  3. Hey guys,

    I may have found a new bug in IE8, googled around a bit but can't find anything close...maybe someone here knows whats going on?

     

    Anyway, basically just a div with background colour, and inside sits a block displayed link, transparent in its normal state, but with a background image when hovered over.

     

    Test case at http://esquimaux.com.au/ie8bgtest/test.html

     

    So the HTML is like this (bare in mind the actual case is valid XHTML 1.1):

    <body>
    
    	<div id="outer">
    		<a href="#" id="inner">test</a>
    	</div>
    
    </body>
    

     

    And the CSS as follows:

    div#outer { width: 100px; height: 100px; background-color: #00FF00; }
    a#inner { display: block; width: 100px; height: 100px; background: transparent; }
    a#inner:hover { background: transparent url(testbg.png); }
    

     

    So its meant to just be a green square with the test link in it, and as you hover over it the backgroun image kicks in and the sits over the whole div, so the whole square goes blue (as thats the colour of the bg image).

     

    Works great in all good browsers, even IE6 and 7, but not IE8 (curiously though it does work in IE8 compatibility mode).

     

    In IE8 the bg image doesnt show. Any other hover css will work (changing link colour etc). Also, it will work if the initial link css doesnt have background: transparent set, but i need that tag for the site im working on.

     

    So it seems the IE8 can't overide the background: transparent on hover state.

     

    Any ideas?

  4. Hi guys,

     

    Hope I have the right forum here...

     

    I'm using the following rule in my .htacces (among others):

     

    RewriteRule ^(001¦002¦003)/foobar/$ foobar/index.php?code=$1 [L]

     

    This works great, enabling any requests to www.mysite.com/002/foobar/ to go through to www.mysite.com/foobar/index.php?code=002, which is what I want.

     

    However, if a user goes to www.mysite.com/002/foobar/?user=booyah, then I would like that parameter passed too (so www.mysite.com/foobar/index.php?code=002&user=booyah), but it doesn't.

     

    The paramters that may appear in the url may be there, or may not, and also will vary greatly.

     

    Can anyone help with how I change my rewrite rule?

     

    Cheers,

    Mitch.

  5. Make an array of error messages (which match the same order that $register is in):

    <?php
    $register_error_messages = array(
        1 => 'You have not entered a correct username'
        2 => 'Your password was not long enough'
        3 => 'You smell bad'
        // etc etc for each of the register processes
    );

     

    Then use what projectfear said, but with a loop for the errors:

    <?php
    $errors = array_keys($register, 1); // the 1 is there so we search the $register array for 1 only.
    if(count($errors) > 0){
        echo 'There was an error! See below:<br />';
        foreach ($register as $key => $value) {
            if ($value == 1) {
                echo $register_error_messages[$key].'<br />';
            }
        }
    } else {
        echo 'No error!';
    }

     

    Haven't tested it, but should be OK.

×
×
  • 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.