|
You last visited: Today at 07:56
Advertisement
[WEBSITE SCRIPT] Help ;)
Discussion on [WEBSITE SCRIPT] Help ;) within the Dekaron Private Server forum part of the Dekaron category.
10/04/2012, 00:48
|
#1
|
elite*gold: 0
Join Date: Aug 2009
Posts: 367
Received Thanks: 309
|
[WEBSITE SCRIPT] Help ;)
Hello elitepvpers,
ET: I created my website with index.php, downloads.php, register php, forum.php contact.php but the problem is! How can i stay logged into a site IF I switch another .php page?
Some pictures:
1.
----> I logged into site!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2.
----> Tryed a switch page!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3.
----> Automatically LOGOUT afther switched page!
- I saw on Eterniagames and other PS sites, they have only index.php with all scripts in one .php
- But i can't understand how to Do it?
- Any explain, suggestions or maybe help?
Thanks u if u understand my problem.
|
|
|
10/04/2012, 06:36
|
#2
|
elite*gold: 20
Join Date: Nov 2007
Posts: 2,854
Received Thanks: 1,891
|
Quote:
session_start() creates a session or resumes the current one based on a session identifier passed via a GET or POST request, or passed via a cookie.
When session_start() is called or when a session auto starts, PHP will call the open and read session save handlers. These will either be a built-in save handler provided by default or by PHP extensions (such as SQLite or Memcached); or can be custom handler as defined by session_set_save_handler(). The read callback will retrieve any existing session data (stored in a special serialized format) and will be unserialized and used to automatically populate the $_SESSION superglobal when the read callback returns the saved session data back to PHP session handling.
|
|
|
|
10/04/2012, 14:13
|
#3
|
elite*gold: 0
Join Date: Aug 2009
Posts: 367
Received Thanks: 309
|
Thanks javnier,
but where session must started and deystoyed?
Here is script:
Quote:
$CONFIG['host'] = "X.XX.XXX.XX";
$CONFIG['user'] = "sa";
$CONFIG['pass'] = "1234";
$CONFIG['conn'] = mssql_connect( $CONFIG['host'], $CONFIG['user'], $CONFIG['pass']);
function anti_injection($sql) {
$sql = preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|\*|--|\\\\)/"),"",$sql);
$sql = trim($sql);
$sql = strip_tags($sql);
$sql = addslashes($sql);
return $sql;
}
if(isset($_GET['action']) && ($_GET['action'] == "login")){
$user = anti_injection($_POST['user']);
$pass = anti_injection($_POST['pass']);
$crypt_pass = md5($pass);
$result1 = mssql_query("SELECT * FROM account.dbo.user_profile WHERE user_id = '".$user."'");
$count1 = mssql_num_rows($result1);
$result2 = mssql_query("SELECT user_pwd FROM account.dbo.user_profile WHERE user_id = '".$user."'");
$row2 = mssql_fetch_row($result2);
$userno = mssql_query("SELECT user_no FROM account.dbo.user_profile WHERE user_id = '".$user."'");
$row5 = mssql_fetch_row($userno);
$coins = mssql_query ("SELECT amount FROM cash.dbo.user_cash WHERE user_no = '".$row5[0]."'");
$row6 = mssql_fetch_row($coins);
if($count1 == '0') {
echo '<br>';
echo '<br>';
echo 'This game account is not' ;
echo '<br>';
echo 'founded in the database ';
echo '<br>';
echo '<a href="index.php">Try again!</a>';
}
elseif($row2[0] != $crypt_pass) {
echo '<br>';
echo '<br>';
echo 'Wrong password. ';
echo '<br>';
echo '<a href="index.php">Try again!</a>';
}
elseif($_GET['login'] != 'login' && $count1 == '0') {
echo '<br>Login Error, Please login again.';
} else {
$_SESSION['user'] = $user;
$_SESSION['coins'] = $coins;
$_SESSION['userno'] = $userno;
echo "<h3>Welcome, ".$_SESSION['user']."</h3>";
echo "<br>";
echo "DK coins: <span style='color: orange;'> ".$row6[0]."";
echo '<img src="img/gold.png" alt="" width="13" height="14" />';
echo '<a href="index.php"> (Buy more)</a> ';
echo '<br>- - - - - - - - - - - - - - - - - - </br>';
echo '<a href="reborn.php">REBORN SYSTEM</a> | <a href="votenow.php">VOTE</a>';
echo '<form id="form1" method="post" action="index.php">
<p> &n bsp; &nbs p; <input type="submit" name="Logout" id="Logout" value="Logout account" /></p>
</form>';
}
} else {
echo '<h2> </h2>
<form name="" action="'.$_SERVER['php_self'].'?action=login" method="post">' ;
echo '<tr><td style="height: 15px; padding-left: 30px;" width="130"><input type="text" name="user" maxlength="12" size="20" class="i" value="Username" OnClick="this.value=\'\'"></td></tr>';
echo '<tr><td style="height: 15px; padding-left: 30px;"><input type="password" name="pass" class="i" value="Password" maxlength="12" size="20" OnClick="this.value=\'\'"><input type="hidden" ></td></tr>';
echo'
<input type="submit" value="Login account"> ';
echo '<br>';
echo '</form>';
|
?>
|
|
|
10/04/2012, 16:41
|
#4
|
elite*gold: 20
Join Date: Nov 2007
Posts: 2,854
Received Thanks: 1,891
|
no where, you need to start it
and mostly destroyed at logout page
|
|
|
10/04/2012, 17:21
|
#5
|
elite*gold: 0
Join Date: Aug 2009
Posts: 367
Received Thanks: 309
|
Ok i started and this error shows me:
Can u modify that script below i posted?
|
|
|
10/04/2012, 19:22
|
#6
|
elite*gold: 0
Join Date: Aug 2009
Posts: 1,297
Received Thanks: 928
|
session_start() must be the first function called in w/e script you plan on using session in.
|
|
|
10/04/2012, 23:28
|
#7
|
elite*gold: 0
Join Date: Aug 2009
Posts: 367
Received Thanks: 309
|
Ok, i made session_start() first fuction, its pretty works without errors. But still same. I try switch .php page! Also i putted session_destory on logout button... also not works... Any diffrent solutions? Please.
|
|
|
10/05/2012, 00:32
|
#8
|
elite*gold: 0
Join Date: Aug 2009
Posts: 1,297
Received Thanks: 928
|
EVERY page where you are using ANY SESSION variables at all, must begin with session_start();, it must be the first function on each page, before anything else, before config vars, before html, before anything.
|
|
|
10/05/2012, 06:51
|
#9
|
elite*gold: 20
Join Date: Nov 2007
Posts: 2,854
Received Thanks: 1,891
|
Quote:
Originally Posted by Decima
EVERY page where you are using ANY SESSION variables at all, must begin with session_start();, it must be the first function on each page, before anything else, before config vars, before html, before anything.
|
but after <?php
Example
PHP Code:
<?php
session_start();
|
|
|
10/06/2012, 17:19
|
#10
|
elite*gold: 0
Join Date: Aug 2009
Posts: 367
Received Thanks: 309
|
Yes janvier and Decima, i added on every my page that command
PHP Code:
Quote:
But that still not working yet, i think i need vizual help.
Sorry, Reply if u have ideas, If i need unpload files to check problems , ill do it 
- - Of course if you have time
-- Thanks Anyway --
|
|
|
10/07/2012, 00:04
|
#11
|
elite*gold: 20
Join Date: Nov 2007
Posts: 2,854
Received Thanks: 1,891
|
send me all your files, and ill have a look
|
|
|
10/07/2012, 14:59
|
#12
|
elite*gold: 0
Join Date: Aug 2009
Posts: 367
Received Thanks: 309
|
Oki, i'll send files in private message box.
|
|
|
 |
Similar Threads
|
[HELP]Website Script
09/20/2012 - Dekaron Private Server - 8 Replies
Hello EPvPer's
I m looking for Website Scripts like the following.
1.Script for "Reborn" like when they login in Website they need to Chose the character they want to reborn onr Categories , also if they get error on requirements they need to go back.
Because on our Reborn System if you reborn and you didn't see the Requirements you will get Reborn Bug like you will receive 1 RB but your level will stay on level 250.
2.Script for "Change Class"
3.Script for "Change Password"
|
i need Silkroad Website Script
08/17/2011 - SRO Private Server - 15 Replies
Hello
I am happy to know you and thanks for your response
i need Silkroad Website Script Please
For my Private server To be online
Home
Regsiter (answer Qution-Full Regsiter)
Download
Login
Buy Silk
News
|
script for website
04/09/2010 - Zero - 9 Replies
my server is online.
someone has the site with the script's to create accounts
|
Website script
11/08/2009 - Metin2 Private Server - 8 Replies
Können Sie mir den Link auf die Rede-Skript
metin2 für pvp
|
[Help] Df script for website
08/18/2009 - Dekaron Private Server - 26 Replies
im looking for a df timer to put on a website so people can see when the df timer is on etc
|
All times are GMT +1. The time now is 07:56.
|
|