Jump to content

Cobra23

Members
  • Content Count

    49
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Cobra23

  • Rank
    Member

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

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

  1. Yes, not to allow multiple zeros in one input box without another positive digit. It is a case of the client validation notifying the user of their input being wrong eg bootstraps red highlighted input boxes that notifies the user of the input being wrong and needs to be sorted. Inputs of two or more 0's only should not be allowed in this case. Anyways, I got this sorted with the following regex. /^([0]|[1-9]|[1-9][0-9]+)$/
  2. Hi, Is there a jQuery validator way to block two or more 0's input and allow one 0. Or even trim the inputs like 00 or 000 or 0000 or 00000 etc and replace it with 0. But I also, want to allow all 0's after a positive number. I can do it on server side no problem but in the jQuery validator i am struggling to do this. Thanks
  3. Thank you Barand. I will make a test with it and compare on my preference
  4. Are you using Wordpress by any chance? I asked because you mentioned a blog
  5. Very very similar Barand. One query is always best. How does one do the SVG part? I've never used SVG. I do have a few different colors and meanings for all the different graphs produced in the same table and their percentages. Anyways, I did get this to work perfectly for what i'm doing and stopped users getting kicked out. I'm still curious to know about the other option in SVG output instead of dynamically adding php variables automatically to the css and produce the classes.
  6. Gas = Laughable The whole idea of doing it this way is so the css classes can be created as soon as there's a change in the database, and then those classes are used in the html's div or span tags automatically. But this is too advanced for you by the way you have commented. Explaining it would be useless to you and will get more ridiculous questions. If you don't understand what headers are, how can you understand anything about generating css classes or even how sessions work (in regards to previous thread).
  7. Again, gas! Second post to me and you leave a gas comment, again 😂 I don't see why you have the need to comment on things you have no clue about? Especially not knowing about a header of "text/css" or the creation of css classes.
  8. This is a problem I had long ago with the same error. Include files allow the php closing tag of ?> but for closing brace } to not be closed in the include files, you will get that error. To make it work, you will need to move all that code with the opening and closing braces into the code you showed above or close it with a closing brace inside the include file.
  9. I was absolutely shattered when I wrote that. It needed to be more clearer. What I am trying to do is have the website automatically create css classes in a css file (mainly with a .php extension) but also have php, sql, and sessions data in that file so I can create unique classes that would change based on each users car_id and progress column names in the database (car_id is an example and not my real column name). I hope that helps. I forgot an include("/database-connection.php"); in the first line which contains a connection for the database. But If I use the above code and refresh or click the link, the following session $_SESSION['identity']; will sometimes become undeclared, and will kick me out of the website.
  10. Hi, I thought it was easier to open a new thread on a different topic. I have a css file that works fine with PHP, SQL and Sessions but this file affects my users by logging them out after a few clicks when a session is in the file due to it sometimes not recognizing the $_SESSION['identity'] where it gets undelcared. The session is the only way I can get it working from all my tests. <?php header("Content-type: text/css; charset: UTF-8"); header('Cache-control: must-revalidate'); mySessionFunction(); $identity = $_SESSION['identity']; $startquery = "SELECT `id` FROM `user_table` WHERE `identity` = :identity LIMIT 1"; $start1 = $connecting->prepare($startquery); $start1->execute(array(':identity' => $identity)); while ($start_row = $start1->fetch(PDO::FETCH_ASSOC)) { $id = $start_row['id']; $querySelect = "SELECT `car_id`, `progress` FROM `cars` WHERE `member_id` = :id LIMIT 1"; $query = $connecting->prepare($querySelect); $query->execute(array(':id' => $id)); $num = $query->rowCount(); if ($num !== 0) { while ($row = $query->fetch(PDO::FETCH_ASSOC)) { $car_id = $row['car_id']; $progress = $row['progress']; echo '.progressed'.$car_id.'{width: '.$progress.'%;}'; if ($progress === 0) { $hidden_progress = '100'; } else { $progress1 = $progress; $hidden_progress = 100 - $progress1; } echo '.hiddenprogressed'.$car_id.'{width: '.$hidden_progress.'%;}'; } } } ?> What I am looking for is how can I get this to work in a different way but to accept the id and progress into the css file. Each user will have different data, so this is why I am doing it this way. Maybe there is a better way outside of css but inline css is not allowed.
  11. I pin pointed the problem 🙄 It was due to the creation of css files with php which in turn had another session in the css that confused the system. It was the only way I could generate them with the exact results. By disabling that, no more kicking out. Onto creating one a new way now. Cheers for helping
  12. Sorry kicken, I didn't see your comment. I was just silly with the session.cache_limiter set to as private. That just saves a cache of the whole page without getting any new updates from the database when logged in. Although, the cache would stop kicking me out of safari, it's not what I need as I need updated content that changes any time. My problem is with safari browser and not really with the sessions as the session file is still active in my tests. So I think the cookies are deleted on the client side with safari even though browser settings are set to not delete them. This happens mostly on some links (sometimes) and repeatedly clicking its link. I did have this problem on Google Chrome but sorted that with jQuery "on" events via the click to not allow a second click until page is loaded. This may be caused by bootstrap 3. I tried adding cookie expiry to 3600 instead of 0 in php.ini which added the expiry date but had no affect on sorting the problem. Also, safari doesn't detect the SameSite settings in htaccess while the other browsers do. It might have to be a case of going to php 7.3 for this to work. SameSite=Strict
  13. Gas! I think I may have sorted it with the php.ini of session.cache_limiter = private I'm not sure of it's restrictions or vulnerabilities, so i'll have to find out on that. and activated: session.gc_divisor = 100
  14. I just want mine to be very secure and private as possible without the use of cookies like PHPSESSID or keeping sessions in the original assigned folder. But having some problems keeping users logged in. That's why i'm asking the question for some advice and help on this.
  15. What do you mean exactly?
×
×
  • 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.