Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
I think you're mistaken. It's not my job (or anyone else's) to help anyone here.
-
It's my honest opinion, and it would be "helpful" to your (potential) client. If I hire someone to build me a house, I would also expect them to know what they're doing and not go searching the internet for "how to build house tutorial".
-
If you have no idea whatsoever how to do it, then perhaps you shouldn't take this gig?
-
I think I'll just close this before the flame war evolves...
-
You already have a topic about this: http://www.phpfreaks.com/forums/index.php/topic,275937.0.html
-
Did you actually benchmark that? I find it surprising that the engine doesn't realize they're identical.
-
Untested, but I think it'll work: preg_replace('#(<img.+?)height=(["\']?)\d*\2(.*?/?>)#i', '$1$3', $html);
-
You can do like join(',', $_POST['curEmpName']);. You should look into database normalization though. Generally, one field in a relational database should only contain one single value.
-
That's perfectly valid. You can add multiple character classes within a character class. In that case it'll act as the union of these (think of set theory in mathematics). Other flavors also support things like the intersection and difference. You might for instance do something like this: $name = 'Daniel'; var_dump(preg_match('/^[D\p{Ll}]+$/u', $name)); to match any names containing only unicode lowercase letters or capital latin 'D'. I know it's a crap example, but I couldn't think of anything better right now.
-
=> http://en.wikipedia.org/wiki/Technobabble I used a similar strategy for writing papers when I was in high school. I didn't use words I didn't know what meant, but I always chose the most advanced synonyms I (and the thesaurus!) could think of. It seemed to work quite well.
-
What exactly do you mean? Can't just just select the element from the array and use that, and why are you even making it an array in the first place if you don't want it to be one?
-
One more: strtok($foo, ' '); echo strtok('');
-
Oh yeah well, it got the point across anyways
-
Nope. strstr things you the stuff after the needle including the needle.
-
ltrim(strstr(' ', $foo)); substr(strstr(' ', $foo), 1); substr($foo, strpos($foo, ' ')+1); for ($i = 0; !isset($foo[$i]) || $foo[$i] != ' '; ++$i) {} echo substr($foo, $i+1); for ($i = 0, $l = strlen($foo); $i < $l && $foo[$i] != ' '; ++$i) {} substr($foo, $i+1);
-
Global variables are widely considered as bad practice.
-
The two regexes (.*) and ^(.*)$ are equivalent. Because the star quantifier is greedy, it'll match as much as possible. Then when given a string, it will always have a start, which the caret anchor matches and an end, which the dollar anchor matches. Had you done something like (foo) then it had matched regardless of where foo appeared in the URL and then you would have needed ^ and $ to make sure it's the only thing. Look, you need to remove the file in the screenshot and then place the .htaccess file where that index.html file is. I can't tell you where that is. Frankly, I would assume you know more about your setup than I do. Everything I know is the things in this topic. [attachment deleted by admin]
-
Well, maybe if you stopped reverting things all the time it would be easier for us to see what's going on so we can help you...
-
If they point to the same directory on the file system, you can do this: RewriteEngine on RewriteCond %{HTTP_HOST} ^(www\.)?oddnerdrum\.info$ [NC] RewriteRule (.*) http://brendansite1.startlogic.com/oddnerdrum/$1 [R=301,L] You still need to remove the old "redirect" though!
-
No, it does not. That's what I'm telling you. From an HTTP perspective, http://oddnerdrum.info/ and http://brendansite1.startlogic.com/oddnerdrum/ point to two different locations. Remove the "redirect" you've already made using your control panel or whatever. Then place the .htaccess file at http://oddnerdrum.info/.htaccess
-
Bash output - is it possible to get "realtime" output?
Daniel0 replied to ubuntu-user's topic in PHP Coding Help
Try something like this: <?php $handle = popen('sh /usr/local/bin/test', 'r'); while (!feof($handle)) { echo fgets($handle); flush(); ob_flush(); } pclose($handle); Your webserver might still buffer output though. In that case there is nothing you can do from the PHP side. -
Well, that's not adequate. Try putting view-source:http://oddnerdrum.info/ in your address bar (works in FF, I don't know about other browsers). It has just placed a file that looks like this: <HTML> <HEAD><META HTTP-EQUIV=Refresh CONTENT="0; url=http://brendansite1.startlogic.com/oddnerdrum/index.php"> </HEAD> </HTML>
-
How did you make your original "redirect"?
-
Exactly where did you put it? http://brendansite1.startlogic.com/oddnerdrum/.htaccess or http://oddnerdrum.info/.htaccess It has to be the latter.