Search found 808 matches

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

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

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

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'.
by hyper
Mon Apr 22, 2019 10:07 am
Forum: PHP coding => General
Topic: Need help using USORT to rearrange array order
Replies: 5
Views: 39

Re: Need help using USORT to rearrange array order

It is not possible to sort by quantity without all of the information to do the comparison, since you don't want to do this in the SQL statement either: read in all products to an array iterate through array and double special products sort array based on quantity output results or: create empty arr...
by hyper
Mon Apr 22, 2019 6:23 am
Forum: PHP coding => General
Topic: Url Rewrite Dynamic to static...
Replies: 3
Views: 25

Re: Url Rewrite Dynamic to static...

Please read and answer all (No one has an idea as to what you have or want to change without the information, we cannot see what you aren't telling us): Explain a bit more clearly what it is you hope to achieve / change: How are the urls generated at the moment? (or what generates them?) Are the url...
by hyper
Mon Apr 22, 2019 6:16 am
Forum: PHP coding => General
Topic: Need help using USORT to rearrange array order
Replies: 5
Views: 39

Re: Need help using USORT to rearrange array order

You don't have any doubling in your script, I'm not sure usort will be of an easy thing to use to help you in this. Far simpler: Create an array of the special products which are going to be doubled, Read in the whole products array (using your select query), Then loop through it- Use in_array to ch...
by hyper
Fri Apr 19, 2019 6:09 pm
Forum: PHP coding => General
Topic: Searched the forum. Sending html form data to php file
Replies: 2
Views: 28

Re: Searched the forum. Sending html form data to php file

Ok, first things first: if the file cannot be found, then it can't be in the same directory, I've just copy pasted them into a trial directory and it can find the file. And now the rest: A basic html file should use the following- <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title...
by hyper
Fri Apr 19, 2019 5:09 am
Forum: PHP coding => General
Topic: Url Rewrite Dynamic to static...
Replies: 3
Views: 25

Re: Url Rewrite Dynamic to static...

Explain a bit more clearly what it is you hope to achieve / change:

How are the urls generated at the moment? (or what generates them?)

Do you already have pages at each location? e.g. /news/4592/global-news-auto

Can you or do you intend to code this yourself?
by hyper
Thu Apr 11, 2019 9:53 am
Forum: PHP coding => General
Topic: Replace null in jsonencoded array
Replies: 2
Views: 71

Re: Replace null in jsonencoded array

Is there a reason why you want to convert nulls after you have converted it to Json?

It would help us to help you if you posted some code in code blocks: </> button on the editor.
by hyper
Thu Apr 04, 2019 8:07 am
Forum: PHP coding => General
Topic: form validation using form from include () file
Replies: 15
Views: 438

Re: form validation using form from include () file

An echo will there appear on every page so no header() function is going to work.
Correct :D

Lesson learned: if you are going to use header() under certain conditions [filling form out], check for those conditions first and re-direct if necessary, or build page [re show form].
by hyper
Tue Apr 02, 2019 8:17 am
Forum: MySQL Installation
Topic: php and mysql install errors
Replies: 4
Views: 9567

Re: php and mysql install errors

It's totally free.
Do you show the attention to detail shown in answering a post made 7 years ago?
by hyper
Tue Apr 02, 2019 8:12 am
Forum: PHP coding => General
Topic: form validation using form from include () file
Replies: 15
Views: 438

Re: form validation using form from include () file

You cannot use echo and then header later on.

Do the logic first, then use header or echo depending on the logic.
by hyper
Thu Mar 28, 2019 12:03 pm
Forum: PHP coding => General
Topic: form validation using form from include () file
Replies: 15
Views: 438

Re: form validation using form from include () file

Do all the validation first, and use the logic to decide if to include or re-direct:

Code: Select all

<?php
  if (form_validates){
    header('thank_you_page');
  } else {
    echo 'errors: ';
  }
by hyper
Wed Mar 27, 2019 4:41 pm
Forum: PHP coding => General
Topic: form validation using form from include () file
Replies: 15
Views: 438

Re: form validation using form from include () file

You're looking at this from the wrong point of view, you are trying to do it in a particular way - don't - you need to do it in the way that it needs to be done. Do not rely on JavaScript to re-direct, and learn from your mistakes: I thought if I concatenated them it should work but it didn't. You a...
by hyper
Wed Mar 27, 2019 4:18 pm
Forum: PHP General
Topic: Dynamically display images in a container depending on page height
Replies: 7
Views: 271

Re: Dynamically display images in a container depending on page height

Is there any method of doing the container height calculation clientside Not easily or consitantly, there are too many variations in the way browsers do things. to use the result to render 'x' number of images serverside By rendering dynamic images, you would change the size of the page. or is it s...
by hyper
Tue Mar 26, 2019 8:54 am
Forum: PHP coding => General
Topic: form validation using form from include () file
Replies: 15
Views: 438

Re: form validation using form from include () file

Hyper I have to admit a 'double dunce' here. Not at all, we all have to learn, and learning like this is usually a good way, as it sticks. I thought if I concatenated them it should work but it didn't. You are missing the slash $root . "frm/frm-pm.php"; should be $root . "/frm/frm-pm.php"; Getting ...
by hyper
Tue Mar 12, 2019 2:52 pm
Forum: PHP coding => General
Topic: Help - Invalid argument supplied for foreach()
Replies: 1
Views: 105

Re: Help - Invalid argument supplied for foreach()

It looks like $rules is not iterable (can't be used in a foreach loop)

try

Code: Select all

echo gettype ($rules);
to see what you've got.
by hyper
Tue Mar 12, 2019 2:42 pm
Forum: PHP coding => General
Topic: form validation using form from include () file
Replies: 15
Views: 438

Re: form validation using form from include () file

Include it using the path to the file or replace the echo with the code you want instead. There is no good reason to use $_SERVER["PHP_SELF"], as I said, learn the directory structure and use $root as shown above, you should already know which file is going to process the form and which files will b...
by hyper
Tue Mar 12, 2019 1:12 pm
Forum: PHP coding => General
Topic: form validation using form from include () file
Replies: 15
Views: 438

Re: form validation using form from include () file

$_SERVER['DOCUMENT_ROOT'] is the full address of your web address from your systems point of view, which is probably to public_html on your system - not all set ups use public_html - by using $_SERVER['DOCUMENT_ROOT'] you can ignore what your path is when developing on one system and then uploading ...
by hyper
Tue Mar 12, 2019 8:46 am
Forum: PHP coding => General
Topic: form validation using form from include () file
Replies: 15
Views: 438

Re: form validation using form from include () file

Your path is wrong, which is why the file can't be found. I use $_SERVER['DOCUMENT_ROOT']: $root=$_SERVER['DOCUMENT_ROOT']; include "$root/retail/pm_form.php"; Don't bother with $_SERVER["PHP_SELF"], just use $root and set the rest of the path: "$root/frm/frm-pm.php"; Warning: PHP doesn't guarantee ...
by hyper
Sat Mar 09, 2019 1:34 pm
Forum: PHP coding => General
Topic: Why PHP is better than Java?
Replies: 2
Views: 137

Re: Why PHP is better than Java?

Java and JavaScript are completely different languages. A CMS is not exclusive to PHP, there are no language constructs which are exclusive to PHP which mean that it is the only language that you can write a CMS in. JAVA provides database connectivity. JAVA and PHP are cross platform. Any program th...
by hyper
Mon Feb 11, 2019 1:57 pm
Forum: PHP coding => General
Topic: Storing a database value as a SESSION VAR
Replies: 1
Views: 133

Re: Storing a database value as a SESSION VAR

Sessions can be used for storing a name or anything else you need, only store what you need. It's a bad practice to pull information from a database unless you need it. 'SELECT * FROM Members' will pull everything and storing it all in sessions will place a heavier un-necessary load on the server. Y...
by hyper
Sat Feb 09, 2019 11:19 am
Forum: PHP coding => General
Topic: Print correct dates in PHP
Replies: 7
Views: 352

Re: Print correct dates in PHP

I meant to state on my last post:

Well done for giving it a go!