Search the Community

Showing results for tags 'php'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • Open Source Contributors
    • Suggestions
  • General MTA
    • News
    • Media
    • Site/Forum/IRC/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • community.mtasa.com
    • Scripting
    • Maps
    • Resources
    • Other Creations
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash
  • Private Bugtracker

Found 14 results

  1. السلام عليكم ورحمة الله وبركاتة كيف الحال ان شاء الله بخير اليوم انا بدي منكو بعض الافكار : اول فكرة ايش احط نوع المتغير الخاص بموضوع كامل text يعني انا بسوي موقع الان لما الناس تنشر توبك اخلي نوع التوبك ذا في قاعدة البيانات ولا في افضل الامر الأخر : الان انا بدي الناس تقدر تحط لايك الان الايك ويظهر عند الموضوع عدد الايكات زبط معي كل شي بس ضل قصة هي ابي يظهر مين الي حطو لايكات كيف اربطهم بالقاعدة الخاصة بالبيانات عقل يقول اسوي جدول للايكات لوحده واربطه مع الجدول التوبك وش قلتو ابي اشوف اذا في طرق افضل
  2. PHP SDK | Login session!?

    Hello. I made a website, where you can see the server chat/players/infos/etc.. Everything is good, but if more people use the site the MTA server ignore the website IP. (HTTP: Connection flood from 'xx.xxx.xxx.x'. Ignoring for 1 min.) I know the problem. The site logging in to the server at every inquiry. (phpsdk: $mtaServer = new mta($hostname, $port, $username, $password);) I checked the default MTA webadmin. Here you need login once. I think this resource is save the connection to a session. Can I save the connection in my site and how?
  3. [PHP][SCRIPT] getPlayerPing

    Hey! Would someone tell me how to do getPlayerPing for the php sdk library? I only managed to make a list of players on the server function listPlayer( ) local players = {} for k, player in ipairs( getElementsByType ("player") ) do local player = getPlayerName( player ) table.insert( players, player ) end return players end
  4. Thanks مشكورين صراحة وانا اسف على الرد المتاخر لظرف ما بس ممكن تشوفولي طلبي الثاني ------------ لما الشخص يدوس زر التسجيل ويرسل البيانات ينتقل للصفحة الرئيسية بس لما يتحقق الموقع من بيناتاته الشخصية <form action = 'Successful.php' method = 'POST' > ----------- ولكم مني خاص احترامي
  5. New with Linux

    howdy.i just hosted my server "RP" and i dont know why i cant connect with Mysql.i tired to put Mysql.so and lib in Modules but it didnt work on windows works. If u dont know how to help me i can give my PHP because anything i have there ist special
  6. Obtener cierto valor

    Buenas, tengo un pequeño inconveniente. Terminé de armar un login y necesito que este esté vinculado con el foro de mi servidor, necesito obtener datos del foro como por ejemplo ciertas estadísticas de los miembros del foro. No conozco mucho el lenguaje de programación php y quisiera saber que debería usar para obtener ciertos valores del foro a través de una consulta GET. Uso IPS de la comunidad. Por ejemplo, cómo puedo obtener o qué debo usar para recibir en mi servidor únicamente el nombre de la cuenta del miembro? Había hecho algo de esto: <?php $communityUrl = 'urlCode'; $apiKey = 'apikey'; $curl = curl_init( $communityUrl . 'api/'.'?/core/members/1' ); curl_setopt_array( $curl, array( CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_HTTPAUTH => CURLAUTH_BASIC, CURLOPT_USERPWD => "{$apiKey}:" ) ); $response = curl_exec( $curl ); echo $response; Con esto logré que me devuelva todos los datos de cierto miembro especificando la ID del usuario, pero quiero que me devuelva sólo cierto como por ejemplo el nombre. ¿Cómo puedo extraer sólo ese dato?. Gracias.
  7. PHP SDK

    Hello guys. I'm trying to use the PHP SDK from MTA: SA on my site but I can not. What I want to do is get the basic information from a server as a number of players online, whether it is password protected, or no password, whether online or offline. I just can not find any documentation to help me. Can someone help me?
  8. [HELP] PHP SDK

    <?php require "mta_sdk.php"; $mtaServer = new mta( '137.74.164.56', 22006); $resource = $mtaServer->getResource ( 'UDCupdates', $mtaServer ); $returns[] = $resource->call('addUpdate', $_POST['name'], $_POST['dev']); ?> ok I use this in the PHP file, don't mind the HTML file since it works fine, now I'll show you my MTA script local sql = executeSQLQuery function createTables () sql("CREATE TABLE IF NOT EXISTS updates (update TEXT, developer TEXT, date TIMESTAMP DEFAULT CURRENT_TIMESTAMP)") end addEventHandler("onClientGUIClick", root, createTables) function addUpdate (text, dev) if (text) then if (dev) then sql("INSERT INTO updates (update, developer) VALUES (?,?)", text, dev) outputChatBox("[Updates] "..text.." ("..dev..")",root,255,130,4) return true else return false end else return false end end resource is started and export is added, but the problem is call function in PHP, help please.
  9. php 'crypt' function in lua

    Is it possible to make crypt function from php in lua? I connected IPS 4 by php script using PHP SDK but on Linux it returns array not JSON (so weird, returns JSON on Windows and array on Linux). It makes few casualities in my script so i decided to ask here. Is it possible to make php crypt function in MTA?
  10. MTA website template with server info

    Hello everyone! I want to present my little development - website template for servers, with information about your server online, embed statistic, and other Useful information. Based on PHP, bootstrap html/css framework, and seegaming servers API. Global update v1.1:- Now using API via JSON- New design- Easy to configure- Supporting API reviews- Support white, dark and blue themes- Parsing favicon, backgrounds, icons (if used default settings)- You can enable/disable players history graph / reviews page- Fast connect from browser to your server Demo page: Link Download: Link
  11. بسم الله الرحمن الرحيم سلام عليكم ورحمة الله وبركاتة انا سويت دورة عن كيف تسوي موقع دردشة .. وممكن يفيد بعضكم وسلام خير الختام
  12. Hi, today i was trying to do function which displays players who are online on my website using php_sdk and i have problem with connection to server. HTTP port is opened, user who i'm using to connect has admin rights and it's not working. mta_sdk version 0.4 - downloaded from wiki mta this is php file on my website: <?php include( "mta_sdk.php" ); $mtaServer = new mta( "ip", 20145, "mta_php_sdk", "password" ); $resource = $mtaServer->getResource ( "php" ); $returns[] = $resource->call ( "getPlayersOnline" ); ?> And the error: Fatal error: Uncaught exception 'Exception' with message 'Could not connect to ip:20145' in /home/users/XXX/public_html/YYY/mta_php_sdk/mta_sdk.php:146 Stack trace: #0 /home/users/XXX/public_html/YYY/mta_php_sdk/mta_sdk.php(79): mta->do_post_request('ip', 20145, '/php/call...', '') #1 /home/users/XXX/public_html/YYY/mta_php_sdk/mta_sdk.php(257): mta->callFunction('php', 'getPlayersOnlin...', Array) #2 /home/users/XXX/public_html/YYY/mta_php_sdk/mta.php(38): Resource->call('getPlayersOnlin...') #3 {main} thrown in /home/users/XXX/public_html/YYY/mta_php_sdk/mta_sdk.php on line 146 If i visit in my browser ip:20145/php/call/getPlayersOnline everything is working correctly. How can i fix it?
  13. TAG System with WEB integration

    Hi, i`m developing a TAG system with web integration and i need a little help. Have some function in MTA where i can load all mods inside a folder without specifying all names inside mtaserver.conf ?
  14. Export score on php website with SDK

    Hello everyone this is my first post please take it easy on me. here goes nothing. I followed xxmadexx's tutorial https://forum.mtasa.com/topic/74834-introduction-to-the-php-sdk/ It works and my site show the users. but I was wondering how do I go about exporting more information such as score and other information stored on the server. This is my server.lua file function getAllPlayersForWebsite ( ) local players = {} for k, player in ipairs( getElementsByType ("player") ) do local name = getPlayerName( player ) table.insert( players, name ) end return players end my meta xml <meta> <info author="xXMADEXx" type="script" version="1.0" name="MTA PHP" /> <!-- Include our awesome script --> <script src="server.lua" /> <!-- Export our function -- Make sure to allow HTTP to access it --> <export function="doPrint" type="server" http="true" /> <export function="getAllPlayersForWebsite" type="server" http="true" /> </meta> and the php file <?php include "sdk/mta_sdk.php"; # Include the MTA PHP SDK - Give us the classes and methods that we'll need $MY_SERVER = [ "host" => "54.153.65.51", #The host/IP of your MTA server "http_port" => 22005, #The HTTP port for your MTA server (Default 22005) "http_user" => "user", #The username that we created in the previous step "http_pass" => "password" #The password for the username that we created ]; #Create a new mta object $SERVER = new mta ( $MY_SERVER['host'], $MY_SERVER['http_port'], $MY_SERVER['http_user'], $MY_SERVER['http_pass'] ); try { $RESOURCE = $SERVER->getResource ( "mta_php" ); # We need to get our resource Object $RESULT[] = $RESOURCE->call ( "getAllPlayersForWebsite" ); foreach ( $RESULT [ 0 ] [ 0 ] as $index=>$playerName ) { print_r ( $playerName ); echo "<br /><br />"; } #Catch any errors that occurred } catch ( Exception $e ){ #Output error message echo "<strong>Oops, Something went wrong!</strong><br />Error: {$e->getMessage()}<br /><br />e printout:<br />"; #Print the error table print_r ( $e ); } ?> Where should I start?