Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
Johnamc328

Strange Login Problem

Recommended Posts

Hello,

 

I successfully logged out and tried to login.  When I click to login it brings me to the default index.asp page with a  "The website cannot display the page".  When I just click on login without the email or PW it takes me to the default index.php page with no problems.  The registration worked with no problems.

 

The admin sections are not checking if I am an admin since the add pdf and add page sections show up with no problems and I have not set anyone up as an admin.

 

These "require" as opposed to "includes" seem to not work with IIS - is there some setting I need to check? 

  • Upvote 1

Share this post


Link to post
Share on other sites

I'm not that familiar with IIS and wouldn't be inclined to use it myself. I have no idea why the require and include lines wouldn't work. That's pretty odd.

 

Also, to be clear, are you pretty comfortable with PHP and MySQL already? This book does assume that. 

 

And I'd also recommend developing locally instead of using GoDaddy. It'll be easier, cheaper, and faster. 

Share this post


Link to post
Share on other sites

Hi Larry,

 

Yes I am pretty familiar with PHP and MySQL - I have never got into the e-commerce portion before.  Many other tutorials I have done do not have code in the header so that is why I am experiencing that now.  I am developing locally and on GoDaddy at the same time just to see if it is possible to create a system for someone in the future.  I am pretty sure that it is some issue with IIS.  The Godaddy person said I should learn Linux but I am a little old to go down that road. I will updated when I have a solution.

Share this post


Link to post
Share on other sites

If the .html page is run directly, the PHP code would show (unless the server was set to handle .html as PHP, which is uncommon). But if it's an included file, it doesn't matter what extension is uses. 

Share this post


Link to post
Share on other sites

Hello,

 

I have the same Problem.   Can't login if they are index.php page.  i try to connect with redirect rule, but the connection don't work.

 

I think its a bug.

Share this post


Link to post
Share on other sites

I installed Bitnami WAMP  - when it tries to connect to MySQL it bombs on this line

 

mysqli_set_charset($dbc, 'utf8');

 

it gives this error

 

mysqli_set_charset() expects parameter 1 to be mysqli, boolean given

 

I googled it but can't find any current info - it did work fine under IIS

Share this post


Link to post
Share on other sites

The same settings would only work if you created the same MySQL user locally that you have at GoDaddy with your IIS.

Share this post


Link to post
Share on other sites

I have found that when you use IIS and try the exercise with WAMP, LAMP etc is that you have default port settings for mysqli commands.  If you are running IIS then those default ports are taken.  If you are running a WAMP you have to go into the PHP inside the WAMP (IIS php is the regular php install) and change the port settings to the ones you selected when you installed WAMP.

 

For example default ports are 80, 3306 and 443 - With a WAMP install most people choose 8080, 3307 and 4443 - in the php.ini you have to set the mysqli to 3307 instead of 3306 or the mysqli command to connect to the DB will not work.

 

As for login problems - these have to be commented out - just in case anybody misses it like I did.

// To test the sidebars:
//$_SESSION['user_id'] = 1;
//$_SESSION['user_admin'] = true;
//$_SESSION['user_not_expired'] = true;
$_SESSION=array();

 

So far everything is working fine - but I will be back with the harder example in part III since it is much more Apache server and I am just learning it now.

Share this post


Link to post
Share on other sites

Thanks for sharing your experience and for letting us know what you figured out. We're here when you have more questions!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...