Questions tagged [php]

PHP (PHP: Hypertext Preprocessor) is a widely used, high-level, dynamic, object-oriented and interpreted scripting language primarily designed for server-side web development.

Filter by
Sorted by
Tagged with
0
votes
0answers
3 views

Unknown “form” function php symfony/form twig

In my project I have installed symfony / form, symfony / twig-bridge but whenever I run the template does not recognize me the tags to render the forms that I could miss? both are in version 5, all ...
0
votes
0answers
9 views

Checking if $_POST variable is set using mysql variable

I have a php file that is receiving some checkbox values from a form. Both the checkbox name and value are set up to match an Item_Name field in a mysql table. My current attempt is below: while($row ...
0
votes
0answers
10 views

Mysql query with subquerys for each column with different categories

Tables: [CATEGORY] idcategory (int), category (varchar) [THEMES] idtheme (int), idcategory (int), theme (varchar) n numbers of categories. For this example, lets say 6. Each categorie has 18 themes. ...
0
votes
3answers
43 views

Only first element of the array is taken

i have searched of this issue on the internet but i dont find anything similar. i have an array in php. i passed this array to javascript function to check and disable checkboxes if their values are ...
0
votes
0answers
8 views

How do I get the document root of my development server with cmd prompt?

when I create a development server on command prompt using php -S localhost:4000, unlike the youtube tutorial i am following, command prompt doesn't return me the document root. Tutorial output: PHP ...
0
votes
1answer
15 views

Getting foreign key column values easily in PDO (JOIN on INSERT)

I have two tables, 'events' and 'activities', where events has a foreign key 'activity' which is the id of that activity. When I'm inserting into the database, the data I get from POST is the activity'...
0
votes
0answers
12 views

Adding time from different tables PHP/SQL [duplicate]

Is there a way to add time from different tables? Visit table ------------------------------------------ idvisit| starttime | endtime| servicename| ------------------------------------------ 1 | ...
0
votes
0answers
3 views

Error Module 'xmlrpc' already loaded when both IIS and Wamp are running

I have IIS and WAMP both install and I am in a situation where I would need both to run simultaneously. The problem is if they both run whenever I want to access a php application using IIS I am ...
0
votes
0answers
4 views

CyberSource API implementation with 3d secure and Soap

I have already implemented a system with soap CyberSource which integrate a website to CyberSource. I have followed the rules from github(https://github.com/CyberSource/cybersource-sdk-php). However ...
-1
votes
0answers
17 views

Prevent User from accessing admin.php

I'm having a problem preventing regular users from accessing my admin.php page. I've set in the database it so that users have a type (either 0 = admin or 1 = normal user) At the top of my admin.php ...
0
votes
0answers
18 views

How to sort My/SQL data into groups on separate pages

So I've been reading and testing but no luck. What I'm trying to do is group my specific data from my database onto separate pages when a specific link is clicked. Here is my DB structure For ...
0
votes
1answer
17 views

Class to check empty inputs validation with php OOP [duplicate]

I dont understand why this is not working and any advice for oop im beginner on oop paradigm My class class formvalidation { public function check_empty_input($inputs=[]){ $checked =...
0
votes
0answers
11 views

Displaying data from MySql in certain html tables that have certain values [closed]

Okay so say I have 3 html tables Superadmin, Admin, Moderator. I then have a table in MySql that's structured like this [ id | name | rank | time online | last online ] How would I make the users ...
-2
votes
0answers
9 views

i need help every time i log in this problem encountered me , [duplicate]

Every timeI log in, this problem is encountered: Parse error: syntax error, unexpected 'mysql_connect' (T_STRING) in C:\xampp\htdocs\ins\include\database.php on line 2 I've tried this <?php ...
0
votes
0answers
21 views

PHP starting a new session on every page

I am trying to use a session value that set is on one page and called on another. The problem is when I call the session value on the other page it says that the value does not exist, specifically ...
-2
votes
0answers
13 views

PHP regular expression with lowercase, underscore, and numbers [closed]

I want a regular expression that must start from 1 to 8 lower case letter (no numbers), followed by an optional underscore, and after underscore 0 to 5 optional numbers. /[a-z]{1,8}_?[0-9]{0,5}/ ...
1
vote
1answer
18 views

PHP regular expression with optional underscore and number [duplicate]

I want a PHP regular expression that must start from 1 to 5 lower case characters, followed by an optional underscore, and then followed by 0 to 5 numbers/digits. This is my code: '/[a-z][_][0-9]/'
0
votes
0answers
14 views

login doesnt direct to the page

my registration page redirects to the user profile but when I login it doesn't and they direct to the same page. The registration is successful because I can see the user profile in my database. I am ...
0
votes
1answer
19 views

PHP Mysql while loop set default array value for empty row with limit

I have 2 groups of banner ads and 2 banner ads. The database is like this. groups_ads | id | name | max_places 1 group1 3 2 group2 2 banner_ads | id | group_id | ...
0
votes
3answers
39 views

How can I create a list where I can add and remove inputs via buttons?

I've an idea. For this I need a list like this draw: So the main idea is to have a plus and a minus button. When a users presses the plus button, another input get's added. When pressing the minus ...
0
votes
2answers
23 views

PHP function to return array with repeated values

I have an array: Array ( [0] => Alex [1] => Michael [2] => Harry [3] => Dave [4] => Michael [5] => Victor [6] => Harry [7] => Alex [8] =>...
0
votes
0answers
9 views

how can I click a link on a page 250 times in the same php session

I am trying to spam click a link in the same php session about 250 times, but every time I google anything about it, it gives me info about emails. where would I begin? any help?
0
votes
1answer
14 views

Refresh on save PHP

I am currently learning PHP but I have one small issue with refreshing the page each time I make a change in my php file. How do I set up the page to refresh each time I save a change on the root file?...
-2
votes
0answers
14 views

Desperately need help figuring out how to change the background of text to a dynamically uploaded pic in PHP

So I’m working on my first ever freelance project. (well waiting on the actual file so I’m trying to get ahead of the game and have stuff in place) and I’ve been stuck for the last 30 minutes. ...
-1
votes
1answer
17 views

How to save an image to a database?

sample predefined icons I kind of wanted the user to choose one image from the predefined set of icons and then the image will be saved in the database after submitting the form. (I also want to know ...
0
votes
2answers
19 views

PHP array to count and return index of similar value

I have an array: Array ( [0] => Alex [1] => Michael [2] => Harry [3] => Dave [4] => Michael [5] => Victor [6] => Harry [7] => Alex [8] =>...
-3
votes
0answers
19 views

text to php array and html table [closed]

I have this output as a text string : [alg_wc_mppu_max_qty max_qty="205" user_id="5" product_id="449"] [alg_wc_mppu_max_qty max_qty="269" user_id="569" product_id="449"] [alg_wc_mppu_max_qty ...
0
votes
1answer
27 views

how can i take data from php to js

So i have some custom attributes that defines a worker,the idea is to echo the name image and position attribute,and i have already done that.Now on click i want to display a small overlay that shows ...
-1
votes
0answers
18 views

Trouble with password_verify() [duplicate]

I am trying to get my login page to work, but it is refusing to do so. I have researched this and am just not understanding how to get this to work. On my register page: <?php if(isset($_POST['...
-1
votes
0answers
6 views

Woocommerce Dnamic pricing for vendors

I am using WC marketplace plguin as my website using woocommerce and multi vendors but i need to add dynamic pricing feature for vedors frontend as it's only show for their backend enter image ...
0
votes
2answers
17 views

How do I verify credentials through a text file instead of through the authorization file?

I have a PHP login script with a basic form, it leads to this file which is the authorization file that contains the credentials, but I want this file to check a text file for a matching username and ...
-1
votes
1answer
32 views

Fields Integer as String, how can do? Php

i need change all fields integer to string, how can do? i am using php, laravel, mysql. The reason is because i need to set the value from the database in input select, to that I am using angularjs,...
-3
votes
1answer
30 views

How to fix this PHP Parse / Syntax error? [duplicate]

I'm trying to fix this script that gets an error: PHP Parse error: syntax error, unexpected 'Content' (T_STRING) in ... The error.log says the error is at line 266, which is the head-meta http-...
-1
votes
0answers
28 views

mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in /storage/ssd3/490/11928490/public_html/server.php on line 34 [duplicate]

Need help, site https://ff7712.000webhostapp.com/register.php <?php session_start(); // initializing variables $username = ""; $email = ""; $errors = array(); // connect to the database $db =...
0
votes
2answers
21 views

Read nested json display each key value [From mySQL]

I am trying to read a nested JSON data where the key values are sub nested key and values but it does not seem to work. first json data from database table [column: Roles] $json = array(); $sql = $...
-1
votes
3answers
28 views

Issue creating a bool JSON response in PDO | PHP

I currently have the following PDO script that simply select values from a mySQL database and displays them in JSON format as an array: $stmt = $pdo->prepare(' SELECT `part_record` FROM ...
0
votes
0answers
14 views

PHPMailer very slow sending email

I have an application sending email with PHPMailer on PHP 7.2, I have to send around 50 emails and it takes about 40 seconds to complete, which I consider is a lot since according to the documentation ...
0
votes
0answers
12 views

Custom navigation bar in wordpress. How to properly style it?

I'm new to wordpress and making my very first theme from scratch. I can sort of cheat my way into making a navigation with bootstrap, but I still don't understand how to make small customization I'm ...
-1
votes
0answers
22 views

Issues with HTML Form and PHP on same page [duplicate]

I'm trying to create a HTML Form combined with PHP, that insert data from the HTML Form into my database. The PHP script is working properly, but I really want it to be displayed on the current page ...
0
votes
0answers
17 views

is this a good way to save data from foreach to variables [duplicate]

and if you run the code below it functions normally but if I run the code on my computer / localhost I don't display output and there are no error messages` $data1 = "smith"; $data = [ [ ...
0
votes
1answer
19 views

.htaccess remove PHP extension conflicts with redirect trailing slash

I have three pieces of code. Here's the first one: RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^([^\.]+)$ $1.php [NC,L] The second one: RewriteCond %{...
-1
votes
0answers
4 views

Login customers from mobile app with Sylius API

I need to login customers from mobile app with Sylius API ! I implement the registration using API, but i need to know how to use the same API (Sylius) to Login the user too. Is this possible?, how i ...
-1
votes
0answers
19 views

Unclear Checkbox value

I have the task of making a table of which you could select specific rows to print on paper. Since the table its quite large and was already made by another party I cannot communicate with, there's ...
0
votes
1answer
17 views

wordpress ordering posts by value held in an acf field

I am wanting to order some posts by "price" this is a value that is held in a number field the acf plugin. I reorder the posts based on some params in the URL, the params then build a query string ...
-2
votes
0answers
32 views

php which function is better for me? [closed]

I have a kml (same as .xml) file with addresses with GPS coordinates (.kml file from google maps). Also have a DB table with user inputs of the addresses, unfortunately these addresses are not ...
-2
votes
0answers
29 views

PHP validation with matching passwords

After doing some research I can't find how to figure out the following issue. I am trying to have the php validate that all fields are being entered by the user and that both passwords are matching. ...
0
votes
2answers
54 views

How to solve the “comma problem” in an elegant way?

This is a problem I solved a lot of times in different ways, but never could quite get an elegant solution for. I have an SQL string which I want to build: $sql = "UPDATE table"; $sql .= "SET"; $...
-1
votes
0answers
11 views

Some part of my inserted strings get missing after Inserting data into mysql data base using php [duplicate]

Am working picking up array of date and time and inserting it into my database as a varchar, but somehow some parts of the time string disappears take for instance I enter "12:30" as time what gets ...
0
votes
0answers
26 views

Single quotes create an issue on a new server ( mysql / php ) [closed]

I am a bit puzzled. I am moving to a new server and I noticed that the WHERE clause doesn't work if it has single quotes. As an example, on the old server (php 7.1) this works fine: WHERE count > '...
-1
votes
0answers
25 views

How do I can exclude others ID from working php code

I want to use some php code on one of theme excluding others. for that I'm using this code, but it take effects on all of my themes... How can I exclude ID's on which I want to disable this function? ...