ManiacDan
Staff Alumni-
Posts
2,604 -
Joined
-
Last visited
-
Days Won
10
Everything posted by ManiacDan
-
$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.
-
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.
-
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.
-
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.
-
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."
-
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' );
-
File On Server Named " Somecustominjectedheaderinjectedbywvs"
ManiacDan replied to rogerdodger's topic in Apache HTTP Server
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. -
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...
-
All three of those links take me to the same place. Your rewrite rules specify one domain and not the other.
-
There's some pretty extensive things in Zane's list, that should get you started.
-
Puzzeled in working new(to me) technology
ManiacDan replied to bugcoder's topic in Other Programming Languages
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. -
File On Server Named " Somecustominjectedheaderinjectedbywvs"
ManiacDan replied to rogerdodger's topic in Apache HTTP Server
PHP's unlink() deletes files. -
File On Server Named " Somecustominjectedheaderinjectedbywvs"
ManiacDan replied to rogerdodger's topic in Apache HTTP Server
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. -
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.
-
Yes, you need to do it manually. Otherwise, how would it be possible?
-
Include Keywods Description And Title For Each Page Differently
ManiacDan replied to slayboy's topic in PHP Coding Help
Once again, welcome to a forum. I asked you questions in your cross-post to devshed. Please answer them, and format your code. -
Securely Transferring Data Between Two Servers (Pci Compliancy)
ManiacDan replied to gorgon2k's topic in PHP Coding Help
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. -
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.
-
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.
-
Puzzeled in working new(to me) technology
ManiacDan replied to bugcoder's topic in Other Programming Languages
Ah, so it's not rails, it's just using any other language in particular. -
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.
-
You have 5 question marks and only 4 variables. Not sure why this is confusing. Add the variable again.
-
Puzzeled in working new(to me) technology
ManiacDan replied to bugcoder's topic in Other Programming Languages
How does that work? -
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);