Existing user? Sign in
Sign up
Games
Servers
Useful
User
Pass
2FA
Ajutor ! PHP
Freakz Forum Index
->
Trash Bin
->
Trash
->
Programming / Scripting / Database
Author
Message
2325
icezone
[Mentally Stable]
Status: Offline
(since 13-04-2020 17:12)
Joined: 31 Jul 2009
Posts: 59
,
Topics: 23
Location:
C:\windows\HERE
Reputation:
239.4
Votes
: 8
Posted: 09-07-2013, 19:52:26
| Translate post to:
... (
Click for more languages
)
Salut ! am un mic script php ... problema e ca nu pot sterge sesiunea ...
Code:
<?php
define(PAGE_TITLE, 'Edita tu Chat');
define(PAGE_ID,'1');
require_once("core/core.php");
require_once("menu.php");
session_start("editg");
$groupname = $Core->FilterText($_GET['GroupName']);
$_SESSION['PASSWORD'] = md5(md5($Core->FilterText($_POST['pass'])));
//$_SESSION['PASSWORD'] = $_POST['pass'];
$parola = $_SESSION['PASSWORD'];
if(isset($_POST['name']) && isset($_POST['descr']) && isset($_POST['bg']) && isset($_POST['button']) && isset($_POST['Lang']))
{
$name = $Core->FilterText($_POST['name']);
$desc = $Core->FilterText($_POST['descr']);
$bg = $Core->FilterText($_POST['bg']);
$button = $Core->FilterText($_POST['button']);
$Lang = $Core->FilterText($_POST['Lang']);
$radio = $Core->FilterText($_POST['radio']);
echo '<center><font color=green><h2>Modificarile au fost salvate cu succes.</h2></font></center>';
mysql_query("UPDATE chats SET name = '".$name."', descr = '".$desc."', bg = '".$bg."', button = '".$button."', language = '".$Lang."', radio = '".$radio."' WHERE name = '".$groupname."'") or die(mysql_error());
}
$sqlmio = mysql_query("SELECT * FROM chats WHERE name = '".$groupname."'");
$sqlmi = mysql_fetch_assoc($sqlmio);
echo $_SESSION['PASSWORD'];
if(mysql_num_rows($sqlmio) > 0)
{
if(empty($_SESSION['PASSWORD']))
{
?>
<div class="container">
<h1><span data-localize=edit.editgrp>Edit chat group</span></h1>
<form method="post" >
<input name="GroupName" type="hidden" value="<?php echo $groupname; ?>">
<label><p><span data-localize=buy.groupname>Group Name:</span> <?php echo $groupname; ?></p>
</label>
<label><p><span data-localize=buy.password>Password:</span></p>
<input name="password" type="password" size="32" maxlength="64">
</label>
<button name="SubmitPass" value="Submit" type="submit" class="btn"><i class="icon-wrench"></i> <span data-localize=main.submit>Submit</span></button>
</form>
<div class="bodline">
</div>
<p><span data-localize=buy.forgotpass>If you have forgotten your password enter your email here</span>:</p>
<form name="Pass" method="post">
<label><p>Email:</p>
<input name="email" type="text" size="62" maxlength="120">
</label>
<input name="GroupName" type="hidden" value="<?php echo $groupname; ?>">
<button name="SubmitLost" value="Submit" type="submit" class="btn"><i class="icon-envelope"></i> <span data-localize=main.submit>Submit</span></button>
</form>
</div>
<div class="adxat" data-adtype="bot" align="center" style="width:728;height:90"></div>
<?php
echo "asd". $_SESSION['PASSWORD']; }
elseif($_SESSION['PASSWORD'] == $sqlmi['password'])
{
?>
<div class="adxat" data-adtype="top" align="center" style="width:728;height:90"></div>
<div class="container">
<h1><?php echo $name; ?> - Editar Chat</h1>
<form name="Main1" method="post">
<table>
<tbody><tr>
<td><p>Nombre:</p></td>
<td><input name="name" type="text" value="<?php echo $sqlmi['name'] ?>" size="60" maxlength="80"></td>
<td><p>(Puede cambiarlo una ves)</p></td>
</tr>
<tr>
<td><p>Descrierea Grupului:</p></td>
<td><input name="descr" type="text" value="<?php echo $sqlmi['descr'] ?>" size="60" maxlength="80"></td>
<td><p>20-50 litere</p></td>
</tr>
<tr><td><p>Colores en HTML:</p></td><td><input name="button" type="text" value="<?php echo $sqlmi['button'] ?>" size="60" maxlength="128"></td>
<td><p>Colores para los botones del chat.</p></td></tr>
<tr>
<td><p>Background Chat:</p></td>
<td><input name="bg" type="text" value="<?php echo $sqlmi['bg'] ?>" size="60" maxlength="1024"><br>
</td>
<td><p>URL imaginei.</p></td>
</tr>
<tr>
<td><p>Radio URL:</p></td>
<td><input name="radio" type="text" value="<?php echo $sqlmi['radio'] ?>" size="60" maxlength="1024"><br>
</td>
<td><p>URL serverului de radio.</p></td>
</tr>
<tr>
<td><p>Limba:</p></td>
<td>
<select name="Lang">
<option value="en" <?php if($sqlmi['language'] == 'en') { echo 'selected=""';} ?>>English</option>
<option value="ro" <?php if($sqlmi['language'] == 'ro') { echo 'selected=""';} ?>>Romanian / Română</option>
</select>
</td>
<td><p>Limba meniului din chat</p></td>
</tr>
</tbody></table>
<input type="submit" name="" value="Guardar Cambios">
</p>
</form>
</div>
<?php
} else { echo '<center><h1>Parola incorecta !</h1></center>'; ?> <form method="post" >
<input name="GroupName" type="hidden" value="<?php echo $groupname; ?>">
<label><p><span data-localize=buy.groupname>Group Name:</span> <?php echo $groupname; ?></p>
</label>
<label><p><span data-localize=buy.password>Password:</span></p>
<input name="password" type="password" size="32" maxlength="64">
</label>
<button name="SubmitPass" value="Submit" type="submit" class="btn"><i class="icon-wrench"></i> <span data-localize=main.submit>Submit</span></button>
</form>
<div class="bodline">
</div>
<p><span data-localize=buy.forgotpass>If you have forgotten your password enter your email here</span>:</p>
<form name="Pass" method="post">
<label><p>Email:</p>
<input name="email" type="text" size="62" maxlength="120">
</label>
<input name="GroupName" type="hidden" value="<?php echo $groupname; ?>">
<button name="SubmitLost" value="Submit" type="submit" class="btn"><i class="icon-envelope"></i> <span data-localize=main.submit>Submit</span></button>
</form>
</div>
<div class="adxat" data-adtype="bot" align="center" style="width:728;height:90"></div> <?php }
} else {echo '<center><h1>Acest grup nu exista.</h1></center>';}
require_once("footer.php");
?>
Multumesc !
hast
0
0
Back to top
koltzu
[Banned user]
Status: Offline
(since 24-10-2013 15:18)
Joined: 24 Oct 2006
Posts: 6632
,
Topics: 170
Location:
Romania
Reputation:
847.9
Votes
: 94
Posted: 09-07-2013, 20:44:33
| Translate post to:
... (
Click for more languages
)
1. Cum adica nu poti sterge sesiunea?
2. Foloseste alt driver de conectare la baza de date, ala e deprecated
3. Foloseste
asta
cand lucrezi cu HTML, ca altfel nu intelege nimeni mai nimic.
4. Nu inteleg mai nimic, structureaza-l mai bine, si pune-l pe pastebin.com
0
0
Back to top
Raster
[ACNA]
Status: Offline
(since 02-09-2016 09:51)
Joined: 24 Feb 2011
Posts: 5377
,
Topics: 210
Location:
In my mind palace
Reputation:
765.4
Votes
: 81
Posted: 09-07-2013, 20:58:52
| Translate post to:
... (
Click for more languages
)
http://php.net/manual/en/function.session-destroy.php
?
Si ti-au mai scapat cuvinte pe acolo cand te-ai pus sa traduci, mai bine nu ai fura munca altcuiva.
0
0
Back to top
icezone
[Mentally Stable]
Status: Offline
(since 13-04-2020 17:12)
Joined: 31 Jul 2009
Posts: 59
,
Topics: 23
Location:
C:\windows\HERE
Reputation:
239.4
Votes
: 8
Posted: 09-07-2013, 22:53:48
| Translate post to:
... (
Click for more languages
)
Ideea e ca nu pot scapa sau sa schimb $_SESSION['PASSWORD'] .
Quote:
http://php.net/manual/en/function.session-destroy.php
?
Si ti-au mai scapat cuvinte pe acolo cand te-ai pus sa traduci, mai bine nu ai fura munca altcuiva.
Am incercat session destroy si unset si tot ce am gasit ( cunosc google )
nu incerc sa fur munca cuiva .... doar ideea .
http://pastebin.ca/2423326
hast
0
0
Back to top
nr913
[Banned user]
Status: Offline
(since 24-10-2013 10:06)
Joined: 24 Apr 2009
Posts: 4224
,
Topics: 223
Location:
România
Reputation:
60.3
Votes
: 156
Posted: 10-07-2013, 09:35:09
| Translate post to:
... (
Click for more languages
)
Tu ești ãla de mi-ai luat script-ul de live stats, i-ai fãcut alt design și ți l-ai însușit ca fiind fãcut de tine. Foarte frumos.
session_start
nu acceptã niciun parametru.
Încearcã bucata asta de cod la începutul fișierului:
Code:
if (session_start()) {
die('Session started');
} else {
die('Cannot start session');
}
Attitude - A little thing that makes a BIG difference
0
0
Back to top
icezone
[Mentally Stable]
Status: Offline
(since 13-04-2020 17:12)
Joined: 31 Jul 2009
Posts: 59
,
Topics: 23
Location:
C:\windows\HERE
Reputation:
239.4
Votes
: 8
Posted: 10-07-2013, 16:31:53
| Translate post to:
... (
Click for more languages
)
nr913 wrote:
Tu ești ãla de mi-ai luat script-ul de live stats, i-ai fãcut alt design și ți l-ai însușit ca fiind fãcut de tine. Foarte frumos.
session_start
nu acceptã niciun parametru.
Încearcã bucata asta de cod la începutul fișierului:
Code:
if (session_start()) {
die('Session started');
} else {
die('Cannot start session');
}
Poftim ? Fii mai explicit ... un link ceva ? eu nu ma ocup de live stats si nici nu m-am ocupat ...
si multumesc !
Scuzee !! Vina mea
am bagat $_POST['pass'] in loc de password
Scuzeee !!
hast
0
0
Back to top
nr913
[Banned user]
Status: Offline
(since 24-10-2013 10:06)
Joined: 24 Apr 2009
Posts: 4224
,
Topics: 223
Location:
România
Reputation:
60.3
Votes
: 156
Posted: 10-07-2013, 16:52:01
| Translate post to:
... (
Click for more languages
)
Atunci îmi cer scuze, era cineva cu nickname similar.
Attitude - A little thing that makes a BIG difference
0
0
Back to top
icezone
[Mentally Stable]
Status: Offline
(since 13-04-2020 17:12)
Joined: 31 Jul 2009
Posts: 59
,
Topics: 23
Location:
C:\windows\HERE
Reputation:
239.4
Votes
: 8
Posted: 10-07-2013, 16:57:04
| Translate post to:
... (
Click for more languages
)
Nici o problema !
hast
0
0
Back to top
thenewbye911
[Mentally Stable]
Status: Offline
(since 11-07-2013 19:40)
Joined: 28 Sep 2010
Posts: 22
,
Topics: 3
Location:
Romania
Reputation:
53.9
Votes
: 3
Posted: 11-07-2013, 21:37:39
| Translate post to:
... (
Click for more languages
)
md5 de md5 nu e bun, cel mai bine faci substr de 32 de chars din sha1 ca sa protejezi major, lumea o sa caute md5 inloc de sha1 si iti securizezi aplicatia.
0
0
Back to top
Freakz Forum Index
->
Trash Bin
->
Trash
->
Programming / Scripting / Database
The time now is 02-12-2024, 04:28:48
Copyright info
Based on phpBB
ro
/
com
B
Login
I forgot my password
World of Warcraft
Login for more...
Download WoW 7.3.5
Misc
eSports
Achievements
Buy reputation with votes
Reputation trades
Forum rules
Ban list
Members list
User guide (FAQ)
World of Warcraft
View details