TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Forum Home Latest Posts Search Help Subscribe

Textarea size problem

Page: 1 Reply
Mar 16th 2005#166736 Report
Member since: Feb 7th 2002
Posts: 1564
Hey coders.

I have this guestbook: http://p-ahlqvist.com/gb/gb.php

Watching that in IE the textarea in which one type messages is reeeaaaly small, in Mozilla, however, it is presented as it should.

Why is that, and can I possibly fix it. there is gassillion of .php files, and I'm too much of a newbie to even try (but I have, and found nothing).

Do anyone have a clue what to do here ?

Tell me what you need to know and I'll post it or mail it to you. I really need help, so, please guy's and gal's...know what to do, hehe...

Patric.
Reply with Quote Reply
Mar 16th 2005#166738 Report
Member since: Apr 20th 2002
Posts: 3000
What's with the ridiculous amount of \'s in the tags -.-;
Reply with Quote Reply
Mar 16th 2005#166740 Report
Member since: Feb 7th 2002
Posts: 1564
Well, that exact thought have crossed my mind aswell, so I've tried to do without them, which results in:

Mozilla
IE

So, I've come to the conclusion that it is some kind of PHP "hack"...anyway, it kind of exceeds my level of knowledge so to speak ;), so I turned to you lot...

D'ya have any idea ? Or anyone else ?

Patric.
Reply with Quote Reply
Mar 21st 2005#166818 Report
Member since: Feb 7th 2002
Posts: 1564
Mhm...no ?
Reply with Quote Reply
Mar 21st 2005#166826 Report
Member since: Feb 16th 2005
Posts: 4
I'd have to see the php source of what you're working with. It looks like the php generated some html or something and escaped the single-quotes ' -> \', but when it was brought back in it didn't strip the slashes. I've run into this problem putting things into a database and bringing them out before.

But the problem does lie in the slashes- the 30 and 10 are embedded in all those slashes and mozilla strips them out but IE doesn't. If you can find the spot in the php code where it echoes out that HTML code and the slashes are in the PHP code, then just strip all of them out but the ones that escape the single-quotes.

Hope that helps any!
Reply with Quote Reply
Mar 22nd 2005#166864 Report
Member since: Feb 7th 2002
Posts: 1564
Tethered, thanks for replying. Ok, I don't know much about PHP, really...That said, moving on ;).

If I understand you correctly I'm supposed to find somewhere in the php code where the html is echco'd out. And where the slashes are in the php code and take the slashes away (except the ones that that escape the single-quotes ??)

Ok, so far so good (or not) I've found this in the index.php:
[PHP] function FormText ( $inTag = "" ) {
// prints the textarea for the entry
global $_entry;

out("";
}[/PHP]

Could that be something ? Which I gues does this in the HTML code:
[HTML]
[/HTML]

I also found this in the functions.php:

[PHP]function vgb_formatText( $t ) {
$o = "";
$buffer = "";
$tlen = strlen($t);
$inTag = false;
for ($i=0;$i<$tlen;$i++) {
if ($inTag) {
$o .= $t[$i];
if ($t[$i] == '>')
$inTag = false;
}
elseif ($t[$i] == '<') {
if ($buffer != "") {
$o .= vgb_removeHTML(vgb_UndoNoHTML($buffer),false);
$buffer = "";
}
$o .= "<";
$inTag = true;
}
else
$buffer .= $t[$i];
}
if ($buffer != "")
$o .= vgb_removeHTML(vgb_UndoNoHTML($buffer),false);
return $o;
}[/PHP]



God allmighty, I can search my brains out without finding anything here...I've been in contact with the writer but he has not replied. I imagen that this would be an easy task for anybody who's able to read thesse things, but I'm totally lost.

Would you mind having a look at the php's if I was to mail the to you, or am I asking to much ?

I really can't find those slashes in any php file at all. I find them in the style.inc file, but I can't take them away there as stated in earlier post.

"Goin nutso" - Patric.




Ohohh, found this aswell (whilst talking about specialchars):

[PHP]function vgb_formdata( $t ) {
return htmlspecialchars(vgb_string($t),ENT_QUOTES);
}

function vgb_removeHTML( $t, $ent = true ) {
if (!$ent)
return htmlspecialchars($t,ENT_QUOTES);
$h = explode("&",$t);
$h[] = "";
$o = htmlspecialchars($h[0],ENT_QUOTES);
$i = 1;
while ($i < count($h)-1) {
$b = true;
$o .= "&";

if ((($m = strlen($h[$i])) > 3) && ($h[$i][0] == '#')) {
$j = 1;
if (($h[$i][1] == "x") || ($h[$i][1] == "X")) {
$j++;
if (eregi("[abcdef0-9]",$h[$i][$j]))
{
do {
$j++;
}
while (($j < $m) && (eregi("[abcdef0-9]",$h[$i][$j])));
if (($j < $m) && ($h[$i][$j] == ';'))
$b = false;
}
}
else {
if (($h[$i][$j] >= '0') && ($h[$i][$j] <= '9'))
{
do {
$j++;
}
while (($j < $m) && ($h[$i][$j] >= '0') && ($h[$i][$j] <= '9'));
if (($j < $m) && ($h[$i][$j] == ';'))
$b = false;
}
}
}
elseif (($m > 2) && (eregi("[a-z0-9]",$h[$i][0]))) {
$j = 0;
do {
$j++;
}
while (($j < $m) && (eregi("[a-z0-9]",$h[$i][$j])));
if (($j < $m) && ($h[$i][$j] == ';'))
$b = false;
}

if ($b)
$o .= "amp;";
$o .= htmlspecialchars($h[$i],ENT_QUOTES);
$i++;
}

return $o;
}[/PHP]
Reply with Quote Reply
Mar 22nd 2005#166869 Report
Member since: Feb 7th 2002
Posts: 1564
Ahhhhahahahahhahaaaa WOHUAAAA...

Ok, never mind me ;)...Tethered, don't bother with this, I fixed it...saying it again I FIXED IT !!!!

Hehe, don't ask me how, but somehow I managed to change the right stuff and it turned out brilliantly (just imagen what a backup and some guts can do, eh ?)

Patric.
Reply with Quote Reply
Page: 1 Back to top
Please login or register above to post in this forum