Search found 14 matches

by Fran3
Thu Mar 15, 2018 4:25 pm
Forum: PHP coding => General
Topic: How to use header redirect in an IF statement?
Replies: 1
Views: 134

How to use header redirect in an IF statement?

What I want is. something like this... but I'm having trouble making it work. It is at the very top of the page before any html or other output code... session_start(); $user_type = $_SESSION['user_type']; If ($user_type == "admin"){ header('Location: admin_page.php'); exit; } else{ header('Location...
by Fran3
Sat Mar 10, 2018 9:02 am
Forum: PHP coding => General
Topic: session_status() returns what?
Replies: 1
Views: 158

Re: session_status() returns what?

OK, I dug a little more and here is the best answer... from: http://www.xpertdeveloper.com/2012/01/session-status-php-5-4/ session_start(); $status = session_status(); if($status == PHP_SESSION_DISABLED) { echo "Session is Disabled"; } else if($status == PHP_SESSION_NONE ) { echo "Session Enabled bu...
by Fran3
Sat Mar 10, 2018 8:51 am
Forum: PHP coding => General
Topic: session_status() returns what?
Replies: 1
Views: 158

session_status() returns what?

I'm a little confused about what session_status() returns. Try this code... <?php // _DISABLED = 0 // _NONE = 1 // _ACTIVE = 2 echo session_status(); ?> and apparently you get 0, 1, or 2 returned... note three potential values ... a 0 or a 1 or a 2 then I see this example... function is_session_star...
by Fran3
Thu Mar 08, 2018 9:52 am
Forum: Server installation and configuration
Topic: Folder Permissions for new iis local site on Win7 - H E L P !
Replies: 1
Views: 492

Folder Permissions for new iis local site on Win7 - H E L P !

I have iis 7 installed on a Win 7 Pro machine and it works if I put sites in c:\inetpub\wwwroot\ The computer name is computer01 The user name is user01 Now I'm trying to create a new iis site in another folder like C:\Users\user01\Desktop\gDrive\dev_web If anybody can help I would really apriceate ...
by Fran3
Wed Mar 07, 2018 2:47 pm
Forum: PHP coding => General
Topic: Best way to Redirect if user not logged in ?
Replies: 7
Views: 337

Re: Best way to Redirect if user not logged in ?

Yes, I don't use frameworks as I try more or less to be a base coder/programmer and just write and organize the code myself. It seems to me the more you rely on a system to help you produce the software the less you actually write in the language you are using and as time goes on you depend more and...
by Fran3
Wed Mar 07, 2018 11:58 am
Forum: PHP coding => General
Topic: Best way to Redirect if user not logged in ?
Replies: 7
Views: 337

Re: Best way to Redirect if user not logged in ?

So the router or controller... this is like part of an MVC framework ... right?
by Fran3
Wed Mar 07, 2018 6:04 am
Forum: PHP coding => General
Topic: Best way to Redirect if user not logged in ?
Replies: 7
Views: 337

Re: Best way to Redirect if user not logged in ?

Thank you phpRob. Question: Where would you put the function so that it was accessible by every page? Or would you put it in an 'include' file include files are cool for keeping the main page readable alternately putting this three lines of code at the top of each page if(isset($_SESSION['loggedin']...
by Fran3
Tue Mar 06, 2018 4:32 pm
Forum: PHP coding => General
Topic: Best way to Redirect if user not logged in ?
Replies: 7
Views: 337

Best way to Redirect if user not logged in ?

Is this code at the beginning of each page for logged in users... the right way to manage this? <?php // Rediredt the user to the login page if not logged in if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == false) { header('Location: http://www.login.php/'); } // normal page code goes h...
by Fran3
Tue Jan 09, 2018 5:15 am
Forum: PHP & MySQL Security
Topic: Are Passwords encrypted on the client side or server side?
Replies: 3
Views: 726

Re: Are Passwords encrypted on the client side or server side?

Thanks for the reply. We had already planned to use password_hash() and password_verify() But that is done on the server side. I've come to the conclusion that the best way to protect passwords passed from the client to the server is via an SSL connection. Of course this is an expense as the site ha...
by Fran3
Sun Jan 07, 2018 7:30 am
Forum: PHP & MySQL Security
Topic: Are Passwords encrypted on the client side or server side?
Replies: 3
Views: 726

Are Passwords encrypted on the client side or server side?

Case 1: New User Registration Case 2: Existing User Login In either case is the User Password encrypted on the Client Side or the Server Side? Somehow I thought it was encrypted on the client side BUT after discovering the PHP API/Functions... - password_hash() - password_verify() I read this online...
by Fran3
Sun Nov 19, 2017 1:40 pm
Forum: PHP coding => General
Topic: date() function format question/problem
Replies: 2
Views: 177

Re: date() function format question/problem

Ah Ha !
Thanks :-)
by Fran3
Sun Nov 19, 2017 9:09 am
Forum: PHP coding => General
Topic: date() function format question/problem
Replies: 2
Views: 177

date() function format question/problem

I've written a function to return the: DayName mm-dd-yyyy It works with input format as "10:30pm April 15 2014" The Question: How to get it to work with input format as "2013-01-10 00:00:00" as this is the value returned from the date field in the record I'm working with. Code Below - Thanks for any...
by Fran3
Wed Oct 11, 2017 4:33 am
Forum: PHP General
Topic: How to add/upgrade from PHP 5.3.x to 5.6 or 7.1.x on local Win10 iis for dev?
Replies: 1
Views: 285

Re: How to add/upgrade from PHP 5.3.x to 5.6 or 7.1.x on local Win10 iis for dev?

OK, we have most of this figured out. For the benefit of others here is some info that may help. Here is where you download the PHP zip file of your choice. http://windows.php.net/download/ We started with 5.6.3.1 because that is what is on our web server. After some research we chose the 'tread uns...
by Fran3
Tue Oct 10, 2017 11:13 am
Forum: PHP General
Topic: How to add/upgrade from PHP 5.3.x to 5.6 or 7.1.x on local Win10 iis for dev?
Replies: 1
Views: 285

How to add/upgrade from PHP 5.3.x to 5.6 or 7.1.x on local Win10 iis for dev?

The Status: - On local development machine I have Win 10, iis, PHP 5.3.x and latest version of MySQL. - I need to upgrade PHP locally to match what is on our Windows Web Server for new dev project. - The GoDaddy web server is currently at PHP 5.6 but we can possibly upgraded (I think) to 7.x The Que...