You Ever Get That Feeling?

EpicGlobalWeb

New member
Joined
Jan 24, 2016
Messages
467
Points
0
When your code isn't working right but there's no error and you spend so much time looking for a major code malfunction and then all of a sudden realize 40 billion years later that it's just a missing ";" or " ' "?

I just did. I feel stupid how often this happens to me LOL!


Here was the real in-depth problem though:

Background: I'm building a custom CMS. Part of its function is to create new files (site pages) based on form input, and display a "thumbnail" of some of the content on another "gateway" page.

During testing, I entered the page content I wanted. It turns out that PHP doesn't like single quotes very well. So in a nutshell it was really a sanitize problem. A noobie mistake, I know.

Anyway the form is handled by two prime functions:

1. Insert form data (in this case a blog post) into a database.
2. Write a new page (fwrite a string of text).

So the issue was basically that I had to use addslashes when putting it into the database, then stripslashes when writing it on the file.

This took me a f***ing hour to find LOL!
 

Rob Whisonant

Moderator
Joined
May 24, 2016
Messages
2,483
Points
113
I feel for you. Have been there, done that way to many times.

Another thing that can drive you crazy is when someone else edits the settings in a PHP script and uses an editor that uses smart quotes... Can take for ever to see that is why the script errors out. :)
 

EpicGlobalWeb

New member
Joined
Jan 24, 2016
Messages
467
Points
0
Lol! When I upgraded Notepad++ it started doing that on its own. I had an extra ")" at the end of every function.
 
Latest threads
Replies
1
Views
97
Replies
0
Views
109
Replies
0
Views
165
Replies
5
Views
409
Recommended threads
Similar threads
Replies
4
Views
471
Replies
5
Views
704
Replies
6
Views
902
Replies
7
Views
1,224

Latest postsNew threads

Referral contests

Referral link for :

Sponsors

Popular tags

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top