Jump to content
xisto Community

vujsa

Members
  • Content Count

    1,008
  • Joined

  • Last visited

Everything posted by vujsa

  1. Thanks, that worked great. I wasn't sure what you wanted me to do at first but I read through a few user contributed notes for array_merge and found what you were referring to. Ended up with this: $result[0] = array('item1', 'item2', 'item3');$result[1] = array('item1', 'item2', 'item3', 'item4', 'item5', 'item6');$result[2] = array('item1', 'item2', 'item3', 'item4');$result[3] = array('item1', 'item2');$merged_items = call_user_func_array('array_merge', $result); This saved me a bunch of time as I wouldn't have stumbled over this by myself for days if ever... I was about to do a loop to merge the arrays the hard way. Thanks again, vujsa
  2. I have been working on a project and attempted several methods of returning the data I need but using array_merge() then count_array() to return matching items from a number of arrays seems to work the best. As a result, I could have hundreds of arrays returned by a database query that I would need to merge. The arrays would have a structure like this: $result[0] = array('item1', 'item2', 'item3');$result[1] = array('item1', 'item2', 'item3', 'item4', 'item5', 'item6');$result[2] = array('item1', 'item2', 'item3', 'item4');$result[3] = array('item1', 'item2'); So I would need a script that would do the following dynamically: array_merge($result[0], $result[1], $result[2], $result[3]); I've got a few ideas of how I could do this but each idea will take time to code, test, and compare to other options. I was hoping that somebody already knew a quick way to do this. Thanks, vujsa
  3. Well, the lead paint problem with toys manufactured in China has not gotten any better. Since the first problem, toy companies have started testing all of their toys that were manufactured in China and found many more are contaminated. While China may have actually stopped using the paint for our children's toys, products already shipped and sold to customers more than likely have some degree of contamination. The only way to know for sure is to buy a lead test kit and test each of you child's toys.Just released this week, the country of Australia has banned Aquadots. The beads are contaminated with a chemical that date rapist use to subdue their victims. This is a very dangerous chemical for Adults and even more so with children. Children placing these in their mouth could slip into a coma or even die.Again, does China have any consideration for the safety of the users of the products manufactured in their country? At this point in time, I can only recommend that if you value your safety, don't purchase ANYTHING made or assembled in China. I generally don't like making suggestions like that but if we continue to buy from China, they will continue to overlook basic safety standards to increase their profits! Maybe if we discontinue buying from China, the Chinese government or even business owners will improve safety to get the rest of use to start buying from them again.vujsa
  4. Yeah, I'm on vacation this week with nothing to do but play online.vujsa
  5. I originally came up with the idea when working on a dynamic signature image. Since the image is generated on the fly, it uses a lot of resources and that use of resources is why many websites don't provide them. If when you generate the image, you save a copy in an image folder; you can use the saved image for a while instead of generating a new one. This is useful if the information in the dynamic signature image isn't updated in real time and the signature is likely to be displayed frequently. Saving a cached copy like this really saves server memory and CPU usage but requires a more complex script and more disk space.This type of on demand data processing could probably be used for about 90% of the current cron processing used these days. The problem is that most people don't consider that User A's activity can trigger a global event. Most developers tend to separate the user from the group so they simply don't see the relationship between the user and the group.The down side is that the user that triggers the global update will likely notice a delay in the loading of the page they requested and if the action is too large, the user could be timed out and the process may terminated before it finishes. So it is important to allow enough time for the operations and try and keep the operations as small as possible.One way to keep the processes small is to use a cascading method. For example, User A initiates the process the sets a value that will be checked the next time a page is requested. User B requests a page which triggers the second step of the process after the script checks for the value set by the first step. Then if required, the second step could set a value which would trigger the third step when then next page request comes. This could continue indefinitely. Alternating processes could also be used. If X amount of time has passed, perform action A unless Y amount of time has passed then perform action B instead...The options and uses are limitless and I urge everyone to experiment with this method.vujsa
  6. I recently got an idea for a project and one of the features I wanted the project to have was an automated suggestion service. If anyone has been to Amazon, it would work much like their recommended product feature.What I want to do is take several users lists of whatever but for this example, I'll use web links like from the browser history.I would want to suggest links to a user based on common links in many other users lists.User A: Amazon, Ebay, Excite, Google, Yahoo, MySpace, WalmartUser B: Amazon, Ebay, Google, Yahoo, You Tube, MySpace, CVSUser C: Amazon, Excite, Google, Yahoo, You Tube, MySpace, Home DepotThe three users have similar lists and as a result, they probably have similar website preferences. So the script would recognize the similarities (All have Amazon, Google, and MySpace), eliminate the uncommon items (Walmart, CVS, Home Depot), and then suggest to each user what ever common link they are missing:User: SuggestionA: You TubeB: ExciteC: EbayThis is a very simplified example but the theory would be the same except for the following:There will likely be more than one common pattern in a user's list like so:User A: Amazon, Ebay, Excite, Google, Yahoo, MySpace, WalmartUser D: Google, Yahoo, Walmart, Applebees, Overstock, PayPalUser E: Ebay, Google Yahoo, Walmart, PayPal, Circuit City, Best BuyAll share Google, Walmart, and Yahoo so that is the pattern match. Ebay should be suggested to User D since User A and User E share that as well. PayPal should be suggested to User A since User D and User E have that in common. Best Buy, MySpace, and Overstock should not be considered.The script should be prepared to search hundreds or even thousands of user lists to find match patterns and make suggestions based on those matches. The script should be able to provide suggestions based on the best matches possible.Ideally, the script would work with nearly any kind of list such as books, links, songs, etc...So the question, does anyone know where I can find a similar script or have any suggestion on how to begin developing such a script.I had considered using a percentage comparison instead of a true pattern matching method. User A's list is compared to every other list in the database using a query that would return lists that are most like it. Using the top 5 or 10 similar lists (Based on how well it match percentage wise). This would use the same technique as the search engines do when they list search results by relevance and show how relevant it is by a percentage value. Then eliminating all of the completely uncommon items from the list, and then removing all of the completely common links would give a list of items that might be suitable to suggest to each of the lists mentioned as long as the suggestion wasn't already on that particular list.So, given that this is the much easier method, does anyone have suggestions for this?Thanks for any help.vujsa
  7. No problems with Joomla here. I as well as others here use Joomla without and issues. Infact, a large ortion of my website is dedicated to the creation of Joomla SearchBots for add-on components that don't include a search plugin.vujsa
  8. Well, I started using Google Analytics three days ago since my built in web stats component is using a very large amount of space in my database. I wanted to find a way to replace it and save the space used so I signed up for Google Analytics. I did as suggested and placed my tracking code right before </body>.There is a very large difference between what Google shows my traffic as and what my built in system. For example, yesterday, my built in system told me that I had 2684 page views (not visitors but actual page loads) but Google only shows 773 page views. I checked the server logs and found that 2684 was the correct amount.Maybe I'll try placing the tracking code at the beginning of the page instead of the end and see if it helps.I would have to say that other than the fact that Google Analytics is incapable of providing accurate statistics, the tool does offer a lot of insight to traffic patterns on your website. The bounce rate alone tells you whether or not the content on your pages is useful or not. Having a better idea of where your visitors come from and a clean organized way to view your stats is priceless.vujsa
  9. I can't believe that I never replied to this topic. I've seen it several times and assumed that I already replied... Well, it all began for me in the early 1980's. I guess it was about 1981 or 1982 when we got our first computer. My uncle worked for Radio Shack and was able to get a discount on a TRS-80 Color Computer which he gave us for Christmas. My Aunt who is only 9 years older than me had learned some BASIC in high school and showed me how to fill the screen with a repeating message using a for loop! Within a few years, I had learned how to reproduce some children's music with the computer. It was just a matter of selecting the right tone and duration for each note. I managed to do a few basic images but the screen resolution was very low. You can get a better idea from the wiki link above. While I rather enjoyed "playing" with the computer, I never had any programing classes in high school. I don't even think that there was any programming classes available when I was in school. By the time I was in high school I had gotten a new computer. It was an Apple IIc which was used and was compatible with the Apple IIe's at school. Once I started college and found that PC's were the way to go, I rarely turned the Apple on anymore. As a freshman in college in 1992, I had a C programming class for the engineering degree I was working on. Although I had no idea why, I was able to follow the examples and write the required programs each week without any trouble. That was until we started working on functions. I couldn't seem to figure out how to write or use functions in C. I guess that either my instructor wasn't able to explain the concepts to me in a way that I could understand or I wasn't able to understand the concepts because it was beyond my ability at the time. Looking back, I can't understand why I had so much trouble with it. After several major changes and a transfer to a different university 1995, I was introduced to the internet. As a result, I learned HTML by comparing the source code to the page displayed on the university website. From there I learned some basic JavaScript skills and made a few specialty calculators. I kind of lost interest in web design and programming again for a few years until my employer needed someone to update their website in 1998 or 1999. I updated the website for a while and during that time I added a link script written in PERL. I had began playing around with PERL script around that time so I knew where to find such a script. My internet provider offered a free web page (maybe 5 MB) with a cgi-bin so I began experimenting with various pre-written PERL scripts. I got pretty good at modifying PERL scripts but lacked the know how to write one myself. I was in need of a web server that had PERL available and didn't have any money. I came across a PHP programming book that described the steps needed to turn any PC into a Apache based test server. I installed Apache, PHP, MySQL, and of course PERL and began to develop a project using a PERL script I had found. In 2003, just as I was finishing up the project, I had a hard drive crash which caused me to lose all of my work. I was devastated! I replaced the hard drive and set up a bunch of backup systems and began playing with PHP. It didn't seem to matter much though since I couldn't afford paid hosting and didn't want to risk a bunch of money hoping that my website would manage to pay for itself. Finally, in 2005, I got an interest in doing a website that would help me keep in touch with old friends. Since it shouldn't have been too large or fancy, I decided to get a free web host. I looked around a tried a few and finally found one of the free web hosting indexes. There I selected the options I really wanted from a web host and found Xisto. Once I got hosting here, I began experimenting heavily with PHP. Since then, I have become pretty good with PHP but still learn something new about it each week. Recently, I finally figured out how to use classes in PHP with limited functionality and have been writing my own functions for a while. As a result, my scripts have become much more efficient and I am getting pretty good at error checking. Using classes and some more advanced PHP techniques, I have started undertaking much more complicated projects. One of my earliest projects was the Free Web Hosting Application. Looking at the source for it now, I can't believe how much better I have gotten at this. I recently started looking into AJAX but probably won't do anything with it until the web browser developers figure out a way to make their browsers follow standards. Drives me nuts that you have to write line after line of code just to make the script work in more than one browser. So I guess I have been doing some kind of programming for about 25 years now. Recap: BASIC LOGO HTML C JavaScript PERL PHP MySQL vujsa
  10. I don't mean to discourage you, most of the code is quite promising. There are just a few problems with the organization.I know I had a lot to say but I wanted to get you started in the right direction. If you can implement some of the suggestions I gave you , you should be able to get your project back on track.vujsa
  11. Well, I'm not sure if I can help. You have a lot going on and most of the code looks okay but I don't understand why you are asking about sessions but not using them... I see in users.php that you start your session as normal but then change the session id to "test". This would give everyone that accesses users.php the same session id! But, keep in mind that this isn't the actual session_id, it is a variable associated with that session named "id". The session id should be something unique every time. Simply by starting a session, the server automatically creates a new one so it isn't necessary to set the id yourself. Then in the files shown here, you never use any session information. Instead, you rely on ip addresses as the key to your database which could have some real problems with it. For example, if you have a user log in many times from the same IP address, the database may have hundreds or even thousands of records using that IP. This could cause cause errors down the road if you aren't careful with how you check fro existing sessions. This is why most developers use the server generated session id as the database key. Your timestamp issue I think is where you have the trouble. First, the next two code bits do exactly the same thing: $w=date('W'); $d=date('d'); $m=date('m'); $y=date('Y'); $h=date('H'); $tim1=$w.$y.$m.$d.$h;echo tim1 . "<br />\n"; $tim2=date('WYmdH');echo tim1 . "<br />\n";which as of right now would give you this: 442007110100 The 44th week in 2007 on the 11th month and 1st day at 0 hours past midnight. Not exactly a highly usable variable to use. And an MD5 hash of this looks like this: 30687663fc34e16d5c272ddf2f44fbc5 which is what $timd is set to. Now for your variable $session after 2 hours would be explained as such: $session=442007110100-442007110102;Which is -2. However, if you do change the $session variable to this: $session=$tim-$time;it would b 2. But even at that, once a new year starts, you'll have problems since the first part of your time value is the week of the year so January 1, 2008 would look like this: 12008010100 and then session could be set like this even if you switched $time and $tim: $session=12008010100-442007110100;Which is -429999100000. If you don't switch $time and $tim: $session=442007110100-12008010100;Which is 429999100000. See how this could be a serious problem... If I log into your site today and then somebody that has the same IP address goes to your site in January without me returning in between they will be logged in as me! This could happen with users of dial up internet access or dynamically assigned IP address broadband access. Which is still quite common. Just between December 31, 2007 and January 1, 2008 there would be issues and that could be less that an hour old session... I think you would be better server using a Unix timestamp which will always get larger every second... time() will return the current Unix timestamp which right now is 1193902752 and now is 1193902765 and now is 1193902771. It increases by 1 every second and is a calculation of the number of seconds since January 1 1970 00:00:00 GMT. This is easily formated into any date formate you want with the date function and is the figure used by default when you use date without the timestamp argument. Since this number is extremely predictable, most developers use it. Now for the next problem... When you have a session greater than "5", you update the MD5 of the time value but you don't update the actual time value! Since your comparison is based on the time value $tim and not $timd, you would be better off to update session.time in the database instead of session.time_stamp. Since currently your session time in the database never gets updated, the comparison will not work correctly. I don't understand the need for $timd. the MD5 hash of $tim doesn't seem to be necessary. You could just as easily drop that from your script and check to see if there is a value for session.time instead. Which if you use my suggestion to use a Unix timestamp instead of what you now use, you could check for a valid session with the database query. For example: $current_time = time();$maximum_session_life = 3600; // 3600 seconds equals 1 hour$session_cut_off = $current_time - $maximum_session_life; // Basically, the session had to have been created less than 3601 seconds ago.$ip=$_SERVER['REMOTE_ADDR'];$query = "SELECT id, session_details, timestamp FROM session WHERE id = '$ip' AND timestamp >= '$session_cut_off'";// Additional query code here followed by whatever you want to do if data is returned...Now this would only return a result if the id was in the database already AND the session time in the database was not too old... I would imagine that if it were too old, you would simply want to redirect the user to the login page. Otherwise, you have to UPDATE the timestamp in the database like so: if(count($row) > 0 && $row['session_details'] != ''){ $session_details = $row['session_details']; $timestamp = $row[2]; mysql_query("UPDATE session SET timestamp = '" . time() . "' where id = '$ip' ");}else{ header ("location: /login.php");}So that check to see if a result was returned and if the the field session_details has a value applied to it. If it does, update the timestamp otherwise redirect to the login page. Now as I suggested at the beginning, I think you should use session_id() instead of $_SERVER['REMOTE_ADDR'] for your table key. This will reduce dynamic IP issues and is easier to deal with since it is generally a good idea to generate a new session id if the previous one is expired. You don't need to use $_SESSION for anything unless you prefer to use that instead of the database to store information about the user. For example, you could assign some details about the user like his name in the $_SESSION variable and use that instead of querying the database each time you want to say "Hello John Doe!". Of course, if you do actually use the PHP session functions, you really should generate a new session id when a session expires and the user has to log in again. I have given you a lot of information here. Between this and my previous reply, I'm sure you'll have many questions. good luck, vujsa
  12. Well, you can control these settings on a directory by directory basis. Just add an .htaccess file to the directory you want to turn these settings on or off in and write the following code to it: php_flag safe_mode onphp_flag register_globals on Remember that any directory inside of the directory you change the settings on will also be affected. vujsa
  13. In the top right corner of this topic, there is a menu button called "Options" Press it and select a different display mode.vujsa
  14. Well, depending on where you look, handyphp.com either has a page rank of 5 or 6! Firefox shows 5 and so does Website Grader but Check Page Rank and Xinu show a rank of 6! Anyhow, there are explanations of the ranking system found on this forum and many other places on the web like Wikipedia. Nevertheless, I'll give a brief explanation. Google has a formula and a computer that calculates the page rank of any given web page. Not site! This is a page by page calculation! A page's rank increases if it is linked to by several other sites. The higher the rank of the page that links to yours, the more credit your link is given in the calculation. So it is most important to have you link listed on highly ranked pages but having a large number links to your page no matter how high their rank is will also help. So in theory, if every web page in the World linked to your page, then that page would earn a 10! But this is all relative!So if your page rank drops a point, it may not mean that your website has less importance, just that there are more websites that managed to gain greater importance. Now, Google uses that page rank data to determine the position of your link in their search results. If your content page has a rank of 3 then any content page related to the search with a higher rank will be shown before yours. However, this can also be relative since Google also uses the number of clicks to the link in the calculation and every page is treated individually by it's content. For example, my PHP related website does very poorly when you search for "PHP". But "PHP Ordinal" does very well. This is because of the exact matching content and the frequency in which Google user's click on the link. But now we are deep into the SEO realm and I need to remember that the topic is who has the better site here. While page rank and SEO statistics help to identify quality content on the internet, learning how to use that data and get honest feedback from discussions like this is where we can benefit the most. So, keep up the hard work and enjoy your hobby! If it makes you money, enjoy it more! vujsa
  15. Well, before I try and figure out some server setting issue that I'm not very good at, I'll try the most obvious stuff first. At the beginning of every page, you need to start a session. The best part about this function is that it starts a new session if one doesn't exist and retrieves the session information for one that does exist. <?phpsession_start(); Then you have to get your session ID: <?phpsession_start();$session_id = session_id(); Finally, you usually want to use that id to retrieve information from the database. <?phpsession_start();$session_id = session_id();$connection = mysql_connect('mysql_host', 'mysql_user', 'mysql_password');mysql_select_db('mysql_dbname', $connection);$query = "SELECT * FROM table_session WHERE id = $session_id";$result = mysql_query($query, $connection);$session_details = mysql_fetch_row($result); Now, you should have set some type of timestamp when you first created the session I usually use the value from time() since it is the easiest to compare with. You compare the stored value to the current value to determine whether or not you should expire the current session. If you don't expire the current session, then you need to update the timestamp in the database... For that you UPDATE the database record... $query = "UPDATE table_session SET time_stamp = '" . time() . "' WHERE session_id = '$session_id'"; Of course, this assumes that you have a session already! If you don't, then you have to add the record to the database. $result = mysql_query($query, $connection);if(!isset($result) || is_null($result)){// INSERT a new database table row here with $session_id as the record ID.}else{// Use the returned data} You will need to start a completely new session if the one retrieved is expired. In some cases where you use user authentication, you'll need to redirect to a login page... The system can be as complex or as simple as you wish. Remember if you don't want to use the database so much, you can store variables in the session... Well, let me know if you need further assistance. vujsa
  16. ;)You can't delete the files or directories because you do not own them! ;)I'm not kidding, you realy don't own them.You probably created the directories with a script. Since the script actually tells the server to create the folders, the server owns the folders. Makes sense right, the server created them so the server owns them...In order to remove them, the server has to do it!No big deal, just write a small script to delete the folders your last script created...Or write a script to change CHMOD the folders and then you can delete them.Since you only have the one master folder that is afected, copy and important data from it then delete the whole thing and the rest will go with it.By the way, you aren't the first person to be stumped by this.Check out some of the related topics below!vujsa
  17. Anytime I consider using a CRON job, I always try and figure out a way to accomplish the same result without having to rely on such a server intensive method. For example, most of the time the data only needs to be updated if someone wants to view it... I keep a time file that simply has a unix timestamp from time() and that is considered the last update time. When someone requests a page that contains data that might need to be updated, the script compare the current time to the last update time. If the difference between the two is greater than the refresh rate, the data is updated and then outputted. Otherwise, if the difference is les than the refresh rate, the existing data is used. Kind of like this: <?php$time_current = time();$time_updates_last = file_get_contents('time_data.txt'); // gets the contents from a file that only has a single value in it$refresh = 1800; // 60 seconds / 1 minutes * 30 minutes = 1800 seconds$data_age = $time_current - $time_updated_last;if($data_age >= $refresh){ // past refresh time// Do whatever data refreshing you need to here and then write a new vale to the 'time_data.txt' file// Then outout the data to the user.}else{// Just output the data to the user.}?> However, if this is a deal where you are doig more than simply updating data for output, then you have more work to do. For example, imagine that you have a ining rate and your user is able to mine 4 units per hour and you want to update this every 30 minutes. If you used the system above, then the users mined units would only increase by 2 when the refresh rate was reached and someone loaded the page... That means if nobody loaded the page for 4 hours, then that user would only increase his mined units by 2 for the 4 hours... This would be a problem wouldn't it? So you need to make sure that the script then accounts for the number of time that the data should have been refreshed. For example, here is a quick example to determin the number of times the update should have taken place. <?php$time_current = time();$time_updates_last = file_get_contents('time_data.txt'); // gets the contents from a file that only has a single value in it$refresh = 1800; // 60 seconds / 1 minutes * 30 minutes = 1800 seconds$data_age = $time_current - $time_updated_last;if($data_age >= $refresh){ // past refresh time$update_count = $data_age / $refresh; // This give you the number of times in decimal form that the update should have happened.}else{// Just output the data to the user.}?>I suggest that you round this number "DOWN" to the nearest interger 3.7654 becomes 3 etc... Do what ever update you need on the data and use the update count to determin the number of times to multiply that or perform a loop. When you update the stored timestamp in 'time_data.txt' don't use the $time_current as that will throw off your interval by whatever the fraction was that you removed earlier. Instead, use ($refresh * $update_count) + $time_updates_last; This will make sure that you only update every 30 minutes not 24, 29, 20, 10, 18 minutes. I mentioned a loop... If your values build on each other like compounding interest, then you have to use a loop like so: Increase the user's gold by 25% each cycle: for($x = 1; $x <= $update_count; $x++){$gold = $gold * 1.25;}So if $gold equaled 10 and the update count was 3, then the following would result: $gold = 19.53125; 10 * 1.25 = 12.5 12.5 * 1.25 = 15.625 15.625 * 1.25 = 19.53125 The same result can be found without a loop like so: $gold = $gold * (1.25^$update_count); Now this would only affect the server when someone loads a page otherwise, the server is happy to ignore the script. This saves the server from performing calulations when it isn't really needed. Your web host will realy appreciate you efforts with this... vujsa
  18. Yeah, that page rank 5 was hard to accomplish too! The Alexa rank of 195,809 was even harder. ;)I'm really surprised that I had the highest page rank. Perhaps other members that were able to get a decent page rank moved their hosting to a paid service.I didn't even realize my site had been placed on the list here. There are a lot of good looking sites on the list but I haven't had time to look at all of the content. I think the content is the most important part of the survey but if your site looks bad will people even look?I think everyone should keep up the hard work they have put into their websites. It won't be long until you all have tricked Google into raising your page rank like I have. ;)vujsa
  19. Thanks for you comment. I appreciate your vote, I didn't even realize my site had been added to the poll.I took your advice and added a little more spacing between the content on the website. I think it does actually help with the overall appearance of the website but has caused a couple of layout flaws as a result. I think I can correct them by developing a new module or two to replace the modules affected.Thanks again,vujsa
  20. Well, this is kind of advanced server issues... If you want to add or remove a subdomain from your server, you will need to have a script that can access the configuration settings of the server. This is tricky since most servers are set up so that these settings can't be accessed from an outside source or from the public directories of your system. Your first obstacle is your hosting provider... If your hosting account isn't dedicated or near dedicated, then you probably won't have the required server permissions to accomplish what you want to do. The second consideration is your server software... If you are using Apache on Linux, then your configuration settings are more than likely all in one file. Being able to select the correct parts of this file and modify it to either add or remove a subdomain is the biggest part of the process. Once that is accomplished, the actual subdomain directory or user account is must than be created for it. Your third issue will be your server interface... Whatever script or scripts you use will need to be smart enough to add or remove a subdomain from your server but not damage the rest of the configuration settings. My suggestion is to do research on Apache and Linux manipulation but since that is a lot of work and you are probably not going to do it, I suggest the following: Get a reseller account from a major hosting provider like Xisto - Web Hosting. This will provide you with an actual Web Host Manager interface to create, modify, and remove new cPanel accounts (subdomains) from the server. Additionally, this also offers the user the ability to "Sign Up" for a new account. You can specify what the basic template of each new website will be and given some trickery with scripts and Apache, you can even force ads on your subdomains. Small reseller accounts can be found for as little as $20.00 US a month. vujsa
  21. Well, Linux is Linux...I've always ended up with pretty much the same installation system and you can choose whatever options you want to install such as server programs and the GUI. However, I haven't been happy with the server operation I encountered with the included programs. Basically, I couldn't figure out how to get it to work...I do have a guide for installing Apache, PHP, Perl, and MySQL on a Linux system but haven't had a chance to try it out...I really didn't like Ubuntu, Red Hat was okay and I currently have Fedora Core installed. The installers were graphical but it was difficult to set up the dual boot with my Windows system.I only use it to play around with and hopefully figure out how to setup a viable web server.Seems like GRUB works better that the alternative boot loaders.Hope this helps.vujsa
  22. In short, yes! there is no reason for this not to work. In fact, you could have PHP dynamically generate an entire JavaScript on the fly if you wanted. This is because PHP is parsed on the server so the browser only sees the output and JavaScript is parsed in the browser so what ever the browser sees, JavaScript can do... Here is what your PHP code would output: <script language="JavaScript">BackColor= "green";</script> Now if you wanted JavaScript to send variables back to PHP, there is some issues but depending on what you want, this could be done using either the POST or GET method of variable passing but usually requires a new page to be loaded. It is possible with AJAX to pass variable to and from the server without the need for a new page load but that is another discussion. vujsa
  23. The forum and the hosted sites are on different servers... The faq.astahost.com site is on the same server as the hosted sites. If you are blocked on one server, the other servers are not informed. If the xisto network goes down for some reason, all of the servers for xisto are affected. Additionally, the Xisto and Xisto forum servers are much less security sensitive. This simply means that it takes longer for those servers to block you than the other servers. Having said that, in order to protect ALL of the hosted websites, the hosting server is set at a greater security sensitivity than the forum servers so if you make a large number of requests on the hosting server from the same IP address in a very short period of time, you IP will be banned automatically. I know this because it happens to me about three times a year. What is worse, is if your page is loading slowly due to high traffic on the hosting server, you might try to load the same page over and over in a short time to avoid the "timeout" feature in most web browsers. Also note that FTP connections are counted in this issue so if you are updating, creating, or testing something for your website, you are at higher risk of this problem. So to prevent this: Be Patient - If a page is timedout, wait a second before you try again. Request Less - If you have more than one page of your website open in your browser windows or tabs, don't try and load / reload more than one of them at a time. multiple requests at the same time is the quickest way to get an IP block since the server thinks you are a bot trying to overwhelm it. Set Up A Test Server on your local system to try stuff out on instead of the hosting server. This will save you time since you don't have to upload files to preview them. Don't Freak Out - The server has two stages for this security feature. When you put in too many requests, the flood control suspends your IP for a few minutes to deter automated bots that are trying to overwhelm the server. If you continue to flood the server after you get a temporary block, the server gives you a permanent block. Once you get yourself banned, there is only one way to get it fixed...Send a support request to tech support. cpanel username forum username domain name description of problem support [at] Xisto - Web Hosting.com vujsa
  24. Well, I actually wrote a function to manipulate dates quickly some time ago. http://forums.xisto.com/no_longer_exists/ // INSERT FUNCTION reformat_date() HERE!$long_date = "August 27, 2007";$year = reformat_date($long_date, "Y"); // 2007$month = reformat_date($long_date, "n"); // 8$day = reformat_date($long_date, "j"); // 27 I didn't try the YYYY-MM-DD format but I think it will also work. The function is pretty basic and will work for nearly any English time format. The guy probably used two time formates in his database because he wasn't very good with PHP date / time functions. Whatever the reason, dates aren't really that hard to manipulate if you let PHP do the work for you. You may note that my function is just a combination of two very common PHP date functions. The trick is figuring out the best way to combine PHP functions with your own hard work to get the results you desire. Personally, I prefer to use UNIX timestamps for all of my date storage. It is easier to compare and manipulate that way. Good luck, vujsa
  25. This is great but you are technically still hotlinking. You are stealing someone else's bandwidth and probably graphic creation for your benefit. While the tutorial shows a very interesting method of obtaining and using someone else's images, the fact remains that every time your page displays the image, the server has to download it from the original server! What is even more interesting, since you transfered the image from their server to yours, both you and the owner's bandwidth is used. That is how it works... When the server uploads or downloads something for your account, every bit goes against your monthly bandwidth total so not only did you use up the owner's bandwidth, you used the same for yourself. BUT, you then transfered that image to the user's browser which is another transfer. It ends up that for a 5MB file, the owner used 5MB and you used 10MB of bandwidth. Remember, just because you get around someone's hotlinking protection doesn't mean that it is right or that it doesn't cost anybody anything in the long run. If you wanted to do this without directly impacting the hosts bandwidth, you should write the script to save the file on your server in the process. Then the next time it is to be displayed, the script would check to see if there was a local version to use first! It wouldn't be hard to modify the script to save a local copy and use it when available. Just ask... Other than all of that, nice tutorial and script. Thanks for sharing. vujsa
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.