Search found 839 matches

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

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

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

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: 1
Views: 70

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

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

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

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

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

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

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.
by hyper
Fri May 24, 2019 5:07 pm
Forum: PHP Installation
Topic: Where to store php programs on Ubuntu 18.04
Replies: 1
Views: 185

Re: Where to store php programs on Ubuntu 18.04

whereis shows the installation directories. You should have been given a location during installation or through usage instructions. is there a page that displays when entering http://localhost/ in your browser url, this might give you the information that you want? You could also do a search for ht...
by hyper
Tue May 21, 2019 11:30 am
Forum: PHP coding => General
Topic: Navigating Relative Links in PHP (using NetBeans)
Replies: 7
Views: 279

Re: Navigating Relative Links in PHP (using NetBeans)

You can do anything you want to do in your autoload function, so it's up to you how you determine what's what, where and how it's stored.

Just keep it simple for your own sanity.
by hyper
Sun May 19, 2019 7:40 am
Forum: PHP coding => General
Topic: Unable to Load Class under a NameSpace
Replies: 2
Views: 149

Re: Unable to Load Class under a NameSpace

As per the other post: read the link for autoloading; PHP is happy to help with namespaces in the autoloader.
by hyper
Sun May 19, 2019 7:39 am
Forum: PHP coding => General
Topic: Navigating Relative Links in PHP (using NetBeans)
Replies: 7
Views: 279

Re: Navigating Relative Links in PHP (using NetBeans)

Read this link I offered earlier

Use the

Code: Select all

define('ROOT', $_SERVER['DOCUMENT_ROOT']);
rather than

Code: Select all

'./cEntities/' . $objectName . '.php';
also note, when using autoloaders, you don't need to use include_once since it will only load the file if it can't find the class definition the first time.
by hyper
Sun May 19, 2019 7:24 am
Forum: PHP coding => General
Topic: highlight item in dropdown box
Replies: 2
Views: 153

Re: highlight item in dropdown box

pre-typed, static is a problem: although you can set an item as selected, that requires parsing the html to find the correct item and then inserting the selected attribute. You would be better off storing the counties in a database table or an included array, then parse the list until you get the c...
by hyper
Sat May 18, 2019 10:22 am
Forum: PHP coding => General
Topic: Navigating Relative Links in PHP (using NetBeans)
Replies: 7
Views: 279

Re: Navigating Relative Links in PHP (using NetBeans)

Yeah, it is confusing - it's to do with current working directory (or the first file executed). Along time ago I stopped trying to work out relative paths for includes and started to use absolute paths. I do this by defining the ROOT directory as a constant: define('ROOT',$_SERVER['DOCUMENT_ROOT']);...
by hyper
Sun May 12, 2019 5:31 am
Forum: PHP coding => General
Topic: HOW TO PREVENT FORM REFRESH ON GETTING REDIRECTION FROM ANOTHER PHP PAGE
Replies: 7
Views: 343

Re: HOW TO PREVENT FORM REFRESH ON GETTING REDIRECTION FROM ANOTHER PHP PAGE

I already have, you can use $_SESSION or maybe pass details through $_GET.

Just to clarify, this is not a script writing service - help only is available - I do hope that you aren't expecting a script to be written for you.
by hyper
Sat May 11, 2019 8:57 am
Forum: PHP coding => General
Topic: HOW TO PREVENT FORM REFRESH ON GETTING REDIRECTION FROM ANOTHER PHP PAGE
Replies: 7
Views: 343

Re: HOW TO PREVENT FORM REFRESH ON GETTING REDIRECTION FROM ANOTHER PHP PAGE

What are you struggling with?

Your post doesn't mention any specific problem that you have, I can't help if you don't show what your problem is.
by hyper
Wed May 08, 2019 2:51 pm
Forum: PHP coding => General
Topic: HOW TO PREVENT FORM REFRESH ON GETTING REDIRECTION FROM ANOTHER PHP PAGE
Replies: 7
Views: 343

Re: HOW TO PREVENT FORM REFRESH ON GETTING REDIRECTION FROM ANOTHER PHP PAGE

If you follow the link I gave and do some research on $_SESSION, you will find how to use it to keep the information on your page, but it does depend on exactly what you want to do, you may not need to use it at all.

To put your code on here, simply paste it into a code block using the </> button.
by hyper
Wed May 08, 2019 8:03 am
Forum: PHP coding => General
Topic: HOW TO PREVENT FORM REFRESH ON GETTING REDIRECTION FROM ANOTHER PHP PAGE
Replies: 7
Views: 343

Re: HOW TO PREVENT FORM REFRESH ON GETTING REDIRECTION FROM ANOTHER PHP PAGE

If I read that correctly, you want to allow a user to delete a record from the database and then show the user what they have just deleted?

If so: you'll need to store the information separately, $_SESSION might be the answer.
by hyper
Sat May 04, 2019 2:48 am
Forum: PHP General
Topic: opening a file on local computer from website
Replies: 1
Views: 182

Re: opening a file on local computer from website

If your webserver is on you local machine, you need to find the full path to it, I doubt that it is in your root (c:\), it is more likely to be something like C:\Users\(User_Name)\Documents Where user_name is your computer user name, Assuming you are using windoze and which version of windoesn't you...
by hyper
Thu May 02, 2019 11:16 am
Forum: PHP coding => General
Topic: How to adapt the insert code?
Replies: 1
Views: 182

Re: How to adapt the insert code?

Change the SQL, that's all you need to do to change the operation.

That is one mash up of code?
by hyper
Mon Apr 29, 2019 11:46 am
Forum: mySQL & php coding
Topic: group and sort Hierarchicaly array in php
Replies: 2
Views: 321

Re: group and sort Hierarchicaly array in php

Is this what you want?

Code: Select all


<?php

function query(){
 return [10=>[1001,1002],
         12=>[1201=>[120101],
              1202=>[120201]],
         13=>[]
         ];
}

var_dump (query());
by hyper
Sun Apr 28, 2019 5:14 am
Forum: mySQL & php coding
Topic: Sum values from the same column where ids are similar
Replies: 5
Views: 301

Re: Sum values from the same column where ids are similar

No it cannot be negative, zero or positive Just trying to make you think, computers don't know what you intend to do, they do what you tell them to do... regardless. A number can be negative, therefore -1 will not be zero: <?php function my_func(){ return 0; } $value = 18; $a = [5, 0.1, 0, null, tr...