473,700 Members | 2,727 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to display PHP without running script

Hi,

I have a page that basically just displays a directory listing of gif
files (along with displaying the file)..
http://gummibearheads.com/ign/icons/iconpage.php
In case you were wondering, they are avatars for a message board...

I want to be able to show visitors the php code if they want to do the
same thing. Its there a way to do this besides copying the file and
making it a text file?

Before you ask, I dont have any passwords or such listed in there...
Jul 17 '05 #1
3 1682
Mark Gray wrote:
I want to be able to show visitors the php code if they want to do the
same thing. Its there a way to do this besides copying the file and
making it a text file?

Copy it to iconpage.phps (or make a symbolic link) and go to
http://yourserver/whatever.phps

NB: The web server must be properly configured to handle phps files.

Or you can use the highlight_file( ) function.
http://www.php.net/highlight_file

All the pages on the PHP site have a "Show source" link at the bottom.
You can copy the way they did it.
http://www.php.net/source.php?url=/index.php

--
USENET would be a better place if everybody read: : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
http://www.expita.com/nomime.html : to 10K bytes :
Jul 17 '05 #2
In article <e9************ **************@ posting.google. com>, Mark Gray wrote:
I have a page that basically just displays a directory listing of gif
files (along with displaying the file)..
http://gummibearheads.com/ign/icons/iconpage.php
In case you were wondering, they are avatars for a message board...

I want to be able to show visitors the php code if they want to do the
same thing. Its there a way to do this besides copying the file and
making it a text file?


viewsource.php

<?php readfile('iconp age.php'); ?>

--
http://home.mysth.be/~timvw
Jul 17 '05 #3
"Mark Gray" <pe******@yahoo .com> wrote in message
news:e9******** *************** ***@posting.goo gle.com...
Hi,

I have a page that basically just displays a directory listing of gif
files (along with displaying the file)..
http://gummibearheads.com/ign/icons/iconpage.php
In case you were wondering, they are avatars for a message board...

I want to be able to show visitors the php code if they want to do the
same thing. Its there a way to do this besides copying the file and
making it a text file?

Before you ask, I dont have any passwords or such listed in there...


show_source($fi lename);
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2432
by: Hemanth | last post by:
Hello there, I've a utility that runs on a linux machine. Basically, it opens a window, draws a figure and captures the image (screen) and stores it as a jpeg file. The utility requires a window to be open (or displayed) inorder to save the image. Also, this utility is in the form of an executable, so I can't possibly alter it. I want to run this utility from a windows web browser and display the saved jpeg file. I pass some command...
13
40744
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div style="display:none"> can be displayed by setting the style attribute to "display:", or hidden with "display:none". This gives the illusion that the person filling out the form is switching from page to page...without the overhead of extra hits on the server,...
9
31240
by: yezanxiong | last post by:
Hello all, I am new in asp.net developer,I would like to ask a simple question. how to display a message box in web application using asp.net? If I just use Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click MsgBox("please enter the correct user name and password",
10
13454
by: DettCom | last post by:
Hello, I would like to be able to display or hide fields based on whether a specific Yes/No radio button is selected. This is in conjunction with a posting a just made here in the same group related to checkboxes. Thanks!!!
1
6017
by: Anonieko | last post by:
Query: How to display progress bar for long running page Answer: Yet another solution. REFERENCE: http://www.eggheadcafe.com/articles/20050108.asp My only regret is that when click the browser back button, it loads the progress bar again. Any solution to this?
4
5617
by: drew197 | last post by:
I am a newbie. I am editing someone elses code to make it compatible with Firefox and Safari. In IE, when you click on the proper link, a block of text is shown in a nice paragraph form. But, in FireFox and Safari it appears as a narrow column of text with only 2-3 words per line. Here is the code: function showAll()
1
1151
by: andre.labonte | last post by:
Hi! I have a script that is taking some time to run and in my page, i've placed some comments to be displayed on the webpage so I can know what the script is currently running. Unfortunately, the HTML page is displayed ONLY when the script is entirely finished. I'd like the comments placed within the script to be displayed as soon as the script is reading them, not at the end!
9
2588
by: tshad | last post by:
This was posted before but the message got messed up (all NLs were stripped out for some reason). I have 2 labels that hold the name of different images on my .aspx page. <asp:Label ID="Logo" runat="server"/> <asp:Label ID="CompanyPicture" runat="server"/> I have 2 links that open the windows to preview these images. The previewed images are done on separate html pages that do nothing but display the
14
23158
by: lmttag | last post by:
Hello. We're developing an ASP.NET 2.0 (C#) application and we're trying to AJAX-enable it. We're having problem with a page not showing the page while a long-running process is executing. So, we're looking for a way to display the page with a "please wait..." message while the process is running, and then, when the process is done, update the page with the actual results/page content. We have a page that opens another browser/page...
4
3102
by: Mantorok | last post by:
Hi ASP.Net v2.0 I have a page and, depending on circumstances, it can sometimes take between 10-30 seconds to load, this is due to a dependency on a 3rd party web-service that is very slow.. Is there anyway of informing the user that the server hasn't died and that the page is busy fetching results?
0
9204
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8914
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7799
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6557
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5897
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4650
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2021
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.