close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Can no longer login in after moving hosting companies

Thread began 5/16/2023 2:42 am by georgina_barrett_187762 | Last modified 5/23/2023 6:02 am by Ray Borduin | 131 views | 6 replies |

georgina_barrett_187762

Can no longer login in after moving hosting companies

I have just moved hosting companies and everything else seems to work except the login authentication. The login redirects successfully but when it goes to the next page the Restrict access code logs you back out again. This is the login user code:..
<?php require_once('../Connections/georgeconnect_i.php'); ?>
<?php require_once('../webassist/mysqli/authentication.php'); ?>
<?php require_once('../webassist/mysqli/queryobj.php'); ?>
<?php
$Authenticate = new WA_MySQLi_Auth($georgeconnect_i);
$Authenticate->Action = "authenticate";
$Authenticate->Trigger = (isset($_POST["Submit"]) || isset($_POST["Submit_x"]));
$Authenticate->Name = "DatabaseLogin";
$Authenticate->Table = "login";
$Authenticate->addFilter("username", "=", "s", "".((isset($_POST["username"]))?$_POST["username"]:"") ."");
$Authenticate->addFilter("password", "=", "s", "".((isset($_POST["password"]))?$_POST["password"]:"") ."");
$Authenticate->addFilter("Company", "=", "s", "Ascars");
$Authenticate->RememberMe = (false);
$Authenticate->SaveLogin = (false);
$Authenticate->AutoReturn = false;
$SuccessRedirect = "home.php";
$FailedRedirect = "index.php";
if (function_exists("rel2abs")) $SuccessRedirect = $SuccessRedirect?rel2abs($SuccessRedirect,dirname(__FILE__)):"";
if (function_exists("rel2abs")) $FailedRedirect = $FailedRedirect?rel2abs($FailedRedirect,dirname(__FILE__)):"";
$Authenticate->SuccessRedirect = $SuccessRedirect;
$Authenticate->FailRedirect = $FailedRedirect;
$Authenticate->execute();
?>

And this is the code on the redirected page....
<?php require_once('../Connections/georgeconnect_i.php'); ?>
<?php require_once('../webassist/mysqli/rsobj.php'); ?>
<?php require_once('../webassist/mysqli/authentication.php'); ?>
<?php
if ("" === "") {
$RestrictAccess = new WA_MySQLi_Auth();
$RestrictAccess->Action = "restrict";
$RestrictAccess->Name = "DatabaseLogin";
$RestricAccessRedirect = "../index.php";
if (function_exists("rel2abs")) $RestricAccessRedirect = $RestricAccessRedirect?rel2abs($RestricAccessRedirect,dirname(__FILE__)):"";
$RestrictAccess->FailRedirect = $RestricAccessRedirect;
$RestrictAccess->execute();
}
?>

Sign in to reply to this post

Ray BorduinWebAssist

The code looks good to me. I'd probably need FTP access and a URL to reproduce this to debug it and see what is going on. Most likely your Session variables aren't working on the server. That is usually an issue with the session_save_path in the php.ini pointing to a non-existent directory.

Sign in to reply to this post
Did this help? Tips are appreciated...

georgina_barrett_187762

I think this might be the case because I have just experienced another error when using InsertQuery. I have 2 inserts on one page and the second insert uses the saveInSession from the first query, but when I submit the form I am getting this error..
Warning: Undefined array key "ContractID" in ....

Sign in to reply to this post

Ray BorduinWebAssist

It is a server configuration issue.... most likely bad session.save_path. I uploaded this file to show the issue:

https://www.alicanteairportcarparking.com/session_check.php

If you give that to your hosting company, once that page says "sessions work" the issue has been resolved.

Sign in to reply to this post
Did this help? Tips are appreciated...

georgina_barrett_187762

Thank you. I have contacted my hosting company and if I follow the link https://www.alicanteairportcarparking.com/session_check.php it says... working
save path exists

However I am still getting the same problems as before. I still can't log in. The login script works and takes me to the next page but the $RestrictAccess code on that page kicks me out again. Also I am still getting the Warning: Undefined array key on the multiple insert page

Sign in to reply to this post

Ray BorduinWebAssist

Can I get FTP access to the parkingascars.com site and get the username and password to test with? I'll test to see what might be wrong.

Sign in to reply to this post
Did this help? Tips are appreciated...

georgina_barrett_187762

Thank you, I spent all day yesterday trying to resolve this issue with Hostgator. They just kept insisting that the error was in the coding and because of that there is nothing they can do.
I even copied a basic session script from this page https://www.php.net/manual/en/function.session-start.php, (https://www.parkingascars.com/page1.php) which didn't work and they still insisted the error was with that coding as well - unbelievable.
I have received an email today from support - again saying that the error is in the code and there is nothing they can do, yet I have just tried to log in again and it is all working, and the script on this page now works (https://www.parkingascars.com/page1.php. Maybe they didn't want to admit it was their fault - or something they did in testing fixed it without them knowing - but at least it is all working now. I have to say I wish I hadn't moved to Hostgator and wouldn't recommend them.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...