Jump to content

garyed

Members
  • Posts

    136
  • Joined

  • Last visited

Everything posted by garyed

  1. Update, I decided to uninstall my LAMP server & reinstall it to see if that would fix anything & sure enough, it did. I'm not sure what happened to only effect two directories but they are working fine since I reinstalled Apache. Anyways, thanks for all the ideas.
  2. I think I'm going to take your advice & close down port 80 until I can figure out what is going on. I wanted to be able to remotely access my work & I've also been tinkering with the idea of hosting my own website so I've been playing around with this for quite a while. My port has been open for a few years & I've never had any problem until now. It all started when I forwarded one of my domain names to my computer as an experiment about a week or two ago. I used a php password protected index page with a mysql database to see if I had any visitors. When I realized it wasn't a good idea, I got rid of the domain name thing but I was still getting visitors. Then I added the .htaccess file with a password. I'm not sure exactly when my directories started having the problem but I'm sure it wasn't until after I forwarded my domain name. It might have started when I added the .htaccess file & changed some configuration files but I can't be sure. If my whole site was down then I would think it would have to do with something I did, but having just two directories down doesn't make sense.
  3. Did you get to the login page? If you did, did you get to any of the site at all?
  4. Yes, I have quite a few different web sites & each site has its own directory. I use my Apache server to design the pages & test them before i upload them to my web host. So I can either just go to localhost from my browser or type in my ip address to view all my sites & pages. There's only two sites & pages on two separate directories along with their sub directories that I get the error & all the other sites & pages in about 40 other directories work fine. The path is fine & that's why i'm wondering if I've been attacked. I'm running Apache on Ubuntu Linux.
  5. I assume Apache has to be running because 90% of my server site is working & it's only two directories that I'm having the problem with. I created a new directory & copied the index file & the background image from one of the directories that wasn't working into it & it works OK except the background image doesn't work. If I type the url of the image file I get the same error but if I put another image file I don't get the error. It's like something has happened to some of the files in those two directories. I'm at a complete loss.
  6. For a couple days I experimented with hosting my own site by routing a domain name to my computer. I didn't really want any outside traffic but i found i was getting a few visitors & i didn't have confidence in my password security. So i decided to unlink the domain name so at least someone would have to use my ip address to get to my site. I found that I was still getting a few visitors each day so I decided to use a password through .htaccess which was on of the suggestions I got from another thread. Everything seemed to be working fine & as far as I could tell no more visitors were getting in to my site. Now I find that two of my directories will not work through either browser, Chrome or Firefox. When I go to localhost to work on my site & to those two directories I just get: " This site can’t be reached localhost refused to connect. Try: Checking the connection Checking the proxy and the firewall ERR_CONNECTION_REFUSED " I've checked permissions & can't find anything different than my other directories that do work. All my files are still there so I'm a little confused. I have plenty of other directories on my site still working. I have messed with some configuration files to get .htaccess password to work but I can't even remember what I did. I tried removing the .htaccess file but that didn't help either. Any ides?
  7. By doing the RewriteRule would that mean if I have any file in the root directory let's say called jimbo.php & someone typed in http://myipaddress/jimbo.php it would redirect them to index.php?
  8. Thanks, If I understand you right, it could either be done through the .htaccess file or else I would have to edit every page to look for the correct session variable that is passed from index.php when the correct password is entered. Assuming that is correct then .htaccess would be a better idea assuming it is reasonably secure. I don't do much other than surfing the web & doing my site on my server but I still don't like the idea of it being insecure.
  9. I'm not sure if this is a php or Apache question but here goes anyways. I have my Apache web server set up so I can access it from anywhere which obviously means anyone else can access it too. I have my index page which is basically a menu for the site password protected with a simple php script. The problem is the index.php password page can be bypassed by just typing the name or path of any of the pages on the site. I don't want to have to password protect or enter a session variable onto every page. Is there a practical way to make it where no page can be accessed without being routed from the index.php page ?
  10. If anyone is using Chromium broswer I'd be curious if they tried that code & see what happened. That code that I posted is the whole html file & nothing else. I made that simple html file just to test the onchange & alert functions together to see why they wouldn't work on my website. In Firefox it works as expected but in Chrome it crashes my browser & freezes my mouse & I have go to the terminal to close the program down. I should have been more specific because it doesn't crash until you actually change from one option to the other. Then the alert pops up on the screen & that's when everything locks up. After spending most of the day on it I finally found a solution. There have evidently been some conflicts with Chrome & the alert & confirm javascript functions & the only thing that worked for me was to use the setTimeout function. After adding that, everything works in Chrome. It's possible it's just the particular Linux version of Chrome that I am using. This works now: <html> <head> </head> <body> <select name="testify" onchange="setTimeout(function(){ alert('something'); })"> <option value=1> one </option> <option value=2> two </option> </select> </body> </html>
  11. When using javascript onchange with an alert function chrome freezes up. I've tried the same code in Firefox & it works fine so I'm wondering if it is a bug or I need to do something different in Chrome. This code couldn't be any simpler & it locks up my browser & freezes my mouse. I'm running Chrome in Ubuntu Linux 18.04. The same happens if I try a confirm function with onchange but both confirm & alert work as long as they are not used with the onchange function. <html> <head> </head> <body> <select name="testify" onchange="alert('something');"> <option value=1> one </option> <option value=2> two </option> </select> </body> </html>
  12. I must apologize because I finally got it. I didn't realize that i could add to the variable you showed me in the brackets. I just used: for (i=2;i<5;i++) { var key='t'+i; document.tester[key+'_home'].value=''; document.tester[key+'_wall'].value=''; /// etc.. } & it works. Thanks again
  13. I do appreciate the help but I still don't think i'm making myself clear. I've tried using the way you showed me with the key variable but in order to make that work i would need 60 different variables. What I need to do is use just a number for the variable so i can run it through a loop without the text. I can't run the way you showed me through a loop because i have to change not just the number inside the key variable but the text inside the variable also. That is why I'm trying to find a way to just add a number variable that can fit into the command line string..
  14. That's what I don't know how to do in javascript. I know how to add a variable to a command in php but not javascript. In other words var x=3; document.house.t+x+_home.value="9"; doesn't work. How can i fit that variable "x" into that command to get it to work the same as: document.house.t3_home. value="9"; ? If I can do that then I can figure out the rest of what I want to do.
  15. Thanks for the help, That would work if "home" stayed the same but it changes too. I really didn't give a good example of what I was trying to do because the 3 does need to change but I have a bunch of different values than .."home" also. I already have about 60 different fields that I've already set up in a script to get the value I want but only for "t3_home.. t3_wall.. t3_window.. etc... " . So what I'm trying to do is just put a variable in just where the "3" is so i can run it through a for loop to get t2.. t3.. t4.. etc.
  16. Is there a simple way to use a javascript variable as part of the actual command? I have : var x=3; & I want my command to be: document.freeone.t3_home.value="close"; x is going to change from 1 to 100 so I want to substitute the variable instead of using the actual number 3 in my example. Any ideas?
  17. I just wanted you guys to know i came up with a pretty simple solution for most of the errors. It may not be right but it works pretty good. It just converts all the empty spaces to zero. I couldn't check for just numbers because there are too many hidden values that are posted that are not numbers so I just checked for empty fields. foreach($_POST as $key => $value) { if ($value=="") { $_POST[$key]=0; } } I needed to add a few more if statements to get rid of division by zero errors & everything seems to be working OK & all the errors are now gone.
  18. Thanks for the ideas, I'll look into them & see if it would be more practical than what i was doing to get rid of the errors. I started thinking that even though everything is working fine now, that down the road when my web host changes to another version of PHP or anything in their settings that I have no control over, those errors could come back & bite me. So I think you guys are right that I should take the time to clean the code up now & not just leave it alone because it's working. I'm in the HVAC business & a lot of times you can get something working temporarily even though it's not right. If you don't go back with the right part or whatever it takes to get it right then down the road it causes a problem. I'm starting to look at my php code the same way, that it needs to be error free or it can hurt you in the future. Thanks again to everyone for the advice
  19. You are absolutely correct. All the errors I'm getting is from using empty strings in my calculations. I started fixing them by putting some of them in an array & then using array_sum which gets rid of the errors when empty strings are added together. Also zeroing out some worked too depending on the calculation but there are so many to do it was getting a little frustrating. I wanted to see if it was feasible to just not show the errors & by doing so everything is working just fine. Since the only errors are from using empty strings, I'm really just trying to find out what the down side is to using an empty string in a calculation other than displaying the error. I am already totally convinced that it is wrong to do but I'm just not convinced of the necessity to fix anything if its working.
  20. The problem is that I don't have any fires that I know of. The same code has been running smoothly for quite a few years. If I was having problems then it would make more sense to me. I may end up changing the code to get rid of the errors anyways but what harm does it do to have a non numeric value that is not being used? That's my question & if I hear a good reason to get rid of those non numeric values that wopuld help me make up my mind. I just don't want to throw in 50 or 100 if statements & arrays that don't help anything except keep errors from being displayed when i can accomplish the same thing with two words in an ini file. I'll know better in the future to be more careful with unused fields but I don't want to rewrite something that's already working & not get any better results..
  21. I found the answer & it was pretty simple. All i had to do was add the line "display_errors = Off" in php.ini & everything works just fine. Now I have to decide if I really want to do the work to correct all those non-numerical values or not. Other than not being notified of errors, does anyone see it causing a problem with functionality?
  22. If I didn't have so many errors I would agree but after spending an hour or two fixing some of those errors & seeing how long it was going to take to fix all of them I figured there's got to be an easier way. The program has been running fine for years on the same server & what is being called errors now have never had any effect on the functionality. I'm not saying it's the right way or the best way but I just don't see a need to fix anything if I can just get rid of the messages. Remember the error messages only appear when I add a two line php.ini file to the server to extend the session time. So I'm assuming it has just as much to do with the .ini file than the coding. It also runs fine on my server & I'm running PHP 7.2.24 where my web host is running PHP 7.2.33 so I assume there is a way to do something in the ini file. I just don't want to spend a couple days fixing errors for no reason if I can fix everything with a single line.
  23. Is there any way to disable the "A non-numeric value encountered" warning in the php.ini file? I don't get that warning on my Apache server but I do when I use the same code on my web host's server. I never got the warning until I uploaded a two line php.ini file to my web host so that I could keep my sessions longer than the default 24 minutes. This is the same online program related to my earlier post about too many inputs. I wanted to try sessions for a 24 hr. period but I'm getting tons of errors for any field that is not used which can be in the hundreds. If I delete my php.ini file from my web host & just let things default to whatever they are using then I don't get those errors,
  24. Very interesting. That seems like something to look into but I do move at a pretty slow pace. I really do appreciate the ideas.
  25. I started the project about seven years ago so I have been learning as i go. I may not have known how to put the state & cities on the same page at the time but that might be a good idea to cut it down to three pages instead of four. I know i wanted the last page & the page before it on separate pages. I didn't want things to look cluttered. The last page is going to have up to 20 rooms instead of just the one you see, so I wouldn't want anything else on it.
×
×
  • Create New...

Important Information

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.