What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » PHP Display Code

Pages: (2): « First [ 1 ] 2 » Last »
PHP Display Code
Author: Message:
DJeX
Veteran Member
*****

Avatar


Posts: 1138
Reputation: 11
– / Male / –
Joined: Jul 2003
O.P. Huh?  PHP Display Code
What php code would I used to display code inside another php file.

Like for example:

Say I have a php file at: http://www.myhost.com/myfolder/test.php

And I want to have a seprate php page to display the php code in that file on the screen. How would I do this?

I thought this may work but I'm not sure.

code:
<?php
echo http://www.myhost.com/myfolder/test.php
?>
[Image: top.gif]
08-17-2005 09:04 PM
Profile PM Web Find Quote Report
Millenium_edition
Veteran Member
*****

Avatar

Posts: 1787
Reputation: 57
Joined: Apr 2003
RE: PHP Display Code
http://www.php.net/include/
08-17-2005 09:06 PM
Profile E-Mail PM Find Quote Report
DJeX
Veteran Member
*****

Avatar


Posts: 1138
Reputation: 11
– / Male / –
Joined: Jul 2003
O.P. Huh?  RE: PHP Display Code
Ok I used this:

code:
<?php

$show = include 'http://www.myhost.com/myfolder/myphp.php;

echo $show;

?>

But it does not show the PHP code of that file it shows the number 1.

Can any one help?
[Image: top.gif]
08-17-2005 09:33 PM
Profile PM Web Find Quote Report
absorbation
Elite Member
*****

Avatar

Posts: 3636
Reputation: 81
– / Male / Flag
Joined: Feb 2005
RE: PHP Display Code
<?PHP



include("name.php");

?>

the page extension must be php :P i use it so i can update pages quicly

This post was edited on 08-17-2005 at 09:38 PM by absorbation.
08-17-2005 09:37 PM
Profile PM Find Quote Report
DJeX
Veteran Member
*****

Avatar


Posts: 1138
Reputation: 11
– / Male / –
Joined: Jul 2003
O.P. RE: PHP Display Code
Will that display the code of a php file on the screen?
[Image: top.gif]
08-17-2005 09:42 PM
Profile PM Web Find Quote Report
segosa
Community's Choice
*****


Posts: 1407
Reputation: 92
Joined: Feb 2003
RE: PHP Display Code
The php file will be parsed on the remote server before being downloaded.. so no, it won't. Change the file on the remote server to .txt so no parsing is done if you want the code to be downloaded.

If you don't want it parsed locally, you can't use include() either. try readfile();
The previous sentence is false. The following sentence is true.
08-17-2005 09:43 PM
Profile PM Find Quote Report
Stigmata
Veteran Member
*****



Posts: 3520
Reputation: 45
21 / Other / Flag
Joined: Jul 2003
RE: PHP Display Code
dude...

http://uk2.php.net/show_source

08-17-2005 09:46 PM
Profile PM Web Find Quote Report
wj
Former Admin
*****

Avatar
I aim to misbehave.

Posts: 2224
Reputation: 52
39 / – / Flag
Joined: Mar 2002
RE: PHP Display Code
http://us2.php.net/manual/en/function.highlight-file.php
"A towel is about the most massively useful
thing an interstellar hitchhiker can have."
08-17-2005 09:46 PM
Profile PM Find Quote Report
Stigmata
Veteran Member
*****



Posts: 3520
Reputation: 45
21 / Other / Flag
Joined: Jul 2003
RE: PHP Display Code
quote:
Originally posted by wj
http://us2.php.net/manual/en/function.highlight-file.php

beat you to it :D


08-17-2005 09:50 PM
Profile PM Web Find Quote Report
DJeX
Veteran Member
*****

Avatar


Posts: 1138
Reputation: 11
– / Male / –
Joined: Jul 2003
O.P. RE: PHP Display Code
how would I use highlight_file()?
[Image: top.gif]
08-17-2005 10:27 PM
Profile PM Web Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On