Jump to content

requinix

Administrators
  • Posts

    15,290
  • Joined

  • Last visited

  • Days Won

    436

Everything posted by requinix

  1. I don't see what the difference between the second example and your working version is - besides changing the locale string and currency ID. You had something that didn't work - what did you change so that it did work?
  2. Can we assume that within those next three years you'll learn how to "do programming"?
  3. Don't have that capability. Besides, half of preventing editing is about stopping spammers who make posts that look fine, wait, then edit in spammy keywords and links.
  4. Don't hijack other people's threads for your own question. TextWithRotation looks like it comes from an FPDF "extension". Did you "install" the code for it? Did you notice that you have to create an instance of RPDF and not FPDF?
  5. Are you using Javascript to submit the form? What's the code for that? Does it blindly look for a form on the page? Or is it smart and look for the form that contains the button that was clicked? You could probably skip all that Javascript stuff if you used a regular form submit button.
  6. Does quite a bit more than just WebM and MP4. The script is broken down into a number of different scripts. Some of them are dedicated to converting to a particular format. If you don't want that format (at least not yet) then comment out the whole step.
  7. Text Fragments As is usual for the web client industry, one browser (Chromium, so Edge gets it too) decided to implement this capability without it being an actual standard yet. It looks funky, but Google wants it so we're probably going to get it.
  8. I expect they were making their best effort to prove somebody else wrong in order to make themselves look better. You know. StackOverflow. JSON is fine.
  9. There is a syntax error in your code. Download and install an IDE or editor that supports PHP code. Put your code in there. You should be able to see the mistake very quickly.
  10. It's at 15 minutes now. I don't think the five additional minutes makes a difference.
  11. Yup. If you go to a grocery store to pick up milk and eggs, do you get one shopping cart for the milk and another shopping cart for the eggs?
  12. Either you should not be GROUPing BY the confno, or you should not be GROUPing BY and instead be searching only for a particular confno, or you should be including more data in the form so it's obvious that those three boxes are for three different confno values.
  13. https://en.wikipedia.org/wiki/History_of_the_flags_of_the_United_States#Possible_future_designs I would rather the table had a simple integer as the PK. Asked and answered.
  14. Send JSON. Even empty arrays are still identifiable as arrays.
  15. *puerto rican sad face* "Abbreviation" or "Abbr". Please. How is it wasteful? In this particular example, the state abbreviation is short and so I wouldn't mind it being the primary key (in which case don't have an ID column at all), But the abbreviation and full name are both "lookup"-able values. BUT I would not make a table that has only US states. I would pretty much always have to think about Canada, or maybe Mexico, or Australia, or some of the other countries that have states/provinces. In which case the abbreviation is no longer unique by itself - you'd need a country FK, and while country + abbreviation would be unique, I would not have the two act as the primary key (mainly due to the awkwardness of a composite PK).
  16. The length of the session ID isn't even remotely as important as what you do with your sessions in code. Focus on that instead.
  17. Then... maybe Yahoo isn't being very nice and isn't automatically creating the link for you. Sounds like you'll have to switch to HTML emails. They don't have to be very complicated messages. In fact for simple emails you can probably just get away with <html> <body> Thanks for registering with {$server}. Please click this link to complete this registration:<br> <a href="{$url}">{$url}</a> </body> </html> Now sending the email, that's potentially complicated. But only a little. Depends on your application.
  18. It's weird because... ah, well, doesn't matter that much. Yes, you can include() a file wherever you want and it will have access to all the same variables at that point. It will have $discountApprovalStatus (set a couple lines earlier) and $highestannualvalue (don't know where that's coming from but apparently it exists). It also has $_GET and $_SESSION and all the other "superglobal" variables that are already available to everyone, everywhere. But, and this is going to take a fair bit of work but I promise it's worth it, You're touching on a good design pattern that not many people ever hear about, let alone know. This one is called "MVP". It's like MVC (if you've heard of that) but works in a slightly different way. The key is that you have two places with code: one that does display (project_status.php) and one that has processing logic (project_status_app.php). One big change that you should make is that the app.php should not simply run everything inside it. You should use it as a place to store functions. For example, a function that handles updating the remarks in the database. This function does not check REQUEST_METHOD or grab values from $_POST. It takes all the values it needs as function parameters. Looks like function updateRemarks($remarkstxt, $pidForApproval) { What does the form send data to? It submits to the same file that started this process: project_status.php. That file is where you put the stuff about REQUEST_METHOD and $_POST. <?php if ($_SERVER['REQUEST_METHOD'] == 'POST') { include('project_status_app.php'); updateRemark($_POST['remarkstxt'], $_SESSION['pidForApproval']); // updateRemark should only update the remark - it shouldn't care about doing redirects too header("Location: project_status.php?id=" . $_SESSION['pidForApproval']); exit(); } include 'inc_fn_header_and_menu.php'; // ... With that updated, there's one more set of changes to make: not using $_SESSION, like I complained about earlier. And it's really, really easy. The pidForApproval is coming from $_GET to start with, right? Just keep doing that. Have the form submit to project_status.php?id=$pid and inside your new if block (seen above) you grab the pid from $_GET once more. Better yet, you can merge some of the new code with some of the old code: <?php if (isset($_GET['id']) && $_GET['id']!="") { $pid = $_GET['id']; $query = 'SELECT * FROM `profile` WHERE pid ='.'\''.$pid.'\''; $result=mysqli_query($db,$queryToRetrievePP) or die("There are no records to display ... \n" . mysqli_error()); foreach ($result as $row) { $status = $row['status']; } if ($_SERVER['REQUEST_METHOD'] == 'POST') { include('project_status_app.php'); updateRemark($_POST['remarkstxt'], $pid); header("Location: project_status.php?id=" . $pid); exit(); } } include 'inc_fn_header_and_menu.php'; // ...
  19. Or? If you need technical help from people with technical knowledge then you need to be very, very specific with your questions. What does "not opening" mean? What is happening and what did you expect would happen?
  20. There's been a bit of a push in recent years for better email security, including showing people URLs they can copy and paste if they're not sure about authenticity, but virtually everyone is capable of handling actual links. It's one of the most basic principles of HTML emails. Anyway, if you don't want then don't. You can put a plain URL into an email. But it has to have a domain that looks real for a client or email service to automatically link it for the user.
  21. 1. There is a syntax error in what you posted for project_status_app.php. What's your real code? 2. Don't use the session to shuffle short-lived data between pages like this. You already have a (weird) mechanism to give data to another file. Use that for the pidForApproval too.
  22. Don't do that. For one, it takes much more space to store whole strings like that. For two, there's a chance the slug may need to change in the future (like expanding the section to "database-design-and-development") and that would mean having to update all the tables using it. Use the number. That's the whole point of why it exists. Make it the PK with auto-increment and make the slug unique. There's no point in making this unique: (1) the uniqueness doesn't actually matter, and (2) the slug is basically the same as the name and it's already going to be unique. No, but if it isn't in the first couple columns then I would be suspicious. I would also be suspicious if there was a numeric "ID" column and it was not the PK. (And while not being the PK.) Just about. Just about. At least when there are better alternatives. Database doesn't care.
  23. One browse.php that handles /browse/whatever. browse.php?city=123 If the page is valid (city #123 exists) then the next step is to figure out what the canonical URL for the page should be. Namely /browse/city-name. If there's a category then that too, which you can handle as just ?category=123 because people don't care about query strings. If the canonical URL does not match the actual URL then redirect.
×
×
  • 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.