NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: oeb on September 16, 2008, 03:29:04 AM

Title: Variables in XHTML code?
Post by: oeb on September 16, 2008, 03:29:04 AM
Is there a way to add variables to XHTML code? So far I've manually coded packet = '(..)'/ DO SendPacket, but is there a simpler/ better way?

Title: Re: Variables in XHTML code?
Post by: Bruce on September 16, 2008, 03:37:55 AM
Hi Ole,

Variables as in fields, Values, or Session Values?

Cheers
Bruce
Title: Re: Variables in XHTML code?
Post by: oeb on September 16, 2008, 03:58:17 AM
Well, all of them :). I just want to view the current value of the variable/ field as text of course.

Like the echo-command in php: 
echo ("Number of messages arrived: $msgs");
echo ("There are $total_msgs in the folder.");

As you understand, I come from the 'php world'! ;)
Title: Re: Variables in XHTML code?
Post by: Bruce on September 16, 2008, 05:55:26 AM
Hi Ole,

The problem with "current value" is that it doesn't mean much, because it's Dependant on the context.

Are you setting the value of this variable inside this procedure? Or are you expecting it to be set by a calling procedure?

PHP is similar in the sense that they also have session variables. Which are ideally what you want to be using. In other words, in nettalk

p_web.SSV('variablename','variablevalue')
or if you prefer the long-hand
p_web.SetSessionValue('variablename','variablevalue')

Session values can be included in your netWebSource as
<!-- Net:s:variableName)

cheers
Bruce
Title: Re: Variables in XHTML code?
Post by: oeb on September 16, 2008, 11:08:20 PM
Thanks, that was what I was looking for.