Hi,
I am new to PHP. I had to block some pages from viewing by everyone. How can I do that?
Thanks
Resmi318
17 1692
Hi resmi318 and welcome to TSDN!!
Could you elaborate on your question - where is the page you want to block being served from - is it a page within a PHP app ? - do you want to block everyone from seeing it or allow a restricted level of access ?
Purple
Hi resmi318 and welcome to TSDN!!
Could you elaborate on your question - where is the page you want to block being served from - is it a page within a PHP app ? - do you want to block everyone from seeing it or allow a restricted level of access ?
Purple
Hi Purple,
I need to allow a restricted level of access. Actually I am totally new to PHP and website development. I didnt get what you mean by a page within a PHP app.
Thanks
Resmi318
Heya, resmi318.
You have a couple of options. If you need to block a page for certain IP addresses or domains, you should have a look at setting up .htaccess files.
On the other hand, if you want to create a 'members-only' section on your website, you'll want to learn more about creating a PHP login script. The linked article is a little complicated at first glance, but if you take it slow, it should help you get started.
i have a working login script, it uses a session varaible. Basically put, you make a login page that sets a session varaible. Then you just throw this schnazzy little code in the top of your private pages that retreives the session varaible, determines if it it valid, and if it is it will display the page, if it is not valid, it will redirect the browser to a error page, or a login page, or a what the heck are you trying to do page. It is entirely customizeable, and it is really great. It saves the fact that the user is logged in untill the user goes to the logout page, or unless the user closes his/her browser. If you want the script, PM me.
i have a working login script, it uses a session varaible. Basically put, you make a login page that sets a session varaible. Then you just throw this schnazzy little code in the top of your private pages that retreives the session varaible, determines if it it valid, and if it is it will display the page, if it is not valid, it will redirect the browser to a error page, or a login page, or a what the heck are you trying to do page. It is entirely customizeable, and it is really great. It saves the fact that the user is logged in untill the user goes to the logout page, or unless the user closes his/her browser. If you want the script, PM me.
Hi,
Thanks. I need the script. How can I PM you? What is your mail id?
Thanks
Resmi318
Heya, resmi318.
You have a couple of options. If you need to block a page for certain IP addresses or domains, you should have a look at setting up .htaccess files.
On the other hand, if you want to create a 'members-only' section on your website, you'll want to learn more about creating a PHP login script. The linked article is a little complicated at first glance, but if you take it slow, it should help you get started.
Hi pbmods,
Thanks. I will go through the sites mentioned by you.
Resmi318
Hi,
Thanks. I need the script. How can I PM you? What is your mail id?
Thanks
Resmi318
you would click my name, and then click Private Message, but ill just post the code here so everybody can see it and use it...
watch for my next post
you would click my name, and then click Private Message, but ill just post the code here so everybody can see it and use it...
That sounds like an excellent idea.
you would click my name, and then click Private Message, but ill just post the code here so everybody can see it and use it...
watch for my next post
Hi eragon,
Waiting for the script.
Thanks
Resmi318
Hi eragon,
Waiting for the script.
Thanks
Resmi318
oh, terribly sorry, im making it an article... ill post a link when im done
There you go.... A session perfect for a secure access
There you go.... A session perfect for a secure access
so i suppose there are no flaws?
so i suppose there are no flaws?
There is only one thing...
you forgot to put
session_start();
on the top page of Secure Page Script B
Hi,
Thanks eragon for the script.
no problem... if you have anything else you want, feel free to ask, i know lots about PHP now.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: . . |
last post by:
Hi
I need some help with java script . I have a ASPX page that is pulling a
user message heading from the table on the page . The user message
header has message body which suppose to dispay...
|
by: sklett |
last post by:
Hi-
I understand that the Page class has methods for inserting client script
into the page. I don't want to build my entire client block w/ a
StringBuilder because I only need 1 dynamic...
|
by: Brett Robichaud |
last post by:
I understand how code-behind can handle events for a page, but can I call a
code-behind method from within a <script> tag in my ASP.Net page, or can I
only call methods defined in other <script>...
|
by: Steve Richter |
last post by:
I have a .cs file that contains the c# script of a page:
<script language="c#" runat=server src="item.cs"/>
The file item.cs contains c# code that contains a namespace:
namespace ItemPages
{...
|
by: ruca |
last post by:
Hi,
Can I call two script blocks for different languages in my ASP.NET code?
I have a button than when clicked it must open a popup window to return some
values for two other controls that I...
|
by: RFS666 |
last post by:
Hello,
I would like to use variables with a type in jscript.NET.
I declare them as follows:
var x : double = 5.03;
This doesn't work in my script, that I write to the page in codebehind with...
|
by: lechatthierry |
last post by:
Is it possible to block a mouse event on an Hyperlink with a general
script event?
This is quite troublesome for me. I am trying to find a way to block
the windows shortcut SHIFT + MOUSE LEFT...
|
by: Neko |
last post by:
Is it possible to block a mouse event on an Hyperlink with a general
script event?
This is quite troublesome for me. I am trying to find a way to block
the windows shortcut SHIFT + MOUSE LEFT...
|
by: ethandbrown |
last post by:
Hi All--
I'm a bit stymied here. I need to display arbitrary HTML obtained
through AJAX. The problem is when a <script> block is encountered
one can't use innerHTML to set the content, because...
|
by: PJ |
last post by:
Greetings...
I have stumbled upon a small problem.
I use Ajax to retrieve part of a page I need to update. I update a DIV
element with the HTML contents I get from another page.
It works...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
| |