Jump to content

Sepodati

Members
  • Posts

    234
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by Sepodati

  1. You can start by seeing whether mail() returns true or false. Is mail() failing or is the message just not making it through the SMTP servers? You're not checking. Your fourth parameter is not a valid email header. That could be causing mail() to fail.
  2. Turn on error reporting or logging and check there. It's likely that the path in the "include_once" portion is not correct and it fails there. What are the absolute paths to phpmailer/class.phpmailer.php and the script that you're running?
  3. $_SERVER['QUERY_STRING'] is already the part of the URL that's after the ?. I'm not sure what kind of result you'd get when you pass it to parse_url(). It's not a URL. If you have to do it this way, parsing the query string yourself... then you can pass $_SERVER['QUERY_STRING'] directly to parse_str() and get your $query array. Then check whether $query['db'] isset() and !empty() and use it's value, or else use 'CALIforn'. Taking something passed from the URL and placing it directly into your code without any validation is a bad idea, however. You're leaving a hole open where anyone can rewrite your entire page by passing values in the URL. -John
  4. I don't know anymore than you. I agree the whole thing looks suspect.
  5. You can't just do a one-for-one swap with preg_replace_callback(). Have you checked out the manual page on the function? http://php.net/manual/en/function.preg-replace-callback.php The second parameter needs to be a function name. It'll be passed the matches and you should return the string you want from there. Within that function is where you'd do the strlen() part. function update($matches) { return('s:' . strlen($matches[2]) . ":\"{$matches[2]}\";"; } $unserialized = preg_replace_callback('!s:(\d+):"(.*?)";!',"update_function",$unserialized ); It's been a while since I've done this, so forgive any errors, but hopefully that gives you the idea. If you check out the manual page, you can also do an anonymous function, rather than defining update() or whatever you want to call it. -John
×
×
  • 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.