php-general Digest 11 Aug 2011 07:12:40 -0000 Issue 7439
Topics (messages 314464 through 314486):
Re: text insertion
314464 by: Ashley Sheridan
314465 by: Chris Stinemetz
314466 by: Shaun Farrell
314467 by: Daniel P. Brown
314469 by: Chris Stinemetz
314470 by: hdedeyan.videotron.ca
314471 by: Chris Stinemetz
314472 by: Daniel P. Brown
314473 by: Tim Streater
314474 by: Ashley Sheridan
314475 by: Tim Streater
Re: regex or 'tidy' script to fix broken <? tags and introspection of variables
314468 by: Daevid Vincent
314476 by: Camilo Sperberg
Problem with inserting numbers...
314477 by: Jason Pruim
314478 by: Jason Pruim
314479 by: Chris Stinemetz
314480 by: æç½|å䏿¥
314481 by: Ken Robinson
concatenating
314482 by: Chris Stinemetz
314483 by: Negin Nickparsa
314484 by: Ken Robinson
PHP mysqli help
314485 by: Peet Grobler
314486 by: Kranthi Krishna
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
Chris Stinemetz <[email protected]> wrote:
>How do I preserve text formatting when text is inserted into a database
>table?
>
>For example: I am using a textarea to allow users to leave comments
>into the database and I am using:
>
>'" . mysql_real_escape_string($_POST['store_comments']) . "', to
>prevent SQL injection;
>
>But when I call the data with php from the database the format it was
>inserted is not preserved. Is there a way to make sure when a user
>adds new paragraphs or indentation it will be preserved?
>
>Thank you,
>
>Chris
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
Are you sure its not preserved? When you output text in a browser, by default
its output as html, not plain text. Html ignores extraneous whitespace, and
doesn't use a monospaced font, so formatting text into columns in a textarea
won't work either. Look at the html source code to see what is actually being
output.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
--- End Message ---
--- Begin Message ---
> Are you sure its not preserved? When you output text in a browser, by default
> its output as html, not plain text. Html ignores extraneous whitespace, and
> doesn't use a monospaced font, so formatting text into columns in a textarea
> won't work either. Look at the html source code to see what is actually being
> output.
Thanks Ashley
Source is showing indentation and new paragaraphs just as I inserted
the text. How can I get HTML output to show same format?
Chris
--- End Message ---
--- Begin Message ---
You could try using markdown too.
Sent from my iPhone
On Aug 10, 2011, at 3:57 PM, Ashley Sheridan <[email protected]> wrote:
>
>
> Chris Stinemetz <[email protected]> wrote:
>
>> How do I preserve text formatting when text is inserted into a database
>> table?
>>
>> For example: I am using a textarea to allow users to leave comments
>> into the database and I am using:
>>
>> '" . mysql_real_escape_string($_POST['store_comments']) . "', to
>> prevent SQL injection;
>>
>> But when I call the data with php from the database the format it was
>> inserted is not preserved. Is there a way to make sure when a user
>> adds new paragraphs or indentation it will be preserved?
>>
>> Thank you,
>>
>> Chris
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>
> Are you sure its not preserved? When you output text in a browser, by default
> its output as html, not plain text. Html ignores extraneous whitespace, and
> doesn't use a monospaced font, so formatting text into columns in a textarea
> won't work either. Look at the html source code to see what is actually being
> output.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
> --
> Sent from my Android phone with K-9 Mail. Please excuse my brevity.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
:On Wed, Aug 10, 2011 at 16:02, Chris Stinemetz
<[email protected]> wrote:
>> Are you sure its not preserved? When you output text in a browser, by
>> default its output as html, not plain text. Html ignores extraneous
>> whitespace, and doesn't use a monospaced font, so formatting text into
>> columns in a textarea won't work either. Look at the html source code to see
>> what is actually being output.
>
> Thanks Ashley
>
> Source is showing indentation and new paragaraphs just as I inserted
> the text. How can I get HTML output to show same format?
Use HTML 'pre' tags:
<pre><?php echo $your_content; ?></pre>
--
</Daniel P. Brown>
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/
--- End Message ---
--- Begin Message ---
>
> Use HTML 'pre' tags:
>
> <pre><?php echo $your_content; ?></pre>
>
I just tried that and that puts all the text on a single line.
echo '<tr class="topic-post">
<td class="user-post"><strong>' . $posts_row['first_name'] . ' ' .
$posts_row['last_name'] . ' ' . date('m-d-Y h:iA',
strtotime($posts_row['store_date'])) . '</strong></td>
</tr>
<tr class="visit">
<td class="post-content">Broad Band test results:</strong> ' .
$posts_row['store_tptest'] . '<br/><br/><pre>'
.$posts_row['store_comments'] . '</pre></td>
</tr>';
--- End Message ---
--- Begin Message ---
how about
echo nl2br($your_content);
----- Original Message -----
From: Chris Stinemetz <[email protected]>
Date: Wednesday, August 10, 2011 5:09 pm
Subject: Re: [PHP] text insertion
To: "Daniel P. Brown" <[email protected]>
Cc: Ashley Sheridan <[email protected]>, PHP General
<[email protected]>
> >
> > Use HTML 'pre' tags:
> >
> > <pre><?php echo $your_content; ?></pre>
> >
>
> I just tried that and that puts all the text on a single line.
>
>
> echo '<tr class="topic-post">
> <td class="user-post"><strong>' . $posts_row['first_name']
> . ' ' .
> $posts_row['last_name'] . ' ' . date('m-d-Y h:iA',
> strtotime($posts_row['store_date'])) . '</strong></td>
> </tr>
> <tr class="visit">
> <td class="post-content">Broad Band test results:</strong>
> ' .
> $posts_row['store_tptest'] . '<br/><br/><pre>'
> .$posts_row['store_comments'] . '</pre></td>
> </tr>';
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
No luck. Thanks.
On Aug 10, 2011 4:17 PM, <[email protected]> wrote:
>
> how about
>
> echo nl2br($your_content);
>
>
>
>
> ----- Original Message -----
> From: Chris Stinemetz <[email protected]>
> Date: Wednesday, August 10, 2011 5:09 pm
> Subject: Re: [PHP] text insertion
> To: "Daniel P. Brown" <[email protected]>
> Cc: Ashley Sheridan <[email protected]>, PHP General <
[email protected]>
>
> > >
> > > Use HTML 'pre' tags:
> > >
> > > <pre><?php echo $your_content; ?></pre>
> > >
> >
> > I just tried that and that puts all the text on a single line.
> >
> >
> > echo '<tr class="topic-post">
> > <td class="user-post"><strong>' . $posts_row['first_name']
> > . ' ' .
> > $posts_row['last_name'] . ' ' . date('m-d-Y h:iA',
> > strtotime($posts_row['store_date'])) . '</strong></td>
> > </tr>
> > <tr class="visit">
> > <td class="post-content">Broad Band test results:</strong>
> > ' .
> > $posts_row['store_tptest'] . '<br/><br/><pre>'
> > .$posts_row['store_comments'] . '</pre></td>
> > </tr>';
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
--- End Message ---
--- Begin Message ---
On Wed, Aug 10, 2011 at 17:37, Chris Stinemetz <[email protected]> wrote:
> No luck. Thanks.
Per list rules, please don't top-post.
If the situation you're describing is accurate and correct, then
<pre> is indeed what you want.
--
</Daniel P. Brown>
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/
--- End Message ---
--- Begin Message ---
On 10 Aug 2011 at 22:39, Daniel P. Brown <[email protected]> wrote:
> On Wed, Aug 10, 2011 at 17:37, Chris Stinemetz <[email protected]>
> wrote:
>> No luck. Thanks.
>
> Per list rules, please don't top-post.
>
> If the situation you're describing is accurate and correct, then
> <pre> is indeed what you want.
But can you put a <pre></pre> inside a table cell? (I don't know that you
can't, but it seems an odd thing to do).
--
Cheers -- Tim
--- End Message ---
--- Begin Message ---
Tim Streater <[email protected]> wrote:
>On 10 Aug 2011 at 22:39, Daniel P. Brown <[email protected]>
>wrote:
>
>> On Wed, Aug 10, 2011 at 17:37, Chris Stinemetz
><[email protected]>
>> wrote:
>>> No luck. Thanks.
>>
>> Per list rules, please don't top-post.
>>
>> If the situation you're describing is accurate and correct, then
>> <pre> is indeed what you want.
>
>But can you put a <pre></pre> inside a table cell? (I don't know that
>you can't, but it seems an odd thing to do).
>
>--
>Cheers -- Tim
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
First thing that jumps out at me is that the <pre> tags are apparently ignored.
This suggests one of those ridiculous reset.css files being used, which uses
css to style every Danny element the same. If its set to override the
whitespace setting in a <pre> tag then that could cause the issue you are
seeing, as I've never known pre tags to fail like that.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
--- End Message ---
--- Begin Message ---
On 10 Aug 2011 at 22:07, Chris Stinemetz <[email protected]> wrote:
>>
>> Use HTML 'pre' tags:
>>
>> <pre><?php echo $your_content; ?></pre>
>>
>
> I just tried that and that puts all the text on a single line.
You could write the string into another textarea, which you could make readonly
for this purpose.
--
Cheers -- Tim
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Camilo Sperberg [mailto:[email protected]]
> Sent: Tuesday, August 09, 2011 5:27 PM
>
> For the first one, it may be that zend studio does have an internal script
> to do the job. Check the general preferences tab, template stuff.
Nope. Nothing there. Those templates are for when you create new blurbs of
code, not modifying existing code.
There is a formatter however, sadly it doesn't have an option to force these
(you'd think that would be the perfect place to do this too huh.) In fact, I
posted this here:
http://forums.zend.com/viewtopic.php?f=59&t=19173#p59348
> Please note that <?= is also valid and should be replaced to "<?php echo"
instead.
Yeah, I don't like that style. I prefer the <?= $foo ?> version. It's
shorter, cleaner and easier to read.
Many people mistakenly think that short version is going to be deprecated
away. It is not. The PHP Devs have already clarified only the "<?" version
is, not this one.
http://www.php.net/manual/en/ini.core.php#ini.short-open-tag
> Also the short if version "1 == 1 ? True : false" should be replaced if
i'm correct.
You are not. ;-)
The Ternary operator statement would never go away. It is a standard
comparison operator in pretty much any language and would be completely
stupid of the PHP Devs to deviate that far from the norm.
http://php.net/manual/en/language.operators.comparison.php
Plus I love that operator and use it quite frequently. However, I use it
like this just for clarity:
echo "your result is ".((1 == 1) ? 'true' : 'false').'<br>';
> Second question: zend studio displays all variables used by a script by
> clicking the arrow next to te file name.
I've used ZS for 4+ years now, and comicaly have never even used those
little down arrows next to a file. HAHAH! Good to know. Although it is a
little strange as they seem to only be where you use a "=" assignment. It
doesn't know about "->" or other instances of that variable (like if you
echo it or something). But still could prove useful.
> If you want to display it in runtime, you can: print_r($GLOBALS);
Whoa nelly! That prints out WAAAAAAY too much information ;-)
But thanks. Not sure why I didn't think of that one. Maybe because at one
time I did use it, got sensory overload from the amount of data it spews to
the page, and then blocked it out of my mind for future use. :)
ÐÆ5ÏÐ
There are only 11 types of people in this world. Those that think binary
jokes are funny, those that don't, and those that don't know binary.
--
> Sent from my iPhone 5 Beta [Confidential use only]
>
> On 09-08-2011, at 19:40, "Daevid Vincent" <[email protected]> wrote:
>
> > I've inherited a bunch of code and the previous developers have done two
> > things that are really bugging me and I want to clean up.
> >
> > [a] They use short-tag "<?" instead of "<?php". Anyone have some good
> > search/replace style Regex (ideally for ZendStudio/Eclipse) that will
run
> > through all the files in the project and fix those? There are lots of
> cases
> > to account for such as a space after the ? or nospace or a newline or
even
> > other text (which are all valid cases).
> >
> > [b] The other thing they do use use register_globals in the php.ini
file.
> Is
> > there a good way to see all the variables that a page uses? Something I
> can
> > print at the bottom of the page on my dev box - ideally with enough
> > introspection to know where that variable originated from, and then I
can
> > start converting things to $_GET, $_POST, $_SESSION, $_COOKIE, etc.
> >
--- End Message ---
--- Begin Message ---
On 10-08-2011, at 16:54, Daevid Vincent wrote:
>> -----Original Message-----
>> From: Camilo Sperberg [mailto:[email protected]]
>> Sent: Tuesday, August 09, 2011 5:27 PM
>>
>> For the first one, it may be that zend studio does have an internal script
>> to do the job. Check the general preferences tab, template stuff.
>
> Nope. Nothing there. Those templates are for when you create new blurbs of
> code, not modifying existing code.
>
> There is a formatter however, sadly it doesn't have an option to force these
> (you'd think that would be the perfect place to do this too huh.) In fact, I
> posted this here:
>
> http://forums.zend.com/viewtopic.php?f=59&t=19173#p59348
That is sad to hear, I have never done the same thing you are now, but I
thought it could help.
>
> Many people mistakenly think that short version is going to be deprecated
> away. It is not. The PHP Devs have already clarified only the "<?" version
> is, not this one.
>
> http://www.php.net/manual/en/ini.core.php#ini.short-open-tag
>
I had no idea, I thought short tags also implied short if-else, short echo and
so on, good to know that, thanks for the clarification ;)
>
>> Second question: zend studio displays all variables used by a script by
>> clicking the arrow next to te file name.
>
> I've used ZS for 4+ years now, and comicaly have never even used those
> little down arrows next to a file. HAHAH! Good to know. Although it is a
> little strange as they seem to only be where you use a "=" assignment. It
> doesn't know about "->" or other instances of that variable (like if you
> echo it or something). But still could prove useful.
Eclipse/Zend Studio is so full of options that you can miss a lot of them.
Another downside of the little arrow thing is that it doesn't recognize arrays,
which is obvious because arrays can only be read on runtime, well, same thing
as objects.
>
>> If you want to display it in runtime, you can: print_r($GLOBALS);
>
> Whoa nelly! That prints out WAAAAAAY too much information ;-)
>
> But thanks. Not sure why I didn't think of that one. Maybe because at one
> time I did use it, got sensory overload from the amount of data it spews to
> the page, and then blocked it out of my mind for future use. :)
Yeah I know it displays a lot of information, but I use it sometimes and it's
the only way I know to display all variables, arrays and stuff in a neat and
nice way. You can also install xDebug and use the included debugger in ZS, but
sometimes using a simple print_r is faster.
Greetings :)
_______________________
Mi blog
CHW
Mi Twitter
--- End Message ---
--- Begin Message ---
So here I am attempting to generate some numbers to be inserted into a
database... eventually they will make up a phone number (Which I've emailed
about before and know about the bad ideas with it.. But it's the customer :))
Here is the code I am working with:
<?PHP
function number_pad($number,$n) {
return str_pad((int) $number,$n,"0",STR_PAD_LEFT);
}
$SQL = "SELECT * FROM Test WHERE `areacode` = '907' AND `prefix` = '200' LIMIT
5";
$result = mysql_query($SQL);
//$num = "0000";
//foreach ($result as $key => $value) {
// echo $key . "-" . $value . "-" . number_pad($num, "4") . "<BR>";
// $num++;
//}
while ($num != "10000") {
while($row = mysql_fetch_assoc($result)) {
$padnum = number_pad($num, "4");
echo $row['areacode'] . "-" . $row['prefix'] . "-" . $padnum . "<BR>";
$num++;
}
}
?>
basically all I'm trying to do is generate the last 4 digits starting at 0000
and going up to 9999. for testing purposes I'm just echoing back but will
eventually insert the complete number back into the database as a 7 digit
string.
The error I'm getting is:
Fatal error: Maximum execution time of 30 seconds exceeded in
/home/pruimpho/public_html/jason/dev/clients/flewid/Phone/config/phoneareacodes.php
on line25
which is where the second while starts...
Does anyone know a better way to do this?
I'm off to finish searching google while waiting for some good news :)
Thanks Everyone!
Jason Pruim
[email protected]
--- End Message ---
--- Begin Message ---
On Aug 10, 2011, at 9:36 PM, MUAD SHIBANI wrote:
> Basically you can increase time limit for this file to handle your request by
> using
> set_time_limit function ...
Hi Maud,
Looked into set_time_limit and even tried running it with a value of "120" but
it didn't help...
I'm affraid I have a problem with the way the 2 while loops are interacting and
creating a infinite loop...
BUT... I'm thinking there must be a better way... Maybe a while with a foreach?
Now I'm just thinking outloud :)
Jason Pruim
[email protected]
--- End Message ---
--- Begin Message ---
>
> basically all I'm trying to do is generate the last 4 digits starting at 0000
> and going up to 9999. for testing purposes I'm just echoing back but will
> eventually insert the complete number back into the database as a 7 digit
> string.
>
> The error I'm getting is:
>
> Fatal error: Maximum execution time of 30 seconds exceeded in
> /home/pruimpho/public_html/jason/dev/clients/flewid/Phone/config/phoneareacodes.php
> on line25
>
I'm not sure the to while loops is the best control structure.
Why not try the following and see if it gets you the results you want?
__untested__
while($row = mysql_fetch_assoc($result)) {
if ($num != "10000") && $padnum = number_pad($num, "4")
{
echo $row['areacode'] . "-" . $row['prefix'] . "-" . $padnum . "<BR>";
$num++;
}
--- End Message ---
--- Begin Message ---
when
$num++;
executed
$num will never be '10000';
you may change the while loop to
while ($num < 10000) {
while ($row = ...
2011/8/11 Jason Pruim <[email protected]>
> On Aug 10, 2011, at 9:36 PM, MUAD SHIBANI wrote:
>
> > Basically you can increase time limit for this file to handle your
> request by using
> > set_time_limit function ...
>
> Hi Maud,
>
> Looked into set_time_limit and even tried running it with a value of "120"
> but it didn't help...
>
> I'm affraid I have a problem with the way the 2 while loops are interacting
> and creating a infinite loop...
>
> BUT... I'm thinking there must be a better way... Maybe a while with a
> foreach? Now I'm just thinking outloud :)
>
> Jason Pruim
> [email protected]
>
--- End Message ---
--- Begin Message ---
At 09:22 PM 8/10/2011, Jason Pruim wrote:
So here I am attempting to generate some numbers to be inserted into
a database... eventually they will make up a phone number (Which
I've emailed about before and know about the bad ideas with it.. But
it's the customer :))
Here is the code I am working with:
<?PHP
function number_pad($number,$n) {
return str_pad((int) $number,$n,"0",STR_PAD_LEFT);
}
$SQL = "SELECT * FROM Test WHERE `areacode` = '907' AND `prefix` =
'200' LIMIT 5";
$result = mysql_query($SQL);
while ($num != "10000") {
while($row = mysql_fetch_assoc($result)) {
$padnum = number_pad($num, "4");
echo $row['areacode'] . "-" . $row['prefix'] . "-" .
$padnum . "<BR>";
$num++;
}
}
?>
Try to avoid putting a database query in a loop. In the query only
ask for the fields you are going to use, it's faster. Why use your
own function to pad a string, when there is a built-in function?
Try this code (untested):
<?php
$nums = range(0,9999);
$q = "SELECT areacode, prefix FROM Test WHERE `areacode` = '907' AND
`prefix` = '200' LIMIT 5";
$rs = mysql_query($q);
while ($row = mysql_fetch_assoc($rs)) {
foreach ($nums as $n) {
echo
sprintf('%03d-%03d-%04d',$row['areacode'],$row['prefix'],$n) "<br>\n";
}
}
?>
Ken
--- End Message ---
--- Begin Message ---
Is it possible to concatenate a string and an element from a
mysql_fetch_assoc array? I haven't had much luck searching google.
Such as concatenating "results" with ' . $posts_row['store_tptest'] .
' so that if there are no elements returned nothing will be displayed?
Thank you,
Chris
--- End Message ---
--- Begin Message ---
read the manual
http://www.php.net/manual/en/ref.strings.php
A comprehensive concatenation function, that works with array and strings
<?php
function str_cat() {
$args = func_get_args() ;
// Asserts that every array given as argument is $dim-size.
// Keys in arrays are stripped off.
// If no array is found, $dim stays unset.
foreach($args as $key => $arg) {
if(is_array($arg)) {
if(!isset($dim))
$dim = count($arg) ;
elseif($dim != count($arg))
return FALSE ;
$args[$key] = array_values($arg) ;
}
}
// Concatenation
if(isset($dim)) {
$result = array() ;
for($i=0;$i<$dim;$i++) {
$result[$i] = '' ;
foreach($args as $arg)
$result[$i] .= ( is_array($arg) ? $arg[$i] : $arg ) ;
}
return $result ;
} else {
return implode($args) ;
}
}
?>
A simple example :
<?php
str_cat(array(1,2,3), '-', array('foo' => 'foo', 'bar' => 'bar', 'noop' =>
'noop')) ;
?>
will return :
Array (
[0] => 1-foo
[1] => 2-bar
[2] => 3-noop
)
More usefull :
<?php
$myget = $_GET ; // retrieving previous $_GET values
$myget['foo'] = 'b a r' ; // changing one value
$myget = str_cat(array_keys($myget), '=', array_map('rawurlencode',
array_values($myget))) ;
$querystring = implode(ini_get('arg_separator.output'), $myget)) ;
?>
will return a valid querystring with some values changed.
Note that <?php str_cat('foo', '&', 'bar') ; ?> will return 'foo&bar',
while <?php str_cat(array('foo'), '&', 'bar') ; ?> will return array(0 =>
foo&bar)
*t0russ at gmail dot com* 14-Jun-2005
05:38<http://www.php.net/manual/en/ref.strings.php#53834>
to kristin at greenaple dot on dot ca:
thanx for sharing.
your function in recursive form proved to be slightly faster and it returns
false (as it should) when the character is not found instead of number 0:
<?php
function strnposr($haystack, $needle, $occurance, $pos = 0) {
return ($occurance<2)?strpos($haystack, $needle,$pos):strnposr($haystack
,$needle,$occurance-1,strpos($haystack, $needle, $pos) + 1);
}
?>
--- End Message ---
--- Begin Message ---
At 12:03 AM 8/11/2011, Chris Stinemetz wrote:
Is it possible to concatenate a string and an element from a
mysql_fetch_assoc array? I haven't had much luck searching google.
Such as concatenating "results" with ' . $posts_row['store_tptest'] .
' so that if there are no elements returned nothing will be displayed?
Sure, do something like this:
<?php
echo ($posts_row['store_tptest'] != '')?"results
{$posts_row['stor_tptest']}:'';
?>
Ken
--- End Message ---
--- Begin Message ---
So I have:
$result = $dbh->query ("select * from roles order by name");
$row = mysqli_fetch_object ($result);
function process_field ($which) {
// This fails, I need to know how to do this the right way
if ($row->may_$which == 'Y') {
// Print stuff
} else {
// Print other stuff
}
}
There's a field "may_basic" in roles. I need to call
process_field ("basic"). If I need to pass the string "may_basic" it
will work also.
--- End Message ---
--- Begin Message ---
$var = "may_$which";
$row->$var
should so the trick
Kranthi.
http://goo.gl/e6t3
--- End Message ---