phaldenby Posted November 10, 2006 Share Posted November 10, 2006 I have grabbed a few variables into php from Flash.They make it to php fine, I can print or echo them no problem.When I try to send them to my MySQL table, I get "<TEXTFORMAT LEA" in any field that I tried to write to.I noticed that when I print or echo it from php it is formatted like this: <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#000000\" LETTERSPACING=\"0\" KERNING=\"0\">chek</FONT></P></TEXTFORMAT>This must be how it is getting it from FlashHere is the PHP code: $fname = $_POST['nbox']; //grabbing from falsh //then I connect to the the DB mysql_query("INSERT INTO users (firstName) VALUES ('$fname')");Here is the Flash statement: on (release) { getURL("email.php", "_blank", "POST"); }Is there a way (in php or even flash) that I can turn this formatted text into the sort of text that MySQL will accept? Link to comment https://forums.phpfreaks.com/topic/26840-formatting-strings-to-send-to-mysql/ Share on other sites More sharing options...
blear Posted November 10, 2006 Share Posted November 10, 2006 $fname = $_POST['nbox']; //grabbing from falsh[code] $fname=str_replace(chr(92),'',$fname); [/code]Put that on the next line after you get $fname assigned. This whacks all the backslashes from your string. That should make MySQL happy. Link to comment https://forums.phpfreaks.com/topic/26840-formatting-strings-to-send-to-mysql/#findComment-122725 Share on other sites More sharing options...
graecyn Posted November 10, 2006 Share Posted November 10, 2006 Nevermind, he got to it before me. ^^ :P Link to comment https://forums.phpfreaks.com/topic/26840-formatting-strings-to-send-to-mysql/#findComment-122728 Share on other sites More sharing options...
phaldenby Posted November 10, 2006 Author Share Posted November 10, 2006 The formatting is still:<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="_sans" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">check</FONT></P></TEXTFORMAT> Link to comment https://forums.phpfreaks.com/topic/26840-formatting-strings-to-send-to-mysql/#findComment-122729 Share on other sites More sharing options...
blear Posted November 10, 2006 Share Posted November 10, 2006 If your MySQL db still truncates the string, then you have your field size set too small. Link to comment https://forums.phpfreaks.com/topic/26840-formatting-strings-to-send-to-mysql/#findComment-122731 Share on other sites More sharing options...
phaldenby Posted November 10, 2006 Author Share Posted November 10, 2006 your right!Its just truncating, thats why is see <TEXTFORMAT LEAis there a way to just get the text that I want, the "check" from:<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="_sans" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">check</FONT></P></TEXTFORMAT> Link to comment https://forums.phpfreaks.com/topic/26840-formatting-strings-to-send-to-mysql/#findComment-122737 Share on other sites More sharing options...
phaldenby Posted November 10, 2006 Author Share Posted November 10, 2006 strip_tags($lname); works great!Removes all that stupid html formatting. Link to comment https://forums.phpfreaks.com/topic/26840-formatting-strings-to-send-to-mysql/#findComment-122740 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.