by gotcan
3 replies
Hi,

I am using AdsDx and what I am trying to do is show a website before members
reach the actual members area of the site.

The problem is that more times than not, after the first login attempt you are
brought back to the login page to login again. After the second attempt the
members area always loads like it is supposed to.

Here is the top section of the code that I changed in adsdx:

<?php


include('elements.php');

$cid = mysql_connect ($db['host'], $db['user'], $db['pass']) or die("Database connection failed.");
mysql_select_db($db['db']) or die("Database could not be selected.");


$_SESSION['level'] = '';
$_SESSION['name'] = '';

if (!isset($_GET['s'])) $_GET['s'] = '';
if (!isset($_POST['gologin']) && !$_GET['s']) $html = elementDocStart("OnLoad=\"javascript: document.loginform.loginname.focus();\"", 0);
else $html = elementDocStart('', 0);

if (isset($_POST['gologin'])) {
session_start();
$_SESSION['login'] = $_POST['loginname'];
$_SESSION['pass'] = $_POST['password'];
if (CheckValidUser($_POST['loginname'], $_POST['password'])) {
if (SetSessionVars($_POST['loginname'], $_POST['password'])) header("Location: http://adsandcash.com/AdvertisingLogin.php");
else die('Unrecognized error #01!');

The only thing I changed is this is the location which should go to main but I
changed it to the page where the website is located at.

The page they see is a frame page with a rotator at the top showing different
websites and the bottom part of the frame is a 15 second timer that says:
Please wait while your website is loading. Then it automatically show the link
to login.

Here is code for these pages: The frame page:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>AdsAndCash Advertising Login</title>
</head>

<frameset framespacing="0" border="0" frameborder="0" rows="*,64">
<frame name="main" src="http://www.adsandcash.com/PRORotator/" scrolling="auto">
<frame name="footer" scrolling="no" noresize target="main" src="AdvertisingLoginBottom.htm">
<noframes>
<body>

<p>This page uses frames, but your browser doesn't support them.</p>

</body>
</noframes>
</frameset>

</html>

The AdvertisingLoginBottom.htm Page:
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Please View The Above Website Wh</title>
<base target="main">
<script language="javascript" type="text/javascript">
<!--
window.setTimeout('window.location="http://adsandcash.com/AdvertisingLoginLink.htm"; ',15000);
// -->
</script>

</head>

<body>

<p align="center" style="margin-top: 0; margin-bottom: 0"><b>
<font face="Georgia" size="4" color="#FF0000">Your Advertising Section is Now
Loading. A Link to Continue Will Appear Here After Loading.</font></b></p>
<p align="center" style="margin-top: 0; margin-bottom: 0">&nbsp;</p>

</body>

</html>

And the AdvertisingLoginLink.htm Page:
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Loading Complete Click Here To C</title>
</head>

<body>

<p align="center">
<a target="_top" href="http://adsandcash.com/adman/admin/main.php">Loading
Complete Click Here To Continue</a></p>

</body>

</html>

That is everything. I am not sure if I need to add some kind of session to one of these
pages that will accept login data or what.

If someone could give me an idea or somewhere I can find help I would appreciate it.

Thanks,
Jason Wise
#needed #php
  • Profile picture of the author praskuma
    Banned
    [DELETED]
    {{ DiscussionBoard.errors[119997].message }}
    • Profile picture of the author gotcan
      I kinda understand what you are saying, but not really knowing much about
      php. I was hoping for a more detailed solution.

      Thanks for your suggestions though.


      Jason
      {{ DiscussionBoard.errors[120071].message }}
      • Profile picture of the author gotcan
        I could really use some help with this.

        If you need more of the script to find the problem let me know and I can post it or
        send it to you in a pm?

        I am sure it is something minor, since it works on the second time everytime, I just
        am not sure what I need to do or change to make it work the first time.

        Thanks,
        Jason Wise
        {{ DiscussionBoard.errors[131473].message }}
  • Profile picture of the author ryanstreet
    looks like when you changed the script you are redirecting users back to the login page. But after that page is loaded, it has another (unedited)script that directs the user as normal. This is just a guess, and I would be happy to help you more if I could see more of the code. Just pm me and I can help you out if you need it.

    Hope this helps.
    Signature
    Ryan Street
    PHP Developer Specializing in WordPress and Magento
    {{ DiscussionBoard.errors[132961].message }}

Trending Topics