Page 1 of 1

Formulário e $_SESSION

Posted: Mon Apr 26, 2021 8:50 pm
by marcelonarezzi
Olá pessoal

Sou novo no WWB, já consegui fazer algumas coisas com a ferramenta.

A questão no momento é como capturar o resultado de uma
$_SESSION['ret_mensagem']='Seja Bem Vindo';
que veio do PHP e preciso preencher um editBox ou um Text ou um Label com o conteúdo da $_SESSION dentro do HTML

Alguém pode me ajudar ?

Re: Formulário e $_SESSION

Posted: Mon Apr 26, 2021 9:51 pm
by marcelonarezzi
Hey guys

I'm new to the WWB, I've already managed to do some things with the tool.

The question at the moment is how to capture the result of a
$ _SESSION ['ret_mensagem'] = 'Welcome';
that came from PHP and I need to fill an editBox or a Text or a Label with the contents of $ _SESSION inside the HTML

Can someone help me ?

Re: Formulário e $_SESSION

Posted: Tue Apr 27, 2021 12:34 am
by MGD4me
First, make sure that the webpage is set to 'php' in the Page Properties (not HTML).

Go to Page HTML and see if it begins with:

<?php
session_start();


If not, you will have to add this php code to ensure any SESSIONs will be included on your webpage.

Then where you would like to display the SESSION contents, insert:

echo "$ _SESSION ['ret_mensagem']";

This will work providing the echo statement is already inside <?php ... ?> code tags. If it is part of HTML code, then you would need instead:

<?php echo "$ _SESSION ['ret_mensagem']"; ?>

Re: Formulário e $_SESSION

Posted: Tue Apr 27, 2021 2:44 am
by marcelonarezzi
caríssimo MGD4me

Agradeço muito por sua disposição em me auxiliar.
a) página inicial chama-se index.php;
b) [Page HTML]->[Start of page] já contém

Code: Select all

<?php 
  session_start();
?>
Essa informação que você me passou, não tenho dificuldade. Até ai, com muita leitura eu já havia chegado.
A dificuldade é como e em que momento, posso adicionar o conteúdo da sessão dentro de uma página HTML

Code: Select all

<?php echo "$_SESSION['ret_mensagem'];"?>
num editbox por exemplo.

a dificuldade está de fato dentro do WWB

Devo usar javascript para capturar o elemento e substituir ?
Se for, em que momento ? em qual intervalo da página, pois assim estou entendendo, mas infelizmente não estou conseguindo executar o desejado.

se você puder me exemplificar, creio que eu consiga entender melhor.

como se diz aqui no Brasil "será que daria para desenhar" ? rsrsrs

muito obrigado