Jump to content
GIGN Forum

Ludzu Ludzu Help


tipa elvis
 Share

Recommended Posts

Es jau labprāt palīdzētu, bet tu jau atkal izveidotu pamācību no skripta, un publicētu kā savu, tākā sry...

Link to comment
Share on other sites

Nu lab lab, tagad pastāsti, kā tev tā liste darbojas iekš mysql glabā datus vai kur?

Link to comment
Share on other sites

vakar nebija laika. Šodien, kkad vēlāk izveidošu, tad editošu šo te postu un ielikšu kodu...

Link to comment
Share on other sites

nu tā, itkā kko uz ātro izveidoju, nezinu vai būs vai nē, katrā ziņā updeitosi jau pats, jo kļūdas (ja nu ir), tad kkādas neuzmanības or somth:

<!-- script by duplets, visit http://cs.hackers.lv enjoy -->
<form method='post' action='add.php'>
<table cellspacing='5' cellpadding='0' style='margin:auto'>

<tr>
<td style='white-space:nowrap'>Spēle: *</td>
<td style='white-space:nowrap'>Ip/hostneims: *</td>
<td style='white-space:nowrap'>Ports: *</td>
</tr>
<tr>
<td>
<select name='type'><option value='avp2'> Aliens VS. Predator 2 </option><option value='aarmy'> Americas Army </option><option value='arma'> ArmA: Armed Assault </option><option value='bf1942'> Battlefield 1942 </option><option value='bf2'> Battlefield 2 </option><option value='bf2142'> Battlefield 2142 </option><option value='bfvietnam'> Battlefield Vietnam </option><option value='callofduty'> Call Of Duty </option><option value='callofduty2'> Call Of Duty 2 </option><option value='callofduty4'> Call Of Duty 4 </option><option value='callofdutyuo'> Call Of Duty: United Offensive </option><option value='cncrenegade'> Command and Conquer: Renegade </option><option value='crysis'> Crysis </option><option value='doom3'> Doom 3 </option><option value='quakewars'> Enemy Territory: Quake Wars </option><option value='fear'> F.E.A.R. </option><option value='farcry'> Far Cry </option><option value='freelancer'> Freelancer </option><option value='gtr2'> GTR 2 </option><option value='graw'> Ghost Recon Warfighter </option><option value='graw2'> Ghost Recon Warfighter 2 </option><option value='halflife'> Half-Life ( Steam ) </option><option selected='selected' value='halflifewon'> Half-Life ( WON ) </option><option value='halo'> Halo </option><option value='had2'> Hidden and Dangerous 2 </option><option value='il2'> IL-2 Sturmovik </option><option value='jediknight2'> JediKnight 2 </option><option value='mohaa'> Medal of Honor: Allied Assault </option><option value='mohaab'> Medal of Honor: Allied Assault Breakthrough </option><option value='mohaas'> Medal of Honor: Allied Assault Spearhead </option><option value='mohpa'> Medal of Honor: Pacific Assault </option><option value='mta'> Multi Theft Auto </option><option value='nascar2004'> Nascar Thunder 2004 </option><option value='neverwinter'> NeverWinter Nights </option><option value='neverwinter2'> NeverWinter Nights 2 </option><option value='flashpoint'> Operation Flashpoint </option><option value='painkiller'> PainKiller </option><option value='quake2'> Quake 2 </option><option value='quake3'> Quake 3 </option><option value='quake4'> Quake 4 </option><option value='quakeworld'> Quake World </option><option value='ravenshield'> Raven Shield </option><option value='stalker'> S.T.A.L.K.E.R. </option><option value='swat4'> SWAT 4 </option><option value='samp'> San Andreas Multiplayer </option><option value='sof2'> Soldier of Fortune 2 </option><option value='source'> Source ( Half-Life 2 ) </option><option value='startrekef'> StarTrek Elite-Force </option><option value='test'> Test ( For PHP Developers ) </option><option value='ut'> Unreal Tournament </option><option value='ut2003'> Unreal Tournament 2003 </option><option value='ut2004'> Unreal Tournament 2004 </option><option value='ut3'> Unreal Tournament 3 </option><option value='vietcong'> Vietcong </option><option value='vietcong2'> Vietcong 2 </option><option value='warsow'> Warsow </option><option value='wolfenstein'> Wolfenstein </option>
</select>
</td>
<td> <input type='text' name='form_ip' size='15' maxlength='128' /> </td>
<td> <input type='text' name='c_port' size='15' maxlength='128' /> </td>
</tr>
<tr>
<td>
<input type='submit' name='pivienot_serveri' value='Pievienot serveri' />
</td>
</tr>
</table>


<?php

// Ievadam datus, lai varam sakonekteeties ar mysql DB
mysql_connect("localhost", "root", "PASS") or die(mysql_error());
mysql_select_db("lgsl") or die(mysql_error());


if ($_POST['pivienot_serveri'])
{
$ip = mysql_escape_string(trim($_POST['form_ip'])); 
$c_port = mysql_escape_string(trim($_POST['c_port']));
$type = mysql_escape_string(trim($_POST["type"]));
if (!$ip || !$type) { echo "Ar zvaigznīti atzīmētie lauki jāaizpilda obligāti"; } else {
$mysql_query = "INSERT INTO lgsl (`status`,`ip`,`q_port`,`c_port`, `s_port`, `type`, `cache`, `cache_time`, `zone`,`disabled`) VALUES ('1', '$ip', '$c_port', '$c_port', '0', '$type', '', '', '0', '0')";
$mysql_result = mysql_query($mysql_query) or die(mysql_error());
echo "Serveris pievienots";
}
}
?>

Edited by duplets
Link to comment
Share on other sites

Tas nozīmē to ka tev iekš lgsl datubāzes nav tabula lgsl, tu esi pārliecināts ka nomainiji lgsl, pret savu DB?

Link to comment
Share on other sites

mysql_select_db("lgsl") or die(mysql_error());

tur kur ir lgsl norādi to DB, kur tev e107 dati stāv

Link to comment
Share on other sites

Nu ko tu nevari?

nomaini šo rindiņu

mysql_select_db("lgsl") or die(mysql_error());

pret šo

mysql_select_db("e107cms") or die(mysql_error());

Link to comment
Share on other sites

nu nestreso uzreiz, tev nekas pat nav jāmeklē iekš mysql/data apsties foldera nosaukumu kurš ir priekš tava e107, es bļē tak nevaru zīlēt tavu e107 datubāzi?

Ja tev iekš mysql/data ir folderis e107 tātad tas ir datobāzes folderis to arī norādi...

Link to comment
Share on other sites

Pakēc man rāda tagad šito:

Warning: Invalid argument supplied for foreach() in C:\AppServ\www\lgsl\lgsl_files\lgsl_list.php on line 38

Warning: Invalid argument supplied for foreach() in C:\AppServ\www\lgsl\lgsl_files\lgsl_list.php on line 47

Link to comment
Share on other sites

Lab es te novilku tagad to e107 ātri uzinstalēju un lūk arī atbilde šajā vietā kur kverījs ievada datus DB:

INSERT INTO lgsl nomainam uz

INSERT INTO e107_lgsl

un itkā problēmai vajadzētu pazust!

Un tātad uz doto brīdi pašreizējie skripti:

1# priekš SA lgsl

<!-- script by duplets, visit http://cs.hackers.lv enjoy -->
<form method='post' action='add.php'>
<table cellspacing='5' cellpadding='0' style='margin:auto'>

<tr>
<td style='white-space:nowrap'>Spēle: *</td>
<td style='white-space:nowrap'>Ip/hostneims: *</td>
<td style='white-space:nowrap'>Ports: *</td>
</tr>
<tr>
<td>
<select name='type'><option value='avp2'> Aliens VS. Predator 2 </option><option value='aarmy'> Americas Army </option><option value='arma'> ArmA: Armed Assault </option><option value='bf1942'> Battlefield 1942 </option><option value='bf2'> Battlefield 2 </option><option value='bf2142'> Battlefield 2142 </option><option value='bfvietnam'> Battlefield Vietnam </option><option value='callofduty'> Call Of Duty </option><option value='callofduty2'> Call Of Duty 2 </option><option value='callofduty4'> Call Of Duty 4 </option><option value='callofdutyuo'> Call Of Duty: United Offensive </option><option value='cncrenegade'> Command and Conquer: Renegade </option><option value='crysis'> Crysis </option><option value='doom3'> Doom 3 </option><option value='quakewars'> Enemy Territory: Quake Wars </option><option value='fear'> F.E.A.R. </option><option value='farcry'> Far Cry </option><option value='freelancer'> Freelancer </option><option value='gtr2'> GTR 2 </option><option value='graw'> Ghost Recon Warfighter </option><option value='graw2'> Ghost Recon Warfighter 2 </option><option value='halflife'> Half-Life ( Steam ) </option><option selected='selected' value='halflifewon'> Half-Life ( WON ) </option><option value='halo'> Halo </option><option value='had2'> Hidden and Dangerous 2 </option><option value='il2'> IL-2 Sturmovik </option><option value='jediknight2'> JediKnight 2 </option><option value='mohaa'> Medal of Honor: Allied Assault </option><option value='mohaab'> Medal of Honor: Allied Assault Breakthrough </option><option value='mohaas'> Medal of Honor: Allied Assault Spearhead </option><option value='mohpa'> Medal of Honor: Pacific Assault </option><option value='mta'> Multi Theft Auto </option><option value='nascar2004'> Nascar Thunder 2004 </option><option value='neverwinter'> NeverWinter Nights </option><option value='neverwinter2'> NeverWinter Nights 2 </option><option value='flashpoint'> Operation Flashpoint </option><option value='painkiller'> PainKiller </option><option value='quake2'> Quake 2 </option><option value='quake3'> Quake 3 </option><option value='quake4'> Quake 4 </option><option value='quakeworld'> Quake World </option><option value='ravenshield'> Raven Shield </option><option value='stalker'> S.T.A.L.K.E.R. </option><option value='swat4'> SWAT 4 </option><option value='samp'> San Andreas Multiplayer </option><option value='sof2'> Soldier of Fortune 2 </option><option value='source'> Source ( Half-Life 2 ) </option><option value='startrekef'> StarTrek Elite-Force </option><option value='test'> Test ( For PHP Developers ) </option><option value='ut'> Unreal Tournament </option><option value='ut2003'> Unreal Tournament 2003 </option><option value='ut2004'> Unreal Tournament 2004 </option><option value='ut3'> Unreal Tournament 3 </option><option value='vietcong'> Vietcong </option><option value='vietcong2'> Vietcong 2 </option><option value='warsow'> Warsow </option><option value='wolfenstein'> Wolfenstein </option>
</select>
</td>
<td> <input type='text' name='form_ip' size='15' maxlength='128' /> </td>
<td> <input type='text' name='c_port' size='15' maxlength='128' /> </td>
</tr>
<tr>
<td>
<input type='submit' name='pivienot_serveri' value='Pievienot serveri' />
</td>
</tr>
</table>


<?php

// Ievadam datus, lai varam sakonekteeties ar mysql DB
mysql_connect("localhost", "root", "PASS") or die(mysql_error());
mysql_select_db("lgsl") or die(mysql_error());


if ($_POST['pivienot_serveri'])
{
$ip = mysql_escape_string(trim($_POST['form_ip'])); 
$c_port = mysql_escape_string(trim($_POST['c_port']));
$type = mysql_escape_string(trim($_POST["type"]));
if (!$ip || !$type) { echo "Ar zvaigznīti atzīmētie lauki jāaizpilda obligāti"; } else {
$mysql_query = "INSERT INTO e107_lgsl (`status`,`ip`,`q_port`,`c_port`, `s_port`, `type`, `cache`, `cache_time`, `zone`,`disabled`) VALUES ('1', '$ip', '$c_port', '$c_port', '0', '$type', '', '', '0', '0')";
$mysql_result = mysql_query($mysql_query) or die(mysql_error());
echo "Serveris pievienots";
}
}
?>

2# priekš e107 lgsl

<!-- script by duplets, visit http://cs.hackers.lv enjoy -->
<form method='post' action='add.php'>
<table cellspacing='5' cellpadding='0' style='margin:auto'>

<tr>
<td style='white-space:nowrap'>Spēle: *</td>
<td style='white-space:nowrap'>Ip/hostneims: *</td>
<td style='white-space:nowrap'>Ports: *</td>
</tr>
<tr>
<td>
<select name='type'><option value='avp2'> Aliens VS. Predator 2 </option><option value='aarmy'> Americas Army </option><option value='arma'> ArmA: Armed Assault </option><option value='bf1942'> Battlefield 1942 </option><option value='bf2'> Battlefield 2 </option><option value='bf2142'> Battlefield 2142 </option><option value='bfvietnam'> Battlefield Vietnam </option><option value='callofduty'> Call Of Duty </option><option value='callofduty2'> Call Of Duty 2 </option><option value='callofduty4'> Call Of Duty 4 </option><option value='callofdutyuo'> Call Of Duty: United Offensive </option><option value='cncrenegade'> Command and Conquer: Renegade </option><option value='crysis'> Crysis </option><option value='doom3'> Doom 3 </option><option value='quakewars'> Enemy Territory: Quake Wars </option><option value='fear'> F.E.A.R. </option><option value='farcry'> Far Cry </option><option value='freelancer'> Freelancer </option><option value='gtr2'> GTR 2 </option><option value='graw'> Ghost Recon Warfighter </option><option value='graw2'> Ghost Recon Warfighter 2 </option><option value='halflife'> Half-Life ( Steam ) </option><option selected='selected' value='halflifewon'> Half-Life ( WON ) </option><option value='halo'> Halo </option><option value='had2'> Hidden and Dangerous 2 </option><option value='il2'> IL-2 Sturmovik </option><option value='jediknight2'> JediKnight 2 </option><option value='mohaa'> Medal of Honor: Allied Assault </option><option value='mohaab'> Medal of Honor: Allied Assault Breakthrough </option><option value='mohaas'> Medal of Honor: Allied Assault Spearhead </option><option value='mohpa'> Medal of Honor: Pacific Assault </option><option value='mta'> Multi Theft Auto </option><option value='nascar2004'> Nascar Thunder 2004 </option><option value='neverwinter'> NeverWinter Nights </option><option value='neverwinter2'> NeverWinter Nights 2 </option><option value='flashpoint'> Operation Flashpoint </option><option value='painkiller'> PainKiller </option><option value='quake2'> Quake 2 </option><option value='quake3'> Quake 3 </option><option value='quake4'> Quake 4 </option><option value='quakeworld'> Quake World </option><option value='ravenshield'> Raven Shield </option><option value='stalker'> S.T.A.L.K.E.R. </option><option value='swat4'> SWAT 4 </option><option value='samp'> San Andreas Multiplayer </option><option value='sof2'> Soldier of Fortune 2 </option><option value='source'> Source ( Half-Life 2 ) </option><option value='startrekef'> StarTrek Elite-Force </option><option value='test'> Test ( For PHP Developers ) </option><option value='ut'> Unreal Tournament </option><option value='ut2003'> Unreal Tournament 2003 </option><option value='ut2004'> Unreal Tournament 2004 </option><option value='ut3'> Unreal Tournament 3 </option><option value='vietcong'> Vietcong </option><option value='vietcong2'> Vietcong 2 </option><option value='warsow'> Warsow </option><option value='wolfenstein'> Wolfenstein </option>
</select>
</td>
<td> <input type='text' name='form_ip' size='15' maxlength='128' /> </td>
<td> <input type='text' name='c_port' size='15' maxlength='128' /> </td>
</tr>
<tr>
<td>
<input type='submit' name='pivienot_serveri' value='Pievienot serveri' />
</td>
</tr>
</table>


<?php

// Ievadam datus, lai varam sakonekteeties ar mysql DB
mysql_connect("localhost", "root", "PASS") or die(mysql_error());
mysql_select_db("lgsl") or die(mysql_error());


if ($_POST['pivienot_serveri'])
{
$ip = mysql_escape_string(trim($_POST['form_ip'])); 
$c_port = mysql_escape_string(trim($_POST['c_port']));
$type = mysql_escape_string(trim($_POST["type"]));
if (!$ip || !$type) { echo "Ar zvaigznīti atzīmētie lauki jāaizpilda obligāti"; } else {
$mysql_query = "INSERT INTO lgsl (`status`,`ip`,`q_port`,`c_port`, `s_port`, `type`, `cache`, `cache_time`, `zone`,`disabled`) VALUES ('1', '$ip', '$c_port', '$c_port', '0', '$type', '', '', '0', '0')";
$mysql_result = mysql_query($mysql_query) or die(mysql_error());
echo "Serveris pievienots";
}
}
?>

Edited by duplets
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...