CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Cleanup Picture link

Print topic Send  topic

Author Message
Steve Jacobsen
Posted: 09/14/2003, 8:52 AM

I'm adding pictures to an application using the fileupload control. I've got all that working. I can upload pictures, display an url in a grid and when I click on it I go to a separate page to display the full picture. What I'm having problems with is the name of the file.

This is what's displayed in the grid: 200309111948380.saddameiffel.JPG
Here's the link: http://localhost/admin/Picture.php?Picture=200309111948380.saddameiffel.JPG

What I want is to have: saddameiffel.jpg displayed as the link. How can I clean off the yyyymmddhhmmss from the beginning of that string. Is there a control that does this or do I have to use regexp.

I'm working in PHP.

thanks.
Steve
DaveRexel
Posted: 09/14/2003, 9:58 AM

::
If only the link display text is to be cleaned up
try PHP function
explode ( string separator, string string [, int limit])

Here's how to use it in CCS

$link_txt = [get_the_string_from_app]
$link_array = explode ( ".", $link_txt);
$arrlength = count($link_array);
$display_txt = $link_array[$arrlength-1].$link_array[$arrlength];

This will return the last two elements in your link display text
EG : MYPIC.JPG

Hope this helps.
Dave


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.