php variable to be displayed as text on the site

Discussions and Questions about Fusion 9
Stevem
Posts: 5
Joined: Wed Feb 25, 2009 4:44 am

php variable to be displayed as text on the site

Postby Stevem » Wed Feb 25, 2009 10:33 am

Hi

New to this forum so any help appreciated.

Not very technically minded but pick things up by trial and error.

At the moment I am stuck.

I have a variable as part of the url

http://www.saveandsupport.com/test/inde ... &id=853053

Now I want to just take the name of the cause, in this case Withdean FC, and put it on the web page.

How do I do that?

I can put it in a form entry field but I just want it as text?

I am sure that it is something obvious.

Also, should I really upgrade to version 11? is it worthwhile and is there a version 12 around the corner?

User avatar
admin
Site Admin
Posts: 1303
Joined: Mon Oct 24, 2005 2:07 am
Location: Stuart, FL
Contact:

Re: php variable to be displayed as text on the site

Postby admin » Wed Feb 25, 2009 11:21 am

Hi

New to this forum so any help appreciated.

Not very technically minded but pick things up by trial and error.

At the moment I am stuck.

I have a variable as part of the url

http://www.saveandsupport.com/test/inde ... &id=853053

Now I want to just take the name of the cause, in this case Withdean FC, and put it on the web page.

How do I do that?

I can put it in a form entry field but I just want it as text?

I am sure that it is something obvious.

Also, should I really upgrade to version 11? is it worthwhile and is there a version 12 around the corner?

Fusion 11 has some nice features that 9 lacks.

It's up to you to decide if those features are important to you.

I'd upgrade... but that's just me. :wink:

When you include a properly formatted variable in a link URL (spaces aren't allowed), the variable is stored in the PHP GET array on the destination page.

You can then display the variable "as is"from the array or convert it to a simple variable like $varname, and then use an echo to display it.

To do so, you don't just type the PHP code on your page in a text box or table cell.

You use the Insert HTML function to place the code.

In a text box, with the text cursor selected, press Ctrl+T. enter the PHP code there.

Like: <? echo "$varname"; ?> for example.

Take a look at my tutorials on using PHP and MySQL with Fusion.

You'll find a link to them on the Resources page on the main Beyond Fusion site.

Admin Chuck

Stevem
Posts: 5
Joined: Wed Feb 25, 2009 4:44 am

Re: php variable to be displayed as text on the site

Postby Stevem » Wed Feb 25, 2009 12:34 pm

Chuck

Many thanks. Sorted it out straight away.

http://www.saveandsupport.com/Supporter ... &id=853053

When is version 12 due out?

User avatar
admin
Site Admin
Posts: 1303
Joined: Mon Oct 24, 2005 2:07 am
Location: Stuart, FL
Contact:

Re: php variable to be displayed as text on the site

Postby admin » Wed Feb 25, 2009 1:33 pm

Chuck

Many thanks. Sorted it out straight away.

http://www.saveandsupport.com/Supporter ... &id=853053

When is version 12 due out?
Glad you got it working.

No idea on 12. Could be a while.

We're still waiting on the next updater for Fusion 11. :wink:

Chuck

Stevem
Posts: 5
Joined: Wed Feb 25, 2009 4:44 am

Re: php variable to be displayed as text on the site

Postby Stevem » Wed Feb 25, 2009 2:33 pm

Chuck

I have worked out how to use the variables in the past and then I have to pass them from page to page in the url which is a pain as it is hard coded so you can not really post it to a test site.

How easy is it, remember I am a non techie, that once you have got the variables from the initial url, to store them somewhere so you can access them?

Is this what cookies are for and is it that difficult. Can Net Objects cope with this?

User avatar
admin
Site Admin
Posts: 1303
Joined: Mon Oct 24, 2005 2:07 am
Location: Stuart, FL
Contact:

Re: php variable to be displayed as text on the site

Postby admin » Wed Feb 25, 2009 2:50 pm

Chuck

I have worked out how to use the variables in the past and then I have to pass them from page to page in the url which is a pain as it is hard coded so you can not really post it to a test site.

How easy is it, remember I am a non techie, that once you have got the variables from the initial url, to store them somewhere so you can access them?

Is this what cookies are for and is it that difficult. Can Net Objects cope with this?
You can use cookies, but I prefer using PHP sessions.

Fusion doesn't care either way. It's just code being added.

Once stored in a session variable (another array), you can use it on other pages involved in the session.

To just have access to it you place a session start function on the very first line of a page. Above the html itself.

Chuck

Stevem
Posts: 5
Joined: Wed Feb 25, 2009 4:44 am

Re: php variable to be displayed as text on the site

Postby Stevem » Wed Feb 25, 2009 3:11 pm

Chuck

I take your word for it.

It does not mean a thing to me. Sorry but our technical abilities are some way apart. :D

Also I can not seem to alter the font of the text displayed on the form via the HTML box you mentioned?

You can change it but it does not seem to save?

Cheers

Steve

User avatar
admin
Site Admin
Posts: 1303
Joined: Mon Oct 24, 2005 2:07 am
Location: Stuart, FL
Contact:

Re: php variable to be displayed as text on the site

Postby admin » Wed Feb 25, 2009 6:31 pm

Chuck

I take your word for it.

It does not mean a thing to me. Sorry but our technical abilities are some way apart. :D

Also I can not seem to alter the font of the text displayed on the form via the HTML box you mentioned?

You can change it but it does not seem to save?

Cheers

Steve
If you add spaces before and after the blue circle with the inverted T that indicates you have inserted code, you can then select the blank text and assign a style to it.

Otherwise it'll take on the style of the text object in your site style.

Chuck

Stevem
Posts: 5
Joined: Wed Feb 25, 2009 4:44 am

Re: php variable to be displayed as text on the site

Postby Stevem » Thu Feb 26, 2009 12:55 pm

Chuck

You kindly wote You can use cookies, but I prefer using PHP sessions.

Fusion doesn't care either way. It's just code being added.

Once stored in a session variable (another array), you can use it on other pages involved in the session.

To just have access to it you place a session start function on the very first line of a page. Above the html itself.

Question

How do you do that and would it mean I do not have to link from every page using the variables.

What code would be needed on the first page?

What code on subsequent pages?

On the other hand would that also mean if the variables werenot in the URL that if someone got 3 pages into the site and then saved as a favourite, the variables would not be there when they came back a few days later?

User avatar
admin
Site Admin
Posts: 1303
Joined: Mon Oct 24, 2005 2:07 am
Location: Stuart, FL
Contact:

Re: php variable to be displayed as text on the site

Postby admin » Thu Feb 26, 2009 3:03 pm

Chuck

You kindly wote You can use cookies, but I prefer using PHP sessions.

Fusion doesn't care either way. It's just code being added.

Once stored in a session variable (another array), you can use it on other pages involved in the session.

To just have access to it you place a session start function on the very first line of a page. Above the html itself.

Question

How do you do that and would it mean I do not have to link from every page using the variables.

What code would be needed on the first page?

What code on subsequent pages?

On the other hand would that also mean if the variables were not in the URL that if someone got 3 pages into the site and then saved as a favourite, the variables would not be there when they came back a few days later?
Can you tell me your logic for using a variable this way?

It would help me to recommend a course of action for you.

Chuck


Return to “Fusion 9”

Who is online

Users browsing this forum: No registered users and 1 guest

cron