Jump to content

how a page invisible from Internet


adrianmak
 Share

Recommended Posts

I'm going to build a course application form. The submitted form data will be saved as page.

These are pesudo steps

1. create an application form template and add fields.

Should the template associated with a template file ? since the data will be shown to the Internet visitors, just for back-end admin

2. create a new page /application-form-submission

How to prevent others to know the url exist accidentally?

Link to comment
Share on other sites

If you don’t set a template file, the URL will show the 404 page, as if the page didn’t exist. Logged in users would still be able to view the page’s content in the admin backend.

If you want to have a page with a visible template that can’t be accessed by guest users, you can check if the user is logged in. If not, you throw a 404 Exception.

<?php

if($user->isLoggedin() != true) {
    throw new Wire404Exception();
}

// normal template code
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...