Search found 634 matches

by chorn
Thu Feb 13, 2020 11:02 pm
Forum: PHP coding => General
Topic: Automatic store POST vars (array) from form with foreach.
Replies: 1
Views: 37

Re: Automatic store POST vars (array) from form with foreach.

store... where? the keys/values are already "stored" in the _POST variable.
by chorn
Mon Feb 10, 2020 1:23 am
Forum: PHP coding => General
Topic: Can you set an include as a variable?
Replies: 2
Views: 41

Re: Can you set an include as a variable?

just for completeness: as included files can have code, you can assign that too

Code: Select all

// including.php

$var = include('codefile.php'); // $var = 123


// codefile.php

return 123;
by chorn
Tue Jan 28, 2020 11:35 pm
Forum: PHP coding => General
Topic: MYSQL DB not showing uft8 on php page
Replies: 6
Views: 177

Re: MYSQL DB not showing uft8 on php page

You read the docs provided, start making your connection and perform the queries.
by chorn
Thu Jan 23, 2020 11:49 pm
Forum: PHP coding => General
Topic: $_POST does not have the CR LF chars
Replies: 3
Views: 89

Re: $_POST does not have the CR LF chars

Did you have a look at the source code of your resulting page?
by chorn
Wed Jan 22, 2020 6:30 am
Forum: PHP coding => General
Topic: Create zip file from changing list of files
Replies: 1
Views: 92

Re: Create zip file from changing list of files

So if you have a script that works, and the one that doesn't, look at the differences, here it must be the filename

Code: Select all

var_dump('/file/path/to/add/that/works');
var_dump($row['filename']);
by chorn
Wed Jan 22, 2020 2:14 am
Forum: PHP coding => General
Topic: MYSQL DB not showing uft8 on php page
Replies: 6
Views: 177

Re: MYSQL DB not showing uft8 on php page

You should change to MySQLi - or better PDO - soon, the mysql_* functions are deprecated and are already removed in current versions of PHP 7. It looks like you are using PHP 5.x which is outdated:

https://www.php.net/supported-versions.php

https://www.php.net/manual/en/book.pdo.php
by chorn
Wed Jan 22, 2020 2:12 am
Forum: PHP coding => General
Topic: PHP image store and retrieve
Replies: 1
Views: 103

Re: PHP image store and retrieve

just have a look at >> php image upload tutorial <<
by chorn
Thu Jan 16, 2020 10:56 pm
Forum: PHP coding => General
Topic: Finding a date by adding work hours to a date.
Replies: 1
Views: 108

Re: Finding a date by adding work hours to a date.

I would say, you take your start date, fast forward one week for every occurancy of combined sheduled hours within your working hours (50 hours = 1.xx weeks), take the rest with modulus, loop over your sheduled hours, forward one day if sheduled hours are fully covered for that day and subtract them...
by chorn
Thu Jan 16, 2020 12:11 am
Forum: PHP coding => General
Topic: MYSQL DB not showing uft8 on php page
Replies: 6
Views: 177

Re: MYSQL DB not showing uft8 on php page

Did you check the file beeing UTF8 WITHOUT BOM? How do you transfer files? FTP may change the encoding, you can try binary transfer.

Did you try setting SET NAMES statement on database connection?
by chorn
Mon Jan 13, 2020 5:25 am
Forum: PHP coding => General
Topic: PHP MYSQL URL Filtering
Replies: 1
Views: 122

Re: PHP MYSQL URL Filtering

You get URL parameters via the varialbe $_GET. But only unique keys are allowed, or you use an array like ?country[]=france&country[]=spain. After checking all array items against a whitelist, using array_filter() and in_array() or array_intersect(), you can turn them into a comma seperated list to ...
by chorn
Thu Jan 09, 2020 12:58 am
Forum: PHP coding => General
Topic: PHP - IF ELSE ELSE Help (NULL NOT NULL etc)
Replies: 4
Views: 184

Re: PHP - IF ELSE ELSE Help (NULL NOT NULL etc)

still no clue what's wrong / what you want to achieve. you did not answer all questions. i've posted a direct translation to working, tested code from your description.
by chorn
Thu Jan 09, 2020 12:22 am
Forum: PHP coding => General
Topic: Help a newbie please :)
Replies: 2
Views: 141

Re: Help a newbie please :)

Why did you use two single-quotes instead of a double-quote in the second parameter?
by chorn
Wed Jan 08, 2020 6:37 am
Forum: PHP coding => General
Topic: PHP - IF ELSE ELSE Help (NULL NOT NULL etc)
Replies: 4
Views: 184

Re: PHP - IF ELSE ELSE Help (NULL NOT NULL etc)

And what do you expect? What do you define as "wrong"? Which input did you use?

Just write a test: https://3v4l.org/tg5UQ
by chorn
Wed Jan 08, 2020 3:26 am
Forum: mySQL & php coding
Topic: Need guidance and support.
Replies: 4
Views: 101

Re: Need guidance and support.

then you need to know what exactly this management software does, is it open source?
by chorn
Tue Jan 07, 2020 6:16 am
Forum: mySQL & php coding
Topic: Need guidance and support.
Replies: 4
Views: 101

Re: Need guidance and support.

how do you get the logfiles now?
by chorn
Mon Jan 06, 2020 1:29 am
Forum: mySQL & php coding
Topic: why my code not working
Replies: 1
Views: 110

Re: why my code not working

enable error reporting

Code: Select all

$pdo = new PDO('mysql:host=localhost;dbname=someTable', 'username', 'password', array(
  PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
));
by chorn
Mon Jan 06, 2020 1:21 am
Forum: PHP General
Topic: Problem with API call
Replies: 1
Views: 57

Re: Problem with API call

on a blank page you should have a look in the error.log of your webserver.
by chorn
Mon Jan 06, 2020 1:19 am
Forum: PHP coding => General
Topic: CSgo gambling error
Replies: 1
Views: 140

Re: CSgo gambling error

ok what error
by chorn
Mon Jan 06, 2020 1:18 am
Forum: PHP coding => General
Topic: File_get_contents
Replies: 1
Views: 158

Re: File_get_contents

source code is just plain text, you can perform plain text search with strpos().
by chorn
Wed Dec 04, 2019 11:21 pm
Forum: PHP General
Topic: Array Indexing Question
Replies: 3
Views: 77

Re: Array Indexing Question

What for do you need an numerical-only index? Numerical and string indexes don't really make a difference in PHP. You could alter the data with array_values, or use array_column to get a list of one property. Looping is with foreach.
by chorn
Tue Dec 03, 2019 1:41 am
Forum: PHP General
Topic: I need PHP to zip certain files on my server
Replies: 4
Views: 203

Re: I need PHP to zip certain files on my server

Haven't you tried the code?
by chorn
Thu Nov 14, 2019 11:29 pm
Forum: PHP coding => General
Topic: Remove session key
Replies: 1
Views: 115

Re: Remove session key

Qhy would you set the session key to null? At least all session data would be inaccesible then. But session_destroy() already manages that.
by chorn
Tue Nov 12, 2019 3:55 am
Forum: PHP coding => General
Topic: Classes/Databases
Replies: 7
Views: 213

Re: Classes/Databases

What for? Looks like you think about a solution that needs a problem.
by chorn
Tue Nov 12, 2019 2:35 am
Forum: PHP coding => General
Topic: Classes/Databases
Replies: 7
Views: 213

Re: Classes/Databases

So your db connection already gives you the data encapsuled in the class provided, you could directly use the db connection without wrapping that in your class again.