Jump to content


Photo

ereg_replace sucks


  • Please log in to reply
34 replies to this topic

#21 MrLeN

MrLeN
  • Members
  • PipPipPip
  • Advanced Member
  • 112 posts

Posted 26 March 2006 - 09:53 PM

Of course I have. Why would I say it doesn't work unless I had tried it? I've tried it multiple times, in different variations, in different orders, with and without quotes or single quotes. What sort of question is that?

It is obvious you're just playing around. If you knew how to fix it you'd just tell me and stop beating around the bush.

If you're going to reply, you should at least give tangable and coherent answers. The point of my post above is that you're telling me you've told me how to fix it and you get some sort of kick out of telling me that you've told me except I've informed you multiple times that it doesn't work.

Look, I should have just not replied.

Either show me the solution or stop wasting both of our time. I don't mind if you don't know the answer. In such a case, just don't reply. I wouldn't get upset with that - of course. But I am not in the mood for cryptic puzzles.

- You either know the solution: Kindly show me, or
- You don't know - That's fine, just stop responding.

MrLeN



#22 toplay

toplay
  • Staff Alumni
  • Advanced Member
  • 973 posts

Posted 26 March 2006 - 10:36 PM

Look in these free forums people post suggestions, they may or may not work. It's as simple as that. You are choosing to get upset over it.

In the future, if you need more one-on-one help, I recommend you post for paid/unpaid help in our freelancing topic area.

The suggestions I made were without actually trying your code because from experience I knew it should work.

Anyway, I took your code and actually tried it. The code below works for me. You did not have anything in the form action but I assume you took that out before showing us your code. Also, you used single quotes when writing headinclude to the config file. I commented out your includes since I don't have them. See the comments in the code. Basically, I just added what I already suggested and that was to include/require the config file after the fclose().

I'm having trouble adding the code too. So, I try and PM the code.

#23 MrLeN

MrLeN
  • Members
  • PipPipPip
  • Advanced Member
  • 112 posts

Posted 26 March 2006 - 10:47 PM

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
Look in these free forums people post suggestions, they may or may not work. It's as simple as that. You are choosing to get upset over it.
[/quote]

..and I'm fine with that (suggestions). I'm not retarded.

However, I get upset when somene repeatedly tells me that I have been given the answer, and being asked if I've "even bothered to try" and other unhelpful comments, when I have already infomed you that your "suggestion" does not work.

Suggestions: I can handle - and appreciate. Know all statements I can't - and don't.

I am telling you - forget stripslashes. I have been trying for two hours to make stripslashes work now. Once I lose the slashes, I can't get one back. No matter what I try. There must be another solution.

I don't know what you're doing to the code, and I have no idea why you keep insisting it works and now you've even tried my code, and "apparently" it works.. well if so, kindly show me what you did?

I am upset at the situation. You do not need to keep insisting I go away and come back or that I am getting upset with people. I am just annoyed with your replies. For two pages you have insisted you have given me a working answer, yet you have not. The suggestion that I have been provided with the solution is tainted with sarcasm - because it is contradictory to me informing you that the answer does not work. Asking if I've "even bothered to try" is just an insult.

You haven't shown me a single thing. Just two pages of telling me you gave me the answer, and I should calm down and asking me not to be arrogant and telling me you tried my code and it works for you

..well in that case SHOW me. Otherwise, I'll continue to view you as an annoying know all.

Any wonder I get upset with people - sheesh.

MrLeN





#24 toplay

toplay
  • Staff Alumni
  • Advanced Member
  • 973 posts

Posted 26 March 2006 - 10:48 PM

This forum is currently not letting me add the simplest of code snippet. If you want, I can email you the code that works for me.


#25 MrLeN

MrLeN
  • Members
  • PipPipPip
  • Advanced Member
  • 112 posts

Posted 26 March 2006 - 10:54 PM

mrlen@mrlen.com

MrLeN



#26 toplay

toplay
  • Staff Alumni
  • Advanced Member
  • 973 posts

Posted 26 March 2006 - 11:01 PM

[!--quoteo(post=358681:date=Mar 26 2006, 02:47 PM:name=MrLeN)--][div class=\'quotetop\']QUOTE(MrLeN @ Mar 26 2006, 02:47 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
..and I'm fine with that (suggestions). I'm not retarded.

However, I get upset when somene repeatedly tells me that I have been given the answer, and being asked if I've "even bothered to try" and other unhelpful comments, when I have already infomed you that your "suggestion" does not work.

Suggestions: I can handle - and appreciate. Know all statements I can't - and don't.

I am telling you - forget stripslashes. I have been trying for two hours to make stripslashes work now. Once I lose the slashes, I can't get one back. No matter what I try. There must be another solution.

I don't know what you're doing to the code, and I have no idea why you keep insisting it works and now you've even tried my code, and "apparently" it works.. well if so, kindly show me what you did?

I am upset at the situation. You do not need to keep insisting I go away and come back or that I am getting upset with people. I am just annoyed with your replies. For two pages you have insisted you have given me a working answer, yet you have not. The suggestion that I have been provided with the solution is tainted with sarcasm - because it is contradictory to me informing you that the answer does not work. Asking if I've "even bothered to try" is just an insult.

You haven't shown me a single thing. Just two pages of telling me you gave me the answer, and I should calm down and asking me not to be arrogant and telling me you tried my code and it works for you

..well in that case SHOW me. Otherwise, I'll continue to view you as an annoying know all.

Any wonder I get upset with people - sheesh.

MrLeN
[/quote]
You have to understand that asking if you tried something is common for me to ask. Sometimes people say they tried the suggestions when they haven't or they tried it the wrong way. Answer over 5,000 posts and then you'll get a better idea of what we moderators go through trying to help people for free.

Your tone towards me is really unjustified. If other moderators were helping you, they would have closed this topic and given you a warning on your record by now.

I haven't insisted on anything. I've "invited" you to take a break and relax.

I have shown you things like where to put the require().

PM your email and I'll send you your own code back with my main one line change that works for me.

Edit:

Ok, I saw your post with the email. I'll send to you what I tried.


#27 MrLeN

MrLeN
  • Members
  • PipPipPip
  • Advanced Member
  • 112 posts

Posted 26 March 2006 - 11:11 PM

I honestly think that when a person joins a new forum, people automatically think that just because they have only 12 posts then they joined the Internet yesterday. I might be a "n00b" on this forum, but I'm not a n00b to "forums" in general. I know perfectly well how people ask questions without even trying to find out themselves. But you should not assume that every person that asks a question is doing that.

All you had to say was "have you tried?". There is a humongous difference between that, and "have you even tried?".

Also, regarding the insistence I should post in the employment section; I already did, and have so far paid a programmer US $260 to help me with this script. However, she is not available right now, or I'd MSN her and send her more money to help me with this.

I want to get this fixed ASAP, which is why I am not trying to hire another programmer. I am trying to fix this myself, but hey - if you want money just ask. I'll PAY someone in a heartbeat. I just want this friggen problem fixed. I have been working on it for 12 hours now. It would take someone who has seen this problem before all but three minutes to fix, but I don't know how to fix this problem and I can't find a solution.

12 hours is a LONG time to be trying to fix such a simple little a problem, especially while being treated like a friggen moron in a search for a simple solution.

MrLeN

#28 MrLeN

MrLeN
  • Members
  • PipPipPip
  • Advanced Member
  • 112 posts

Posted 26 March 2006 - 11:22 PM

I just got your email.

Require has nothing at all to do with my problem.

I have require config.php stated within the script already. You can't see it in the code snippet that I posted here because it's not in that actual document. It's in a document that's included within that document. But forget all that, it's neither here nor there. config.php doesn't have anything in it that's related to this problem.

My Problem is:

I can strip the slashes, but that causes a problem. I end up with:

$headinclude = ' this 'is' wrong';

If I do not strip the slashes, I end up with:

$headinclude = ' this \\\\\\\\\\\\'is\\\\\\\\\\\\' wrong';

If you, or anyone else laughing at this thread knows the solution. Please let me know.

MrLeN

#29 toplay

toplay
  • Staff Alumni
  • Advanced Member
  • 973 posts

Posted 26 March 2006 - 11:36 PM

I had to edit your previous post to conform to board rules.

If you haven't already tried the code I gave you as is, please do and you'll see it works.

The fact of placing the require after the fclose is important not for the sake of having the file included itself but because the variable names inside the file are the same names you're using to echo out with htmlentities. The require file is going to overriding the existing values in the variables, which happen to have the slashes removed.

As mentioned in one of my previous posts, you can put the require or stripslashes() before echoing the variables with htmlentities.

I'll send you another email with the use of stripslashes() in a little while. Either solution works for me.

Edit:

Also, you were using single quotes on headerinclude. I changed that to double quotes to be consistent with the others, otherwise it will generate a syntax error.


#30 MrLeN

MrLeN
  • Members
  • PipPipPip
  • Advanced Member
  • 112 posts

Posted 26 March 2006 - 11:49 PM

Mate, thank you very much!

It worked. TWELVE HOURS!

See! "32" characters of code is all I needed.

I do appreciate your help. And I don't think you're an annoying know all now :)

I'll even send you money, I am so relieved!

MrLeN

#31 toplay

toplay
  • Staff Alumni
  • Advanced Member
  • 973 posts

Posted 26 March 2006 - 11:55 PM

I've sent you an email with the stripslashes() modifications. Both sets of code sent work for me (with magic_quotes on).


[!--quoteo(post=358703:date=Mar 26 2006, 03:49 PM:name=MrLeN)--][div class=\'quotetop\']QUOTE(MrLeN @ Mar 26 2006, 03:49 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Mate, thank you very much!

It worked. TWELVE HOURS!

See! "32" characters of code is all I needed.

I do appreciate your help. And I don't think you're an annoying know all now :)

I'll even send you money, I am so relieved!

MrLeN
[/quote]
Great, I'm glad you got it to work.

FYI: Offering of money is not allowed except in the freelancing topic area.

:)

#32 MrLeN

MrLeN
  • Members
  • PipPipPip
  • Advanced Member
  • 112 posts

Posted 27 March 2006 - 12:03 AM

I must say, I really can't work out why that works.

I just sat here for 10 minutes staring at it.

Lucky I even tried it.

I was thinking: This guy is a NUT JOB!

I tried it and it worked. I nearly fell off my chair.

*bewildered*

MrLeN

#33 toplay

toplay
  • Staff Alumni
  • Advanced Member
  • 973 posts

Posted 27 March 2006 - 12:12 AM

[!--quoteo(post=358711:date=Mar 26 2006, 04:03 PM:name=MrLeN)--][div class=\'quotetop\']QUOTE(MrLeN @ Mar 26 2006, 04:03 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I must say, I really can't work out why that works.

I just sat here for 10 minutes staring at it.

Lucky I even tried it.

I was thinking: This guy is a NUT JOB!

I tried it and it worked. I nearly fell off my chair.

*bewildered*

MrLeN
[/quote]
LOL. See now why I ask people if they tried something or not. Next time, I'll take your advice and leave off "even" when I ask if someone has tried it.

Remember, the code I gave you have some stuff commented out (because I don't have your other header and footer files).



#34 btherl

btherl
  • Staff Alumni
  • Advanced Member
  • 3,893 posts
  • LocationAustralia

Posted 27 March 2006 - 02:04 AM

That was quite an exciting read :) Glad you got it done Len.. now you won't have to bug me about it :P

BTW Len, your first posts left out information that a programmer needs to give you an answer. That's part of why it took so long. PHP files, variables, forms, HTML, they all have different rules for where you need to use slashes. And ereg_replace() has different rules again. And magic_quotes complicates it further, though it was intended to simplify it.

It's a mess, but you just have learn them all..

#35 MrLeN

MrLeN
  • Members
  • PipPipPip
  • Advanced Member
  • 112 posts

Posted 27 March 2006 - 02:16 AM

Yeah, well I don't know! All these different things - just doin' my best and I get really frustrated. I am glad toplay stuck it out and put up with me, because with what I have learned, I have also added this function to over 50 fields in the script - on several pages. Now I can move on and start adding functionality for site customization, like colors, site sections widths and heights etc. It's all really coming along great now. I have almost everything I wanted implemented.

I know I get frustrated. I try not to, but it took me 12 hours just to figure out how to stop backslashes from causing these errors. Now, every editable field in the script is working like a dream - pretty much for the first time since I started making it a month ago.

I am quite happy now, and I have learned heaps :)

Thanks again toplay.

MrLeN





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users