Markie
Posts: 251
|
| Posted: 12/26/2008, 4:24 AM |
|
I've made some custom code and I would like that the result of the code appears in a label somewhere on my page. The code is working, but the result appears at the very left top of the page instead of in the label.
My code:
$old_name=$uploaded2->Label2->Getvalue();
$replace_name = array("jpg","á", "ä", "é", "ë", "í", "ó", "ö", "ú", "ñ", "Á", "Ä", "É", "Ë", "Í", "Ó", "Ö", "Ú", "Ñ", "¿", "?", "!", "'", " ");
$newname = str_replace($replace_name,'', $old_name);
$NameChunks = explode(".", $newname);
echo $NameChunks[2];
echo $NameChunks[3];
echo $NameChunks[4];
echo $NameChunks[5];
echo $NameChunks[6];
the result should appear in Label1
The settings of Label1:
Control Source Type: code expression
Data type: text
Content: HTML
What's the answer to my problem ?
I have looked at this solution: http://forums.yessoftware.com/posts.php?post_id=97665
but this error appears:
Fatal error: Call to a member function SetValue() on a non-object ...
_________________
The Netherlands, GMT+1
Tools: CCS 5.1, Windows 7, Navicat, Ultraedit
Local server: XAMPP with Apache, php and MySQL
Webserver: Windows 2008 IIS 7, php and MySQL |
 |
 |
datadoit
|
| Posted: 12/26/2008, 4:38 AM |
|
Instead of echoing, use SetValue().
$Component->SetValue($NameChunks[2].$NameChunks[3].etc);
|
|
|
 |
Markie
Posts: 251
|
| Posted: 12/26/2008, 5:05 AM |
|
Wonderfull, this does the trick !
Merry Christmas to you, Datadoit
_________________
The Netherlands, GMT+1
Tools: CCS 5.1, Windows 7, Navicat, Ultraedit
Local server: XAMPP with Apache, php and MySQL
Webserver: Windows 2008 IIS 7, php and MySQL |
 |
 |
|