IT.COM

Need Coding Help..Removing a "/"

Spaceship Spaceship
Watch

briguy

Guru In Remission!Top Member
Impact
60,876
Hey there.. this "old schoool html" guy who bought a script cause he doesn't know how to code need your help!
Like I mentioned bought a "shopping site affiliate script" and their "support" is of no help, give me the run around..no more of my hard earned money..

Anyway here is my problem
ms3z.png

That is what I do behind the scenes when I want to add a product to the site, notice the "Elmer's" then I publish and get this
vpep.png

Notice the Elmer\'s on the published page.. I have to go back and remove the ( ' ) to make my site more professional looking.
Is there any thing that I can do from my template to get rid of that "\".. hate wasting my time editing my published items!

Thanks.. please note keep your answers as simple as possible and I am not even sure what part of my template to work on or even what type of coding causes this..
 
1
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Last edited:
1
•••
Looks like you got it taken care of.
Hey, what is this script?
I might like it.
 
1
•••
Thanks iowadawg for dropping by.. haven't touched the script yet..
You'll have to dig in the code a bit & use stripslashes where this is coming from.

http://www.php.net/stripslashes

Here's a simple explanation for wordpress (but should apply to you or most php scripts)
http://wpgarage.com/code-snippets/how-to-fix-apostrophes-turning-into-slashes-in-wordpress/

Possibly an easier explanation:
http://php.about.com/od/phpfunctions/g/stripslashes.htm
Thanks for your time and the links "south"
Now if I understand the second link correctly..
I just have to find this
<?php echo get_option(‘cgn_404_text’); ?>
and change it what was suggested?
 
1
•••
Thanks.. please note keep your answers as simple as possible and I am not even sure what part of my template to work on or even what type of coding causes this..

So you're not sure what part of the script is failing.. you're not sure what code it is.. but you want people to help :)

If you send me the script package you installed I'll have a look at it see if I can make an update at the source of the problem.

---------- Post added at 11:52 PM ---------- Previous post was at 11:48 PM ----------

Hey, what is this script?
I might like it.

Really? It looks quite chintzy and I heard it has silly bugs and their "support" is shit. I'm not sure why we can't name and shame them here, though.


Now if I understand the second link correctly..
I just have to find this and change it what was suggested?

Errr.. no. That was just an example of how to use the function.
If you want to do this yourself - using chrome do the following:

Right click and Inspect the element that contains the bad apostrophe. Search for that div id - that will be where it is output. Then either fix the output using stripslashes - or go back further and see where the slash gets introduced incorrectly in the first place.
 
3
•••
0
•••
Here's the issue:

http://www.php.net/magic_quotes

If you have Scripts that don't check if it is off or on, and act accordingly, you may have double escaped database entries.

The appropriate action is probably to update php.ini; however, on a shared host this may not be that easy. Just need to add a check for the magic_quote setting and strip any additional slashes.
 
1
•••
Thanks everyone for the suggestions and help!
Now after hours upon hours of trying to fix the problem (had some great help) FINALLY FOUND A SOLUTION to the problem, I have to use "&# 39;" (remove space)
this code was found on http://www.ascii.cl/htmcodes.htm

More extra time, just to make a small site, look professional to it visitors.. can anyone say "pure bullsh*t".. I can and did over and over and over again...
 
Last edited:
1
•••
In php \ is used to escape a character. Like for example there is a code

<?php
echo 'my name is Elmer's and I live in NewDelhi';
?>

Now you can see this will produce an error because 'my name is Elmer' it is a single sentence and then s and I live in NewDelhi is another sentence. Because the compiler is thinking that you have ended the sentence at Elmer.
So in order to get over this situation we use a escape sequence which is a back slash / to escape ' at Elmer's .
To overcome this problem i think you should use a escape sequence yourself.
Instead of just writing Elmer's 3D you yourself write Elmer\'s in the admin panel. If problem persists you need to change the code. Hire some php programmers.
 
1
•••
Instead of just writing Elmer's 3D you yourself write Elmer\'s in the admin panel. If problem persists you need to change the code. Hire some php programmers.
Thanks for the suggestion sonu, tried your suggestion and this is what happened...
Elmer\\\'s 3D Washable Glitter Pens

only thing that worked so far is the " ASCII"

Yes, really been trying to fix the code (well others have volunteered their time) and still no results! Wish I had the budget and a PHP coder that I can trust..

The script changes the ' that I put in to a \
 
0
•••
In php \ is used to escape a character. Like for example there is a code

<?php
echo 'my name is Elmer's and I live in NewDelhi';
?>

Now you can see this will produce an error because 'my name is Elmer' it is a single sentence and then s and I live in NewDelhi is another sentence. Because the compiler is thinking that you have ended the sentence at Elmer.
So in order to get over this situation we use a escape sequence which is a back slash / to escape ' at Elmer's .
To overcome this problem i think you should use a escape sequence yourself.
Instead of just writing Elmer's 3D you yourself write Elmer\'s in the admin panel. If problem persists you need to change the code. Hire some php programmers.


Problem is that with magic quotes on the input is interpreted as "Elmer\'s Glue" because it is escaped already coming into the php.

The script is not magic quote aware so doesn't handle it properly.

This input is then escaped again using mysql_real_escape_string (deprecated); however, this treats the slash as a literal.

So "Elmer\'s Glue" gets entered into the table.

Briguy's shared hosting is at PHP 5.3 and Magic Quotes is deprecated but still functional. With 5.4+ it is removed as it was a stupid solution.

I don't know if a double quote would work. Elmer''s.

The easiest solution is to stop selling Elmer's glue ..
 
0
•••
The easiest solution is to stop selling Elmer's glue ..
lol and any other items that I have to use the ( ' ) with, even in the sales paragraph!

Seriously... I made a mistake and fell for a "salespitch" didn't do my "Due Diligence"(research).

If it wasn't for the help of namepros members, I probably would have thrown my computer through the window (fancy way of saying gave up because of frustration)!

Find first flaw, get it fixed (posted it here), find another (posted it here) received help and figured a quick fix to it.. found a third flaw ("Whitespace is not allowed at this location.") and since it shouldn't affect sales (yes Elmer's glue lol) just going to ignore it!

So if anyone thinking of getting into a "sale sites".. please research before you buy!
 
0
•••
Simple rules here.

If you have single quotes IN single quotes, backslash the inner single quotes not the dbl quotes.

If you have dbl quotes IN double quotes, baskslash the inner dbl quotes not the sng quotes.

If grabbing data from sql, ALWAYS use stripslashes() to remove the backslashes.

I suggest you all read php for dummies, not becuase you are dummy, but because you have holes in your php education.
 
Last edited:
0
•••
Simple rules here.

If you have single quotes IN single quotes, backslash the inner single quotes not the dbl quotes.

If you have dbl quotes IN double quotes, baskslash the inner dbl quotes not the sng quotes.

If grabbing data from sql, ALWAYS use stripslashes() to remove the backslashes.
Simple rules for a programmer BUT I Paid for a template that was supposedly user friendly..no reason for me as a client to do all this crap..
I suggest you all read php for dummies, not becuase you are dummies, but because you have holes in your php education.
Interesting sure sounds like a insult to me! Again why should I spend any money on a book? I already spent money on a domain name..hosting, template and support! Why should I spend more money on a problem that shouldn't have been there!

I suggest you read manners for tech geeks for dummies, not because you are a dummy, but because you have holes in talking to the average person.

No I got ripped off... this problem and this one https://www.namepros.com/programming/803943-php-script-help-page-continuosly-uploading.html
 
0
•••
Simple rules for a programmer BUT I Paid for a template that was supposedly user friendly..no reason for me as a client to do all this crap..

Interesting sure sounds like a insult to me! Again why should I spend any money on a book? I already spent money on a domain name..hosting, template and support! Why should I spend more money on a problem that shouldn't have been there!

I suggest you read manners for tech geeks for dummies, not because you are a dummy, but because you have holes in talking to the average person.

No I got ripped off... this problem and this one https://www.namepros.com/programming/803943-php-script-help-page-continuosly-uploading.html


Wow man you are a judgmental jerk. I was not insulting you in any way. It is a genuinely thorough book that I recommend to everyone.

I didn't code it, not sure why you have jumping on my butt. Perhaps you should point your attitude towards the jerk that coded it and not people trying to offer valid advice.

The way you responded makes your statement to me look highly hypocritical. It appears that you, Sir, have issues communicating and controlling your anger.
 
Last edited:
0
•••
Wow man you are a jerk. I was not insulting you in any way. It is a genuinely thorough book that I recommend to everyone.

I didn't code it, not sure why you have jumping on my butt. Perhaps you should point your attitude towards the jerk that coded it and not people trying to offer valid advice.
lol okay call me names.. cause you suddenly posted some mumbo jumbo in this thread about me asking for help.. and then you insult other members who spent their time to help me and offer me advice and pretty sure know about php/sql/ and other coding..

This script was picked up by this site from somewhere else, so maybe you didn't code it..maybe the coding worked back in the 90's but it doesn't work

P.s go ahead call me all the names you want, you are pretty safe behind a computer...
 
0
•••
Ok have a nice day. Bye bye now.

PS... I insulted no other members, just the one that responded like a tool.
 
Last edited:
0
•••
Thanks for the compliment.. a tool is useful!
I suggest you all read php for dummies, not becuase you are dummy, but because you have holes in your php education.

PS... I insulted no other members, just the one that responded like a tool.
Have a great day lampninjaman and " you all" that read this thread!
 
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back