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,489
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
Similar threads
Replies
1
Views
509
Replies
3
Views
1,235
Replies
7
Views
2,834
Replies
3
Views
1,482
Top