Thank you for all of the help! $age refers to the id of the textbox that I am using GET to retrieve the data from. I never switched the variable names b/c I was suing it for another script and just modified that script to fit this one. I am looking at the database and that is why I think that is where the error is. Even if there are breaks in the textbox, the data that is inserted into the database is just one long strand that only keeps the spaces and not the breaks, that is why I think that the error is occurring while I am inserting the data into the database.
Here is the code that retrieves the data:
PHP Code:
mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname) or die(mysql_error());
$id2 = $_GET['q'];
$id2 = mysql_real_escape_string($id2);
$getdata8 = mysql_query("SELECT * FROM guestbook WHERE profilename='$id2' ORDER BY id DESC");
$getdata10 = mysql_query("SELECT * FROM guestbook WHERE profilename='$id2' ORDER BY id DESC");
while ($row8 = mysql_fetch_assoc($getdata8))
{
$row10 = mysql_fetch_assoc($getdata10);
$id40 = $row10['id'];
$name8 = $row8['name'];
$message8 = $row8['message'];
$date8 = $row8['date'];
$time8 = $row8['time'];
echo"
".nl2br($message8)."<br>
<h8> <a href=/profile.php?u=$name8>$name8</a> at $time8 on $date8 $echovar800 $echovar888</h8>
";
that is not all of it, only part of the php.
Thanks guys, if you have anything else to say that would be greatly appreciated. I am going to go try to implement some changes and see if i can fix this problem!
---------- Post added at 09:53 PM ---------- Previous post was at 08:37 PM ----------
I think that my best bet might be to try converting this ajax into POST instead of GET. However, I have tried and failed. Would any of you possibly know how i could do this?
I would have to convert this into POST
Code:
<script language='javascript' type='text/javascript'>
function ajaxFunction(){
var ajaxRequest;
try{
// Opera 8.0+, Firefox, Safari
ajaxRequest = new XMLHttpRequest();
} catch (e){
// Internet Explorer Browsers
try{
ajaxRequest = new ActiveXObject('Msxml2.XMLHTTP');
} catch (e) {
try{
ajaxRequest = new ActiveXObject('Microsoft.XMLHTTP');
} catch (e){
// Something went wrong
alert('Your browser broke!');
return false;
}
}
}
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
var ajaxDisplay = document.getElementById('pagecomments');
ajaxDisplay.innerHTML = ajaxRequest.responseText;
}
}
var message = document.getElementById('message').value;
var wpm = document.getElementById('wpm').value;
var queryString = '?message=' + message + '&wpm=' + wpm;
request.open("POST", ajaxprofilechat.php, true);
http.send(null);
}
</script>
As you can see I have attempted to use the POST method, but I must have an error somewhere because this section of script is not working. Did I overlook something when converting it from GET to POST? Any help would be appreciated.