• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Php script to remove spaces from a value

Php script to remove spaces from a value 11 years 2 months ago #26554

Hello,

I'm basically trying to solve this problem whole week but it seems like my PHP knowledge isn't good enough to fix my problem.

I'm having a registration form, where people fill in their name/username etc. I'm Mapping these value's to a ZOO tabel in the database.

I'm mapping the value of name to 2 different rows (Name, alias). Now i'm trying to remove any spaces and any capital letters from the alias.

Looking through the documentation i figured out i should work with $_post. I just can't find out what to code.

Any help would be really appreciated,

Dennis
The administrator has disabled public write access.

Php script to remove spaces from a value 11 years 2 months ago #26557

  • josh.thomson
  • josh.thomson's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 19
  • Thank you received: 2
for the alias? you can use the convert to lowercase string function

Code:

$str = getElementById(PUT DIV ID NAME HERE FOR NAME TEXTBOX or use 'ElementByClass' and put Class name here);
$alias = string strtolower ( string $str );



.....

for the removal of spaces you could just use a string replace function and specify ("") two double quotes for to remove it...


mixed str_replace ( mixed $search , mixed $replace , mixed $subject [, int &$count ] )


Look here for definitions:

uk1.php.net/manual/en/function.str-replace.php
The administrator has disabled public write access.

Php script to remove spaces from a value 11 years 2 months ago #26832

I have a similar issue trying to map an Eventlist component image field.

I use an rsform image upload to post an image to eventlist but it wraps an anchor tag around the image so the image is not rendered in Eventlist.

I only need the image name and extension inserted to the field. How can I strip the anchor tag?
The administrator has disabled public write access.

Php script to remove spaces from a value 11 years 1 month ago #26879

Eventlist is a component (com)_eventlist) and it has a database column for images. I use the RSform field file upload to submit the image and map it to the Eventlist component DB table.

I still am trying to strip the anchor tag wrap which is added on DB post. I have attemptemted multiple forms of str_replace but all have failed.

does anyone know how to strip the anchor tag from rsform submitted images. I just need the image name and extension.
The administrator has disabled public write access.

Php script to remove spaces from a value 11 years 1 month ago #26933

I tried some str_replace configurations but still no success. How do I get rsform to post an uploaded image to the database without the anchor tag? I just need it to insert the image filename and extension.
The administrator has disabled public write access.

Php script to remove spaces from a value 10 years 11 months ago #27758

Well I still could not figure the image issue but found an article that includes a step to convert the title field of custom rsform to an alias and convert to lowercase and special characters replaced by minus sign '-' See cmsenergizer.com/website-energy-guide/44...la-content-component
Last Edit: 10 years 11 months ago by kimosiris.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!