Search found 687 matches

by hyper
Wed May 23, 2018 3:17 pm
Forum: PHP coding => General
Topic: custom wordpress plugin code
Replies: 3
Views: 18

Re: custom wordpress plugin code

It looks to be JQuery script which is why you got an error trying to parse it as PHP.

What did the instructions that came with the script tell you to do?
by hyper
Mon May 21, 2018 12:39 pm
Forum: PHP General
Topic: session value at any moment
Replies: 3
Views: 48

Re: session value at any moment

It's an online manual
by hyper
Sun May 20, 2018 1:20 am
Forum: PHP coding => General
Topic: auto increment value inserted to two db tables
Replies: 6
Views: 41

Re: auto increment value inserted to two db tables

Look at your data: you have duplicated username and password in both tables you have contact information in the repairs table you already have a memberID, use that to get your data is customer_ref for your information or their information? could you have different technicians working on different or...
by hyper
Sat May 19, 2018 12:07 pm
Forum: PHP coding => General
Topic: auto increment value inserted to two db tables
Replies: 6
Views: 41

Re: auto increment value inserted to two db tables

I think that you're trying to do too much in one go, have you created the database and tables?

I think that you'll a few more tables and look a bit more in depth at your data requirements.
by hyper
Sat May 19, 2018 10:38 am
Forum: PHP coding => General
Topic: auto increment value inserted to two db tables
Replies: 6
Views: 41

Re: auto increment value inserted to two db tables

Have you tried it?

What happens when you try?

Stating the obvious: Don't try it on a live database.

If it does work, are you sure that it will solve your problem?
by hyper
Sat May 19, 2018 9:33 am
Forum: mySQL & php coding
Topic: new version of PHP got me..
Replies: 4
Views: 37

Re: new version of PHP got me..

Sorry, I didn't realise, that's where using code tags comes in handy.

try using var_dump after the fetch:

Code: Select all

$rowAccount=mysqli_fetch_array($result);
var_dump($rowAccount);
See what is actually returned from the fetch.

Have you checked your error logs?
by hyper
Sat May 19, 2018 7:24 am
Forum: PHP coding => General
Topic: Usage of __DIR__ constant
Replies: 1
Views: 21

Re: Usage of __DIR__ constant

If I understand correctly, the __DIR__ "knows" where the including file is located __DIR__ knows which directory the currently executing file is located. so that if I move the file to a new directory it should work without updating the code. No, you need to change your include statement, the server...
by hyper
Fri May 18, 2018 11:53 pm
Forum: PHP coding => General
Topic: Fatal Error with initial example of sms platform attempt
Replies: 1
Views: 16

Re: Fatal Error with initial example of sms platform attempt

Have you checked that you followed all of the installation instructions?

As the error message states, it cannot find the 'autoload.php' file, so you need to change the path in this line:

Code: Select all

require_once '../vendor/autoload.php';
so that it can find it
by hyper
Fri May 18, 2018 11:45 pm
Forum: PHP coding => General
Topic: How to display current logged information
Replies: 1
Views: 41

Re: How to display current logged information

however it is displaying EVERYBODIES details It is returning what you have asked for, change the SQL, and I strongly recommend using prepared statements while you go about making your changes, the point in using prepared statements was to improve security. $stmt = $con->prepare("SELECT *FROM Users"...
by hyper
Fri May 18, 2018 11:36 pm
Forum: mySQL & php coding
Topic: new version of PHP got me..
Replies: 4
Views: 37

Re: new version of PHP got me..

MySQL functions are deprecated

Code: Select all

mysql_connect("$host", "$username", "$password",)or die("cannot connect");
, so all of your function calls need to be changed, I suggest you change to PDO.

If your other sites already use PDO or MySQLi, you shouldn't have any problems changing.
by hyper
Thu May 17, 2018 8:06 am
Forum: PHP coding => General
Topic: php pdo mysql id to two different tables help
Replies: 3
Views: 38

Re: php pdo mysql id to two different tables help

Maybe a bit late, but if you have 2 tables: repairs: memberID, jobID members: memberID, username, password Then all you need to do is $db->prepare('SELECT jobID FROM repairs WHERE memberID = ?'); You might want to add more fields for date, phone number, maybe a description of the repair etc..? but t...
by hyper
Sun May 13, 2018 11:50 am
Forum: PHP coding => General
Topic: PHP Warning: Declaration
Replies: 8
Views: 179

Re: PHP Warning: Declaration

PHP can't find 'ttfonts.php', your path is wrong.
by hyper
Sun May 13, 2018 12:22 am
Forum: mySQL & php coding
Topic: PHP Registration accepts SAME USERNAME and EMAIL in uppper and lower case
Replies: 1
Views: 49

Re: PHP Registration accepts SAME USERNAME and EMAIL in uppper and lower case

This is deliberate behaviour, the letters 'A' and 'a' are not the same in computers as it needs to know if you want an upper case letter or lower case letter. The easiest way is to use either strtoupper or strtolower to change the input; or you can use PDO or SQL to do it when you insert into the da...
by hyper
Sat May 12, 2018 7:33 am
Forum: PHP coding => General
Topic: Permission Denied When Using fopen
Replies: 1
Views: 40

Re: Permission Denied When Using fopen

You'll need to contact your college admin to get permissions changed or change the user that PHP runs under.
by hyper
Sat May 12, 2018 2:32 am
Forum: PHP General
Topic: Parsing a binary file
Replies: 1
Views: 44

Re: Parsing a binary file

fread can open binary files , then I think you are looking for unpack to translate the data and the pack page will give you the data type codes. PHP tries to avoid binary data since it is largely machine dependant and portability is the goal. Using binary formats could lead to problems at a later d...
by hyper
Sat May 12, 2018 2:08 am
Forum: MySQL Installation
Topic: MySQL 8 Connection Question
Replies: 1
Views: 40

Re: MySQL 8 Connection Question

As a general rule, upgrade to the latest stable version. Why are you hesitating?
by hyper
Fri May 11, 2018 7:48 am
Forum: PHP coding => General
Topic: Should I bother to build unique PDO for update?
Replies: 3
Views: 78

Re: Should I bother to build unique PDO for update?

If it's 'System performance' that you're concerned about, then I ask you this: do you really need to improve the performance? What justification would you have for this if the answer is yes? To try to determine if you have achieved any time saving, you would need to benchmark what you have and try a...
by hyper
Mon May 07, 2018 7:19 am
Forum: PHP coding => Images
Topic: Image rotate save but need to remove old
Replies: 3
Views: 68

Re: Image rotate save but need to remove old

To delete a file use unlink / delete.
i think the quality is compromised?could it be?
Could have been, have you looked at the compression setting?
by hyper
Mon May 07, 2018 7:14 am
Forum: PHP coding => General
Topic: Last 4 characters of a filename
Replies: 4
Views: 84

Re: Last 4 characters of a filename

Ooops, cross post, same answer :o
by hyper
Mon May 07, 2018 7:13 am
Forum: PHP coding => General
Topic: Last 4 characters of a filename
Replies: 4
Views: 84

Re: Last 4 characters of a filename

Use a negative start position

Code: Select all

echo substr('MyString',-4, 2);
You don't need to getenv or any of the other functions.
by hyper
Mon Apr 30, 2018 12:14 pm
Forum: PHP coding => Mail
Topic: input missing in mail sent by php
Replies: 1
Views: 79

Re: input missing in mail sent by php

Is this what is not being sent:

Code: Select all

<textarea id="info" name="info" type="text" cols="40" rows="10" placeholder="info *"></textarea>
?

as this:

Code: Select all

echo "Info = ".$_POST['message'];
might be the reason?

Also have a look at this to add some protection to your forms in a simple way.
by hyper
Mon Apr 30, 2018 11:59 am
Forum: PHP coding => General
Topic: Handling dates and times, and DST
Replies: 1
Views: 64

Re: Handling dates and times, and DST

Yep, dates and times can get complicated; use PHPs in-built functions to help you. The Unix Timestamp is a single number from which you can calculate both date and time as it is the number of seconds since 1st January 1970 - I would leave PHP to apply localised changes for summer time, leap years, t...