Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. If you're using 3rd party email service, then you should be sending email through them. They also should provide you the SPF, DKIM and DMARC TXT records you would need to add to your DNS. Really this is a question for your hosting company, as the details of how they support email differ based on the hoster.
  3. Admin please delete the post above thx.
  4. Today
  5. Hello, I have this php file <?php $account_no = empty($_POST['account_no']) ? : $_POST['account_no']; $valid_accounts = array(501412195); $result = in_array((int)$account_no,$valid_accounts); if($result) { echo('Success'); } else { echo('Failed! - no account where found... '); } ?> It print out "Failed! - no account where found..." no matter what account number im using. If i change $result = in_array((int)$account_no,$valid_accounts); to $result = in_array($account_no,$valid_accounts); it print out "Success" not matter what account number i use. What is wrong with the code i have?
  6. It would be good to actually explain where you are using this regex. Looks like it's in a spreadsheet. Regex engines can have different syntax and capabilities. You also provided examples of strings that I guess don't work right, but you didn't include the output you expect. That is important information to include in a question like this. The core of this is very simple. [A-Z][a-z]+ Things inside a [] pair are called character classes. So this means: Match any uppercase character -> [A-Z]. This will be a single match. Then match any lowercase character [a-z]. The "+" following is a quantifier which means "1 or more times". So for a match to be made, it requires at least 1 lowercase letter. So the obvious problem with this example: Zentropa International SwedenCanal+Ciné+ Is that it has a plus sign. That could be fixed by this: [A-Z][a-z+]+ However, the non - obvious problem is that you have a non-ascii character in Ciné, which wlll also not match. I am going to make an assumption here that you're using excel, and that it supports .NET's regex library. So by substituting a unicode specific character class that matches any "lowercase" unicode character, as well as allowing a + sign to be part of a string this would work: [A-Z](\p{Ll}|[+])+ I don't know if these are the only strings you have that are problematic, as company names can have all sorts of other non-ascii characters you might have to deal with. Which brings us to this: Nordisk Film ProductionNadcon FilmZweites Deutsches Fernsehen (ZDF) I assume the problem is that nothing will match the (ZDF). This is really a weakness of the approach. A better approach for this would be: Parse original string into an array using the space as a delimitter For each element in the array, perform the regex replacement that finds capital letters and adds a space to break it up into multiple words Rejoin all the elements in the array using a space This would fix the problem with the ZDF as well as any similar issues, as the regex replacement would not affect existing "words" like the "(ZDF)". I hope this helps you. Vibe coding/copy paste only gets you so far when you aren't able to study and understand how the code works, and whether or not it is applicable to your problem.
  7. Yesterday
  8. Hey everyone, I changed the service I use for my e-mail hosting away from my website hosting. The only "email thing" I really use the hosting service for is sending emails, for reason explained below. Usually, I would have changed the SMTP settings using php.ini, and been done with it, however, my shared hosting has removed that ability. This has created two unique problems: 1. Now that my my email is handled by a third party, the hosting no longer DKIM signs emails it sends out using "mail()" 2. The "header from" and the "envelope from" no longer match by default. The ladder is the default shared hosting domail email. These two issue resault in the mail going into the spam folder. I can fix this by using either the phpmailer library, or the -f parameter in mail; however that now means compatabilty issues with future applications I install, that depend on the php.ini information being accurate. Is there any workaround you guys can think of that might help me fix this?
  9. Not having symbols is okay, it just means that gdb won't be able to fully translate the machine symbols it's reading into more useful, human-friendly symbols - like, parts of a backtrace will be cryptic. But it'll all still work fine.
  10. @requinix I'm not sure what happened, but when I start gdb now I get this error: $ gdb php GNU gdb (Ubuntu 15.0.50.20240403-0ubuntu1) 15.0.50.20240403-git Copyright (C) 2024 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <https://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from php... This GDB supports auto-downloading debuginfo from the following URLs: <https://debuginfod.ubuntu.com> Enable debuginfod for this session? (y or [n]) y Debuginfod has been enabled. To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit. Downloading separate debug info for /usr/bin/php8.3 (No debugging symbols found in php) (gdb) I tried searching on that error "(No debugging symbols found in php)" but I couldn't find anything. I don't understand why it was working before and then stopped working.
  11. I was following along until the "please do this for me" bit at the end. REGEXREPLACE + REGEXEXTRACT like that is silly. Not sure where you got it from, but a single REGEXEXTRACT is enough to extract all the <uppercase letter + stuff>s in the cell. Check the documentation/help docs for how to make it match everything instead of just once (which is what it does by default). For the regex part, it's currently doing <uppercase letter + lowercase letters> so naturally it will only work with lowercase letters and not with numbers or symbols. If you want to match things that look like <uppercase letter + stuff> then realize that "stuff" is a less precise way of saying "keep going until the next uppercase letter". Or in other words, "anything that isn't uppercase". Because computers need you to be precise if you want them to work a certain way. Excel's regex syntax for "anything that isn't ___" is the same as everybody else does it, so you can check either the docs (which I'm sure include a little bit of regular expression syntax) or virtually any other regex resource to find how to write that.
  12. Last week
  13. Hello Regexperts, I have pulled a regex from the internet to seperate words that start with capital letters. The regex is here TEXTJOIN(" ",,REGEXEXTRACT(R158,REGEXREPLACE(R158,"([A-Z][a-z]+)","($1)"))) When I have this: HummelfilmTamtam FilmThe Imaginarium Films The Regex works and returns this: Hummelfilm Tamtam Film The Imaginarium Films But when I have this Nordisk Film ProductionNadcon FilmZweites Deutsches Fernsehen (ZDF) or this Zentropa International SwedenCanal+Ciné+ The Regex breaks. It looks like the presence of non alphanumeric characters is causing the problem. Can anyone please help me out and rewrite the Regex so that it works with non alphanumeric characters too?
  14. PHP array... $data = [ 'store_id' => 'test', 'api_token' => 'test', 'checkout_id' => 'test', 'txn_total' => '4.00', 'environment' => 'qa', 'action' => 'preload', 'cart' => [ 'items' => [ [ 'description' => 'Item 1', 'unit_cost' => '1.00', 'quantity' => '3' ], [ 'description' => 'Item 2', 'unit_cost' => '1.00', 'quantity' => '1' ] ], 'subtotal' => '4.00' ] ]; $json = json_encode($data); echo $json; gives this json string (spaces and newlines added for readability) { "store_id":"test", "api_token":"test", "checkout_id":"test", "txn_total":"4.00", "environment":"qa", "action":"preload", "cart":{ "items":[ {"description":"Item 1", "unit_cost":"1.00", "quantity":"3" }, { "description":"Item 2", "unit_cost":"1.00", "quantity":"1" } ], "subtotal":"4.00" } }
  15. Thanks for the reply everyone, No basically I wanted to know how to actually declare the PHP object so json_encode() would return everything properly. What tripped me up was that there's an Array inside an Array inside of an Array and it made the actual declaration too confusing to write. So I broke it up into sub arrays and then declared the largest array by calling the smaller arrays. I have it working now, and I really appreciate the help!
  16. Earlier
  17. No the idea is, if I send or receive email from a email with pgp the php script does nothing. if I receive an email from someone who doesn’t, the php script will encrypt it on my server. if I sent it to someone that doesn’t have it, it will send a plain text email, then encrypt the local copy.
  18. PHP will set the response code to be a 302, when it issues the Location header. If this same code was running, but it was sending a 200, that could be because either the webserver or something in the code has already set the response code. We have no context or information on what triggers this code. The only other thought I could contribute is that a 302 should not be used if the redirect is being issued in response to a POST request, you should not use the 302, but instead issue a 307. This is discussed here.
  19. Why? Do you expect everyone you send email to, to use PGP to decrypt your emails?
  20. There's been a name for this type of UI/window/panel effect for a while under the moniker of "glassmorphism". So if you do some googling for that with css, you'll find a lot of different examples. Here's one of many: https://codepen.io/kanishkkunal/pen/QWGzBwz One thing to note is that most implementations make use of backdrop-filter, and you want to check caniuse for support.
  21. Hi all This image is from Apple's new OS... and they called it Liquid Glass. I was wondering if there is some smart CSS you could create to turn this effect, into a Button? I know you can do blurring, but like this? with that sort of edging.. I tried a box shadow but even with rgba background of the button, it doesn't show thru. Love to see some ideas.
  22. There was nothing "kind" about the volume of spam you just sent out. Please use the existing account tools to request a deletion of your account.
  23. Hey Everyone, I am using a host that uses Cpanel/GNUpg. From what I can tell, any email sent to me using PGP/GPG is stored on my server as encrypted. If the sender didn't use encryption, it is saved as plain text. I know I can pipe my emails through a PHP script. Does a PHP script/library exist that will automatically encrypt any plain text emails using my public key, before passing them to my email client? Thanks
  24. Please could you kindly delete my account. I haven't used it since 2007 and no longer need it. Please could you delete the account and any data. Thank you.erg ergergerg
  25. Hi Everyone, I’m Kamal Hinduja from Geneva, Switzerland. I’m new to this community and look forward to contributing positively to the discussions while learning from your insights. Thanks in Advance! Kamal Hinduja Geneva, Switzerland
  26. Hi, The following code has been part of the system for several years. However, a recent issue prevented the browser from redirecting as expected. Typically, the code performs a redirection to a new URL with an HTTP status code of 302. Unfortunately, for one specific website, the redirection failed, and instead of a 302 response, the server returned an HTTP 200 status code. When the new URL is pasted directly into the browser, the website works fine. However, the issue arises when the redirection is triggered through the code. This issue has now been resolved, but we would like to understand the circumstances under which this behaviour occurs and how to replicate it. Could this be related to the website’s response time? If so, why does the PHP backend need to account for this particular website and return an HTTP 200 status code instead of the expected 302? header('Referrer-Policy: unsafe-url'); header('Location: ' . $result['shortenedUrl']); exit; Thank you
  27. It sounds like you aren't sure what the problem is. Either way, there is not much help we can provide with no specific diagnostics and no code to look at.
  28. @Barand gave you code and instructions for taking json and converting it into php. From what I read, you actually want to go the opposite direction -- take a php object or array (or some combination) and convert that into json. You do that using json_encode(). There are flags you might need that control how certain PHP types get converted to match what the api requires.
  29. It sounds like a simple database structure would likely be very helpful in maintaining and updating data, and rendering maps and links.
  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.