- Strength to Increase Rep
- +6
- Strength to Decrease Rep
- -1
- Upvotes Received
- 5
- Posts with Upvotes
- 5
- Upvoting Members
- 5
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
Im a Web Developer. I like be to be nerdy, play soccer and eat cookies.
- Interests
- php, web development, apache, mysql, wordpress, ajax, soccer, hockey
- PC Specs
- 3 desktops, 3 laptops, 1 netbook, 1 ipod touch, 1 smartphone and a lot of spare parts. I am a fan of…
Re: [QUOTE=martinkorner;989143]Hi, I am trying to write a .htaccess script that can redirect any URL on my site (whether it exists or not, including sub-domains) to the index page of that site. For example: example.com/pages/page.htm ---> example.com sub.example.com/page.htm ---> example.com error.example.com/error ---> example.com I've tried a few things with mod_rewrite but … | |
Re: I also have a few sites that increased due to this change... however, I'll admit some of my pages are ranked above others much better sites. Not all my sites increased rank, most of them had no shift. | |
Re: Looks to me like you've got WHERE in there twice. An SQL statement should only have 1. (unless your using join, subqueries, etc.) I havent tested this but try: [CODE] UPDATE `isc_products` WHERE `prodcostprice` >= 0 AND `prodcostprice` <= 1000 SET `prodprice` = (`prodcostprice` * 1.20); [/CODE] notice, I removed … | |
Re: If you put the pictures into an list <li> it would be easier to keep updated. You could style them to show 5 pictures per row. Then later, if you need 3 pictures per row, you can just adjust your css, rather than your entire table structure. But if you … | |
Re: can you post the virtual host from your conf file? | |
looking to build a network for link exchange/promotion. The plan is to get a distributed group of reliable people. Then exchange promotion between group members. The group would need to be relatively small and manage-able. Communication would need to be open amongst the group, but kept private and away from … | |
Re: the .htaccess file won't be read by apache outside the document root. if your just trying to restrict access, you could use authentication, not sure if you could get flash to work with that though. generally, you put something outside the document root that you don't want the web to … | |
Re: if CPU and RAM usage isnt high when the page is 'loading' seems to me that the problem is elsewhere. Do pages load successfully, or do they timeout? Most browsers have a 90sec timeout by default. Is the server responding with a static file or a dynamic script? Check to … | |
| Re: You could leave it as an html file, and make your html files parsable as php files (with addhandler in your .htaccess) I would stay away form iframes wherever possible. |
Re: Use this, you won't have to type up the months. This creates a string '5/1/2010' and then converts it to a timestamp, and passes it into the date function with the 'F' as the format, which will output the text version of the month. [CODE] $oldm = 5; $newm = … | |
Re: the counter.txt file does not exist. create the file first, and make sure its writable by the webserver. | |
Re: use mktime() or strtotime(). [CODE] strtotime('April 1 ' . date(Y) . ' 1:59:59'); [/CODE] this would get you paril 1 of the current year at 1:59:59. | |
Re: there are a few ways to do it use explode() to split by a comma and space, strpos() to find the position of of the period, and substr() to only get the data after that position. or, you can use regular expresions and preg_replace(), something like '[a-z]\.(.*),? ?' would probably … | |
Re: I'd use a debugger or start printing out variables at various locations. You'll also want an 'else' case if the login does fail. session_start is usually called before other stuff happens, most specifically before any output is sent to the browser, so your lines #1-3 are probably sending output (empty … | |
| Re: I suggest going with a forum. Or you could try something like phpfox. |
Re: why not just remove the outdated one, and symlink it to the correct version? [CODE] rm -rf /usr/bin/perl; ln -s /usr/bin/perl /usr/local/bin/perl; [/CODE] you'll want to back up your old version of perl just in case. (never blindly run any script some just gives you) | |
Re: be careful when using something like fopen with a dynamic variable. If something you didnt expect got into that fopen, it could open files you don't want anyone to open (passwords files, files with database connection details, configuration files, etc.). that being said, you cant refresh anything via php, as … | |
Re: try casting it as a string. I would guess your $module['id'] is not a string, which likely means that even casting it, won't give you expected results (though it probably won't throw an error). you could try : [CODE] $pos = strpos( (string) $string, $find ); [/CODE] | |
Re: try this: [CODE] # redirect visitors to not have .php in the url RewriteCond %{REQUEST_FILENAME} -f # only if the file requested actually exists RewriteCond %{REQUEST_FILENAME} \.php$ # only if the file ends in .php RewriteRule ^/(.*).php$ /$1/ [R=301,L] # 301 them to the same location, without the .php ending … | |
Re: check to make sure that the directory /var/www/ is readable (at least 444, but more than likely it should be 755) and check the owner and group as well. | |
I am looking to have both a forward proxy, and a reverse proxy at the same time. It seems as though, when I do this, the Proxy definition I put in place to restrict access to the forward proxy also effects the reverse proxy. [CODE] ... #... inside my virtual … | |
Re: I'd suggest an XML sitemap, Digg, and twitter. I've seen digg and Twitter get picked up within hours. I also like delicious, though, I am not convinced it will produce any significant change. Set up some google alerts if you want to see how fast results change. Also I'd set … | |
Re: Try: [CODE] $myVar = "data[1]['items'][4]['items']"; $$myVar = 'xyz'; [/CODE] The two dollar signs I think is what you'll need, though I have never tried it with indexes like this. hope that helps. | |
Re: using php base64_encode and php base64_decode can help as well. never run a query on data you unsure about. also, its a good idea to restrict the permissions of the mysql user your scripts are using, so in case someone does get in, they can't create, alter or drop tables. … | |
Re: I've done some similar work, there is a lot of code already written. Heres one class already written that may help: [url]http://www.micahcarrick.com/04-19-2005/php-zip-code-range-and-distance-calculation.html[/url] | |
Re: Yahoo and Bing! (MSN) both have similar services, though the features suck in comparison to Google Webmaster Tools. | |
Re: Your issue is your using single quotes ' instead of double quotes " as a string with a variable in it. on line 48 you have: [CODE] createthumb('$dir1','$dir/thumbs/$photo1',100,100);//Not working(problem here only) [/CODE] Try: [CODE] createthumb("$dir1","$dir/thumbs/$photo1",100,100);//Not working(problem here only) [/CODE] the problem is, that when you use single quotes '$myvar' will … | |
Re: if you have an auto increment field, just use mysql_insert_id() to get the last auto increment | |
Re: would it not make more sense to have all this data in 1 table? if your table names are literally differentiated by a number, just add a field to your table structure. So instead of having 62 tables, have 1 table with the following fields: date, user, url, short_url, TableNumber … | |
Re: if your looking to concatinate (combine) two strings, in php, use the dot (.). [CODE] $a = "string1"; $b = "string2"; $combinedStrings = $a . $b; [/CODE] But it looks to me like your trying to combine the strings in the wrong place, unless you have a column with the … |