how to connect website to server ?? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: how to connect website to server ?? (
/showthread.php?tid=597376)
how to connect website to server ?? -
jokerm - 30.12.2015
please help me ,i dont know how to connect web and server
Re: how to connect website to server ?? -
bigtigerbeee - 30.12.2015
mean UCP ?
Re: how to connect website to server ?? -
Stones - 31.12.2015
Quote:
Originally Posted by bigtigerbeee
mean UCP ?
|
Yeah, I think so.
Quote:
Originally Posted by jokerm
please help me ,i dont know how to connect web and server
|
First of all, get you're own forum / website, make your own or use a template.
Here's some example of ' some ' code you could use to make a UCP.
Код:
<?php
$con = mysql_connect("localhost","Stones","*********");
mysql_select_db("Stones");
?>
Код:
<?php
include("connect.php");
session_start();
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
if(isset($_SESSION["Username"]))
{
$user = $_SESSION["Username"];
$pass = $_SESSION["Password"];
}
else
{
$user = $_POST["User"];
$pass = $_POST["Password"];
$_SESSION['Username'] = $user;
$_SESSION['Password'] = $pass;
$escuser = mysql_real_escape_string($user);
$escpass = mysql_real_escape_string($pass);
}
$query = "SELECT * FROM users WHERE pUsername = '$escuser'";
$result = mysql_query($query);
$username_exist = mysql_num_rows($result);
if($username_exist == 0)
{
echo 'That profile does not exist! <br />';
echo '<a href="index.php">Idi nazad</a>';
unset($_SESSION['Username']);
unset($_SESSION['Password']);
die;
}
$row = mysql_fetch_row($result);
if($row[2] !== $escpass)
{
echo 'Password is not valid! <br />';
echo '<a href="index.php">Idi nazad</a>';
unset($_SESSION['Username']);
unset($_SESSION['Password']);
die;
}
Use this as an example to escape forms.
PHP код:
function sanitizeString($var){
$var = stripslashes($var);
$var = htmlentities($var);
$var = strip_tags($var);
return $var;
}
Use this as an example to escape strings.
PHP код:
function sanitizeSQL($var){
$var = mysql_real_escape_string($var);
$var = sanitizeString($var);
return $var;
}
This part is taken from elsewhere but if you want have extra security on your passwords.
PHP код:
$Salt1 = "#$@#%#$!@$@#1234223233";
$Salt2 = "#*$(#@$&AJDSU#341224334";
$Hash = md5("$Salt1$password$Salt2");
Re: how to connect website to server ?? -
J4Rr3x - 31.12.2015
You need to make an ucp, so you need to use mysql in your gamemode and connect the website to same database of the gm.
I suggest to don't copy and paste code from some tutorial. Learn PHP and MySQL and after make your own UCP.
Re: how to connect website to server ?? -
Elegy - 31.12.2015
It hard?
I use ipboard foru,idk how to make.
See my forum
website
wxtdm.cf
forum
wxtdm-rp.cf
how to make that?