The only reason it would re-load the Loginpage is it your User/pass is incorrect It has to match the database;s information.
Printable View
The only reason it would re-load the Loginpage is it your User/pass is incorrect It has to match the database;s information.
Antv912, it does match i tried with 6 differente accounts...
can you please check the codes, i checkd them but i find no error, but maybe m missing somethins :\
Unknown column 'character' in 'where clause' damit dude fix it please
As I've said BEFORE in CharacterID you Must put in a damn number <_< TO FIND that number enter your character ID in the search Bar!
antv912, any tips on my problem?
All of it seems to be fine.
[url=http://fams.no-ip.biz/loginpage.php]..::FantasyMS
it's working for me now thx m8 :D but i need to make a button so it calls clear2.php can any one help me with that??
how could you get it to work if there is atleast one script missing (clear2.php)
Can someone help me I cant seem to get it working?
aparently there a mistake in the first post, ive been waiting for antv912 to fix it :\
http://forum.ragezone.com/f427/relea...ml#post3289066
check this post of mine to see what faulty in the first post ( i just wish i cud fix it on my own ) :blowup:
very nice works like a charm .
helps me out rather than clearing EVERYONES inventory i can just do 1 character !
Clear.php
Code:<form name="form" action="search.php" method="get">
<input type="text" name="q" />
<input type="submit" name="Submit" value="Search" />
</form>
so antv, that's the form for clear.php, and whats the code for clear2.php?,
EDIT:
i've seen it, sory ;)
Yo antv, i need ur help since i know jack about php and I dunnno if i can edit search.php in html.
this is my project,
the site ran search.php in the background and instead of showing a new page for the errors and the character ID, it would come out a prompt saying, your character ID is, or account id not inserted,
i don't want you to do it for me, i just want to know what I would need to do, so i can learn that specific php part at w3schools :P
Try this
PHP Code:<?php
session_start();
$server = "localhost";
$username = "root";
$password = "";
$db_name = "maplestory";
$db = mysql_connect($server,$username,$password) or DIE("Connection to database failed, perhaps the service is down !!");
$charid = $_POST['text'];
$name = $_POST['username'];
$pass = $_POST['password'];
mysql_select_db($db_name) or DIE("Database name not available !!");
$sel_ = mysql_query("select * from users where (username = '" . $_POST['username'] . "') and (password = '" . $_POST['password'] . "')",$db);
if($name == ""){
echo '<script language='JavaScript' type='text/javascript'>alert('No Username Inserted')</script>';
exit();
}elseif($pass == "") {
echo ' <script language='JavaScript' type='text/javascript'>alert('No Password Inserted')</script> ';
exit();
}elseif($charid == ""){
echo ' <script language='JavaScript' type='text/javascript'>alert('No CharacterID Inserted')</script> ';
exit();
}else{
$rowcount = mysql_num_rows($sel_);
if ($rowcount == 0) {
echo '<script language='JavaScript' type='text/javascript'>alert('User/Password Incorrect')</script>';
}else{
$login = ' Delete from equip where (charid = '. $_POST['text'] .')';
mysql_query($login) OR die (mysql_error());
echo " Inventory Cleared for $name - Character ID $charid ";
}
}
?>
if im not mistaken thats clear_.php
im getting this error.
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\AppServ\www\clear_.php on line 14
ive checked and it has the ; in the end of line 14 :\
EDIT: Yahoo Answer for the winner xD
Answer :
You just echo / print the javascript like you would do with html, like:
<?
echo "<script language=\"JavaScript\">\n";
echo "alert("javascript from php");\n";
echo "</script>";
?>
Edit2: still having the same error -.-'
Work's and Fixed Change Clear_.php to this
has a Redirect after you hit " Ok " when the Javascript Alert Message pop's up.PHP Code:<?php
session_start();
$server = "localhost";
$username = "root";
$password = "";
$db_name = "maplestory";
$db = mysql_connect($server,$username,$password) or DIE("Connection to database failed, perhaps the service is down !!");
$charid = $_POST['text'];
$name = $_POST['username'];
$pass = $_POST['password'];
mysql_select_db($db_name) or DIE("Database name not available !!");
$sel_ = mysql_query("select * from users where (username = '" . $_POST['username'] . "') and (password = '" . $_POST['password'] . "')",$db);
if($name == ""){
echo '<script type="text/javascript">alert("No Username Inserted")</script><META HTTP-EQUIV="refresh" CONTENT="0;URL=securedpage.php">'
;
exit();
}elseif($pass == "") {
echo '<script type="text/javascript">alert("No Password Inserted")</script><META HTTP-EQUIV="refresh" CONTENT="0;URL=securedpage.php">
';
exit();
}elseif($charid == ""){
echo '<script type="text/javascript">alert("No CharacterID inserted")</script><META HTTP-EQUIV="refresh" CONTENT="0;URL=securedpage.php">
';
exit();
}else{
$rowcount = mysql_num_rows($sel_);
if ($rowcount == 0) {
echo '<script type="text/javascript">alert("Username And or Password is incorrect")</script><META HTTP-EQUIV="refresh" CONTENT="0;URL=securedpage.php">
';
}else{
$login = ' Delete from equip where (charid = '. $_POST['text'] .')';
mysql_query($login) OR die (mysql_error());
echo '<script type="text/javascript">alert("Inventory Cleared")</script><META HTTP-EQUIV="refresh" CONTENT="0;URL=securedpage.php">';}
}
?>
works like a charm, thank you very much
edit: anyway to had the Serach function to that? isntead of opening a whole new page, hit shows a javascript alert and redirects back?
Not that I know of I'll see what I can do.
Can i change ur scrip.php and see if I can do it?
I dont mind.
thanks ill se what i can do with the echos at search.php
not again :'(
first 2 echo of search.php, getting that stupid error again :(PHP Code:<?php
// Get the search variable from URL
$var = @$_GET['q'] ;
$trimmed = trim($var); //trim whitespace from the stored variable
// rows to return
$limit=10;
// check for an empty string and display a message.
if ($trimmed == "")
{
echo '<script type="text/javascript">alert("Enter your Character's name.")</script><META HTTP-EQUIV="refresh" CONTENT="0;URL=loginpage.php">;
exit;
}
// check for a search parameter
if (!isset($var))
{
echo '<script type="text/javascript">alert("No search parameter found.")</script><META HTTP-EQUIV="refresh" CONTENT="0;URL=loginpage.php">;
exit;
}
Quote:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\AppServ\www\search.php on line 14