- 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…
56 Posted Topics
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 … | |
Re: relying on the URL and $_GET variables can leave you vulnerable. It can be safe, when done correctly. The most important thing, is you need to verify the data, before you try to do something with it. Specifically when adding/modifying/deleting things from a database, be sure the person should be … | |
Re: yea, definately a cron job would be your best bet. If youre hosting on a cPanel server, you can do this without going to the command line. If not, and you'll either need to get your host to set up the job for you, or if you have ssh, you … | |
Re: you'll have to use javascript for that. [URL="http://ostermiller.org/calc/calculator.html"]http://ostermiller.org/calc/calculator.html[/URL] [URL="http://www.javascriptkit.com/script/cut42.shtml"]http://www.javascriptkit.com/script/cut42.shtml[/URL] | |
Re: I agree with what everyone else said. There are solutions to make things easier, frameworks for instance make building forms/database input easier and faster, but without knowing your way around is going to make installing a framework, and making it work for you, instead of against you, pretty difficult. good … | |
Re: Yea, no point in suggesting possible solutions, they are endless, and would be a waste of everyones time. Find out what your host allows, or at a minimum, some specifics on your setup. | |
Re: You would need to start with fopen, curl, or any other http request function. Youll then have to parse the html returned using a regular expression search to find the pieces of the header your looking for. hope that helps. | |
Re: Youll need to use some server side scripting to do this. What type of server are you using? | |
Re: I currently use phpDesigner. I like it cause its a very easy and light solution. I've used dreamweaver, but it definately lacks alot of features of an development IDE. I've also used Aptana and Netbeans. Both are pretty solid, but require a lot of resources. [QUOTE] Id recommend Apache as … | |
Re: using an .htaccess file you can redirect your old product pages to your new ones. search engines will pick this up over time, but it will help those people that click on old links, they'll get to the right place. I'd also suggest creating a friendlier 404 page, so you … | |
Re: if your using an embed tag, you can do loop=true. But are you trying to embed an AVI file? thats definately not a good idea | |
Re: You can also do this via css and ajax. I do it this way, so i can create a few simple classes for my cursors, and then just use addClass or removeClass whenever an event occurs that I need to change the cursor (click, hover, alert, etc.) | |
Re: its easiest if you have a site worth linking to. give them a reason to link. if your site doesn't offer anything that other people want, you'll be the only one linking to it. start here: [URL="www.webmasterworld.com"]www.webmasterworld.com[/URL] | |
Re: You could use an ajax request, so the page wouldnt reload, it would just be sent without the user knowing. You wouldnt want that to be done onChange though, you would need to change it to onBlur. If ajax isnt for you, the anchor would be the another solution, your … | |
Re: your php code is not visible in the source of a page. only your output from a php file is visible in the source. now, if someone had access to your files themselves, through a command line, or FTP or something like that, they could read the file, and see … | |
Re: I dont know of a way to actually limit the table to 20 rows, your better off doing a query and conditionally displaying the form. Count the number of entries in the table, then only display the form if there are less than 20 rows. | |
Re: I cant say that I've ever worked with a space in a column name... but I would assume you could use the little tick marks around the name of the field. [CODE] $sql = "UPDATE Lieneke SET `Best moment` = REPLACE(`Best moment`,'$moment','$momentnew')"; [/CODE] If your using a tool like phpMyAdmin, … | |
Re: I strongly advise against building your own in a hurry, especially if you plan on putting a lot of important data in it. There are plenty of open source CRM systems out there that will probably accomplish your goals. There are also paid systems that will handle everything for you, … | |
Re: Try this: instead of: [CODE] $test = new test; [/CODE] try: [CODE] $test = new test(); [/CODE] | |
Re: I am not sure i fully understand the question, but I think you may be better off taking the time calculations out of SQL and moving it into PHP. Have your table have a timestamp field, then your PHP can do the calculation when the page is rendered. If you … | |
Re: If you just want the content of the page, you could do an fopen on that URL, but if your looking for the username column out of the table on that site, you'll need to do a lot of string manipulation to get them out. I would say your better … |
The End.