about UCP
#1

Does UCP works same as script?
I mean, Do i have to change UCP MYSQL version too?

Or it doesn't matter? idk much about uCP/ just reading some tuts. BUt i need this answer too. Thanks
Reply
#2

If you plan on making a web application, you'd need to use something like Python or PHP. MySQL syntax would the the same, since SQL isn't specific to SA-MP, it is a whole different language - thus the 'L' in SQL. The version of the MySQL plugin you use on your SA-MP server is irrelevant.

Before creating a public-facing UCP, ensure you really know what you're doing, or I can guarantee you it'll be exploited by anyone that tries.
Reply
#3

Well, I know something about php and i know html full. Also, reading some tuts and googling.
But I downloaded a simple login page from forum and using wamp to test it. But i get this error

"The mysql extension is deprecated and will be removed in the future: use mysqli or PDO "

What does this mean? Outdated or what?
Reply
#4

Quote:
Originally Posted by sscarface
Посмотреть сообщение
Well, I know something about php and i know html full. Also, reading some tuts and googling.
But I downloaded a simple login page from forum and using wamp to test it. But i get this error

"The mysql extension is deprecated and will be removed in the future: use mysqli or PDO "

What does this mean? Outdated or what?
It means exactly what it said. It's saying the function while still works, is outdated, and is going to be removed. Use a better alternative.
Reply
#5

Well, Can you update it? If you know about somthing php.

PHP код:
 <?php

    $connect 
mysql_connect("My SQL Server Here""Database User""Database Password") or die("Can't Connect To the Server"); //connecting to mysql 
    
mysql_select_db("Database Name") or die ("Database Not Found"); // database name
    
    
function sanitize($string// unction for sanitize from xss and mysql and csrf.
    

        
$string strip_tags($string); 
        
$string mysql_real_escape_string($string); 
        return 
$string
    }

?>
This is simple login page. I want to test it for my server. I would be your thankful. if you update it and i would like to see codes too.
Reply
#6

Quote:
Originally Posted by sscarface
Посмотреть сообщение
Well, Can you update it? If you know about somthing php.

PHP код:
 <?php
    $connect 
mysql_connect("My SQL Server Here""Database User""Database Password") or die("Can't Connect To the Server"); //connecting to mysql 
    
mysql_select_db("Database Name") or die ("Database Not Found"); // database name
    
    
function sanitize($string// unction for sanitize from xss and mysql and csrf.
    

        
$string strip_tags($string); 
        
$string mysql_real_escape_string($string); 
        return 
$string
    }
?>
This is simple login page. I want to test it for my server. I would be your thankful. if you update it and i would like to see codes too.
I would highly recommend converting that to use the PDO method and its attributes (low weight app).

Here's an example:
PHP код:
<?php
    $database_host 
"localhost";
    
$database_user "root";
    
$database_pass "";
    
$database_db "something";
    
$connection = new PDO("mysql:host=$database_host;dbname=$database_db;charset=utf8"$database_user$database_pass);
    
$connection -> setAttribute(PDO::ATTR_ERRMODEPDO::ERRMODE_EXCEPTION);
    
$query $connection -> prepare("SELECT `something` FROM `something` WHERE `something` = :something");
    
$query -> bindParam(":something"$_GET['something']);
    if(
$query -> execute())
    {
        if(
$response $query -> fetch()) 
        {
            
// query succeeded
        
}
        else
        {
            
// query failed
        
}
    }
?>
Since you fully know html and other sums of stuff in php, then there would be no problem for you to do the rest, make it compatible and generically do what it should do.

However, you could create a dedicated file for the connection between the database and the host/user, and include/require that file to be added to the other pages you have so that editing it would be a breeze.
Reply
#7

What should i write here? I didn't get it. I used to do html before an year so.

PHP код:
$query -> bindParam(":something"$_GET['something']); 
and also how to describe nick in php?
PHP код:
$query $connection -> prepare("SELECT `something` FROM `something` WHERE `something` = :something"); 
I mean here
PHP код:
 = :something"); 
Reply
#8

Quote:
Originally Posted by sscarface
Посмотреть сообщение
What should i write here? I didn't get it. I used to do html before an year so.

PHP код:
$query -> bindParam(":something"$_GET['something']); 
and also how to describe nick in php?
PHP код:
$query $connection -> prepare("SELECT `something` FROM `something` WHERE `something` = :something"); 
I mean here
PHP код:
 = :something"); 
It's PHP, sir. You should go do some more research about the matter. I ain't going to explain everything for you, plus this forum's generic purpose isn't for these type of matters.
Reply
#9

Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)