RE: [PHP] Question on sending PhP variable results to an HTML page to be displayed.

This is a discussion on RE: [PHP] Question on sending PhP variable results to an HTML page to be displayed. within the PHP General forums, part of the PHP Programming Forums category; [snip] If you use the date function in PhP you can get the date and it will not change in ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-01-2003
Jay Blanchard
 
Posts: n/a
Default RE: [PHP] Question on sending PhP variable results to an HTML page to be displayed.

[snip]
If you use the date function in PhP you can get the date and it will not
change in the cache since the actual code is not on the page that
generated
it.

My question is how do I get the answer that I have in a PHP variable
back to
an HTML page and give it lets say to JavaScript to display.
[/snip]

Why do you need to give it to JavaScript to display? Consider this in
your HTML ....

<?php echo date("m - d - Y"); ?><br>
Reply With Quote
  #2 (permalink)  
Old 12-01-2003
Al Costanzo
 
Posts: n/a
Default Re: [PHP] Question on sending PhP variable results to an HTML page to be displayed.

Hi Jay,

This will not work because the page in question ends in .HTML but I did
discover a way to do what I need and an answer to many other posts.

Here is the answer:

To make a PHP command to execute on a .html page create another page ending
in .php with the code there. Where you need to display this in your .html
page use the <IFRAME> html tag. It works just fine.

A person gave me this idea by emailing me and saying why not use a frameset
to do this. This is kinda what IFRAME does but it is more like a little
window. Same concept but it does not interfere with how a search engine
indexes a website.

Anyone interested in seeing the resulting code, it is located at:
http://www.dynamicsubmission.com and a one line php program returns the date
to the page.

I would like to thank everyone for their ideas and this is a very useful
resource to have.

I may know a great deal about seach engines, but when it comes to php...
well ... thanks for the help!

Al Costanzo
----- Original Message -----
From: "Jay Blanchard" <jay.blanchard@niicommunications.com>
To: "Al Costanzo" <al@akc.com>; <php-general@lists.php.net>
Sent: Monday, December 01, 2003 8:49 AM
Subject: RE: [php] Question on sending PhP variable results to an HTML page
to be displayed.


[snip]
If you use the date function in PhP you can get the date and it will not
change in the cache since the actual code is not on the page that
generated
it.

My question is how do I get the answer that I have in a PHP variable
back to
an HTML page and give it lets say to JavaScript to display.
[/snip]

Why do you need to give it to JavaScript to display? Consider this in
your HTML ....

<?php echo date("m - d - Y"); ?><br>
Reply With Quote
  #3 (permalink)  
Old 12-01-2003
Jon Bennett
 
Posts: n/a
Default Re: [PHP] Question on sending PhP variable results to an HTML page to be displayed.

Hi Al,

I'd add a scrolling tag to your iFrame, as you won't ever need it to
scroll.

<iframe width=550 height=25 scrolling=false marginwidth=0
marginheight=0 frameborder=0 scrolling ="no" src="cache.php"></iframe>

hth

Thanks,

Jon


jon bennett | jon@jben.net
new media designer / developer
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

J b e n . n e t

91 Gloucester Rd, Trowbridge, Wilts, BA14 0AD
t: +44 (0) 1225 341039 w: http://www.jben.net/


On 1 Dec 2003, at 14:04, Al Costanzo wrote:

> Hi Jay,
>
> This will not work because the page in question ends in .HTML but I did
> discover a way to do what I need and an answer to many other posts.
>
> Here is the answer:
>
> To make a PHP command to execute on a .html page create another page
> ending
> in .php with the code there. Where you need to display this in your
> .html
> page use the <IFRAME> html tag. It works just fine.
>
> A person gave me this idea by emailing me and saying why not use a
> frameset
> to do this. This is kinda what IFRAME does but it is more like a little
> window. Same concept but it does not interfere with how a search
> engine
> indexes a website.
>
> Anyone interested in seeing the resulting code, it is located at:
> http://www.dynamicsubmission.com and a one line php program returns
> the date
> to the page.
>
> I would like to thank everyone for their ideas and this is a very
> useful
> resource to have.
>
> I may know a great deal about seach engines, but when it comes to
> php...
> well ... thanks for the help!
>
> Al Costanzo
> ----- Original Message -----
> From: "Jay Blanchard" <jay.blanchard@niicommunications.com>
> To: "Al Costanzo" <al@akc.com>; <php-general@lists.php.net>
> Sent: Monday, December 01, 2003 8:49 AM
> Subject: RE: [php] Question on sending PhP variable results to an HTML
> page
> to be displayed.
>
>
> [snip]
> If you use the date function in PhP you can get the date and it will
> not
> change in the cache since the actual code is not on the page that
> generated
> it.
>
> My question is how do I get the answer that I have in a PHP variable
> back to
> an HTML page and give it lets say to JavaScript to display.
> [/snip]
>
> Why do you need to give it to JavaScript to display? Consider this in
> your HTML ....
>
> <?php echo date("m - d - Y"); ?><br>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Reply With Quote
  #4 (permalink)  
Old 12-01-2003
Chris Shiflett
 
Posts: n/a
Default Re: [PHP] Question on sending PhP variable results to an HTML page to be displayed.

--- Al Costanzo <al@akc.com> wrote:
> This will not work because the page in question ends in .HTML but I
> did discover a way to do what I need and an answer to many other
> posts.
>
> Here is the answer:
>
> To make a PHP command to execute on a .html page create another page
> ending in .php with the code there. Where you need to display this in
> your .html page use the <IFRAME> html tag. It works just fine.


This will work, but it sure seems ugly. There are possibly better
alternatives for you. For example, you can make your Web server interpret
..html files as PHP, or you can use the proper .php extension.

Are either of these a possibility for you?

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
Coming mid-2004
HTTP Developer's Handbook
http://httphandbook.org/
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:19 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0