Search found 10280 matches

by Christopher
Tue Sep 21, 2021 3:41 pm
Forum: PHP - Code
Topic: Read txt file and repeat lines based on data in file - Write to array or another file.
Replies: 2
Views: 7054

Re: Read txt file and repeat lines based on data in file - Write to array or another file.

You have an input array and an output array that will have the replicated lines. You could loop through the array returned by file(), explode each line, find the integer in column one, and append N lines to the output array: $input = file('/path/to/my/file.csv'); $output = []; foreach ($input as $li...
by Christopher
Sat Jul 06, 2019 2:28 pm
Forum: Databases
Topic: Array to find providers based on Answers to Qs
Replies: 1
Views: 76161

Re: Array to find providers based on Answers to Qs

You could put "1,3,7" in the ProvideId field, or create a forth Answers_Providers table that has AnswerId and ProviderId fields.
by Christopher
Mon Mar 25, 2019 10:28 pm
Forum: HTML, CSS and other UI Design Technologies
Topic: Can this html table loop be done
Replies: 2
Views: 85215

Re: Can this html table loop be done

Use <textarea>:

Code: Select all

   echo("<td style='" . $StyleVaries . ";border:1px #c0c0c0 solid;text-align:left;vertical-align:top;width:180px;height:18px;' ><textarea name='fooSongName[]' cols='60' rows='2'>$fldSNF_SongName</textarea></td>\n");
by Christopher
Sat Mar 02, 2019 11:54 pm
Forum: PHP - Code
Topic: Good code or bad code: my_sqli
Replies: 1
Views: 65077

Re: Good code or bad code: my_sqli

I would recommend validating and filtering the variables from $_REQUEST. Other than that it is just mediocre procedural code that could be refactored.
by Christopher
Sat Mar 02, 2019 11:37 pm
Forum: PHP - Code
Topic: readership map
Replies: 1
Views: 64593

Re: readership map

Code: Select all

<iframe src="https://assets.bepress.com/20170928/shared/embed/index.html?origin=https://repository.law.miami.edu" title="Readership Activity Map" width="978" height="768"></iframe>
by Christopher
Fri Jan 04, 2019 1:16 pm
Forum: PHP - Code
Topic: php ehler fisher strategy
Replies: 3
Views: 67317

Re: php ehler fisher strategy

ddragas wrote:yeah mate ... same here. Already started translation, but without success.
Thank you for your time
Post your code and I will help with the port. It shouldn't be that difficult. The trick will be to translate the Pine functions.
by Christopher
Thu Jan 03, 2019 5:09 pm
Forum: PHP - Code
Topic: php ehler fisher strategy
Replies: 3
Views: 67317

Re: php ehler fisher strategy

I couldn't find any PHP code online. That page has code in Pine Script (https://www.tradingview.com/wiki/Introduction), so you could translate the calculation into PHP and then plot the results.
by Christopher
Fri Dec 14, 2018 10:28 pm
Forum: HTML, CSS and other UI Design Technologies
Topic: CSS, Worpress CMS Custom CSS
Replies: 2
Views: 61400

Re: CSS, Worpress CMS Custom CSS

The problem seems to be that the white background is set in style .navigation-bar.fixto-fixed
by Christopher
Fri Dec 14, 2018 10:16 pm
Forum: PHP - Code
Topic: PDO::FETCH_ASSOC Question
Replies: 1
Views: 65269

Re: PDO::FETCH_ASSOC Question

$stmt->fetchAll(PDO::FETCH_ASSOC); will fetch all the rows selected, so you are at the end of the dataset. You don't need to loop. Either use fetchAll() or loop and use fetch(),
by Christopher
Mon Nov 12, 2018 10:01 pm
Forum: Javascript
Topic: Making a Ajax request and manipulate the text
Replies: 5
Views: 71835

Re: Making a Ajax request and manipulate the text

You can do it from a server with PHP, Python, etc. But you can't do it from the browser with Javascript.
by Christopher
Mon Oct 22, 2018 3:57 pm
Forum: Javascript
Topic: Making a Ajax request and manipulate the text
Replies: 5
Views: 71835

Re: Making a Ajax request and manipulate the text

You can call a PHP script on the same domain as the Javascript. That PHP script can fetch the contents of another domain, parse it, and return data to the Javascript script.
by Christopher
Fri Oct 19, 2018 8:39 pm
Forum: Javascript
Topic: Making a Ajax request and manipulate the text
Replies: 5
Views: 71835

Re: Making a Ajax request and manipulate the text

Have you checked your Javascript console for errors. I suspect your are getting cross-site scripting error.
by Christopher
Sat Oct 13, 2018 7:14 pm
Forum: PHP - Code
Topic: Convert a php resource to a string
Replies: 3
Views: 69607

Re: Convert a php resource to a string

I have one other question how do i increase the time limitation of 30 seconds per execution in PHP? I'm having problems running the whole script under 30 seconds. You cannot really speed up how fast mail is sent. You probably need to call the script multiple times. Each call would only sends a smal...
by Christopher
Sun Oct 07, 2018 9:35 pm
Forum: PHP - Code
Topic: Convert a php resource to a string
Replies: 3
Views: 69607

Re: Convert a php resource to a string

The $file variable is a resource returned by fopen(). The first parameter for mail() should be a string containing the email address of the recipient. Are the email addresses in the file? If so, then read the line into a variable: $email = fgets($file); mail($email, 'Thanks for joining!', Hi\nWe are...
by Christopher
Fri Sep 28, 2018 5:27 pm
Forum: PHP - Code
Topic: Can someone assist with this foreach loop?
Replies: 5
Views: 73179

Re: Can someone assist with this foreach loop?

I don't know the exact logic, but that looks confusing. You only have three unique responses.

And how do you deal with more than two tracking numbers?

And what is this line supposed to do?

Code: Select all

(($trackingInfoInEmail+1));