PHP variable not showing

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
IMPORTANT NOTE!!

DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.



PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Post Reply
frafi
 
 
Posts: 12
Joined: Thu Apr 01, 2021 9:18 am

PHP variable not showing

Post by frafi »

Hello,

in the custom form processing if have the php-code:
$var = "TEST";

in the editbox of the success page:
$var

user defined variables and the vars from hidden fields work but i cannot show this php one.

What could it be?

Franz
User avatar
BaconFries
 
 
Posts: 5328
Joined: Thu Aug 16, 2007 7:32 pm

Re: PHP variable not showing

Post by BaconFries »

The success and error page should only be html and not contain any php due to it requiring to be processed on the server.
User avatar
Pablo
 
Posts: 21577
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PHP variable not showing

Post by Pablo »

PHP variables are only valid within the current context.
If you want to transfer a value from one page to another, then you will need to use cookies or sessions.

Note that this is not specific to WWB.
frafi
 
 
Posts: 12
Joined: Thu Apr 01, 2021 9:18 am

Re: PHP variable not showing

Post by frafi »

thanks both for the explanation
frafi
 
 
Posts: 12
Joined: Thu Apr 01, 2021 9:18 am

Re: PHP variable not showing

Post by frafi »

Okay, i am now running into another problem.

The project has a page1 with an inline frame and a page2.

In page2 i have defined a php variable in the head and want to give it out in a html table in the same page.
No problem so far when i open the page2 directly, localhost/test/page2.php, the variable is shown.

Running the site from page1 and page2 is called into the iframe from a button then the variable is not there.
Something must undefine the variable.

I am new here and your advice is greatly appreciated.
User avatar
Pablo
 
Posts: 21577
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PHP variable not showing

Post by Pablo »

An inline frame is a different page so variables from another page are not valid.

Please note that this is unrelated to WWB. We cannot teach you how to write PHP code.
But any code that work in another program will also work with WWB.
frafi
 
 
Posts: 12
Joined: Thu Apr 01, 2021 9:18 am

Re: PHP variable not showing

Post by frafi »

My post was not clear enough.
My code works well in the page2.php. localhost\test\page2.php manually started.
Loading it in the iframe frome page1 the vars are gone.
The code in page2.php have not changed.
Why?
User avatar
Pablo
 
Posts: 21577
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PHP variable not showing

Post by Pablo »

Without knowing the code, it will be difficult to say anything meaningful about this.
Note however that this has nothing to do with WYSIWYG Web Builder.
Post Reply