Jump to content

gizmola

Administrators
  • Posts

    6,077
  • Joined

  • Last visited

  • Days Won

    154

gizmola last won the day on May 27

gizmola had the most liked content!

7 Followers

About gizmola

Contact Methods

  • Website URL
    http://www.gizmola.com/

Profile Information

  • Gender
    Male
  • Location
    Los Angeles, CA USA

Recent Profile Visitors

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

gizmola's Achievements

Prolific Member

Prolific Member (5/5)

357

Reputation

72

Community Answers

  1. In every case, you are not passing an account #. You should have seen that already in the debugging. You need to pick a method (GET or POST) and stick with it. The most recent code you provided appears to be making a POST request. It appears to me that your bot code retrieves your account# from the system. Since this is not coming from a form, I would suggest you just use a GET request which will make it easier to just setup the URL. With an HTTP GET request, you just add parameters to the url as name=value pairs. Then in PHP, you can get the variable from the $_GET superglobal. As the problem is with your client, and that client is based on MQL4 language, I am just making an educated guess here, based on looking at the Manual page for the webRequest function. From what I read briefly, it's essentially C++ syntax, but something none of us who aren't using the trading product you are using could possibly debug for you. But as I said, I made a guess for you as to what I would change. string url = "https://johnnylai.me/license/customers.php?"; string headers; char post[]; int accountNumber = (int)AccountInfoInteger(ACCOUNT_LOGIN); string paramText = "account_no="+IntegerToString(accountNumber); StringToCharArray(postText, post, 0, WHOLE_ARRAY, CP_UTF8); char result[]; string resultHeaders; int response = WebRequest("GET", url+paramText, headers, 1000, post, result, resultHeaders); Print(__FUNCTION__," > Server response is ", response, " and the error is ", GetLastError()); Print(__FUNCTION__," > ", CharArrayToString(result)); return(INIT_SUCCEEDED); Then your first line of the PHP script would be: $account_no = $_GET['account_no'] ?? 0; If $account_no == 0 when running the script, then the parameter is not working, which so far has been the case in all your testing. If you use my code make sure you understand that the full url to be passed needs to be: https://johnny.../license/customers.php?account_no=274020340 (or whatever the account# is). If the client code works as expected that is what should be available to the php script. You can test that the backend script is working by just pasting the url to your server with the url parameter with one of your valid account #'s. I do have to warn you that you have posted your real url and if these are real account#'s that might be an issue for you.
  2. You didn't provide the form that targets this script, but often the issue with people new to PHP superglobals, is that $_POST only gets set to data that is in an actual POST request. <form action="url/to/yourscript.php" method="POST"> If the form includes a file input, you also need to set the enctype to multipart/form-data. <form method="post" action="url/to/yourscript.php" enctype="multipart/form-data"> Your code has this: $account_no = empty($_POST['account_no']) ? : $_POST['account_no']; A cleaner way to handle this would be to use the null coalescing operator "??" $account_no = $_POST['account_no'] ?? 0; One last piece of advice: Leave off the PHP end tag. You don't need it, and in some cases it can cause trouble. This and other formatting standards and advice can be reviewed in https://www.php-fig.org/per/coding-style/
  3. 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.
  4. 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.
  5. 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.
  6. Why? Do you expect everyone you send email to, to use PGP to decrypt your emails?
  7. 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.
  8. 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.
  9. @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.
  10. It sounds like a simple database structure would likely be very helpful in maintaining and updating data, and rendering maps and links.
  11. Yes, you can rename index.html to index.php and it will work fine, with the following caveats: If your webserver is not set to treat index.php as the DirectoryIndex, then it won't serve index.php if it isn't specifically referenced. It does not automagically make html into PHP. You need to have PHP blocks or add PHP alternative syntax within your html markup. You've provided 6 static links here, and no explanation of what PHP is going to be doing for you. I'd also highly recommend you improve your markup, rather than using a bunch of wonky br's organize your internal structure, and use bootstrap's utility classes as well: <div class="col-xl-2"> <div class="fw-bolder fs-3"> Adams County </div> <ul class="list-group"> <li class="list-group-item"><a href="https://adamssheriff.org/ "> Sheriff</a></li> <li class="list-group-item"><a href="https://www.coloradojudicial.gov/courts/trial-courts/Adams-county ">Judicial</a></li> <li class="list-group-item"><a href="https://adcogov.org/">Government</a></li> <li class="list-group-item"><a href="https://www.brightonco.gov/">Brighton</a></li> <li class="list-group-item"><a href="https://www.brightonco.gov/203/City-Council">Council</a></li> <li class="list-group-item"><a href="https://en.wikipedia.org/wiki/Adams_County,_Colorado">Wiki</a></li> </ul> </div> If you have a more specific question, add a follow up.
  12. This is an old thread, but just in case, here are a few pieces of advice: Move your CSS into an external file Include a CSS Reset OR use a CSS framework that includes one. (for example "bootstrap css") Consider use of BEM for organization and better integration of markup and styling Investigate use of SASS (allows use of variables, nesting of css classes within source sass) Convert all pixel sizing to use REM (or EM inside of @Media queries) Make UI responsive using media queries Base colors on a color based theme. Sites like https://coolors.co/ are very useful in this regard. Here's an example color pallet: https://coolors.co/bcd4de-a5ccd1-a0b9bf-9dacb2-949ba0 You have a cool app, but I do think a simpler layout would make it simpler and more usable. The font use and coloring would be improved if labels and headings weren't the same color (black) as the inputs. It looks like you are trying to pack in multiple fields horizontally, with labels, which makes it busy. When you choose transparent background, the background input should be made read only. The "Preview" section should have the same section treatment (background, border, padding etc) as the other sections.
  13. There is no way for anyone to help you, when we have no information about the mail server you are trying to connect to. GoDaddy provides email servers for you to use: https://www.godaddy.com/en-in/help/mail-server-addresses-and-ports-for-business-email-24071 It appears you are using some other service. There's additional information here: https://www.godaddy.com/en-in/help/send-form-mail-using-an-smtp-relay-server-953 Ordinarily using an smtp client is a superior solution for sending mail, but with GoDaddy, using mail() is probably best, as they have already setup the MTA on the server to deposit your outbound mail into their mail system. For local development, the best practice these days is to use a local email testing tool. There's a number of these tools, but from what I've seen with Container wrapper tools like DDEV, Mailpit seems to be the preferred solution. You need some way of differentiating environments to make this type of thing work, as the configuration for a development or QA environment is not going to be the same for a production environment.
  14. How do you "get a script" that doesn't work without alteration of the the SQL code? Was it designed to use a different database? Yes GROUPS is a MySQL reserved/keyword You took care of this correctly by using the backtick character to quote the groups table name
  15. You need to get really familiar with the web development tools, inspect elements look at page source code, and figure out how to figure out these things for yourself. When you say "comes in like that, there are multiple things happening, but in general, these are all css animations. Do some learning in regards to how they work, and things like keyframes. This is an elementor hosted site, and thus it includes a bunch of styles that come in from the elementor.min.css file, that is part of their publishing platform. So if you look at the image in the top right, and the flex box it is contained within, you will notice a lot of different styles driving this functionality. I will hi-light a couple for you: <div class="elementor-container elementor-column-gap-no"> <div class="elementor-column elementor-col-100 elementor-inner-column elementor-element elementor-element-af52a3e animated-slow alpha-entrance-reveal animated rotateInDownRight" data-id="af52a3e" data-element_type="column" data-settings="{&quot;animation&quot;:&quot;rotateInDownRight&quot;}"> <div class="elementor-widget-wrap elementor-element-populated"> <div class="elementor-element elementor-element-bca11ec animated-slow elementor-widget elementor-widget-image animated fadeInRightShorter" data-id="bca11ec" data-element_type="widget" data-settings="{&quot;_animation&quot;:&quot;fadeInRightShorter&quot;}" data-widget_type="image.default"> <img fetchpriority="high" decoding="async" width="945" height="763" src="https://d-themes.com/wordpress/udesign/corporate-4/wp-content/uploads/sites/74/2024/10/intro-banner-image.png" class="lazy-fade attachment-full size-full wp-image-3916" alt="Banner" srcset="https://d-themes.com/wordpress/udesign/corporate-4/wp-content/uploads/sites/74/2024/10/intro-banner-image.png 945w, https://d-themes.com/wordpress/udesign/corporate-4/wp-content/uploads/sites/74/2024/10/intro-banner-image-768x620.png 768w" sizes="(max-width: 945px) 100vw, 945px"> </div> <div class="elementor-element elementor-element-e4a20a1 elementor-widget__width-auto elementor-absolute animated-slow elementor-widget elementor-widget-image animated fadeIn" data-id="e4a20a1" data-element_type="widget" data-settings="{&quot;_position&quot;:&quot;absolute&quot;,&quot;_animation&quot;:&quot;fadeIn&quot;,&quot;_animation_delay&quot;:600}" data-widget_type="image.default"> <img decoding="async" width="279" height="623" src="https://d-themes.com/wordpress/udesign/corporate-4/wp-content/uploads/sites/74/2023/08/shape-1.png" class="lazy-fade attachment-large size-large wp-image-727" alt="shape"> </div> </div> </div> </div> Notice that this div that contains these other divs, has some styles like: alpha-entrance-reveal, animated, rotateInDownRight, etc. Figure out where these styles are defined. You can do this by clicking on the style names in dev tools. You will find that for "rotateInDownRight" there's this definition: .alpha-entrance-reveal.rotateInDownRight { animation-name: revealRotateInDownRight; } The dev tools even include a little paperclip icon that that will run the animation when clicked, so you can easily see the effect it produces. Look up the css definition of animation-name and what it does. CSS Animations like many similar packages utilize key frames. You set up a particular state and the animation calculates how to get from that initial state to future keyframes. So the definition of "revealRotateInDownRight" turns out to be this css animation: @keyframes revealRotateInDownRight { 0% { transform: rotate(25deg); transform-origin: right bottom } to { transform: rotate(0); transform-origin: right bottom } } It should be apparent that what is happening is that it is starting with the element rotated 25 degrees, using the bottom right corner as the "origin". You want to investigate what an "origin" is for in a grid or animation system. When the animation is complete, the element will no longer be rotated. What you can do, is make small tests to explore these effects. It should go without saying that there are many other styles that are contributing to the overall animation effects of the page, but individually you can understand them once you break them down and isolate them. If you investigate the "fadeInRightShorter" you will find a similar transformation that utilizes transform-origin. @keyframes fadeInRightShorter { 0% { opacity: 0; transform: translate(50px,0); transform-origin: 0 0 } to { opacity: 1; transform: none } } .fadeInRightShorter { animation-name: fadeInRightShorter } This page has an awful lot going on, including the use of Skrollr, which is a really old javascript scroll animation library.
×
×
  • 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.