-
Posts
15,274 -
Joined
-
Last visited
-
Days Won
432
Everything posted by requinix
-
Split array every 3 commas & return as string?
requinix replied to AquariaXI's topic in PHP Coding Help
I'll try again but even more explicitly. 1. You need to call WriteFile with certain arguments. The first one is the file path and name, great. Now think about the second one. Is it a variable? 2. Take that variable, put a real "value" into it, and print_r() it. What is the output? 3. Given that particular output, exactly what is it that you want to write to the file? -
php-soap is the correct name for the official package, however CentOS 7 is a very old version and only supports PHP 5.4. Which means you probably installed another source in order to get a more recent version of PHP. Try a yum search for anything soap and see if the package you need goes by a different name.
-
Split array every 3 commas & return as string?
requinix replied to AquariaXI's topic in PHP Coding Help
If the data is CSV then you need to treat it like CSV data. Because that's what it is. If you try to pretend it is something else then you'll run into problems. It's trivial to take an array with a bunch of things and "group" them into 3s - once you get it into that form. Back to this code: $file-> File :: WriteFile ( $filepath . $filename, "TEST!, TEST!, TEST!, " . "TEST!, TEST!, TEST!, " . "TEST!, TEST!, TEST!" ); I imagine that is not the real code you want to use. What is the real code? The data you're trying to write to the file: what does it actually look like? -
Split array every 3 commas & return as string?
requinix replied to AquariaXI's topic in PHP Coding Help
This: $file-> File :: WriteFile ( $filepath . $filename, "TEST!, TEST!, TEST!, " . "TEST!, TEST!, TEST!, " . "TEST!, TEST!, TEST!" ); Is that what it has to be? Because you act like you want those three "lines" of TESTs to be three separate strings, but if you concatenate them like that then you only have one string, and splitting them apart into multiple strings again leads to this whole mess about splitting delimiters. You also talk about a multidimensional array, but you don't have that here. You have an array containing one string. And you have code that uses fopen/fclose but does absolutely nothing with them because you actually use file_put_contents. And there's the comment which makes it super obvious that you copy/pasted the code from StackOverflow. So I don't really get the impression that you know what's going on here. And if you don't know then how am I supposed to know? Is the "TEST" string supposed to represent some different string? CSV string, maybe? Is it written in code or pulled from a database or submitted by a user through a form or what? Not asking to be annoying. I'm asking because this whole thing doesn't make any sense, and I can only assume that it's supposed to make sense, so clearly I'm missing something important. -
Split array every 3 commas & return as string?
requinix replied to AquariaXI's topic in PHP Coding Help
The code behind checkDelimiter and SplitFileByDelimiter is probably going to be relevant here, don't you think? -
Composer is a command-line utility, meaning you cannot use it through WHM/cPanel. You need SSH access and a general familiarity with Linux terminals.
-
@sumon4asad44: Please reply to this thread with an email address or other external contact method for someone to reach you about this work.
-
javascript sometime not work when user not in chrome interface
requinix replied to nitiphone2021's topic in Javascript Help
Browsers may throttle background activity when users are not active on the page. Switch to WebSockets instead of AJAX polling. -
You cannot control how the browser gets the video from a capturing <input>. If you need more control of that process then you'll have to get the video another way.
-
All that code in InitializeData should be inside the constructor instead. There is no need for InitializeData to exist. It forces you to call that method every time you create a new instance of MainframeData, and if you forget then you get problems like the one that started this thread. If you need to set up appVer and appTitle when the object is created then you should be literally setting up appVer and appTitle when the object is created.
-
Did you write the code for the MainframeData class? If not, where did it come from?
-
You already know that the appTitle is set by InitializeData. If you don't call InitializeData then there will be no appTitle. All that InitializeData code should exist in the constructor anyways. Move it and you won't have to call any special methods before you can use appTitle.
-
What's the code where you call it? Is it part of the code you posted before or is it written somewhere else?
-
Have you tried calling that get_appTitle() method?
-
If the filename is title + genre + year then you're going to have to identify each piece. The genre will either have to be a single word (so you know the last "word" in the filename was the genre) or one from a specific list, the year is obviously the numbers at the end, and the title would be everything else.
-
No. Just because you found code posted somewhere on the internet does not make it open source. You can make whatever changes you want but I expect you're going to have a very hard time making it work without using cameratag.com's systems and APIs.
-
Are you even sure there was a "Titanic" movie in 1990?
-
If you search for "app-id" in the code you'll see that UUID gets sent to the new_video() function, which makes API calls to www.cameratag.com. Please, please, please, don't go finding Javascript code snippets out there and just copying them into your site without knowing 110% exactly what they do. That's the kind of mistake that results in lawsuits with terms like "monetary damages".
-
Submit without reload page ajax, javascript
requinix replied to tivadarsubotica's topic in Javascript Help
What about the time to maintain this code? There is more than just writing the code and saving the file. What will you do if you have to come back to this file again in the future? What if you need to do another similar AJAX feature somewhere else? Your time to learn this is not a price to pay but an investment in yourself and your employer. Strider64 gave an example of how to do this. AJAX and mod_rewrite are two completely different things. -
What "both ways"? Which one? I'm sure it can work, so there's probably something different about your code. Did you check that the HTML works in a regular webpage? What's the rest of the code?
-
I know what the answer is. It's to wrap your Array in a Proxy. If you don't like that answer then does that mean you want to shop around until you find one you like better?
-
Submit without reload page ajax, javascript
requinix replied to tivadarsubotica's topic in Javascript Help
If you need to use AJAX but don't know how then this would be a good time to learn. Are you using a Javascript framework? If so then see what it offers for AJAX support. If not then you should look into the Fetch API - not XMLHttpRequest, that's mostly obsolete, but the fetch() function and stuff related to it. What you would do is, when someone clicks the button to "submit" the "form", you create a Request with appropriate information (eg, a URL, the POST method, and FormData body), give that to fetch(), and it will give you a Response that you can read from. -
Submit without reload page ajax, javascript
requinix replied to tivadarsubotica's topic in Javascript Help
If you don't want the page to do anything then use AJAX instead of a <form>. So yes, AJAX can definitely do what you want.