Search found 429 matches

by Strider64
Wed Sep 29, 2021 6:27 am
Forum: phpMyAdmin
Topic: phpMyAdmin records into table are not seen
Replies: 2
Views: 211

Re: phpMyAdmin records into table are not seen

I haven't used mysqli in a long time, so I won't be able to help you out. However, I would recommend using PDO as it would be easier. Here's a good link that I still use from time to time - https://phpdelusions.net/pdo From the looks of the screenshots that is the structure of the database table and...
by Strider64
Wed Sep 22, 2021 3:19 am
Forum: PHP Scripts
Topic: How do I remove a key from a JavaScript object?
Replies: 2
Views: 226

Re: How do I remove a key from a JavaScript object?

Let's say we have an object with this format: var thisIsObject= { 'Cow' : 'Moo', 'Cat' : 'Meow', 'Dog' : 'Bark' }; I wanted to do a function that removes by key: removeFromObjectByKey('Cow'); just use delete thisisObject.cow and use a switch statement or if statements (I would use a switch statement)
by Strider64
Thu Sep 16, 2021 2:38 am
Forum: HTML Basics
Topic: All selected rows not submitted on form submit
Replies: 4
Views: 365

Re: All selected rows not submitted on form submit

My suggestion would to get the PHP to work first then add the JavaScript. HTML tables should only be used to display data like a spreadsheet does and that is the only time I would use a table. I think you need to revise your logic on that part. Just my .02 cents...
by Strider64
Wed Sep 08, 2021 8:08 am
Forum: PHP coding => Mail
Topic: [Help] Why isn't my sendmail working?
Replies: 8
Views: 3741

Re: [Help] Why isn't my sendmail working?

I don't know why it's not working on my end either. I'm still trying to figure it out. commercial epoxy flooring chattanooga Save yourself a bunch a headaches and just use a third-party mailer such as PHPMailer or SwiftMailer (I use this one). The sending it is easy to do. An example - Form <?php r...
by Strider64
Sun Sep 05, 2021 7:54 am
Forum: Your Scripts
Topic: A Simple Set of PDO Functions
Replies: 0
Views: 232

A Simple Set of PDO Functions

I made a series of functions that interact Dynamically with Database Tables and plan on adding more as time goes on. Right now you can Create, Read, Update and Delete and yes it is more suited of Object-oriented Programming, but this is geared more towards beginners in hopes they don't get discourag...
by Strider64
Sun Aug 29, 2021 6:58 pm
Forum: PHP General
Topic: Can't display items from query
Replies: 1
Views: 246

Re: Can't display items from query

My suggestion is to learn PDO instead of mysqli as it's more versatile and you are NOT tied down to just using MYSQL as your database.

A good resource that I even go back from time to time is https://phpdelusions.net/pdo
by Strider64
Tue Aug 17, 2021 2:44 am
Forum: PHP coding => General
Topic: Logic in MySql with PHP needed
Replies: 4
Views: 444

Re: Logic in MySql with PHP needed

Hi member, I have a database table containing all the papers received in an office (government office). If related papers already exist, then the new paper(correspondence) to be entered in the table should be linked to the relevant record. If not i.e., there is no connected papers, a new file numbe...
by Strider64
Thu Aug 12, 2021 3:00 am
Forum: PHP coding => General
Topic: trouble finding undefined key error
Replies: 3
Views: 425

Re: trouble finding undefined key error

if (($_SERVER['REQUEST_METHOD'] === 'POST') ) { /*** PROCESS FORM ***/ } That's basically all you have to do. My suggestion is to get the form working BEFORE worrying about validation. From a design point of view just use short descriptions for the placeholder attribute (for example placeholder="1-...
by Strider64
Fri Jul 30, 2021 2:49 am
Forum: PHP coding => General
Topic: Stuck in... if
Replies: 3
Views: 595

Re: Stuck in... if

Egads! 😲 I am going to cut to the chase and tell to you to find the delete key on your keyboard then press it on that file that contains that code. My suggestion to you would to find a good online tutorial or a good how-to-book on PHP that is recent. Don't worry about MySQL right now though when you...
by Strider64
Thu Jul 29, 2021 2:24 am
Forum: mySQL & php coding
Topic: Using MySQLi to connect
Replies: 9
Views: 2153

Re: Using MySQLi to connect

Hmm? Where to start? My first recommendation would to be to use PDO instead of mysqli to access the MySQL Database Table(s). A good resource that I even still use on occasion is this -> https://phpdelusions.net/pdo I would start small and setup a PHP Sandbox that you can test out your PHP and PDO. T...
by Strider64
Mon Jul 26, 2021 8:50 am
Forum: PHP coding => General
Topic: Best editor for PHP
Replies: 225
Views: 264774

Re: Best editor for PHP

Even though PhpStorm isn't Free, I switched over to it and after a bit of a learning curve that IDE really has help my coding. It gives you suggestions for the most part on how to make your code better and more streamline. Less banging your head against the wall and actually getting things done. I a...
by Strider64
Fri Jul 16, 2021 5:47 pm
Forum: PHP coding => General
Topic: Prevent Duplicate entry on form update with PDO
Replies: 6
Views: 909

Re: Prevent Duplicate entry on form update with PDO

I don't know how you would exactly write the code (maybe someone else will know), but you have to create an unique index and check from that. This is how I prevent an user having a same username in the same database table: public function create():bool { try { /* Initialize an array */ $attribute_pa...
by Strider64
Sun Jul 11, 2021 5:41 am
Forum: PHP coding => General
Topic: PHP Redirecting to another page problem
Replies: 1
Views: 523

Re: PHP Redirecting to another page problem

A signup or registration should be simple and one page. However, if you just want to have a signup page without having a user enter a password then simply asks the questions and inform the user that the no secured information will be shared. However, it looks like you want the user have to login int...
by Strider64
Sun Jul 11, 2021 5:19 am
Forum: Server security
Topic: Disable dangerous php functions in php.ini to reduce security exploits
Replies: 5
Views: 1170

Re: Disable dangerous php functions in php.ini to reduce security exploits

You want to disable functions that are security risks in PHP? That doesn't make sense.

Simply don't use them
by Strider64
Tue Jun 22, 2021 8:50 am
Forum: HTML Basics
Topic: Attempting to set up php quiz with limited retries using sessions
Replies: 2
Views: 3690

Re: Attempting to set up php quiz with limited retries using sessions

cathyscherer wrote:
Tue Jun 22, 2021 12:24 am
please update me on the progress of this set-up. We need to know it for our roofing contractors gibsonton.
You do realize this thread is 3 years old?
by Strider64
Fri Jun 18, 2021 10:23 am
Forum: PHP coding => General
Topic: Form Validation
Replies: 13
Views: 1911

Re: Form Validation

Personally, I like keep HTML and PHP separated as much as possible. Here's my contact page's HTML form id="contact" name="contact" action="contact.php" method="post" autocomplete="on"> <input id="token" type="hidden" name="token" value="<?= $_SESSION['token'] ?>"> <label class="labelstyle" for="name...
by Strider64
Mon Jun 14, 2021 10:15 am
Forum: PHP coding => General
Topic: Where should I start
Replies: 3
Views: 1381

Re: Where should I start

Just remember CONTENT is king and that is basically what people that do searching on the internet basically care about. I have seen some poorly design websites do really well because they had really good content. If you think about it when Facebook and Amazon first started the webpages weren't nothi...
by Strider64
Wed May 26, 2021 1:28 pm
Forum: PHP coding => General
Topic: date conversion
Replies: 4
Views: 958

Re: date conversion

<?php /* * First you have the incorrect timestamp for Jan 24, 2021 */ try { $myDate = new DateTime('Jan 24, 2021', new DateTimeZone("America/Detroit")); } catch (Exception $e) { } echo $myDate->format('U = Y-m-d H:i:s') . "<br>\n"; // Timestamp and MySQL Date Format /* * This is how you set the tim...
by Strider64
Wed May 26, 2021 5:32 am
Forum: PHP coding => General
Topic: date conversion
Replies: 4
Views: 958

Re: date conversion

/* * First you have the incorrect timestamp for Jan 24, 2021 */ $myDate = new DateTime('Jan 24, 2021', new DateTimeZone("America/Detroit")); echo $myDate->format('U = Y-m-d H:i:s') . "<br>\n"; // Timestamp and MySQL Date Format /* * This is how you set the timestamp using the DateTime() method/func...
by Strider64
Sun May 16, 2021 2:56 am
Forum: PHP coding => Mail
Topic: integrating recaptcha v2 in php contact form
Replies: 3
Views: 1492

Re: integrating recaptcha v2 in php contact form

The following might help you : if (hash_equals($_SESSION['token'], $data['token'])) { /* The Following to get response back from Google recaptcha */ $url = "https://www.google.com/recaptcha/api/siteverify"; $remoteServer = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_SANITIZE_URL); /* * g-respon...
by Strider64
Fri May 14, 2021 5:49 pm
Forum: PHP General
Topic: Help with IF rule
Replies: 1
Views: 660

Re: Help with IF rule

Personally, I think you would have an easier time deciphering you PHP from your HTML if you kept them separated as much of possible. Here's a small example of what I'm talking about : <main id="content" class="main"> <div class="container"> <?php foreach ($cms as $record) { ?> <article class="cms" i...
by Strider64
Fri Apr 16, 2021 9:20 am
Forum: PHP coding => General
Topic: When do you think PHP 5 will become totally unusable for developers?
Replies: 11
Views: 2273

Re: When do you think PHP 5 will become totally unusable for developers?

Most of the projects I've been given for a new job are PHP 5.6... I wasn't expecting this, and have had difficulty getting them to work locally. I know that some software still supports it without having to compile old libraries (MAMP Pro, maybe some things on Linux), but even then it seems to be w...
by Strider64
Fri Apr 09, 2021 2:30 am
Forum: PHP General
Topic: [SOLVED] Uploading picture on a blog post
Replies: 2
Views: 1025

Re: Uploading picture on a blog post

I personally would just save the whole filename along with the path in the database table: /* * Set the paths to the correct folders */ $dir_path = 'assets/uploads/'; /* * Create unique image name. */ $new_file_name = $dir_path . 'img-gallery-' . time() . '-600x400.' . $file_ext; move_uploaded_file(...
by Strider64
Sun Mar 28, 2021 1:20 pm
Forum: PHP coding => General
Topic: php 7.4 errors
Replies: 3
Views: 1343

Re: php 7.4 errors

My advice where ever you found that script throw it in file 13 as that is so obsolete that you would be writing or finding a more up-to-date script. Just my opinion.
by Strider64
Mon Mar 22, 2021 7:00 am
Forum: PHP coding => Mail
Topic: check to see if an email given contains certains a phrase
Replies: 2
Views: 1378

Re: check to see if an email given contains certains a phrase

Hi I keep getting spam from my contact form http://www.art86.org/contactus.php where the sender is inserting something like bendfgfsd@art86.org. I've looked for a way of comparing the &youremail string given to see if it contains 'art86.org' and, if so, reject it with an error message but cannot fi...