NetTalk Central

Author Topic: Variables in XHTML code?  (Read 2827 times)

oeb

  • Newbie
  • *
  • Posts: 33
    • View Profile
    • Email
Variables in XHTML code?
« 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?

--------------------
Ole

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11194
    • View Profile
Re: Variables in XHTML code?
« Reply #1 on: September 16, 2008, 03:37:55 AM »
Hi Ole,

Variables as in fields, Values, or Session Values?

Cheers
Bruce

oeb

  • Newbie
  • *
  • Posts: 33
    • View Profile
    • Email
Re: Variables in XHTML code?
« Reply #2 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'! ;)
--------------------
Ole

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11194
    • View Profile
Re: Variables in XHTML code?
« Reply #3 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

oeb

  • Newbie
  • *
  • Posts: 33
    • View Profile
    • Email
Re: Variables in XHTML code?
« Reply #4 on: September 16, 2008, 11:08:20 PM »
Thanks, that was what I was looking for.
--------------------
Ole