Jump to content

gizmola

Administrators
  • Posts

    5,960
  • Joined

  • Last visited

  • Days Won

    146

Everything posted by gizmola

  1. No. If it's linux you can do something like this with mount: <?php exec('mount', $output, $result); if ($result == 0) { echo "<pre>"; var_dump($output); echo "</pre>"; } else { echo "Failed with result: $result<br>"; } If that works, I leave the parsing of filesystem from the output to you. You'd also have to determine which filesystem is relevant perhaps using getcwd or realpath(__FILE__)
  2. I would do what @ginerjm suggested and make this script a self posting form. Wrap the html form elements in a standard form tag of type post. Get your variables from $_POST and not $_GET. Otherwise it should work in similar fashion. Your markup as presented is very messed up. You have an entire body inside the head tag, and then you try and create another html document for your output. You can't do that. You only should have one html/head/body tag. Another problem with your current code, is that php runs "serverside" and not "clientside". You can not intermix php and javascript this way (as you did in the snippet I quoted). The javascript code is delivered statically to the client when the page is requested. If you use the chrome debug tools for example, you should see that your javascript function is invalid. When people want dynamic data, they use ajax, which is a level of complexity higher, so to keep your project simple, just use the standard html form, which will post back to the php script on submit, do the calculation (serverside in your php script) and re-render your output. For simplicity, I've just shown a simple div/pre as you already are trying to echo out variables for debugging purposes. Notice that I moved your blocks around, with your functions at the start of the script. Functions are typically included prior to your logic, and it makes the flow of control clearer when you are intermixing html and php in this way. Something similar to this should work (I editted your code, but don't guarantee that there are no errors). <?php // Function to get the closest value of dcu to the calculated one function closestValueTo($calculated_dcu, $db_file) { $db = new SQLite3($db_file); $query = "SELECT dcu FROM table ORDER BY ABS(dcu - $calculated_dcu) LIMIT 1"; $results = $db->query($query); if($results){ $row = $results->fetchArray(); return $row['dcu']; } else { return null; } } // Function to get a specific value from the database function getValueFromDB($dcu, $db_file, $column) { $db = new SQLite3($db_file); $query = "SELECT $column FROM table WHERE dcu = '$dcu'"; $results = $db->query($query); if($results){ $row = $results->fetchArray(); return $row[$column]; } else { return null; } } ?> <!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>Calculator electromagnet</title> </head> <body> <form method="post"> <div class="ele-calculator"> <a href="https://imgbb.com/"><img src="https://i.ibb.co/hZLHzMG/download.png" alt="download" border="0" /></a> <h2>Calculator electromagnet</h2> <section> <fieldset> <div class="row"> <label for="ele-raport">Raportul h/(d2-d1)</label> <select id="ele-raport" class="ele-raport" name="ele-raport"> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> </div> <div class="row ele-inductie-row"> <label for="Inductia">Inductia (T)</label> <input type="text" id="ele-inductie" class="ele-inductie" name="ele-inductie" size="2" maxlength="10" value="" /> </div> <div class="row ele-forta-row"> <label for="ele-forta">Forta (N)</label> <input type="text" id="ele-forta" class="ele-forta" name="ele-forta" size="2" maxlength="10" value="" /> </div> <div class="row"> <label for="ele-intrefier">Intrefierul (mm)</label> <input type="text" id="ele-intrefier" class="ele-intrefier" name="ele-intrefier" size="2" maxlength="10" value="" /> </div> <div class="row last"> <input type="submit" id="ele-calc" class="ele-calc" name="ele-calc" value="Calculeaza" /> </div> </fieldset> </section> </div> </form> <?php if(isset($_POST['ele-calc'])){ $Forta = $_POST['ele-forta']; // value for Forta $Inductia = $_POST['ele-inductie']; // value for Inductia $Intrefierul = $_POST['ele-intrefier']; // value for Intrefierul $mSelect = $_POST['ele-raport']; if ($mSelect === '3') { $raport = 3; } if ($mSelect === '4') { $raport = 4; } if ($mSelect === '5') { $raport = 5; } // Equation A1 $A1 = (2* 1.257*pow(10,-6)*$Forta)/pow($Inductia, 2); // Equation d1 $d1 = sqrt((4*$A1)/3.14); // Equation A1 (repeated) $A1 = (pow($d1, 2)* 3.14)/4; // Equation F1 $F1 = ($A1*pow($Inductia, 2))/ (2* 1.257*pow(10,-6)); // Equation Sol $Sol = ($Inductia * $Intrefierul) / ( 0.7 * 1.257*pow(10,-6)); // Equation h $h = pow (((5* 2.115 * pow (10, -8) * pow ($Sol, 2) * 0.5)/(2*4*40/100* 40), 1/3)); // Equation d2 $d2 = $h/$raport – $d1; // Equation d3 $d3 = sqrt((pow($d1, 2)/0.8 + pow($d2,2))); // Equation g $g = $d2 – $d1; // Equation dcu $dcu = sqrt((4* 2.115 * pow (10, -8) * ($d1 + $d2) * $Sol)/ 24); // Compare DCU with values from a .db file $dcuiz = closestValueTo($dcu, 'sarma.db'); // Get dcuiz from database $dcuiz = getValueFromDB($dcuiz, 'sarma.db', 'dcuiz'); // Equation Nst $Nst = $h/$dcuiz; // Equation N $N = (4*40/100 * $g* $h)/ 3.14 * pow($dcu); echo "<div><pre>"; echo "d1: " . $d1 . "<br>"; echo "d2: " . $d2 . "<br>"; echo "d3: " . $d3 . "<br>"; echo "g: " . $g . "<br>"; echo "h: " . $h . "<br>"; echo "N: " . $N . "<br>"; echo "</pre></div>"; } ?> </body> </html>
  3. The way to do this in mysql is to store the address in a varbinary(16). This is because the IP address is a number, and the formatting is simply to make the IP scheme understandable. MySQL has specific functions for converting an ip address to and from this format, and handles the issue of whether the IP address is in v4 or v6 format. Use the v6 functions as they handle both v4 and v6 ip addresses. inet6-aton inet6-ntoa
  4. My experience is with larger Hosting companies, using VPS servers. What is right for you depends a lot on what you are doing with your server. What does the server do for you? Is it a business, and if so what market(s) does it serve? The location of the server is important to any decision you make. I have experience with all 4 of these services and can recommend them for someone who is not based in the US. Amazon Web Services (AWS) Microsoft Azure Linode Vultr All of these services have a presence that should be suitable for you in Israel, although you might need to experiment. With a VPS provider, you can easily create VPS server, and experiment with it, and shut it down if you don't feel it's providing the performance you want, given your location. AWS in particular is soon to open a Tel Aviv "Region" which means one or more data centers located in that city.
  5. I had to maintain and enhance a React app a few years ago, and I also found it bothersome in many ways. I'm sure having to get up to speed on someone else's convoluted code, while at the same time learning something that was in transition at the time, didn't help my level of enjoyment, but I left feeling like there had to be something better. I also have found Vue more to my liking. I still have a ways to go to get to the point where I would reach for it as my first preference for UI, but I'm fairly confident that I'm not going back to React unless I have a significant incentive to do so.
  6. How did you think you were going to install the pecl imagick package with no php or pecl? 🤣 As requinix advised, stop now before you really screw up your machine. This is not good debugging. Instead of trying to figure out what the issue was using yum, you just pivot to trying something else entirely, when your entire server is based on and dependent on packages. Did you search for the name of the php packages with remi active? Remi has a page on this, that I'm guessing you haven't looked at: https://blog.remirepo.net/post/2022/02/07/Install-PHP-8.1-on-Fedora-RHEL-CentOS-Alma-Rocky-or-other-clone
  7. Don't use include. Use require_once(). The fact that you are having these issues speaks to lack of structure in the code you are writing, and the high probability that using MVC with a front controller would be advisable.
  8. Please don't ever use w3schools as documentation for anything related to PHP. The PHP manual is complete and well written, and also tends to have some excellent comments illustrating use or warning of gotchas. For example, the manual page says this: So it looks from your recent test that something has already sent the http header prior to trying to set the cookie. That won't work. Irrelevant to your problems, my advice on setting the time, as a more readable and simple solution: $expirationDate = strtotime('+7 days') // <-- 7 days later (make sure your comments are accurate) Where are you running this code during development? Are you by chance using a localhost environment? Since you aren't setting the domain in your setCookie, it is a long standing and well known issue that cookies require a valid domain, and "localhost" is not valid as it has no TLD (.something). At this point, there are 3 recommended choices for a tld configuration you would make on your workstation. (.test, .example or .dev). .test and .example are reserved in the RFC's so there is no issue adding a domain to your workstation in a "/etc/hosts" files mapping it to 127.0.0.1. .dev was purchased by Google, and is unused, so many people have decided to use that for development, and is known to work fine and have no conflicts. I personally use www.something.test for development projects, so I'll map both 'something.test' and 'www.something.test' in my /etc/hosts file.
  9. @HawkeNN I want to clarify some things for you. Most code that was written for PHP 7.x will still run fine under php 8. For the most part PHP 8 added new features. There are "Breaking Changes" that were made, listed here: https://www.php.net/manual/en/migration80.incompatible.php but it is unlikely that is the problem with your code from some of the errors I saw listed. For example, the "headers already sent" error is a common one and has been around since php 3 at least. It has to do with code that sends output to the browser (as in the case of a script that intermixes HTML and php) and then tries to set HTTP header values. At that point, the HTTP request has already been sent with whatever headers it had, and it's too late to add or modify them. PHP session use is one function that sets header values because it sets a cookie. Some of the advice that you got is related to common techniques for trying to solve the issue. Equally important is your hosting configuration for PHP. Changes to the configuration of PHP from a version upgrade, can turn on settings that might have been off previously, or warnings being emitted that weren't before. This can then trigger output which also causes the "headers already sent" message. I suspect that this is part of your problem here, and really requires some debugging of your hosting setup. This was already brought up to you, in that there will be a php.ini (and often other assorted xyz.ini files that are included by the main php.ini) where settings can be made or changed to re-configure php. In conclusion, this is a PHP developer forum. From looking at this thread, you aren't likely to have a good outcome here, because you aren't a php developer. My sincere advice is to just find yourself a developer (this forum is chock full of them) you can pay a fee to, in order to resolve your issues and get your site working again. We have established that the code is bad, and that there is likely a few different things going on that are somewhere between the configuration of your server to possible improvements to the code you have. In other words, this is a problem for an experienced developer that requires debugging. I probably shouldn't say this, but my knee jerk reaction is that getting your code to work is not that big of a job, but looking at a thread like this is frustrating to read, because in my experience it is not going anywhere. There isn't any long term value to it for our forum, and you are not going to become an active member of the forum, nor learn PHP development, so there is nothing in it for us, or the community at large.
  10. One thing I forgot to add, is that you need to insure that the input to the hash routine has enough things in it to have a high degree of confidence that the computed file name is unique. So an example might be: $fileName = sha1($user_id . $originalFileName . uniqid($mimeType, true)); Another interesting application of sha1, that you might find useful is the sha1_file function. Optionally you could have a column in your asset table that contains this value, indexed. Prior to storing the uploaded file, you can run sha1_file on it, and use this value to check if any other assets have been uploaded with the same hash. This is a great way to prevent people from uploading the same file repeatedly, if that is something you want to prevent.
  11. The basics of how PHP handles files is that you set in your php.ini a temp directory. Uploaded files go into this temp directory. You then use the function move_uploaded_file to move it to a destination. What you want to do is use some sort of hashing technique to come up with a name for your file. Typically people also do hygiene on the files, checking things like the extension, mime type, and since these are images, there are routines in the libraries you can use to try and read the meta information from the file and determine that it is what it says it is. You don't want people uploading malicious files that look like images, but are actually root kits or something bad. At the point you are confident that it's a valid image file you want to keep, have your routine create a new name for the file. Do not use or trust the name provided by the uploading user. You can save this name in your database table as "original_name" or something similar if you want. Just keep in mind that people can upload files with all sorts of wonky names containing file path characters and spaces, and you don't want to use those for anything. What most people do is concatenate some things together and pass that to a one-way hash routine like md5 or sha1. Your table should also have the mimetype of the file. Then store the file where you actually want it to be. Whether you want something sophisticated or not depends on you. For example, for organizational purposes, you might want to make subdirectories (your code would need to do this of course) for each authenticated user. This is all up to you. Many people choose to keep the files outside the webroot so that people can't navigate to them directly, but again that is up to you as to whether you want to secure the files in some way or not. So to summarize: You need an asset/media/image whatever table You'll want these columns to store mime_type file_path This is the directory path where you will store the file file_name This is the hashed name you will use with move_uploaded_file to store the uploaded file once you are happy that it is legitimate and you want to keep it original_name Up to you if you want to keep this or not description this is common, if the user is prompted for it. user_id If you track the user that uploads it. You can also maintain this via a many-to-many table created_on Timestamp of the upload Don't accept/move files until you have tested that they are legitimate, based on what you want to allow I believe at this point in time the mime_content_type function is a good way to do this for images. Decide in advance what image types you will accept and limit those in the upload form and check in your php script. You can never trust that someone malicious isn't using a tool to bypass the html/javascript checking you might have implemented in the user UI Once you are happy that the file is ok, compute the name you will store, and make any decisions on the path. Use these to do what you want with the file. Some people will store the filename with the validated mimetype, but that is up to you as to how you want to handle it. It does make it somewhat easier for you as sysadmin of your server to look at files in the directories where you are storing them and find a particular file for the purposes of examining it. You probably want to do that if you do decide to store files below the webroot and allow navigation to them directly to be served by the server from a simple img tag.
  12. These are the parameters you provided in the script: $mail->Host = 'localhost'; // Set the SMTP server to send through $mail->SMTPAuth = false; // Enable SMTP authentication $mail->Username = 'myemail@here.com'; // SMTP username $mail->Password = 'myPasswordHere'; // SMTP password $mail->SMTPSecure = 'None'; // 'ssl' or 'tls' or Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` also accepted $mail->Port = 25; // TCP port to connect to. For Example: 25 - Simple SMTP. 465 - SSL SMTP. 587 - TLS SMTP. Based on information you get from GoDaddy, $mail->Host should be one of their hostnames. You either need a user/password or you don't. This is information you need to get from GoDaddy. Let's assume that the mail relay server for your hosting plan is 'mail3.godaddy.com'. Then you would need to change this line of code in the script: $mail->Host = 'localhost'; To whatever the actual host is. In the example I provided, then that line needs to be changed to be: $mail->Host = 'mail3.godaddy.com'; This is not an actual godaddy host, so don't try and use that. You need to get the correct mail server host name from your hosting information provided to you by godaddy. As for whitelisting, that depends on the email client you use. For example, I used gmail for most things, so a search on "whitelist {your email client}" should provide you some documentation or articles showing you how to do it. For gmail that would be an article like this one: https://www.whitelist.guide/gmail/
  13. Requinix pretty much nailed it. Something has changed, and according to you it was a php upgrade. That upgrade might not only be version related, but could be server configuration related. Often with package installs, configuration files get overwritten, and some setting might have been introduced that prevents something from happening that used to happen. So strictly speaking it could be a lot of things, that nobody here has any visibility into. Looking at your code, this depends on a small javascript timer that repeatedly makes calls to the alert_generate.php script. So there are a few things I'd do to debug this on a surface level: Access alert_generate.php directly. See what the result is. Is there an error being generated or do you get a result? Use the chrome developer tools from the view.php page, and open the network tab. See what is happening there. Are there any javascript errors being generated? If network calls are happening as expected, each request can be inspected to see if it is succeeding or an error is occurring. Since you shared the code, it has to be said: I've seen better code from a high school student working on their 1st project This person didn't apparently know how to use require()? They literally copy and pasted the db credentials into each script rather than putting them in a single include file so they could be shared The database design is humorous. The database code could be really old, and was perhaps retrofitted to mysqli_ but still they should have used named parameters I'm not 100% sure that a clever individual couldn't introduce some sort of sql injection, since the alerting code reads values from a database to then formulate a potentially harmful query Using the php end tag ( ?> ) is bad. Small changes to files that intermix presentation and logic like this can break them My advice would be to go through all these php scripts and remove the end tags The PHP Framework interoperability group has published code standards that are widely adopted, so I include a link here just for reference. You can see that here if you are interested: https://www.php-fig.org/psr/psr-12/ See section 2.2. It's qualified, but in your case, all your php scripts should not have php end tags at the end (assuming that is the last thing in any of the scripts.
  14. So according to Mac's link, as I surmised, you can't relay mail directly from your server via it's mta. Port: 25 SMTP Authentication: False or none SSL or Secure Connection: None Server or Host: The relay server you need to use depends on the type of hosting and script you use. This is apparently why your script doesn't work. It is trying to send mail to your local mta via the smtp protocol. There should be instructions on what the relay server is for your email domain. It is not going to be localhost, but rather some domain name they specify. Changing the script to use the right server should allow it to work. While this has nothing to do with your contact script, as far as the other issues with deliverability, one main issue from the report you provided is that DKIM is not being used. There is nothing you can do about that, as DKIM has to be implemented by the email administrator. I don't know if there is any possibility of having it supported by GoDaddy hosting or not, as it is non-trivial. If you want to know more about it, this article does a good job of explaining the basics so you have a frame of reference: https://www.uriports.com/blog/introduction-to-spf-dkim-and-dmarc/ I don't know the purpose of your server or what types of emails you intend to send, but they will not have a high deliverability score, and thus will likely be spam filtered by some email systems. For the purposes of a contact page, that is not a concern, as you can whitelist your address, but if you will be sending regular/automated emails from your domain, you may encounter problems with other people receiving them. Candidly, Godaddy is not a well regarded hosting company, although many people do use it. Hopefully at very least you are not using shared hosting.
  15. In general, images are best stored either on a filesystem or in a CDN like cloudfront or akamai. It's enticing to store them in a database that you are already using, but it's highly inefficient. Blob storage in databases is expensive considering that you must query the result from the database in order to then return it to the client. What most people do instead is have a table that stores a path to the image, so that you can have the best of both worlds.
  16. I should probably add that the secret to determining if recursion allows for something elegant, is to determine if you can reduce the problem down to a discrete examination. In the case of my solution, the insight I depend upon is that I only need to check the outer 2 letter of the string in order to determine if it *might* be a palindrome. Another solution using this insight could also be coded using map and reduce. It also needs to be said that the overhead of recursion means that it is almost never employed, although there are some problems involving nested arrays where I see people using it in PHP.
  17. There are no doubt a number of different solutions to this. Here is one. So one way to look at it is that in order for a word to be a palindrome, letters offset from each other must be the same. Treating the word as an array, that means you can check word[0] against word[word.length-1] , and if those characters are the same, then it could be a palindrome. If not, it is definitely not a palindrome. Now if you then remove the outer characters (using shift and pop), and check again, this same process is also valid on the remaining inner string. Thus you have an opportunity to use recursion. You can continue this process until the string you are checking has 1 character or less remaining. If you get to the point that the array of characters has no characters remaining then it was a palindrome. Here is an implementation of this idea: function isPalindrome(word) { let palindrome = true word = word.split("") //console.log(word) if (word.length < 2) { return palindrome } palindrome = (word[0] === word[word.length-1]) if (!palindrome) { return palindrome } word.pop() word.shift() return isPalindrome(word.join("")) } const words = ["HelloWorld", "abba", "abcdecba", "a", "oio", "nevermoreromreven"] words.forEach(word => console.log(`"${word}" is a Palindrome: ` + isPalindrome(word)))
  18. The error you are getting is saying no smtp connection could be made to localhost. Does your server have an mta running (sendmail or postfix)? Does your server have any sort of firewall running that might be blocking port 25? Email configuration for a domain and server is a highly complicated endeavor that involves many different moving parts. It also depends a lot on the type of hosting you have. When you state that "it's sending and receiving other emails" I don't know what that means exactly in your case. There are many things this could be, all of which require a fair degree of system administration skills, and an understanding of your hosting. One possible issue is that "localhost" is not being resolved by your server to the loopback address. About the only suggestion I could make, pretty much as a hail mary attempt, would be to change your script to use '127.0.0.1' instead of 'localhost'. Assuming this is a linux based server, you can check the contents of the /etc/hosts file to see if there is a proper entry mapping localhost to that ip. For mail to have any degree of deliverability direct from a domain, requires lot of things to be setup correctly. This site is an excellent aid in testing and diagnosing deliverability: https://www.mail-tester.com/ If GoDaddy is acting as your MTA, then I would expect that your scripts would be delivering mail to a godaddy mail server, and not to localhost at all, so again, email is complicated, and we really don't have enough information to provide more than a couple of educated guesses as to what your issue is.
  19. I'm sure there are many such libraries but this one has been used by many people: https://github.com/ddeboer/imap This one comes up as the most used in packagist: https://github.com/barbushin/php-imap
  20. This looks like homework .... I understand the idea, and it smells like a recursive exercise, which teachers love, and yet are rarely employed due to the huge overhead involved in building a functional stack. 2 things here: You have code that "looks" ok. Obviously you are having some problems with it, but you have no examples or debugging of what doesn't work Do you expect us to set up an environment and run your code and debug it for you? See #1. So in general, yes, I would say that yes, if this is an assignment, this is an exercise that should involve recursion. This code looks very suspect for a few reasons including that repeat is not shown to be initialized anywhere, and it should be local to the running function on the stack: $repeat = $repeat * $data[$i]['number']; Just off a quick browse of your code, you are trying to combine the reading of the array with the processing of a repeat/close_repeat. You want a recursive function that only handles the repeat/close cycle. So what you need in terms of variables is: index of global array temporary array built, which is return when function completes and is returned to be added to the finalized array. Inside your recursive function you can encounter 1 of 3 things: An entry which you add to your temporary array A repeat, where you calls the function recursively having advanced the start/end index an end_repeat where you duplicate the temp index the #repeat times and return it you increment the index internally, so you need to pass this by reference One trap you probably have is trying to control the other process with a for loop. What you actually want is a repeat--until pattern where you will process starting with index=0 until the index = count(array) -1. PHP does not have repeat/until but it does have do..while, so that is what your control should be based on. Hopefully this leads you to a solution, otherwise, again we need specific code, with your debugging and specific problems you are having with select sections of the code.
  21. I provided you a solution that should work. Just keep in mind that rules are processed in order. You need this "catchall" to come at the end/after all the other more specific rules or those other rules will never be reached. So you want: www rewrite rule specific pseudo directory rules like your news/ the catchall to *.php Just looking at where you are going with this, having a routing class and using a front controller pattern where you route everything through index.php which acts as a router, is essentially the direction you are taking your site from the look of it. You can make everything simpler and cleaner by either porting to symfony or laravel (which have many benefits in terms of access to all the other features of those frameworks) or just integrate some routing class into what you have. This looks like a possible solution for you: https://phprouter.com/ With that said there are myriad others, but that one appears to be functional, simple and minimal.
  22. The courses I mentioned in the other reply cover design and include layouts with flexbox and grid. https://scrimba.com/learn/flexbox https://scrimba.com/learn/cssgrid You want to keep in mind that your goal is to end up proficient with making "responsive layouts" so you should be at some point absorbing some of the ideas involved in how to have a design that adapts to device viewport. Of course you need to get down the basics first and then I think you can add in the elements that really make things responsive. Responsiveness involves a judgement call on your part... what things should shrink or be hidden at smaller sizes. When it's a mobile phone user, do you stack a menu or replace it entirely with a hamburger button? You figure these things out based on your preference. I mentioned Kevin Powell recently. Go through the free Scrimba course they have with him instructing. If you particularly like his style, then you might want to look at his paid courses. Some are free and some are paid either directly or through a Scrimba membership. In my opinion the Scrimba membership gets you the most bang for your buck, but he has a course on flexbox you can enroll in directly: See links to his various course at https://www.kevinpowell.co/courses/ Powell has this "free" course: https://courses.kevinpowell.co/conquering-responsive-layouts It is being done as a 21 day challenge, with new material being released day by day. The course is just being released now, and only has the first few days of content, but it could be a really good place for you to start. I personally like the idea of Scrimba for people learning as it gets you right to where you want to be within the courseware environment. It also has a very active Discord community you should join if you go the Scrimb route. You can also take the scrimba files and download them, fork your solutions etc, and they host all that for you. But of course for your own projects you need a local environment and code editor, and he is likely presenting that material in a local environment using Visual Studio Code and the "Live Server" extension. One nice thing about Visual Studio Code is that you can add the PHP Intelephense plugin and use it for your PHP development as well. Most pro PHP developers are using the PHPStorm commercial editor, but VSCode is the choice of javascript developers at this point, so if you're doing a lot of both, then VSCode + Intelephense is a good alternative. Powell's free responsive course has an early lesson on the environment and that might be helpful to you to see what he's using for his course.
  23. Ease of use vs security is a never ending battle. Try to opt for the simplest solution that also works. You can either act as custodian (allows for you to aid a user when they forget/misplace something) provide no custody, thus insuring a compromise of your system doesn't compromise user assets You can't do both. Not knowing enough about this system, I would question the nature of the vouchers themselves. Does your system know the value and when something is redeemed? You might have a customer service feature that would allow someone to make a new voucher to replace a lost one? That mght be an alternative, but would require your system to have the necessary information and controls available to you to determine the status of a voucher, and be able to revoke/replace it.
  24. Just a note: please don't use imgur links. That site is a mess, and the forum allows you to attach and insert images into your posts. I editted your question to do that. It's better for everyone to have the content referenced here. As I answered this in the bootstrap thread you made, I'm not going to repeat my comments but they are relevant. These days, layouts are a lot easier to do using flexbox and/or grid. I would also suggest using an html/css/js sandbox for your prototyping/etc. Here's an article with quite a list of different ones. I did already mention scrimba to you, so you can certainly use that as well. https://www.sitepoint.com/code-playgrounds/
  25. I'm not 100% sure what you trying to do. I tried to extrapolate that you are looking for "/something" and wanting to rewrite that to "/page.php?slug=something". Options +FollowSymLinks -MultiViews RewriteEngine On ErrorDocument 404 /404.php RewriteCond %{HTTP_HOST} ^domain.com$ RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L] RewriteCond %{HTTP_HOST} !php$ RewriteRule "^([A-Za-z]+)" "page.php?slug=$1" [L,QSA] Since you didn't provide examples of what other rules this "broke", this is my best guess. An important addition is that this rule won't run for existing *.php scripts.
×
×
  • 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.