-
[PHP]Wierd Symbols
TO NOOBS: NO RIPPING MY CODING
Ok, so, I have my PHP form(not the whole thing, I hate rippers)
PHP Code:
<tr>
<td class='rankingHeader' align='center' colspan='3' nowrap='nowrap'><font size="4">- VengeanceCo Account Creation -</font></td>
</tr>
<form action="/testreg.php" method="post">
<tr>
<td class='rankingHeader' align='center' nowrap='nowrap'>Username:</td>
<td class='rankingHeader' align='center' nowrap='nowrap'><input size="20" name="regwho" type="text"></td>
<td class='rankingHeader' align='center' nowrap='nowrap'>4-10 Characters. Case Sensitive.</td>
</tr>
<tr>
<td class='rankingHeader' align='center' nowrap='nowrap'>Password:</td>
<td class='rankingHeader' align='center' nowrap='nowrap'><input size="20" name="regcred" type="password"></td>
<td class='rankingHeader' align='center' nowrap='nowrap'>8-12 Characters. Case Sensitive.</td>
</tr>
<tr>
<td class='rankingHeader' align='center' nowrap='nowrap'>Confirm Password:</td>
<td class='rankingHeader' align='center' nowrap='nowrap'><input size="20" name="pas2" type="password"></td>
<td class='rankingHeader' align='center' nowrap='nowrap'>Confirm your password.</td>
</tr>
<tr>
<td class='rankingHeader' align='center' nowrap='nowrap'>First Name:</td>
<td class='rankingHeader' align='center' nowrap='nowrap'><input size="20" name="regname" type="password"></td>
<td class='rankingHeader' align='center' nowrap='nowrap'>Case Sensitive.</td>
</tr>
<tr>
<td class='rankingHeader' align='center' nowrap='nowrap'>E-Mail Adress:</td>
<td class='rankingHeader' align='center' nowrap='nowrap'><input size="20" name="regmail" type="text"></td>
<td class='rankingHeader' align='center' nowrap='nowrap'>Must be valid. Case Sensitive.</td>
</tr>
<tr>
<td class='rankingHeader' align='center' nowrap='nowrap'>Confirm E-mail:</td>
<td class='rankingHeader' align='center' nowrap='nowrap'><input size="20" name="mailconf" type="text"></td>
<td class='rankingHeader' align='center' nowrap='nowrap'>Confirm your E-mail Adress.</td>
</tr>
<tr>
<td class='rankingHeader' align='center' nowrap='nowrap'>Validate Code:</td>
<td class='rankingHeader' align='center' nowrap='nowrap'><input size="20" name="valcod" type="text"></td>
<td class='rankingHeader' align='center' nowrap='nowrap'><img src="http://www.daevius.com/minor-projects/randomizer/vco.png" title="Validation Code" alt="Validation Code"></td>
</tr>
<tr>
<td class='rankingHeader' align='center' colspan='3' nowrap='nowrap'><div id="text1" style="width: 100%px; height: 150px;scrollbar-face-color : #000000; scrollbar-highlight-color : #000000; scrollbar-3dlight-color : #2C2B2B; scrollbar-shadow-color : #2C2B2B; scrollbar-darkshadow-color : #000000; scrollbar-track-color : #090909; scrollbar-arrow-color : #FFFFFF; overflow: auto">
<div align="center">
<u>TERMS OF SERVICE/ToS AGREEMENT</u><br><br><br>
1. Terms of Agreement<br><br>
All rights reserved. All materials are provided for noncommercial, personal use only.<br>
VengeanceCo maintains this site and server(s) for your personal information testing, and education.<br>
You may download material displayed on the site for noncommercial, <br>personal use only provided you also retain all copyright and other proprietary notices contained on the materials. <br>You may not, however, distribute, modify, transmit, reuse, re-post, or use the content of the site for commercial purposes.<br>
By accessing and browsing and playing on this server, you accept, without limitation or qualification, all VengeanceCo's Conditions.<br><br>
2. Cheats and hacking rules<br><br>
All hackers and cheaters are null and void of terms of services and aside from being banned <br>will have all your info posted in our hall of shame for all to see and do anything they wish.<br><br>
3. Do not beg from GMs, Admins or other players<br><br>
No excuses! You will be jailed automatically if you ask a GM or Admin to level you up, get you items, or gold. <br>The shopping center is no place for low levels and if you are caught asking for gold, you will be jailed.<br><br>
4. No PvP in start point or shopping centers<br><br>
Do not kill or PvP any players in any of our shopping area or starting point. You will be jailed and possibly be banned from this server<br><br>
5. Donation Terms Of Service<br><br>
Any and all donations to VengeanceCo/VCo are not required, but are a gift given by players, not forced, but is a gift<br>This gift will not be refunded and is given at the<br>players free will. <br>Items given as gifts from the server admin<br>will not be refunded aswell.
</tr>
<tr>
<td class='rankingHeader' align='center' colspan='3' nowrap='nowrap'><input type="checkbox" Name="agreement" value="Agree">I agree to the Terms Of Service, I have read and understand it.</td>
</tr>
<tr>
<td class='rankingHeader' align='center' colspan='3' nowrap='nowrap'><input type="submit" name="submit" value="Create Account"></td>
</tr>
</form>
And my testreg.php:
PHP Code:
<?php
$username = "root";
$password = "tina84628462";
$hostname = "localhost";
$dbh = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL Database.");
mysql_select_db("coproj");
$regwho=stripslashes($_POST['regwho']);
$regcred=stripslashes($_POST['regcred']);
mysql_real_escape_string($regwho);
mysql_real_escape_string($regcred);
$regc = ($regcred);
$login = mysql_query("SELECT * FROM accounts WHERE AccountID='$regwho'
OR AccountID='$regwho' AND Password='$regcred'")
or die ('Error: ' . mysql_error());
if ($row = mysql_fetch_array($login)){
echo 'The Username <b><font color="green"> ' . $_POST['regwho'] . ' </font></b> is already taken. Please try again with a different username.
<br><br>Here are some suggestions for different Usernames:<br><br>
<font color="green"> ' . $_POST['regwho'] . '1
<br>
' . $_POST['regwho'] . '2
<br>
' . $_POST['regwho'] . '3
<br>
' . $_POST['regwho'] . '4 </font>
<br><br><a href="/index.php">Try again</a>';
}
else {
$sql = "INSERT INTO accounts VALUES ('$_POST[regwho]', '', '2', '0', '0', '', '', '0')";
mysql_query($sql)
or die('Error: ' . mysql_error());
echo '<b>Registration successful. You may now log into VengeanceCo!</b>';
}
?>
But when I click Submit on my registration page, I get the following symbols:
[CODE]格浴㹬戼摯㹹猼祴敬琠灹‽琢硥⽴獣≳ാ 愠献牥敶⁻潢摲牥猭祴敬
-
Re: [PHP]Wierd Symbols
I tried the script on my server and work normals,
Only thing i would suggest is
PHP Code:
mysql_select_db("coproj");
-->
PHP Code:
mysql_select_db("coproj", $dbh);
-
Re: [PHP]Wierd Symbols
wow that's strange. I see that your code has nothing to do with Chinese language ;]
-
Re: [PHP]Wierd Symbols
First i doubt anybody would want to use this code,
Second i actually think this is a html problem,
You should check the charset,
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
-
Re: [PHP]Wierd Symbols
Was thinking about something like that.
Google around for charsets, then you'll find yours.
-
Re: [PHP]Wierd Symbols
It was saved as Unicode, so I saved them both as ANSI, and it won't give the crazy symbols but now the PHP code won't even work, lol.