Jump to content

ManiacDan

Staff Alumni
  • Posts

    2,604
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by ManiacDan

  1. $a = $b is not the same as $b = $a. Your initial post says you have: $_SESSION['cid'] = $cid; That is not what your code has.
  2. Your host upgraded from a language version which supports the ereg family of functions to a version which does not. They also "helpfully" added a module which replaces any existing calls to ereg with calls to the preg family of functions. Your code on those lines is wrong. Line 121 should be: $output = str_replace(";", "", $output); Line 309 should be: if ($count % 10 == 0 ) { This code is awful, neither of these lines even needed to be a regular exp<b></b>ression. Any line which contains "ereg" must be replaced by something. Scoot: The host seems to be doing real-time aliasing between ereg and preg since ereg is gone.
  3. What problem are you trying to solve here? Why is this so important to you? 1/2 is math. It means 0.5. The way you write your code, $YearArr[.5] is the only thing which will output 19. Keep your code the way it is. It's the fastest implementation of whatever it is you're talking about, unless you tell us what the actual problem is.
  4. Do not ever use cookies to store session data. Cookies are passed to the client with every request and are visible by the client (and can be modified). Your encryption is probably not good enough to protect your session. Instead, override the session storage location and store the data in memcache or a database. Articles on overriding the session using session_set_save_handler are everywhere.
  5. Please answer the question. I don't know what "number 1 or 2 means/echoes 19" means. Your original code is probably the fastest way even though there are "duplicates."
  6. Would you honestly like the keys to be a string list of all the old keys which pointed to the data? Or do you just want to remove the duplicates? Which of these do you want? $YearArr = array( '1/2' => '19', '3/4' => '18', '5/6' => '20' ); $YearArr = array( 0 => '19', 1 => '18', 2 => '20' );
  7. You had files on your filesystem named after a common hacking tool, your server was compromised. What was the actual problem? There's hundreds of ways to cleanse $_POST, it depends on what the data is.
  8. All three URLs took me to: http://shortit.org/index.php I'm not sure how to write a better rewrite rule, I'll get someone in here...
  9. All three of those links take me to the same place. Your rewrite rules specify one domain and not the other.
  10. There's some pretty extensive things in Zane's list, that should get you started.
  11. Well it had much of what he said. Autoloading is easy. views and layouts are not exactly easy, but common. Presenters and the whole application stack is not really possible without a dirty hack, Ruby and Python just don't work the way HTTP was originally designed to work.
  12. foreach("/mydir/" as $file){ That's not your code, that would throw an error. You're saying the filesystem doesn't see it, but PHP does? If your server is compromised, you need to shut down its access to the internet right now and fix it. It could be involved in any number of things, including the DDoS that took down six major banks this week. Shut it down. Once it's shut down, remove any files that shouldn't be there or simply wipe the hard drive and restore from a backup.
  13. I don't see where you're inserting anything into the database. Is the table storing the full URL? Narrow this problem down yourself. So far you have "the whole process is broken, here's some of the code." Does the form post include the whole URL? If so, does the script accept the whole url? If so, does the whole URL get inserted into the database? If so, does the key for that URL get represented properly by the system? If so, does that key retrieve the full URL? If so, does the full URL get added to the location redirect? That's how debugging works. Small units of functionality.
  14. Yes, you need to do it manually. Otherwise, how would it be possible?
  15. Once again, welcome to a forum. I asked you questions in your cross-post to devshed. Please answer them, and format your code.
  16. You could just accept google checkout or something, that would solve your problem immediately. Consider this: Server D has two APIs: 1) Establish session 2) Accept payment information This is how it would work: 1) Servers A, B, and C are about ready to take a customer's payment. They submit a server-to-server call to API 1, "Establish Session", with the username and the domain name of the site. 2) Server A/B/C print a form to the client containing this session ID, which POSTS to server D 3) Customer fills in billing information, including card number and CVV. 4) Customer clicks submit. Data is posted securely to server D (the only server which needs an SSL certificate). 5) Server D accepts the payments, processes them, assigns the payment to the account, and redirects the user back to server A/B/C based on the server identifier found in the session. 6) The customer never realizes they've hit server D unless they were watching their network traffic.
  17. I tried to fix your post here but was completely unable to. It's a server-side bug, if that helps anyone. The Ajax call doesn't contain the bad data.
  18. http://whatsintheredsuitcase.com/disclaimer.php <-- bad footer, and a login box for no reason. http://whatsintheredsuitcase.com/login-fail.php <-- 404 http://whatsintheredsuitcase.com/story.php <-- "sign up" link malformed Site functions ok, but I didn't sign up (since I rarely do). Make us a test account to use so you can delete whatever we do when we're done.
  19. PHP actually supports using { and } as the opening and closing delimiters, which seems weird (since it's not the same character) but looks more like a PHP control structure.
  20. Ah, so it's not rails, it's just using any other language in particular.
  21. How was the computer supposed to know which of your 4 variables was the right one? PHP can't read SQL, it's a completely separate language. The VALUES() function is technically more correct, but either works.
  22. You have 5 question marks and only 4 variables. Not sure why this is confusing. Add the variable again.
  23. In your replacement, \\0 is whatever was matched by the match part of your expression: preg_replace("|($searchWord)|Ui" , "<span class=\"highlight\">\\0</span>" , $string);
×
×
  • 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.