Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Using a scripting language to return a list of files in a directory

Featured Replies

This follows on from a question that came up in a topic about getting the html contents of a file using php: Can php return a list of files in a directory, so that the pages that make up the site can be listed?

 

I've used shell scripts, like bash on linux. Is there anything similar in php for navigating and new file creation/deletion ?

This follows on from a question that came up in a topic about getting the html contents of a file using php: Can php return a list of files in a directory, so that the pages that make up the site can be listed?

 

I've used shell scripts, like bash on linux. Is there anything similar in php for navigating and new file creation/deletion ?

 

glob() is your friend.

  • Author

I've had more success than I'd dared to hope for. I've got a form that works with ckEditor and sends results to a page which shows the user a preview and let's them save. However, when I try to save the results, the file that's created shows up like this in the browser:

<html> <head> <title></title> </head> <body> <p> Type, slice, put pictures in to make a new page look good!</p> </body> </html>

 

Which should be the source of the page, not what is displayed. When I look at the source code of the page it looks like this:

 

&lt;html&gt;
&lt;head&gt;
	&lt;title&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;p&gt;
		Type, slice, put pictures in to make a new page look good!&lt;/p&gt;
&lt;/body&gt;

&lt;/html&gt;

 

There must be something I can do before writing to the new file created to make it save in an HTML friendly way.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.