who does he look like? He's Linear88 O_o. Lol, I feel stupid for not being able to notice the bugs, even though i have little to no experience coding webs, since I said it looks good. Ah but w/e, I guess we learn by making mistakes first.
Printable View
who does he look like? He's Linear88 O_o. Lol, I feel stupid for not being able to notice the bugs, even though i have little to no experience coding webs, since I said it looks good. Ah but w/e, I guess we learn by making mistakes first.
Parse error: syntax error, unexpected '=' in D:\xampp\htdocs\Gunz\os\os_changename.php on line 39
Thanks for informing me, fixed it.
Click Thanks if it worked.PHP Code:<?php
// <!-- -->
// Copyright Linear88 for the modifications. Alfredao for the original code.
// <!-- -->
function antisql2($sql)
{
$sql = str_replace("'","''",$sql);
$sql = strip_tags($sql);
$sql = addslashes($sql);
return $sql;
}
$code = mssql_query("SELECT * FROM Login(nolock) WHERE AID = " . $_SESSION['AID'] . "");
if( isset($_POST['changename']) )
{
$cid = antisql2($_POST['cid']);
$charname = antisql2($_POST['charname']);
$query = mssql_query("SELECT Name FROM Character WHERE Name = '$charname'");
if( mssql_num_rows($query) != 0 )
{
echo "<script>alert('A Character with this name already exists!');</script>";
die();
}
else
{
mssql_query("UPDATE Character SET Name = '$charname' WHERE CID = '$cid'");
echo "<script>alert('Name changed successfully!');</script>";
die();
}
}
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<b>Change: </b><select size="1" name="cid">
<?php
$code1 = mssql_query("SELECT * FROM Character(nolock) WHERE AID = " . $_SESSION['AID'] . " AND CharNum != '-1'");
while( $char = mssql_fetch_assoc($code1) )
{
?>
<option value="<?php echo $char['CID']; ?>"><?php echo $char['Name']; ?></option>
<?php
}
?>
</select>
<b> To: </b>
<input type="text" name="charname" size="20" maxlength="12">
<input type="submit" name="changename" value="Change Name">
</form>
Um Linear, it turns up as a blank white page :o
A fix again, this time, it was tested.
PHP Code:<?php
// <!-- -->
// Copyright Linear88 for the modifications. Alfredao for the original code.
// <!-- -->
mssql_connect("PCNAME\SQLEXPRESS","sa","YourPasswordHere");
mssql_select_db("GunzDB");
function antisql2($sql)
{
$sql = str_replace("'","''",$sql);
$sql = strip_tags($sql);
$sql = addslashes($sql);
return $sql;
}
$code2 = $_SESSION['AID'];
$code = mssql_query("SELECT * FROM Login(nolock) WHERE AID = '" . $_SESSION['AID'] . "'");
if( isset($_POST['changename']) )
{
$cid = antisql2($_POST['cid']);
$charname = antisql2($_POST['charname']);
$query = mssql_query("SELECT Name FROM Character WHERE Name = '$charname'");
if( mssql_num_rows($query) != 0 )
{
echo "<script>alert('A Character with this name already exists!');</script>";
die();
}
else
{
mssql_query("UPDATE Character SET Name = '$charname' WHERE CID = '$cid'");
echo "<script>alert('Name changed successfully!');</script>";
die();
}
}
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<b>Change: </b><select size="1" name="cid">
<?php
$code1 = mssql_query("SELECT * FROM Character(nolock) WHERE AID = '" . $_SESSION['AID'] . "' AND CharNum != '-1'");
while( $char = mssql_fetch_assoc($code1) )
{
?>
<option value="<?php echo $char['CID']; ?>"><?php echo $char['Name']; ?></option>
<?php
}
?>
</select>
<b> To: </b>
<input type="text" name="charname" size="20" maxlength="12">
<input type="submit" name="changename" value="Change Name">
</form>
Still just a blank page man :o, im on Wamp.
the script works fine. The only thing you need to include with that is a login script so that it can read the characters (unless I'm mistaken). Don't use wamp, it sucks, use appserv.
I use Xampp and it is added to my site (final revolution by ~DN modified by me) and it works great
I am already using AppServ but it stills show as a blank page :x
blank page, fix please? O_O
I managed to view the page, but the drop down box is blank.
And yes short tags are enabled.
In which directory do i have to put it in?
since my webshop items are in the database not in the xampp map if u know what i mean. (X-weaver database) so In which directory do i have to put it in?:ehh:
I get this error at every page =/.Code:Fatal error: Call to undefined function mssql_connect() in C:\wamp\www\User\index.php on line 5
Exept register ODBC 2