Jump to content
Sign in to follow this  
ossieshan

Help! Cannot use < and > in product description

Recommended Posts

Everytime I use an opening < or closing bracket > in my product descriptions, it replaces it with and underscore _

 

I have tried installing the tinyMCE and the FCKEditor thinking this would get fixed with this, but it still replaces all my brackets with underscores.

 

Please help......

Share this post


Link to post
Share on other sites
Everytime I use an opening < or closing bracket > in my product descriptions, it replaces it with and underscore _

 

I have tried installing the tinyMCE and the FCKEditor thinking this would get fixed with this, but it still replaces all my brackets with underscores.

 

Please help......

Read a book on HTML or start with the information available on the web, like this Beginners course.

 

This is the wrong forum for such a question by the way. "General support" is more fitting.

Share this post


Link to post
Share on other sites
Read a book on HTML or start with the information available on the web, like this Beginners course.

 

This is the wrong forum for such a question by the way. "General support" is more fitting.

 

I do not think this is the wrong forum since I have tried using two mods for this problem (FCKEditor and tinyMCE) and thanks for the heads up on understanding HTML first, but you should have asked whether I do or not first. (and I do). My problem is that when I use HTML coding all the opening brackets and closing brackets get replaced by underscores when hitting the preview button (it replaces them....) and so this has nothing to do with my abilty to write HTML.

 

So instead of giving me grief about my posting I weould have rather received a question what is happening if I was not clear enough. Nederlanders denken altijd dat ze het beter weten. Als je het beter weet geef dan een antwoord op mijn vraag and geen kritiek.

 

Hartelijk Dank

Share this post


Link to post
Share on other sites
thanks for the heads up on understanding HTML first, but you should have asked whether I do or not first. (and I do). My problem is that when I use HTML coding all the opening brackets and closing brackets get replaced by underscores when hitting the preview button (it replaces them....) and so this has nothing to do with my abilty to write HTML.

It absolutely has. Everyone who has dealt with using HTML should know that these opening and closing brackets are used for tags and so therefore cannot be used directly in a text. Just as ampersands (&). So yes, you should get back to that book on HTML and find the character name entities for those > and &lt characters.

Share this post


Link to post
Share on other sites
It absolutely has. Everyone who has dealt with using HTML should know that these opening and closing brackets are used for tags and so therefore cannot be used directly in a text. Just as ampersands (&). So yes, you should get back to that book on HTML and find the character name entities for those > and &lt characters.

Sorry, but if you have a WYSIWIG you do not have to write any HTML code, it does it for you. And guess what, it still replaces all the open and clse tags with underscores. so if I do not code and I still get the same problem then I think you are wrong.

 

Please correct me if I am wrong though.

Share this post


Link to post
Share on other sites
It absolutely has. Everyone who has dealt with using HTML should know that these opening and closing brackets are used for tags and so therefore cannot be used directly in a text. Just as ampersands (&). So yes, you should get back to that book on HTML and find the character name entities for those > and &lt characters.

Okay, I figured out what you meant with that and I am not trying to include < and > in the actual text showing, I am simply trying to use a WYSIWIG editor ( one of the MODS) or write HTML myself, but when I do this it displays fine untill I hit the preview button. At this time it takes all the HTML tags and replaces the opening and closing brackets of the HTML tags. Hopefully now you understand that it is not a lack of HTML coding.

Share this post


Link to post
Share on other sites
Okay, I figured out what you meant with that and I am not trying to include < and > in the actual text showing, I am simply trying to use a WYSIWIG editor ( one of the MODS) or write HTML myself, but when I do this it displays fine untill I hit the preview button. At this time it takes all the HTML tags and replaces the opening and closing brackets of the HTML tags. Hopefully now you understand that it is not a lack of HTML coding.

 

So, to clarify a final time. When I write HTML and write:

 

<BR>text here<BR> my name

 

when I hit the preview button, I get the following:

 

_BR_text here_BR_ my name

 

And if I write:

 

<img title=" osCommerce " height="50" alt="osCommerce" src="images/oscommerce.gif" width="204" border="0" />

 

after hitting the preview button, it replaces it with:

 

_img title=" osCommerce " height="50" alt="osCommerce" src="images/oscommerce.gif" width="204" border="0" /_

 

Maybe now someone will understand what I am going through here.

Share this post


Link to post
Share on other sites
So, to clarify a final time. When I write HTML and write:

 

<BR>text here<BR> my name

 

when I hit the preview button, I get the following:

 

_BR_text here_BR_ my name

 

And if I write:

 

<img title=" osCommerce " height="50" alt="osCommerce" src="images/oscommerce.gif" width="204" border="0" />

 

after hitting the preview button, it replaces it with:

 

_img title=" osCommerce " height="50" alt="osCommerce" src="images/oscommerce.gif" width="204" border="0" /_

 

Maybe now someone will understand what I am going through here.

 

With the image, if I drop an image in the description using a WYSIWIG editor, it gives me the same problem.

Share this post


Link to post
Share on other sites
So, to clarify a final time. When I write HTML and write:

 

<BR>text here<BR> my name

 

when I hit the preview button, I get the following:

 

_BR_text here_BR_ my name

 

Maybe now someone will understand what I am going through here.

That sucks big time. No clue why the editors you installed do that. Never used them in osC so never run into that problem. Don't you need to use the clicky buttons of the editors (vague notion of how it looks like, so bear with me) to use the HTML features, and are line breaks not automatically replaced by break tags when it goes into the database?

Share this post


Link to post
Share on other sites
That sucks big time. No clue why the editors you installed do that. Never used them in osC so never run into that problem. Don't you need to use the clicky buttons of the editors (vague notion of how it looks like, so bear with me) to use the HTML features, and are line breaks not automatically replaced by break tags when it goes into the database?

 

Jan, it was actually already doing this before using a WYSIWIG editor and I figured I could not use HTML with the normal product description fields unless downloading an HTML editor. After downloading and successfully installing two different editors I got the same problems with both editors. All tags loose their < and > it does not matter what tags I use.

 

Maybe you can help me find which file creates the "preview" of the product page. I know it uses the categories.php, but which file actually takes the description that I just wrote and outputs it on the preview page, before submitting it to actually update the description? So, what I am trying to say is that somewhere in the preview process it gets changed, before sending it in to the database.

 

I appreciate any help here and do not mind digging myself if I know where to look other then the catagories.php file.

 

Thanks

Share this post


Link to post
Share on other sites
Jan, it was actually already doing this before using a WYSIWIG editor and I figured I could not use HTML with the normal product description fields unless downloading an HTML editor. After downloading and successfully installing two different editors I got the same problems with both editors. All tags loose their < and > it does not matter what tags I use.

 

Maybe you can help me find which file creates the "preview" of the product page. I know it uses the categories.php, but which file actually takes the description that I just wrote and outputs it on the preview page, before submitting it to actually update the description? So, what I am trying to say is that somewhere in the preview process it gets changed, before sending it in to the database.

Totally weird. Never heard of that. Indeed everything happens on categories.php. If you do a preview a GET parameter called new_product_preview is added to the url and the code takes the HTTP_POST_VARS around line 600:

  } elseif ($action == 'new_product_preview') {
if (tep_not_null($HTTP_POST_VARS)) {
  $pInfo = new objectInfo($HTTP_POST_VARS);
  $products_name = $HTTP_POST_VARS['products_name'];
  $products_description = $HTTP_POST_VARS['products_description'];
  $products_url = $HTTP_POST_VARS['products_url'];

(You could try using $_POST there, removes perhaps one layer of complication due to the register_globals stuff)

 

Then it goes through escaping the line breaks etc. with tep_db_prepare_input (see admin/includes/functions/database.php) which takes out the extra slashes added for inputting in the database.

	  } else {
	$pInfo->products_name = tep_db_prepare_input($products_name[$languages[$i]['id']]);
	$pInfo->products_description = tep_db_prepare_input($products_description[$languages[$i]['id']]);
	$pInfo->products_url = tep_db_prepare_input($products_url[$languages[$i]['id']]);

Then around line 700 the actual stuff that goes in the database is put in hidden fields and the actual content echo'ed to the screen where it uses htmlspecialcharacters to make those greater than symbols into named entities.

	  $languages = tep_get_languages();
  for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
	echo tep_draw_hidden_field('products_name[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_name[$languages[$i]['id']])));
	echo tep_draw_hidden_field('products_description[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_description[$languages[$i]['id']])));
	echo tep_draw_hidden_field('products_url[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_url[$languages[$i]['id']])));
  }

So you should check ithe source code of the page in the preview and see if that strange conversion already happened there. In regular osC I cannot where that could happen.

Share this post


Link to post
Share on other sites

Jan,

 

Instead of digging through the code like all day and night, is there an easy way to simply update the whole "admin" folder from the original osC admin folder, overwriting everything?

 

Obviously I will need to keep my configure.php file, but could I delete and replace all other files with the original admin folder files?

 

This should take care of everything, correct?

 

Thanks

Share this post


Link to post
Share on other sites
Instead of digging through the code like all day and night, is there an easy way to simply update the whole "admin" folder from the original osC admin folder, overwriting everything?

 

Obviously I will need to keep my configure.php file, but could I delete and replace all other files with the original admin folder files?

 

This should take care of everything, correct?

Your Dutch language files would be gone and all contributions you would have added to the admin...scary (of course you could rename that folder and add a new admin directory).

 

Actually, in my opinion it can only be two files where that code get mangled (categories.php and includes/functions/database.php). You don't have a contribution added against cross-site scripting and you inadvertently added it to the admin part also?

Share this post


Link to post
Share on other sites

I think I gave you the right answer here

 

It has nothing to do with the arrogant response initially given to you by Jan, what is osC forums coming to, my goodness, a representative of this site should not act like that

 

Good luck, HTH


"I must admit that I personally measure success in terms of the contributions an individual makes to her or his fellow human beings."

---Margaret Mead---

 

"The answer is never the answer. What's really interesting is the mystery. If you seek the mystery instead of the answer, you'll always be seeking. I've never seen anybody really find the answer -- they think they have, so they stop thinking. But the job is to seek mystery, evoke mystery, plant a garden in which strange plants grow and mysteries bloom. The need for mystery is greater than the need for an answer.

--Ken Kesey"

Share this post


Link to post
Share on other sites
It has nothing to do with the arrogant response initially given to you by Jan, what is osC forums coming to, my goodness, a representative of this site should not act like that

Down the drain Rabbit, down the drain. But that is not strange if the knowledge level of the people trying to get a shop up and running gets to this level: :lol:

How I can I start to do my own web page using your product open source?

 

I have downloaded oscommerce-2.2rc1.zip and did not be capable to understand anything at all to start

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×