[Pro] Using PHP Use Include Pages

How to you position PHP using the Action PHP Use Include Pages? I have placed the Action on the page and positioned the box where I would like to see the information, but no matter what I do, the PHP ends up at the top of the browser page, above my masthead and navigation fields.

Any help would be greatly appreciated. Thank you.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

What sort of content are you trying to include in your page?

Is it another complete page or just a snippet?

Can you also post a link to your page online so that we can see what is going on.

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Note:

This Action will insert PHP code contained in the Actions PHP Mark Up, MySQL Connect and MySQL Get Records. The PHP code is inserted at the top of the page.

So this action is really for the underlying code to connect to the database (or similar) - not to actually display the result in the body of the page.

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

David,
The content is a directory. I am inserting a page or php code into my FWY file. My page is output as the index.php page which links to other php files within the directory. The website uses php and a mysql database.

I originally inserted the php code directly into a Markup Item. But a problem persists. If you register and then try to login, it takes you to the “Continue to My Account Page” as it should, but when you continue, it take you back to the Client Sign In page. It should take you to your account.

Everything else in the site works just fine. So I started stripping the code from the FW output index.php file using DW and the only way it works is without the FW code. But if I insert the php code using PHP Use Include Page, it works. I just need to be able to place the php in the middle of the page and not at the top of the page.

You can give it a try at www.freewayDRIVERS.com. Use the Username: “cindy” and the Password: “shop” to test the page if you like.

Thanks for any help you can give me.

Kim


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

David,
I used an iFrame to add the php and that worked, but is there a way to make the iFrame variable size? In other words, if the user wants to show 50 listings instead of 5, I need the webpage/iFrame to expand in height. I don’t want it to be a fixed height.

Thanks again.

Kim


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

The page that you’re trying to insert inside another page – is it a
complete page, with head and body tags, or is it a fragment containing
only the table of results?

If the former, you cannot use anything besides the hack you settled on
(the iframe) to add it to another page.

But if you have control over the code that generates the table, and
you can change it so that all it outputs is the table (without any
surrounding HTML) then you can insert that anywhere you like on your
page using a Markup Item, and the result will be a much more finely
controlled layout, without any need for JavaScript hacks to resize an
iframe.

Let’s say your script is called table_listing.php and it lives inside
the same folder as your index.php page. Remove any Actions like PHP
Use Insert Page or whatever from index.php. Then while nothing on the
page is selected, choose Insert / Markup Item from the main menu. You
will see a dialog on the page. In that dialog, add the following code:

<?php require_once('table_listing.php'); ?>

Okay the dialog, and you will see a 100px square box on your page, in
the middle of the screen. Resize and position this box to be where you
expect your table to appear. Upload to your server (and make sure that
table_listing.php is in the same folder as the resulting page) and
visit in your browser. You should see the table in the middle of your
page.

If you want to ensure that the rest of the page can shrink and grow
around this element, the quickest way is to un-check the Layer box in
the Inspector for each element on your page. The outline of the
element should become blue where it was previously green. A table-
based layout like this can expand and contract to suit the content.
(Note that this will not work for your iframe – before you ask. That
solution is like cutting a window in your page and using it to view a
distant harbor. No matter how many boats enter the harbor, your window
won’t ever get larger, because the boats don’t actually occupy any
space in your window.)

As far as your login not being set properly, that sounds like it might
be a PHP error, or a logical error in the way the application was
coded. If the login is being stored in a session, you cannot read the
session cookie back again until you completely reload the page. And if
the cookie isn’t coded to save the reference to your entire domain
rather than a particular folder, then you won’t be able to access the
cookie from anywhere besides that folder. There’s lots of other
reasons why this might not work, those are off the top of my head. To
turn on strict PHP error checking, add the following to the very top
of your outermost PHP page (so probably your index.php, since that
includes the other page):

<?php ini_set('display_errors',1); error_reporting(E_ALL); ?>

You have to get this above the first line of any other code, so you
might want to try doing this with a text editor, upload the file, and
test in your browser. Note that when you next publish from Freeway,
this line will be stripped out, and you’ll have to hand-enter it again.

Walter

On Aug 17, 2011, at 11:53 AM, kdcs wrote:

David,
The content is a directory. I am inserting a page or php code into
my FWY file. My page is output as the index.php page which links to
other php files within the directory. The website uses php and a
mysql database.

I originally inserted the php code directly into a Markup Item. But
a problem persists. If you register and then try to login, it takes
you to the “Continue to My Account Page” as it should, but when you
continue, it take you back to the Client Sign In page. It should
take you to your account.

Everything else in the site works just fine. So I started stripping
the code from the FW output index.php file using DW and the only way
it works is without the FW code. But if I insert the php code using
PHP Use Include Page, it works. I just need to be able to place the
php in the middle of the page and not at the top of the page.

You can give it a try at www.freewayDRIVERS.com. Use the Username:
“cindy” and the Password: “shop” to test the page if you like.

Thanks for any help you can give me.

Kim


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

David, Sorry, I got pulled away to another job and was working on it until midnight. Anyway, your script works like a charm. All I need to do is fix the php to let me login. Not sure what that’s all about. Your error script did find one thing, but not what is causing the login problem. I will keep working on it.

Thanks again for the help. It is much appreciated.

Kim


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options