Search found 904 matches

by hyper
Sat May 25, 2019 11:34 am
Forum: PHP Scripts
Topic: Prevent function execution on page load?
Replies: 2
Views: 735

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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...
by hyper
Sun Apr 28, 2019 4:30 am
Forum: PHP coding => General
Topic: Practical ways of using $_SESSION and $_COOKIE in procedural PHP
Replies: 3
Views: 909

Re: Practical ways of using $_SESSION and $_COOKIE in procedural PHP

Seems odd, but ok :D As indicated, the internet does have some very old scripts still promoted today which would fit the bill including some which claim to be oop (that aren't, simply throwing the odd object and using new at scripts doesn't make them ooop), the problem of course is trying to work ou...
by hyper
Sat Apr 27, 2019 11:27 am
Forum: PHP General
Topic: PHP - Generating a link with a picture
Replies: 1
Views: 675

Re: PHP - Generating a link with a picture

It doesn't look as though you have a form in page 2?
by hyper
Sat Apr 27, 2019 11:17 am
Forum: PHP coding => General
Topic: Search in a multidimensional array and get the key?
Replies: 2
Views: 869

Re: Search in a multidimensional array and get the key?

You'll need to iterate through the arrays.
by hyper
Sat Apr 27, 2019 11:15 am
Forum: PHP General
Topic: Useful PHP Articles, Sites
Replies: 50
Views: 35787

Re: Useful PHP Articles, Sites

Does it specialise in posting posts started in 2013? or how to improve your seo by getting backlinks?
by hyper
Sat Apr 27, 2019 11:13 am
Forum: PHP coding => General
Topic: Practical ways of using $_SESSION and $_COOKIE in procedural PHP
Replies: 3
Views: 909

Re: Practical ways of using $_SESSION and $_COOKIE in procedural PHP

The internet is littered with 1990s scripts, insecurely and badly misusing sessions and cookies.

Is this post actually genuine or do you have another agenda?
by hyper
Sat Apr 27, 2019 10:43 am
Forum: mySQL & php coding
Topic: Sum values from the same column where ids are similar
Replies: 5
Views: 918

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

If you want to select only products where product_master is not zero

You could use this as a sub query

Code: Select all

SELECT product FROM table WHERE product_master != 0
Is it possible for product_master to be negative? what happens then?

NOT zero can include -1 for instance
by hyper
Thu Apr 25, 2019 9:59 am
Forum: PHP Jobs
Topic: Small Task: PHP convert Image to RGB565, compress, show stats then download
Replies: 2
Views: 784

Re: Small Task: PHP convert Image to RGB565, compress, show stats then download

You're willing to pay someone to do your homework? Hi Everyone!! I am working on logic for a Microcontroller that dynamically updates a screen via UART. The screen only accepts vector based commands to fill a coordinate with a square and a filled color. The command looks like so fill x,y,h,w,<color>...
by hyper
Tue Apr 23, 2019 11:18 am
Forum: PHP coding => General
Topic: Problem with Oracle Database and PHP Form
Replies: 1
Views: 534

Re: Problem with Oracle Database and PHP Form

Your code is taking too long to execute, I suspect that it isn't Oracle or SQL at fault; if you show the full error and post some code (in code blocks using the </> button ) it might help us to help you. We do not have access to your system so cannot see what you are referring to.
by hyper
Mon Apr 22, 2019 1:41 pm
Forum: PHP coding => General
Topic: Need help using USORT to rearrange array order
Replies: 5
Views: 772

Re: Need help using USORT to rearrange array order

Yes it's possible to do all of this using SQL in one query - look up 'sub queries', 'IN' and 'IF'.