Search found 903 matches

by hyper
Tue Nov 12, 2019 2:20 pm
Forum: PHP coding => General
Topic: cannot modify header information
Replies: 3
Views: 144

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: 72

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: 162

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: 203

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: 203

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: 154

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: 2805

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: 4
Views: 1283

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: 96

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: 660

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: 496

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: 6
Views: 1112

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: 1198

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: 6
Views: 1112

Re: cannot purge phpmyadmin and reinstall without errors

You can try this:
sudo apt purge phpmyadmin
followed by
sudo apt autoremove
by hyper
Wed Jul 24, 2019 7:27 am
Forum: JavaScript
Topic: whats the best way to get dynamic table on a webpage?
Replies: 1
Views: 912

Re: whats the best way to get dynamic table on a webpage?

Tables are wrong for what you are describing, a product list is not tabular data, it is a list. Why JavaScript when you don't want to do it in html? Doing it in JavaScript will restrict (read as totally exclude) getting listed in search engine results. Doing it in JavaScript will restrict your audie...
by hyper
Sun Jul 14, 2019 3:00 am
Forum: PHP coding => General
Topic: How to make PHP code to receive data from firebase?
Replies: 5
Views: 972

Re: How to make PHP code to receive data from firebase?

I would suggest that you look at help pages for firebase, if someone could help you from this forum, I'm sure they would have.

Good luck in your endeavours.
by hyper
Wed Jul 10, 2019 3:20 pm
Forum: Free time
Topic: Permitted Development advice please
Replies: 1
Views: 751

Re: Permitted Development advice please

I might be able to give you a tenner for it.
by hyper
Sun Jun 30, 2019 2:13 pm
Forum: PHP coding => General
Topic: HREF link vith PHP...
Replies: 3
Views: 863

Re: HREF link vith PHP...

ok, where is $webpage defined?

Did your first code sample work?
by hyper
Sat Jun 29, 2019 1:22 pm
Forum: PHP coding => General
Topic: Adding PHP Code in WordPress Website
Replies: 0
Views: 768

Re: Adding PHP Code in WordPress Website

The first thing to do is look at what is affecting your page load time, I would start looking at: javascript & css then look at image sizes.

I suspect your server is not the culprit and is fine.
by hyper
Sat Jun 29, 2019 1:10 pm
Forum: PHP coding => General
Topic: HREF link vith PHP...
Replies: 3
Views: 863

Re: HREF link vith PHP...

Without seeing the code in your 'web' method, we can't help you, even then we may need more. I will however point out that using "_blank" is considered bad practice in anchors unless you have indicated that the link will open in a new window, most of the time you don't need to do this as users can d...
by hyper
Thu May 30, 2019 10:27 am
Forum: PHP coding => General
Topic: "Each of the variable has truth value embedded in its name"?
Replies: 2
Views: 878

Re: "Each of the variable has truth value embedded in its name"?

What is the advantage of embedding "true" word in a variable's name? None whatsoever. It would cease to be variable if it could only be set as true, that's where constants come in, and that would be pointless. I haven't looked at the tutorial, but I suspect that there should be more to read which e...
by hyper
Sun May 26, 2019 6:57 am
Forum: PHP coding => General
Topic: Exclude dates from a php DatePeriod output
Replies: 4
Views: 957

Re: Exclude dates from a php DatePeriod output

Common mistake: if ($testDate !== $excludeDate->format("l d F")) { $output.= $testDate." at 2:00pm <br>"; } You're comparing each date in your $exclude array, so if the $testDate is not the same as the date contained in the $exclude array, it adds it to the $output string. If you have three exclude ...
by hyper
Sun May 26, 2019 1:51 am
Forum: PHP coding => General
Topic: Exclude dates from a php DatePeriod output
Replies: 4
Views: 957

Re: Exclude dates from a php DatePeriod output

Add this to your code:

Code: Select all

var_dump($exclude);
var_dump($dateList);
add it just before the foreach loop:

Code: Select all

var_dump($exclude);
var_dump($dateList);
// iterate over $dateList and remove the excluded dates. Output the non-excluded dates
foreach($dateList as $newDate){
by hyper
Sat May 25, 2019 11:40 am
Forum: PHP coding => Images
Topic: Can a return function be writen inside a loop?
Replies: 1
Views: 1316

Re: Can a return function be writen inside a loop?

To answer the question literally, and as you have already found, there is nothing stopping you from doing it, and as you have probably found out - it doesn't complete the loop and only iterates once.

Have a read of this
by hyper
Sat May 25, 2019 11:34 am
Forum: PHP Scripts
Topic: Prevent function execution on page load?
Replies: 2
Views: 734

Re: Prevent function execution on page load?

You'll have to put some logic into your script for this to check for the add button.