473,750 Members | 2,583 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 1684
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
2434
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
40756
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
31244
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
13459
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
6024
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
5624
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
1152
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
2593
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
23167
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
3106
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
8838
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9583
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
9396
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9342
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
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...
1
6808
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
6081
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
4716
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...
2
2807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.