Feb 20, 2026 - 04:29 AMDeutsch | English
Hello unlogged user [ Register | Log in ]

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
jesseman
Post subject: A bit of a strange request ...  PostPosted: May 22, 2006 - 05:07 PM



Joined: Feb 01, 2006
Posts: 37
Location: Summerville, SC
I need your help in setting up a script. I post news for a large online gaming league. Now, although it is in HTML, I have to post the news via forum. The forum interprets all tabs and carriage returns in my HTML. This means my readable code renders real crazy in the forums.

So, I need a script to remove all tabs and carriage returns. Help!
 
 View user's profile Send private message  
Reply with quote Back to top
zulu9
Post subject: A bit of a strange request ...  PostPosted: May 22, 2006 - 07:23 PM



Joined: Jul 31, 2004
Posts: 249

there may be a better/faster/easier way, but you could try use perl.
in perl,there is a function, which cuts off the CR at the end of a line.
chomp($var);

_________________
http://kanotix.wordpress.com/ inoffizielles Kanotix-Blog
 
 View user's profile Send private message  
Reply with quote Back to top
markb
Post subject: RE: A bit of a strange request ...  PostPosted: May 22, 2006 - 11:20 PM



Joined: Aug 09, 2004
Posts: 121
Location: Brisbane Australia
Code:
tr -d '\t\r'
 
 View user's profile Send private message  
Reply with quote Back to top
h2
Post subject: RE: A bit of a strange request ...  PostPosted: May 23, 2006 - 12:18 AM



Joined: Mar 12, 2005
Posts: 1005

PHP:
// data in form field:
$formdata = $_POST['form field name'];// replace with real form input data names
$replace_stuff = array("\r\n","\n","\t");// str_replace will use this array to search for all present array items
$cleaned_form_field_data = str_replace( $formdata, '', $replace_stuff);

I think that will do it.

_________________
Read more on dist-upgrades using du-fixes-h2.sh script.
New: rdiff-backup script
 
 View user's profile Send private message  
Reply with quote Back to top
jesseman
Post subject: RE: A bit of a strange request ...  PostPosted: May 23, 2006 - 01:04 PM



Joined: Feb 01, 2006
Posts: 37
Location: Summerville, SC
I will be trying markb and h2's ideas later today. Results will be coming! Thanks guys!
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group
Credits
 
Deutsch | English
Logos and trademarks are the property of their respective owners, comments are property of their posters, the rest is © 2004 - 2006 by Jörg Schirottke (Kano).
Consult Impressum and Legal Terms for details. Kanotix is Free Software released under the GNU/GPL license.
This CMS is powered by PostNuke, all themes used at this site are released under the GNU/GPL license. designed and hosted by w3you. Our web server is running on Kanotix64-2006.