monkeytooth Posted January 3, 2008 Share Posted January 3, 2008 Ok I have yet another frustrating problem.. I don't know if its with the host I have (Godaddy) or if its with the code.. What I have is a form, with a confirmation page. We all know the use of a confirmation page. Double Check and go back and edit if need be. Well anyway I have a multi-line text area for a message body.. Now what I want from that particular part is the ability on the confirmation page to have it echo the submitted data. Which that parts not hard part.. Its replacing quotation marks (double and or single) its replacing \n with <br> just for the sake of displaying it nicely.. Now I used to use $optional_comment2 = ereg_replace("\\\'","'",$optional_comment2); $optional_comment2 = ereg_replace("\n","<br>\n",$optional_comment2); $optional_comment2 = ereg_replace("\"",""",$optional_comment2);[\code] along with similar in concept.. and this used to work on previous host's I have had.. worked like a charm.. again I don't know if its a me thing and I was just getting lucky in the past or its a godaddy thing, I have PHP 4.0.32 I belive on my godaddy server. I dunno, anyone got idea's? What am I doing wrong or yea.. Quote Link to comment https://forums.phpfreaks.com/topic/84226-solved-replacement-of/ Share on other sites More sharing options...
teng84 Posted January 3, 2008 Share Posted January 3, 2008 what is your question? Quote Link to comment https://forums.phpfreaks.com/topic/84226-solved-replacement-of/#findComment-428898 Share on other sites More sharing options...
dewey_witt Posted January 3, 2008 Share Posted January 3, 2008 if your hosting on the windows hosting at godaddy the php is run in strict safe mode. I know this much I made this mistake a while back. So if you are thats more than likley your isssue. I suggest you switch to their linux hosting unless your relying on .asp for some reason or another. In that case the joke is on you. Quote Link to comment https://forums.phpfreaks.com/topic/84226-solved-replacement-of/#findComment-428900 Share on other sites More sharing options...
gurhy Posted January 3, 2008 Share Posted January 3, 2008 May I ask how much are you paying fr the space on their server? Quote Link to comment https://forums.phpfreaks.com/topic/84226-solved-replacement-of/#findComment-428904 Share on other sites More sharing options...
monkeytooth Posted January 3, 2008 Author Share Posted January 3, 2008 Its godaddy, linux based... The question is can anyone tell me from my code above what i might be doing wrong.. in the case where I want to remove the quotation marks, and put something more code friendly per say replacing " with " for example.. Quote Link to comment https://forums.phpfreaks.com/topic/84226-solved-replacement-of/#findComment-428908 Share on other sites More sharing options...
dewey_witt Posted January 3, 2008 Share Posted January 3, 2008 Your code looks fine to me..... Im not sure what issue would cause this. :| Anyone help this guy? Quote Link to comment https://forums.phpfreaks.com/topic/84226-solved-replacement-of/#findComment-428927 Share on other sites More sharing options...
awpti Posted January 3, 2008 Share Posted January 3, 2008 First: Use str_replace(), it's far less intensive (cpu-wise)compared to ereg_replace() Second: Switch your GD account to PHP5 - no reason at all to continue with PHP4.x. You can do that in your control panel under Languages I tried your code on my own test site with GD and had no problems. Some changes: $optional_comment2 = str_replace("\\\'","'",$optional_comment2); //Where are you getting the triple \'s from? $optional_comment2 = str_replace("\n","<br />\n",$optional_comment2); $optional_comment2 = str_replace('"',""",$optional_comment2); Quote Link to comment https://forums.phpfreaks.com/topic/84226-solved-replacement-of/#findComment-428938 Share on other sites More sharing options...
gurhy Posted January 3, 2008 Share Posted January 3, 2008 Hey there I just tried it and works perfectly, if I di it to way I am sure you said. It breaks a line when you press enter and when you submit it echo it the way you typed it out <? $optional_comment2 = ereg_replace("\\\'","'",$optional_comment2); $optional_comment2 = ereg_replace("\n","<br>\n",$optional_comment2); $optional_comment2 = ereg_replace("\"",""",$optional_comment2); echo $optional_comment2 ?><form action="" action="get"> <textarea name="optional_comment2"></textarea> <input type="submit" value="Submit"> </form> Quote Link to comment https://forums.phpfreaks.com/topic/84226-solved-replacement-of/#findComment-428939 Share on other sites More sharing options...
monkeytooth Posted January 6, 2008 Author Share Posted January 6, 2008 Ahh found part of my problem.. I didn't realize it before but it was magic quotes, kinda new with magic quotes but after playing with it I got my disired output.. however a new problem has arised... Which is fine, Im gonna have to tinker with it a bit but Im sure I can get my ultimate disired end result out of it. I just wanted to say thanks yet again to all who have posted in reply.. Quote Link to comment https://forums.phpfreaks.com/topic/84226-solved-replacement-of/#findComment-432198 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.