Search found 54 matches

by benanamen
Sun Aug 19, 2018 9:44 am
Forum: PHP coding => General
Topic: using array's in PHP
Replies: 1
Views: 29

Re: using array's in PHP

Just make the form name an array. Then just loop over the array to insert to DB <input type="text" name="same_name[]"> <input type="text" name="same_name[]"> <input type="text" name="same_name[]"> <input type="text" name="same_name[]"> You can see an example at my website here: https://galaxyinterne...
by benanamen
Mon Aug 13, 2018 3:24 pm
Forum: PHP Installation
Topic: PHP 7.1 installation problem
Replies: 2
Views: 878

Re: PHP 7.1 installation problem

Post the error instead of a broken image link. In any case, there are issues with Php 7.1x. You should run at least 7.2
by benanamen
Wed Aug 08, 2018 9:07 am
Forum: mySQL & php coding
Topic: connecting to my database
Replies: 4
Views: 74

Re: connecting to my database

Your code is wide open to an SQL Injection Attack. You need to use Prepared Statements. Leave the ID out of the query and get rid of the extra comma at the end of the values.
by benanamen
Wed Aug 08, 2018 8:50 am
Forum: PHP coding => General
Topic: Multidimensional array to html-table
Replies: 1
Views: 51

Re: Multidimensional array to html-table

I dont see what you are talking about.

That is some pretty bad code by the way. Best thing to do is post an SQL dump of your schema along with a few sample records and then tell us what you want to know from the data.
by benanamen
Mon Aug 06, 2018 10:01 am
Forum: PHP coding => General
Topic: How to change this to associative array
Replies: 2
Views: 52

Re: How to change this to associative array

What is the Real problem you are trying to solve? I dont mean your attempt at solving it.
by benanamen
Fri Aug 03, 2018 7:16 pm
Forum: PHP coding => General
Topic: Sends email successfully, but no User Name
Replies: 4
Views: 98

Re: Sends email successfully, but no User Name

Not with that code. Post the function PT_SendMessage
by benanamen
Wed Aug 01, 2018 10:18 am
Forum: PHP Scripts
Topic: PHP module to get filled a web form ?
Replies: 1
Views: 59

Re: PHP module to get filled a web form ?

What have you tried? Has your professor provided an lessons prior to this?
by benanamen
Wed Jul 25, 2018 7:04 pm
Forum: PHP coding => General
Topic: == not working
Replies: 4
Views: 157

Re: == not working

Jumping in and out of Php seven times for a paragraph of code that only needs to be two lines is very sloppy. Do not create variables for nothing either. The whole mess can simply be <?php echo $_POST['fname'] == 'vivek' ? '<p>Great Job !</p>' : $_POST['fname']; echo "<p>{$_POST['lname']}</p><p>{$_P...
by benanamen
Mon Jul 16, 2018 8:58 am
Forum: PHP coding => General
Topic: IP server address
Replies: 4
Views: 156

Re: IP server address

What is the real problem you are trying to solve? I dont mean your attempt at solving it.

If you are trying to do some sort of traffic tracking you are better off using Google Analytics.
by benanamen
Tue Jun 05, 2018 2:51 pm
Forum: PHP coding => General
Topic: No values in dropdown box
Replies: 4
Views: 291

Re: No values in dropdown box

mysqli_query requires two parameters. You only have one. Missing the connection param.
by benanamen
Wed May 30, 2018 9:53 pm
Forum: PHP coding => General
Topic: no data outputted after login
Replies: 3
Views: 264

Re: no data outputted after login

The problem is glaringly obvious. You cannot use an alias in a WHERE clause. Per the Manual An alias can be used in a query select list to give a column a different name. You can use the alias in GROUP BY, ORDER BY, or HAVING clauses to refer to the column. Standard SQL disallows references to colum...
by benanamen
Fri Mar 30, 2018 2:17 pm
Forum: PHP coding => General
Topic: Escape single quote
Replies: 4
Views: 326

Re: Escape single quote

How would you like to be banned on all the forums I moderate?

I gave you the exact answer on the other forum. All you had to do was copy and paste it. If you cant do that you have no business messing with code.
by benanamen
Fri Mar 30, 2018 11:49 am
Forum: PHP coding => General
Topic: Escape single quote
Replies: 4
Views: 326

Re: Escape single quote

See my reply in the other forum you cross posted to. Take some time to learn the basics.
by benanamen
Fri Mar 09, 2018 1:08 pm
Forum: PHP coding => General
Topic: is this site (php-forum.com) the most active php place?
Replies: 8
Views: 464

Re: is this site (php-forum.com) the most active php place?

All of the coding forums have been pretty dead lately. Since I joined , this is one of the slowest ones of all.
by benanamen
Mon Feb 26, 2018 11:05 am
Forum: PHP coding => General
Topic: variables inside pdo query
Replies: 4
Views: 252

Re: variables inside pdo query

a hidden value attached to a submit button so there is no actual user input,
A post can come from outside your form in numerous ways, so your hidden field is still user input. A hacker is not constrained to using your form to submit data.
by benanamen
Fri Feb 23, 2018 8:44 am
Forum: PHP General
Topic: How can I pass button id's to perform multiple actions within form
Replies: 1
Views: 266

Re: How can I pass button id's to perform multiple actions within form

What is the REAL problem you are trying to solve. This smells like an XY Problem.
by benanamen
Wed Feb 21, 2018 11:55 am
Forum: PHP coding => General
Topic: Output Function results to an array
Replies: 7
Views: 441

Re: Output Function results to an array

What is the real problem you're trying to solve? I don't mean your attempt at solving it. This sounds like an XY problem.
by benanamen
Mon Feb 19, 2018 7:47 pm
Forum: PHP coding => General
Topic: Include_once
Replies: 4
Views: 276

Re: Include_once

return the array. Don't format in the function. <?php function Task() { $crap = [ 'Hoses' => "Assorted lengths of used hose" , 'Poop' => "Collection of dog poop going back years from various dogs" , 'Urin' => "My Lifetime collection of urin in jars" , 'VHS' => "My collection of vhs home movies" ]; r...
by benanamen
Mon Feb 19, 2018 1:55 pm
Forum: PHP coding => General
Topic: Include_once
Replies: 4
Views: 276

Re: Include_once

You are on the right track with the include. If you are not going to use the page 2 code more than once there is no need to create a function for it. Just put it in page 1. If you will be using the page 2 code more than once, turn it into a function and put it in a file that you will store all your ...
by benanamen
Sun Feb 11, 2018 12:44 pm
Forum: PHP coding => General
Topic: A little trouble with php and html
Replies: 1
Views: 178

Re: A little trouble with php and html

The file extension needs to be .php, not .htm or .html
by benanamen
Fri Feb 09, 2018 6:25 pm
Forum: PHP coding => General
Topic: Add variable to array without using array push
Replies: 1
Views: 194

Re: Add variable to array without using array push

Code: Select all

<?php
$sklabels   = [];
$sklabels[] = 'var1';
$sklabels[] = 'var2';
$sklabels[] = 'var3';

print_r($sklabels);
by benanamen
Wed Jan 24, 2018 10:21 am
Forum: mySQL & php coding
Topic: Blank row every refresh
Replies: 5
Views: 456

Re: Blank row every refresh

There is no reason you should be inserting blank rows.
by benanamen
Tue Jan 23, 2018 3:46 pm
Forum: mySQL & php coding
Topic: Blank row every refresh
Replies: 5
Views: 456

Re: Blank row every refresh

Add' is a input/submit button which should create blank rows for my sql table
Why in the world do want to insert blank rows in the database?
by benanamen
Sun Jan 14, 2018 11:32 am
Forum: mySQL & php coding
Topic: sql help?
Replies: 2
Views: 375

Re: sql help?

What is a "Crossing Number"?