Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. In the tryguess.php file, encase the code into a function. On your trynumber.php script, include the tryguess.php script Put the HTML in this trynumber.php script change the form to POST to itself run the function, included by tryguess.php, within the HTML to output the string you want.
  3. Today
  4. <?php session_start(); $_SESSION["correct_answer"] = rand(1,100); $_SESSION["guess"] = 0; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <h1>Welcome to the Great Number Game!</h1> <h2>I am thinking of a number between 1 and 100</h2> <h2>Take a guess!</h2> <f
  5. Yesterday
  6. https://www.sanfoundry.com/java-program-permute-all-letters-input-string/ I don't know how to do it with this
  7. str = [5,3,7,1]; this string should be input by user and generate only when user click on generate button to show result
  8. To add, I tried the latest version of the script : - https://github.com/tuupola/lazyload#changelog & tried modifying this code : - let images = document.querySelectorAll(".example"); lazyload(images); To the span name but still nothing, the rendered HTML of the image is like this :- <span class="thumb" style="background-image: url(https://www.example.com/images/thumbnails/example.jpg);"></span> I wonder if the lack of height & width maybe causing it? (this info is in the CSS file but I'll try adding it inline now)
  9. Hi, I've implemented lazy loading on my website using this guide : - https://web.dev/codelab-use-lazysizes-to-lazyload-images/ However I can't get the last bit of code to work! Basically I have images that are in a span tag loaded as a background image, I have this is the CSS : - .blocks1 .block a span.thumb { width: 120px; height: 90px; background-repeat: no-repeat; background-position: center; background-size: contain; margin: 0 auto } The page uses this tpl file for the images : - {section name=c loop=$cats->mCats} <div class="block"&g
  10. Imagecreatefromjpeg is part of the GD library. You can examine the source code by looking at the underlying libgd code.
  11. Last week
  12. I guess it depends on what is being examined (and retained) by imagecreatefromjpeg(). Surely it's examining more than just the file extension to determine whether true or false. And if an image does PASS (as true) but contains malicious code, is it nullified? Suppose I take a 10 kb jpeg and incorporate 1 MB of evil scripting. The uploaded file is now the size of that sum, right? What size will it be after running through imagecreatefromjpeg? Does the process evaluate the file and eliminate/erase/void pieces that are not color/image related?? (Maybe I should learn
  13. I can't see your code ... $file = $im; ... helping much. If you want to write the GD image in memory (that was created by imagecreatefromjpeg()) back to the file in jpeg format, then use imagejpeg($im, $file); I do not know if this sequence has any cleansing effect though.
  14. I've got this working thanks to everybody that's assisted. Now I've got a more academic question: what exactly is $im = imagecreatefromjpeg($file); doing when it runs? More directly, suppose a malicious actor places evil code into a jpeg file that passes thru this function. Will the file always fail? Or is it more prudent to continue with: $file = $im; //overwrite with $im Because $im will somehow be 'cleansed' of the evil code that had been inserted. Is continuing with $file safe if it passed this examination? I'm trying to understand the
  15. Thanks for sharing these details , its really helpful for me.
  16. uomptrucknumber is unique every-time never duplicated. the data here is only good for thirty days when the uompturcknumber falls off of the grid/list I would want to remove it from the json file. The date and time move constantly so I would not want that in the json file. This is for what we call pickups we don't handle the logistic for these other companies do and they are a lot of no shows and moving these around.All of this is onetime information never needed again.
  17. Totally agree. My comments were basically just musings to provide an alternative albeit more complex solution, for the purposes of discussing what additional relations might provide functionally.
  18. @gizmola I note your comments regarding dates and, had this been for a commercial marina with many comings and goings, stays of varying duration and future bookings, I too would have put them in the schema. However I was under the impression that this situation was more like allocating semi-permanent car-parking spaces to employees.
  19. The points is a system you have to socialize. It's a scale not different than perhaps, a rating system for a restaurant or movie. Some movie review sites might use a 4 star system, or a 4 star with half stars, or a 5 star system. The important thing in story points is that for a storypoint of 1, whatever time that might take, a storypoint of 2 is 2x the work, and thus relatively speaking, at last 2x the time. When you have separate tasks with separate story points, those estimates are for the people involved. So if you want an idea of the entire scope of those stories combined,
  20. It's really very simple: you can not start output before session start. You are outputting HTML at the start of your file, which sends the http header, so there's no way for PHP to provide the cookie with the session id. This is a big reason to have a bootstrap script or front controller so that you can do essential initialization and setup in one place. Obviously you don't have either of those currently, but you could for now make a script named something like "initialize.php" and put things into it that you always want to do, like redirecting to https://, configuring a database conn
  21. So, first off, json is a data format. A "json file" is just a file that contains serialized json, that can be unserialized back into a json structure. The primary use of json is to provide interoperability between javascript functions, and in many cases persistent storage. Yes, you should use json to for example, provide data to ajax calls, but that would be something you would design into your backend api and javascript UI code. You can for example, read data from a database and easily turn it into json format using the json_encode() function. Ditto with receiving client information and
  22. Three people see this list/grid. When the truck is ready to load we have a person that will print the truck paperwork from our erp system not from this list/grid and the note is to tell the person printing the paper work if they need two copies or a seal or lock etc..... Right now they email this information and email sometime gets over looked with this its up on there screen. As far as the table goes I think all I need is the uomptrucknumber, checkbox and note fields. I was thinking json because I was hoping it would have low overhead verse writing back to my MSSQL Plus I wanted to learn how
  23. Doh... Answered my own question as I just input session_start() into my index.php and it now works as expected... I'm wondering why when login.php runs which looks like the below doesn't start the session though?! Login.php is as follows <!DOCTYPE html> <html> <head> <meta charset="utf-8"/> <title>Login</title> <link rel="stylesheet" href="style.css"/> </head> <body> <?php require('dbconnect.php'); session_start(); // When form submitted, check and create user session. if (isset($_POST['
  24. Hi thanks for the responses they are very informative However I am calling start_session() in login.php (login.php is run when they login) which is my question as to why the divs are not changing when I do an if(isset($_SESSION['username'])) in the index.php (main page) <?php require('dbconnect.php'); session_start(); // When form submitted, check and create user session. if (isset($_POST['username'])) { $username = stripslashes($_REQUEST['username']); // removes backslashes $username = mysqli_real_escape_string($conn, $username); $passwo
  25. It sounds like you might just need to re-consider your design. If it's the client that's interested in whatever this change is, the typical solution to this is to just have the client make a request periodically. One name for this is Ajax Polling. You make an Ajax request to your change detection script. The script will check for the change in a loop and return when a change is detected. You could wait 30 minutes, but it's more typical to wait 30-sec to a minute then return a "No changes" response. This way your web-server's available threads don't get used up waiting. If th
  26. You mean are most questions we get here about Javascript? No, it's mostly PHP, but it's mostly PHP in a web context. As in PHP is running on a website and people are visiting it in their browser. Which means Javascript is an option. But sometimes there are non-web PHP questions. I don't know which one of those this thread is yet... If you want to run something every X minutes then the standard answer is to use cron: every *nix server has it, it runs in the "background", meaning it's not driven by or reliant upon users taking specific actions (such as "keeping the browser op
  27. Just curious, since you mentioned Ajax, are most of these threads about JS web development? Because if so, I do indeed have a solution for requesting on the client side but it is in another framework called Flutter. If it's necessary I can repost but with an AJAX based solution and the whole problem. I have made a client side program and so far even on the client side two php scripts with a delay will only execute one at a time. My original plan is to have a php task loop for 30 minutes and every second it will check my mysql database for a value change. (This is prob a terribl
  28. I am playing around with the Web Audio API now. I set up a test application to play back an audio file. One of my desired options (at least currently) is to shift the pitch. An easy way to do this is to adjust the playbackRate property. So, it seems to work fine in Chrome and Firefox. Great, lets make it awesomer! Is that a word? I call to preservePitch elsewhere in the code. I threw in the following code for a Canvas Spectrum Analyzer, which works great: function graphAnimator(){ requestAnimationFrame(graphAnimator); let fbc_array = new Uint8Array(analyzer.
  29. What are these two pieces of code that have to run at the same time? Do they have output? Where is the output supposed to go? Is this something that would be better served by running two concurrent AJAX requests on the client side?
  1. Load more activity
×
×
  • 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.