Hey everyone, I'm just a student and I use a blackberry to browse the net sometimes. A friend helped me write a program for my phone to help manage better my SMS's. OK, I have the code working great! But I use Opera Mini and the Default. one shows up nicely and the other ... very ugly! So my question is if someone can help me fix the code a little bit so they both look nice! I'll show you two pics :
http://web.zkentspain.com-a.googlepages.com/DSC05581.JPG when it looks good
http://web.zkentspain.com-a.googlepages.com/DSC05580.JPG when it doesn't look good!
I'm not sure what's making it look like that. I'm sure it has something to do with the javascript.
So ... if anyone could tell me a way to get around it I'd REALLY appreciate it! Thanks a lot!
Kent.
PS - If you look at the picture in which it looks bad, the text is lined, like each letter is on a different line. I don't understand it!
CODE
<?php
include_once("dbconnect.php");
if (isset($_GET['status']))
$StatusMessage = $_GET['status'];
else
$StatusMessage = "Not Yet Sent";
if (isset($_GET['to']))
$to = urldecode($_GET['to']);
else
$to = "";
if (isset($_GET['message']))
$message = urldecode($_GET['message']);
else
$message = "";
if (isset($_GET['charcount']))
$charcount = $_GET['charcount'];
else
$charcount = "";
if (strlen($charcount) > 1)
$divTotalChars = strlen($message);
else
$divTotalChars = "0";
$query = "SELECT value FROM spn_totalSMSMessage";
$result = mysql_query($query, $conn);
$reccount = mysql_num_rows($result);
if ($reccount)
{
$row = mysql_fetch_assoc($result);
$divTotalSMSMessage = $row["value"];
}
else
{
$divTotalSMSMessage = "0";
}
$to = stripslashes($to);
$message = stripslashes($message);
?>
<html>
<head>
<title>Send An SMS</title>
</head>
<font face="verdana" size="2">
<script language="javascript">
function encode4sending(msg)
{
result = msg;
/*result = result.replace("#", "%23"); // fix #
result = result.replace("'", "%60"); // fix '
*/
result = escape(result);
return result;
}
function openphonebook()
{
window.location.href = "phonebook.php?to=" + encode4sending(document.getElementById("to").value) + "&message=" + encode4sending(document.getElementById("message").value);
}
function opencharcount()
{
window.location.href = "index.php?to=" + encode4sending(document.getElementById("to").value) + "&message=" + encode4sending(document.getElementById("message").value) + "&charcount=true";
}
function openSMSArchive()
{
window.location.href = "SMSarchive.php?to=" + encode4sending(document.getElementById("to").value) + "&message=" + encode4sending(document.getElementById("message").value);
}
</script>
<form method="post" action="index_submit.php">
<table>
<td>
<tr><a href="index.php">NEW SMS</a></tr><br>
<tr><a href="#" onclick="opencharcount();">CHAR COUNT:</a><?php echo $divTotalChars; ?></tr>
</td>
</table>
<p>To:
<input type="text" name="to" id="to" size="26" value="<?php echo $to; ?>">
<a href="#" onclick="openphonebook();">Phone Book</a><br><br>
<textarea name="message" id="message" cols="40" maxlength="160" rows="3"><?php echo stripslashes($message); ?></textarea><br><br>
<table>
<tr>
<td><input type="submit" value="Send"></td>
<td><div id="divStatus"><?php echo $StatusMessage; ?></div></td>
</tr>
</table>
<table width=20>
<tr>
<tr></tr>
<div id="divTotalSMSMessage"><?php echo "Total SMS Messages:".$divTotalSMSMessage; ?></div>
</tr>
<br>
<tr>
<a href="#" onclick="openSMSArchive();">SMS Archive</a>
</tr>
</table>
</p>
</p>
</form>
</font>
</html>
This post has been edited by hotsnoj: 8 Jun, 2007 - 02:00 PM