Search found 864 matches

by hyper
Tue Dec 10, 2019 10:33 am
Forum: PHP coding => General
Topic: OK to keep link open?
Replies: 1
Views: 14

Re: OK to keep link open?

As data is likely to be sent every few seconds, it would seem to be more efficient to simply open the link on startup and leave it open indefinitely.
Servers don't work that way, the server receives, processes, sends then closes.
by hyper
Tue Dec 10, 2019 10:28 am
Forum: PHP coding => General
Topic: Undefined variable:
Replies: 7
Views: 92

Re: Undefined variable:

Probably because if there is no file, it uses 'unknown.php' as the filename ? I don't know where in the code it will be as I don't have all the code, I'm just guessing. It may have been something that the original author did at one time and hasn't removed it. I haven't looked at the link you provid...
by hyper
Mon Dec 09, 2019 11:50 am
Forum: PHP Scripts
Topic: function function_name(parameters)
Replies: 3
Views: 22

Re: function function_name(parameters)

OK, so any parameter in a function() needs to be predefined before the function is called. Kind of correct if slightly re-worded: Functions need to be supplied with the correct number of values. Some values can set to a default. function threevalues ($x, %y, $z){ //Must supply function call with th...
by hyper
Mon Dec 09, 2019 10:24 am
Forum: PHP Scripts
Topic: automated betting script
Replies: 3
Views: 27

Re: automated betting script

I will still suggest contacting your bookies if this is the case, as they will probably already have a route that they are happy with.
by hyper
Mon Dec 09, 2019 10:20 am
Forum: PHP coding => General
Topic: Undefined variable:
Replies: 7
Views: 92

Re: Undefined variable:

Probably because if there is no file, it uses 'unknown.php' as the filename?
by hyper
Wed Dec 04, 2019 9:50 am
Forum: PHP Scripts
Topic: function function_name(parameters)
Replies: 3
Views: 22

Re: function function_name(parameters)

What is the correct term to use for the items in the parenthesis? Are they variables, strings, arguments or something else altogether? They are called 'parameters' or 'arguments'. Do items in the parenthesis have to be defined in the function and/or somewhere else in the same script? No, as they ar...
by hyper
Wed Dec 04, 2019 9:22 am
Forum: PHP Scripts
Topic: automated betting script
Replies: 3
Views: 27

Re: automated betting script

I suspect any attempt to do this would ring alarm bells on the chosen site, which may end up in a ban. I would ask why you would want to write a script to do that? It seems to be a convoluted way of doing something. If it is something that you really want to do, then I would suggest that you contact...
by hyper
Mon Dec 02, 2019 9:33 am
Forum: PHP General
Topic: I need PHP to zip certain files on my server
Replies: 4
Views: 138

Re: I need PHP to zip certain files on my server

Have you checked your error log? the answer may be in there?

Have you tried displaying errors when testing? (only do this on a test machine)

It would be easier to help if you posted the code.
by hyper
Thu Nov 28, 2019 11:27 am
Forum: PHP coding => General
Topic: Undefined variable:
Replies: 7
Views: 92

Re: Undefined variable:

I can't be certain as I don't know if $two_letter_country_code is defined in one of your includes? include("ip_files/".$numbers[0].".php"); Anyway, try declaring it in your function call (it's considered a good idea to declare variables before first use): function iptocountry($ip) { $two_letter_coun...
by hyper
Wed Nov 27, 2019 7:03 pm
Forum: PHP coding => General
Topic: multidimensional array ?
Replies: 2
Views: 41

Re: multidimensional array ?

The problem that you have is that it's not clear how the data is structured and it's difficult to get information back from arrays like this. Not knowing how you expect to retrieve the data also increases the problems. A well structured database may be the solution, however, if you re-structure your...
by hyper
Wed Nov 13, 2019 9:39 am
Forum: PHP coding => General
Topic: cannot modify header information
Replies: 3
Views: 94

Re: cannot modify header information

I commented out the echo and it resolved my issue
This would be better deleted:

Code: Select all

echo '<pre>';
print_r(debug_backtrace());
echo '<pre>';
As stated, these things can reveal information which may allow access to your server, especially if you are running a version of PHP before V 7.
by hyper
Tue Nov 12, 2019 2:20 pm
Forum: PHP coding => General
Topic: cannot modify header information
Replies: 3
Views: 94

Re: cannot modify header information

If you use print, echo, var_dump or print_r you have sent the header.

If you have things like this:

Code: Select all

echo '<pre>';
print_r(debug_backtrace());
echo '<pre>';
in your code, you may well have big problems as it might reveal information you need to keep to yourself.
by hyper
Sat Nov 02, 2019 10:54 am
Forum: PHP Installation
Topic: installing php 7 on 14.04 - Cannot add PPA: 'ppa:ondrej/php-7.0'
Replies: 1
Views: 41

Re: installing php 7 on 14.04 - Cannot add PPA: 'ppa:ondrej/php-7.0'

try:

Code: Select all

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0
I would advise upgrading to 18.04 which is the latest LTS, then just:

Code: Select all

sudo apt install php
by hyper
Wed Oct 23, 2019 8:40 am
Forum: PHP coding => General
Topic: foreach question
Replies: 1
Views: 116

Re: foreach question

Use SQL to fetch the column, there's no need to use a foreach loop.
by hyper
Wed Oct 23, 2019 8:35 am
Forum: PHP coding => General
Topic: ZipArchive zips slow to open, Win10
Replies: 4
Views: 147

Re: ZipArchive zips slow to open, Win10

At 30k, it's honestly not worth the effort; any time saved would be spent trying to work out why it takes so long, and then having to unzip it at the other end.

Out of interest, how big is the file once zipped?
by hyper
Tue Oct 22, 2019 8:09 am
Forum: PHP coding => General
Topic: ZipArchive zips slow to open, Win10
Replies: 4
Views: 147

Re: ZipArchive zips slow to open, Win10

It will take some time if the file is big.

Are you doing this as a cron job?
by hyper
Tue Oct 22, 2019 8:03 am
Forum: PHP coding => General
Topic: echo <<< tag
Replies: 2
Views: 106

Re: echo <<< tag

It's called heredoc it is explained better in the given link than I could. There are still a few gotchas in there so have a play with it.
by hyper
Fri Oct 18, 2019 7:33 am
Forum: PHP coding => Mail
Topic: I can't get the form method and submit button to work.
Replies: 6
Views: 2723

Re: I can't get the form method and submit button to work.

Whatever they were trying to do, it was 4 months ago.
by hyper
Fri Oct 18, 2019 7:30 am
Forum: PHP Jobs
Topic: Looking for a PHP/mysql Programmer
Replies: 3
Views: 1208

Re: Looking for a PHP/mysql Programmer

You've both failed the observation criteria.
by hyper
Sun Sep 22, 2019 11:59 am
Forum: PHP General
Topic: Using Table HTML tag in PhP
Replies: 2
Views: 76

Re: Using Table HTML tag in PhP

Because you have an extra space in this line print ("<TR><TD BGCOLOR=\ "$rowColor\">"); the parser cannot compile the file. If you are going to escape a character, you need to put if straight after the slash: print ("<TR><TD BGCOLOR=\"$rowColor\">"); You should use css not html to set the background...
by hyper
Tue Aug 27, 2019 8:59 am
Forum: PHP Scripts
Topic: PHP -> strJsonFile -> json_decode
Replies: 1
Views: 647

Re: PHP -> strJsonFile -> json_decode

You need to set json_decode $assoc to true <?php $file = '{ "258": { "AT": { "av": -65.532, "ct": 296965, "mn": -100.044, "mx": -26.219 }, "First_UTC": "2019-08-18T07:24:23Z", "HWS": { "av": 4.745, "ct": 130562, "mn": 0.18600000000000003, "mx": 16.788 }, "Last_UTC": "2019-08-19T08:03:59Z", "PRE": {...
by hyper
Tue Aug 27, 2019 8:05 am
Forum: PHP coding => General
Topic: How to enable error display and logging in php.ini?
Replies: 1
Views: 474

Re: How to enable error display and logging in php.ini?

The problem is when setting the error log in the script is if there is a fatal error, nothing will be logged as the script will exit without executing the call to log errors. A possible way around this is to set up your own error handling or set up a testing server so that you can control the ini fi...
by hyper
Tue Aug 06, 2019 10:58 am
Forum: phpMyAdmin
Topic: cannot purge phpmyadmin and reinstall without errors
Replies: 5
Views: 1075

Re: cannot purge phpmyadmin and reinstall without errors

It's a PHP warning, phpMyAdmin is doing something that it will not be able to in a future PHP version - I don't know which version. You might not find any problems at the moment, I don't use it so can't help any further - sorry.
by hyper
Mon Aug 05, 2019 9:43 am
Forum: Server installation and configuration
Topic: cheap sr22 quote
Replies: 0
Views: 1175

Re: cheap sr22 quote

How much are your quotes?
by hyper
Mon Aug 05, 2019 9:39 am
Forum: phpMyAdmin
Topic: cannot purge phpmyadmin and reinstall without errors
Replies: 5
Views: 1075

Re: cannot purge phpmyadmin and reinstall without errors

You can try this:
sudo apt purge phpmyadmin
followed by
sudo apt autoremove