Jump to content

jodunno

Members
  • Content Count

    59
  • Joined

  • Last visited

  • Days Won

    2

jodunno last won the day on May 15

jodunno had the most liked content!

Community Reputation

3 Neutral

About jodunno

  • Rank
    Regular Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Update: this isn't an Apache problem. I have battled this issue now for three days and i found a culprit: Edge browser (versions 38 up until new chrome based version) break my css button tranform if clear cached data and files is selected. That is ridiculous. Like saying we aren't allowed to clear our cache to help espionage and data centralization. Absolutely garbage. I will be sure to mention this in my specifications/requirements page. All other browsers handle my files correctly. Microsoft is a piece of work. Anyway, Thank you for your time. By the way, no-store is the correct method of having pages not cached. no-cache is not correct. private is not correct. I had to research this subject. Best wishes and please stay healthy everyone. Corona virus is a big problem for us all.
  2. so the problem persists after a boatload of testing. I have tried separating headers in apache: HEADER set Cache-Control "no-cache" HEADER set Cache-Control "no-store" HEADER set Cache-Control "private" I've discovered a new cause. I have my site set as homepage in Edge. The problem is started whenever i just close the browser (not log out), then open the browser and log back in. It appears as though the homepage is a cached version of the site? which should still check the server and detect a no-cache header. The problem is especially noticeable whenever i have Chrome open at the same time. I cannot recreate this wobbly css cache problem with new versions of Firefox but old versions also make my css unstable. Anyone know of a solution to this problem? otherwise, i have to tell people that they cannot make my site their home page and that they have to manually clear the cache. that is sh1tty.
  3. Hello everyone, I don't know where to post this question because it is related to Apache and web browsers as well as php and programming design. I chose Apache because this is where the problem begins for me. problem: i have css code that uses transitions, transorm scale and transparency etc. so graphics heavy. Everything is okay in major browsers (IE/Edge, Firefox, Chrome and Opera). Now i want to control the cache. I set a Header in Apache to maxage=3600, private. I don't want a public cache when i have private protected pages (member subscriptions). Every browser except Edge is okay with my changes. Edge is creating multiple problems! My css transform icons are now unstable or wobbly during the transform/transition state. It is horrible. However, a bigger problem exists: my single page routing system breaks the home page in Edge. I route all requests through an page router, which then loads the appropriate content for index.php Now Edge does not show my home page. Instead i see only the last page loaded from the page router. understand? so home page, then click on link, linked page loads. click home link and it simply reloads the current page as index file. Why is this happening? All of my links are post requests, home page links are anchors. So i need to make home links also post requests? I wonder if my routing is the problem and other browsers are ignoring it? or is this an Edge issue, since only Edge is giving me a problem. Honestly, i am not a server configuration guru and i have no experience with proper headers. Anyone able to understand my problem and offer a solution? Best wishes.
  4. Hi again, I have 20+ years experience in programming. Do whatever you want but consider the following: When i first tried xampp with phymyadmin i couldn't login to my site either. I had to switch to the console. I rebuilt my database through the console and i logged in just fine. I think that phpmyadmin is difficult to use somehow. I filled in all of the data but it wasn' working. I find that the console makes it easier to build a database. Try to verify that your database is working using the console. If you need help with that, then let us know. Honestly, i have no problems since i switched to the console. Good luck.
  5. Hi gizmola, Thank you for taking time to reply. I appreciate your expertise with this subject. I'm a bit like a programming sheriff: trust noone and nothing / suspect everything. I don't even trust my own code. i use a counter in my foreach loops to be certain that they cannot become infinite loops via tampering: $count = 0; $maxentries = 100; ++$count; if ($count === $maxentries) { //i said 100 so why is this still going? exit now } i have designed my site to detect as many errors as possible. if file exists, if function exists, if isset everything. I don't want to help a hacker wreck my site. No stepping stones from me. I look at everything and question everything. In this case, i was startled by the history of background image names in the idb file like a fingerprint. Your explanation is most helpful to me. I am comfortable with this info. I've retained update as it is the best option. I can only do so much anyway. Atleast now i know more than i did yesterday. Best wishes to you and all members. I hope that you have a pleasant day. Stay safe and healthy and make the most of life, my friends.
  6. Hi requinix, No need to sigh, i'm sticking with update. Your opinion is good enough for me. Thank you for the lovely posts. You have been very helpful. Best wishes to you and all members.
  7. Hi slotegraafd, I'm just a normal user here so you should wait for pros to help you. However, i would still like to offer my opinion about your posted code: pdo is a safer solution to interacting with a database. I recommend that you switch to pdo: https://phpdelusions.net/pdo I've never understood error arrays and pushing data into them. a simple binary switch can be used to deal with error scenarios and a variable or array for error messages only: $error = 0; if (empty(bla_bla)) { $errors = 1; $message = 'bla_bla contains no usable data'; } if($errors) { //code to handle errors } //else continue or no else if header relocation exit is used if $errors if one of the required fields is empty or erroneous then just cut out completely and stop evaluating the rest of the data. you should use password_verify to check the password. MAJOR security error here. Also, hashing passwords as a student testing login scripts is not necessary but it is absolutely necessary on live site. encryption is not a protection mechnism. Use hashes. skip for now but never forget to hash the passwords (which also requires a rehash if php changed something as the default encryption method.) you use a header relocate without an exit: header('location: home.php'); change this to: header('location: home.php'); exit; to stop evaluation of the rest of the script. i wouldn't escape input. I recommend that you validate input then compare login values. In any event, just use htmlentities with ENT_QUOTES or html special chars before outputting post data or using it in anyway. you have the following code: f (mysqli_num_rows($results) == 1) you need to verify that the usernames match and that the passwords match: if ($username === $resultfromdb && password_verify()) { } else {} password verify works like so: if (hash_equals($usernameFromDB, $username) && password_verify($password, $passwordFromDB)) { } else { } Start with pdo then try again. I'm sure that pro members will help you further. Good luck and i hope that you switch to pdo for security purposes. Learn proper coding early to save many headaches and problems.
  8. Hi Requinix, it is a lovely informative post by you (as usual because i always enjoy your messages. I learn alot from you. I remember always that you helped me learn regex on my own and i always appreciate you.) Still, i am having difficulty excusing the history. I don't like that user background photo preferences are stored like a history or cache. bg preferences should be private. I have tried to find a method that removes the entry (from idb file as well), thereby replacing it with a new value. I thought that update does it but apparently not. interesting. I'd hate to have a history of user names and passwords even hashed passwords (which i use hashed passwords). i am not familiar with the term atomicity but i all ready think about this concept. worry is a better word. I know that i have to deal with delete at some point and i am not experienced enough to know correct methods. I figure that i would have to loop while error is not present or maximum tries/loops have been met. then store the original data before delete (via session variable at login). if delete successful then insert new value. if no error then operation complete. select new data and compare to new data post to verify no corruption. finished or rinse and repeat until max tries then restore old data and exit with error. I really don't know if this is correct procedure or not and it sounds alot like the built in transaction. anyway, i tried replace and it works but it seems to me that it is like deleting then reinserting. I suppose that i could encrypt all of my data and stick with update. But i would like to know what you think of replace? here is my quick and dirty test code at the console: create database testBed character set utf8mb4 collate utf8mb4_unicode_ci; use testBed; create table usersettings(id mediumint unsigned not null auto_increment, bgphoto varchar(32) default 'bgfactory', bgcategory varchar(3) default '0', primary key(id)); INSERT into usersettings SET bgcategory = 0; INSERT into usersettings SET bgphoto = 'testinsert', bgcategory = 1; describe usersettings; SELECT bgphoto FROM usersettings WHERE id = 1; SELECT * FROM usersettings; REPLACE INTO usersettings SET id=1, bgphoto = 'namechanged'; SELECT * FROM usersettings; what do you think about replace? do you suggest that i just encrypt and stick with update? Thank you very much for your expertise. Please stay healthy, requinix.
  9. Hello, I am not a very good programmer and i really don't know professional methods to accomplish many taska. I've managed to build a login system for my website and it works. I've finally started revisiting my sql code to add new features and i noticed some files in mysql folder. One particular file is named after my user_settings table with .ibd extension. I looked at the file with Notepad++ and i see a sort of history of background images. I have a feature on my site which allows users to choose a background photo for the site. It seems that all of my selections are stored in this file like a history. I use the update sql command to write your new selection to the database. I now think that delete and insert is a better method to avoid this history. How is this process of changing field data normally done by pros? delete, then insert? update with a history is not good when changing passwords and usernames. I guess that i chose update because it worked. I thought that it deleted the current field data then added the new data. oops! Thank you and stay healthy.
  10. Hi Barand, Amazing code and you only read a description of my bookmark profile. You are a 'helluva' coder. Your expertise and mastery shows in your replies. I don't really need to change anything that you have posted other than names but i didn't post to get free code. I am trying to learn from your example. I'm reading about sql now so that i can think better about these problems and approprite solutions. I'd like to come to the same conclusions as you oneday. I really learn alot from you and i thank you for that. Meantime, i've changed the last login code and it works well. I was actuly just inserting your login into lastlogin then inserting the current login into current login. I guess it is easier to say that login becomes your last login before i update the login. I guess i was thinking wrong here. Your idea is better. I don't have time to add the book mark code today. I have alot of things to do and i am behind schedule. I'll read more about sql before i go to bed, then tomorrow i will tackle this topic. I finished adding the bookmark profile to each page, so all i have to do now is submit it to the dbase. This code example is a great start! I also have to read the data from the db before i can display the bookmarks. I do not have so much coding experience as you do, so i am a bit slow. I'll update the post when i can finish this feature. I'll let you see the final code here so you can offer an opinion if you want to do so. Thank you, Barand, i have learned alot about sql today. You are steeringme in the right direction!
  11. Hi Barand, wow! that is a pretty elegant way of including last login data. You're clearly an sql expert. I didn't know about COALESCE and i didn't think about a separate table for logins. Very nice example. Thank you! I will make a copy of your post and use it as a guideline for revamping my code. I will also need to redesign my database. I'll let you know how it goes. I am learning alot from you but most importantly how to be a better database designer/programmer. Thank you very much! I really appreciate your wisdom. Best wishes :-)
  12. well i've tried the if (empty($lastLogin)) method and it works. I just display a simple message: 'details unavailable'. I don't want to detect a first login and maybe the null value isn't a first login anyway (perhaps corruption, tampering, etc). So, i will just use if empty(), unless there is a better method. Thank you.
  13. Hello, I'm a total newbie with db and db design. I currently have a login system with screwed up logic (manually entered id primary keys) until i learn how to connect these tables by userid, hence relational. Anyway, i have two columns in the user settings table: currentLogin and lastLogin. If you sign in for the first time, then there is no last login. My page obviously shows an error on the first login. Otherwise, the last login is displayed the next time that you login. I want to be able to detect a first login so that i can display a message instead of the last login data, which will be null. How can i do this correctly? should i use a php if statement to detect null? if (empty($lastLogin)) ? basically, i don't want my php script to show an error when the database returns a null value. How can this be done correctly? Thank you.
  14. By the way, i have to read about json encoded arrays. is this serialized like php serialize()? i'm not familiar with this so i will research json encode/decode. Thanks for he tip!
  15. Hi Barand, Thank you for the tips. You are very kind to take time to help a newb. I appreciate your post very much! I've made notes from your post. I will use a table like you mentioned. I am not really new to php/sql but i am obviously not a programmer. I suck, actually. I have alot of trouble with database design. I have not mastered this concept. I made a login system three years ago for the first time in my programming tenure. So i have a dtabase of users. I will just add this table to this database like you mentioned. Thank you for the count() function tip. I didn't realize that sql has this function. Very nice, indeed! and very helpful post from you. i can explain a bit more while sticking to the bookmark db problem/topic: i actually built my own routing system which does not use query strings. I use forms and session variables to load pages through a single index file. So the "link" is a partial path to the php file system to load the correct "page" in a single page template. Somewhat spaghetti code but i do not like frameworks. I am happy for now. I will get better over time. Anyway, the bookmark will be a collection of known data from the template page: page link as a db title to detect duplicates: path/to/data (path is always the root. bookmarks are only used within these pages. thus path is like c:/) css icon display: i use icons to represent the links to pages and this is either a round icon or rectangular icon (which holds a photo). icon photo link: each icon has a unique photo, so i need this data to get the correct icon for the bookmark. language: i use a multi language file system so this is important to display the correct icon title by language. so here en-us, en-uk, de-de etc. icon title: all ready present on the page as a variable ($pageTitle) all of the above is my bookmark profile. now i just need to store each bookmark <101 into a database. Then figure out how to read these entries to display them on your bookmarks page (i guess a loop to read each entry and store each entry into an array?) I figure that serialized profiles will make this an easier task. How to know duplicate entries? i figure that a bookmark title (the page link) can be used. Thus, i can easily detect if this page is all ready bookmarked or not. I will give it my best try and post any problems here. Remember, i am not a guru/programmer. Thus, i may need alot of time to get this set up. Your tips will help me. Thank you!
×
×
  • 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.