Raised This Month: $ Target: $400
 0% 

is there anyone skilled in php


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alahmoh
Member
Join Date: Jun 2018
Old 08-09-2022 , 07:37   is there anyone skilled in php
Reply With Quote #1

anyone is skilled in php?
i want him to make a simple index.php file that makes the other plugin read from it the menus.
Alahmoh is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: United States
Old 08-09-2022 , 18:24   Re: is there anyone skilled in php
Reply With Quote #2

Do you want to read <tr> inside <table> ?
__________________
bigdaddy424 is offline
wilian159
Member
Join Date: Dec 2013
Old 08-09-2022 , 20:53   Re: is there anyone skilled in php
Reply With Quote #3

Quote:
Originally Posted by Alahmoh View Post
anyone is skilled in php?
i want him to make a simple index.php file that makes the other plugin read from it the menus.
explain more
__________________
Hmm, nice....... www.addonscs.com
wilian159 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-09-2022 , 23:08   Re: is there anyone skilled in php
Reply With Quote #4

How is this related to plugins? If it's not then you'll want to search online for PHP info.
__________________
fysiks is offline
MrPickles
Member
Join Date: Aug 2022
Location: Colombia
Old 08-10-2022 , 01:48   Re: is there anyone skilled in php
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
How is this related to plugins? If it's not then you'll want to search online for PHP info.
i think that he need learn php first, cause he wants to communicate a PLUGIN with a PHP

Last edited by MrPickles; 08-10-2022 at 01:49.
MrPickles is offline
Alahmoh
Member
Join Date: Jun 2018
Old 08-10-2022 , 11:03   Re: is there anyone skilled in php
Reply With Quote #6

so im using a plugin to store player played time in MySql server which is currently working,
the only problem i have is with the php files not being able to read the data from MySql server.

here is MySql info:
SQL_HOST = 127.0.0.1
SQL_PORT = 8080
SQL_USER = lmao
SQL_PASS = husam123Hane
SQL_DB = bym_cod

the data of players time played are stored in mysql without any problem
i just need the php to fetch there data and store them in a MOTD.

here is the php files i am using(not working):-
https://pastebin.com/2a0R2HV4

// btw sorry for being late in answers its because I am busy looking for universities to study in because I just finished high school. \\

Last edited by Alahmoh; 08-10-2022 at 11:21.
Alahmoh is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-11-2022 , 01:10   Re: is there anyone skilled in php
Reply With Quote #7

FYI, you have an SQL Injection security vulnerability in your code. You need to use prepared queries.

While I commend you for posting your code, you should also have the list or errors that you get when you run your code.

I noticed a couple things in your code after looking at it briefly. 1) You have a SQL Injection vulnerability and you should switch to prepared queries to resolve it. 2) You're hard coding your database connection info in the PDO constructor instead of using your $GLOBALS variable. This is how I do it:

PHP Code:
new PDO(sprintf("mysql:host=%s;dbname=%s;charset=utf8"$dbconfig['host'], $dbconfig['dbname']), $dbconfig['user'], $dbconfig['pass']); 
P.S. If the data in your $GLOBALS variable is your real data, you need to change them. If you write your PDO constructor arguments like I've shown, you'll never need to post the $GLOBALS variable when asking for help.

Some other tips: get the actual query string and test it in your database using something like phpMyAdmin to make sure that it works. It looks like it should work but you should verify the actual string that gets passed (i.e. your $_GET parameter might not be what you're expecting).
__________________
fysiks is offline
Alahmoh
Member
Join Date: Jun 2018
Old 08-11-2022 , 06:20   Re: is there anyone skilled in php
Reply With Quote #8

Quote:
Originally Posted by fysiks View Post
FYI, you have an SQL Injection security vulnerability in your code. You need to use prepared queries.

While I commend you for posting your code, you should also have the list or errors that you get when you run your code.

I noticed a couple things in your code after looking at it briefly. 1) You have a SQL Injection vulnerability and you should switch to prepared queries to resolve it. 2) You're hard coding your database connection info in the PDO constructor instead of using your $GLOBALS variable. This is how I do it:

PHP Code:
new PDO(sprintf("mysql:host=%s;dbname=%s;charset=utf8"$dbconfig['host'], $dbconfig['dbname']), $dbconfig['user'], $dbconfig['pass']); 
P.S. If the data in your $GLOBALS variable is your real data, you need to change them. If you write your PDO constructor arguments like I've shown, you'll never need to post the $GLOBALS variable when asking for help.

Some other tips: get the actual query string and test it in your database using something like phpMyAdmin to make sure that it works. It looks like it should work but you should verify the actual string that gets passed (i.e. your $_GET parameter might not be what you're expecting).
my bad the error im getting is :[Error] Query failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`Id' at line 1
Alahmoh is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-11-2022 , 23:07   Re: is there anyone skilled in php
Reply With Quote #9

I would recommend using something like phpMyAdmin to build a query for you and then you can replace the search criteria with your variable (hopefully via prepared queries).
__________________
fysiks is offline
Alahmoh
Member
Join Date: Jun 2018
Old 08-12-2022 , 05:06   Re: is there anyone skilled in php
Reply With Quote #10

Quote:
Originally Posted by fysiks View Post
I would recommend using something like phpMyAdmin to build a query for you and then you can replace the search criteria with your variable (hopefully via prepared queries).
hmmmm what is that supposed to mean???
Alahmoh is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:17.


Powered by vBulletin®
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Theme made by Freecode