-
Posts
15,229 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
If the browser corrects your HTML then you can treat it as if it were valid. Use something to inspect the HTML structure of the page (like Chrome's Inspector thing) to make sure the was moved into the . Assuming it does so then you can write your CSS as if the markup was valid.
-
Javascript inside Ajax called pages not working
requinix replied to ankur0101's topic in Javascript Help
All AJAX does is get stuff from a URL. The browser won't try to parse or interpret anything returned unless you try to put it into your page somewhere. But even then the browser will not execute Find another way to do what you want. By the way, what are you trying to do? -
Hard to do considering how the HTML is invalid. What it tries to do is reasonable but it is still wrong and should be fixed. Note that's "fixed", not simply "changed".
-
Then whatever you're doing to "read" it is incorrect. You're getting the right data the right way, but reading it the wrong way. Post some code.
-
...which you aren't using here (though ArrayAccess uses a similar mechanism)? Yes.
-
You don't have to enable it. In fact unless you have a solid reason for doing so you should leave it disabled. Yes, ob_clean() erases whatever is there. Yes, you have to call ob_start() to begin buffering, but with certain settings PHP will start one up automatically for you. My comment was merely that if you did so then the code I posted, which will work fine in most cases, would need an adjustment. It is also there to serve a different purpose than the code you actually have now, but what I believe was the intention.
-
$config['dbSettings']['dsn'] = 'localhost'; $config['dbSettings'] is actually a return value from a function. You can't modify it, but you can copy the value to a variable, modify it there, and put the value back (via another function call). $array = $config['dbSettings']; $array['dsn'] = 'localhost'; $config['dbSettings'] = $array;
-
It makes sure that anything in the current output buffer (if anything) is cleared before the message is also added to the output buffer. It doesn't guarantee that the buffer (again, if present) won't get cleared later and the message disappears. This could make sense if whatever was generating output failed and the output can/should be discarded. If you want to clear all output buffering to make sure that an error message is written then a better solution is while (ob_get_level()) ob_end_clean(); // or ob_end_flush()however that will cause problems if you use automatic output buffering (eg, with the output_buffering setting enabled).
-
1. Database. 2. It's a very good idea. 3. Please don't use Dreamweaver. A framework is also a good idea, even if just to save some time.
-
Take a close look.
-
likely regex (eregi) problem -- input allows non-digit characters
requinix replied to stevieontario's topic in Regex Help
Trial and error? Do you have another question besides how to check that something is a number? -
That alone won't do it. It doesn't even have a semicolon to end the statement, and if it did it still wouldn't do anything. You have to write code. You can use that glob() thing in it but you still have to write a lot (relatively) more around it before anything will work.
-
I don't see any "decoder" in there. In case you haven't realized, that's a JPEG image.
-
It contains a "pointer" (only kinda) to the string value itself. The string doesn't know that it's contained in an array or whatever, so the variable with the reference doesn't know that either. Now, maybe I misread but I thought you were asking about just having the $ref and figuring out more information from there. That's not possible. If you have both $ref and the source array then it's a different question. But only kinda possible. The language doesn't expose a way to tell if two variables both reference the same value. You can only tell if a variable is a reference, and even then it's very hacky and I wouldn't dare suggest it to anyone to actually use. As a workaround you could loop through everything, modify $ref to a random value, and check if the source array's item is also modified (or vice versa) but that's crazy. Please think of another way to do this. If you want a location in an array then use a set of keys, like as used in breadcrumbs. References are not suitable for it.
-
I hope that wasn't a bump.
-
It is not. You cannot start from $ref and derive anything in $some_array - you only have a reference to the string "_smth", not to a location in an array.
-
Looks like you're trying to store most of the file in memory. You really have to do that? I bet you don't. And did you restart after applying the memory_limit changes?
-
And the line 33 that the error message clearly indicates looks like... what?
-
Trying to cApitalize only the second letter in a sentence
requinix replied to cyborgeek's topic in PHP Coding Help
str_replace() is wasteful and will only work if you pass a $count=1 argument. A loop to copy the string is even worse. $string = "capitalize"; $string[1] = strtoupper($string[1]); -
Define "doesn't work". Because the character encoding won't affect you getting the content, only when you try to do something with it.
-
How to set file pointer to end of file when opening a file?
requinix replied to ballhogjoni's topic in PHP Coding Help
Use the a or a+ mode when fopen()ing the file. -
likely regex (eregi) problem -- input allows non-digit characters
requinix replied to stevieontario's topic in Regex Help
All your expression does is check the string contains a number. ctype_digit And avoid ereg/POSIX functions. They're old and deprecated and not as powerful as the preg/PCRE functions. -
I didn't give you any code. Run what, exactly?
-
So now either you find a new hosting company, upgrade to dedicated hosting (where you can control the server and install your own software on it), or don't convert files.
-
ffmpeg has nothing to do with PHP or GD, the latter of which is a library and not an application, but your conclusion is correct.