Wolphie Posted October 18, 2007 Share Posted October 18, 2007 Hey, i'm currently working on an advertisement project. This requires paypal payment methods etc... and a membership system. Most of these i have alreayd implemented myself. But i'm currently having trouble on the membership system. Since this project would be too large to post the code for, i was wondering if anybody would be kind enough to email me or send me a private message and/or add me to MSN so i could send them the folder. Also, if you have already looked at this project, suggestions to improve it would be highly appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/73807-few-issues/ Share on other sites More sharing options...
Wes1890 Posted October 18, 2007 Share Posted October 18, 2007 What problems are you having exactly? Quote Link to comment https://forums.phpfreaks.com/topic/73807-few-issues/#findComment-372345 Share on other sites More sharing options...
Wolphie Posted October 18, 2007 Author Share Posted October 18, 2007 Well, i've probably been looking at TOO much code to identify the 'exact' problem myself. But the problem is within the membership system. It's not logging the users correctly. (Registration & Login) Quote Link to comment https://forums.phpfreaks.com/topic/73807-few-issues/#findComment-372351 Share on other sites More sharing options...
thefollower Posted October 18, 2007 Share Posted October 18, 2007 just give us snips of the code that are the crucial parts of logging the users in ...and we can see if it is that Quote Link to comment https://forums.phpfreaks.com/topic/73807-few-issues/#findComment-372353 Share on other sites More sharing options...
Wolphie Posted October 18, 2007 Author Share Posted October 18, 2007 Registration Form: <?php require_once("modules/header.php"); require_once("modules/stat.php"); ?> <tr> <td class="form"> <table cellpadding="0" cellspacing="0" border="0" align="center"> <form action="modules/regv.php" method="post"> <tr><td align="right" class="formB">Banner/Image URL:</td> <td align="left" class="formB"><input type="text" class="blue" name="bannerurl" value="http://" style="font-family: Verdana;" /></td></tr> <tr><td align="right" class="formB">Website URL:</td> <td align="left" class="formB"><input type="text" name="siteurl" class="blue" value="http://" style="font-family: Verdana;" /></td></tr> <tr><td align="right" class="formB">Description:</td> <td align="left" class="formB"><input type="text" name="description" class="blue" style="font-family: Verdana;" /></td></tr> <? if(!$_SESSION['user']) { ?> <tr><td align="right" class="formB">Desired Username:</td> <td align="left" class="formB"><input type="text" name="username" class="blue" maxlength="25" style="font-family: Verdana;" /></td></tr> <tr><td align="right" class="formB">Desired Password:</td> <td align="left" class="formB"><input type="password" name="password" class="blue" maxlength="25" style="font-family: Verdana;" /></td></tr> <tr><td align="right" class="formB">Email Address:</td> <td align="left" class="formB"><input type="text" name="email" class="blue" style="font-family: Verdana;" /></td></tr> <tr><td align="right" class="formB">PayPal Email Address:</td> <td align="left" class="formB"><input type="text" name="paypalemail" class="blue" style="font-family: Verdana;" /></td></tr> <? } else { ?> <tr><td align="right" class="formB"><br /><br />Username:</td> <td align="left" class="formB"><br /><br /><?php echo '<span class="formA">' . $_SESSION['user'] . '</span>'; ?></td></tr> <tr><td align="right" class="formB">Email Address:</td> <td align="left" class="formB"><?php echo '<span class="formA">' . $_SESSION['email'] . '</span>'; ?></td></tr> <tr><td align="right" class="formB">PayPal Email Address:</td> <td align="left" class="formB"><?php echo '<span class="formA">' . $_SESSION['paypalemail'] . '</span>'; ?></td></tr> <? } ?> <tr><td><br /><br /> </td><td align="center" class="formB"><input type="submit" value="Continue" style="font-family: Verdana;" /> <input type="reset" value="Reset" style="font-family: Verdana;" /></td></tr> </table> </td> </tr> <? require_once("modules/footer.php"); ?> Registration PHP: <?php session_start(Header("Location: pay.php")); $host = "localhost"; $user = ""; $pass = ""; $db = ""; $con = mysql_connect($host, $user, $pass); if (!$con) { die("Could not connect: " . mysql_error()); } mysql_select_db($db, $con); $bannerurl = $_POST['bannerurl']; $websiteurl = $_POST['siteurl']; $description = $_POST['description']; $username = $_POST['username']; $password = MD5($_POST['password']); $email = $_POST['email']; $paypalemail = $_POST['paypalemail']; $sql = mysql_query(sprintf("INSERT INTO `paddle` ( bannerurl, description, siteurl, username, password, email, paypalemail ) VALUES ( '%s', '%s', '%s', '%s', '%s', '%s', '%s' )", mysql_real_escape_string($bannerurl), mysql_real_escape_string($websiteurl), mysql_real_escape_string($description), mysql_real_escape_string($username), mysql_real_escape_string($password), mysql_real_escape_string($email), mysql_real_escape_string($paypalemail) )); if($obj = mysql_fetch_object($sql)) { $_SESSION['logged'] = true; $_SESSION['user'] = $_POST['username']; $_SESSION['website'] = $obj -> siteurl; $_SESSION['description'] = $obj -> description; $_SESSION['email'] = $obj -> email; $_SESSION['paypalemail'] = $obj -> paypalemail; $_SESSION['banner'] = $obj -> bannerurl; } else { $_SESSION['logged'] = false; } ?> Login Form: <?php require_once("modules/header.php"); require_once("modules/stat.php"); ?> <tr> <td class="form" align="center"> <? if(!$_SESSION['user']) { ?> <table cellpadding="0" cellspacing="0" border="0" align="center"> <form action="modules/logv.php" method="post"> <tr><td align="right" class="formB">Username:</td> <td align="left" class="formB"><input type="text" class="blue" name="username" style="font-family: Verdana;" /></td></tr> <tr><td align="right" class="formB">Password:</td> <td align="left" class="formB"><input type="password" class="blue" name="password" style="font-family: Verdana;" /></td></tr> <tr><td><br /><br /> </td><td align="center" class="formB"><input type="submit" value="Login" style="font-family: Verdana;" /> </form> </table> <? } else { ?> You are already logged in. <? } ?> </td> </tr> <? require_once("modules/footer.php"); ?> Login PHP: <?php session_start(Header("Location: usercp.php")); $host = "localhost"; $user = ""; $pass = ""; $db = ""; $con = mysql_connect($host, $user, $pass); if (!$con) { die("Could not connect: " . mysql_error()); } mysql_select_db($db, $con); $username = $_POST['username']; $password = MD5($_POST['password']); $sql = mysql_query("SELECT * FROM `paddle` WHERE username = '$username' AND password = '$password' LIMIT 1"); if($obj = mysql_fetch_object($sql)) { $_SESSION['logged'] = true; $_SESSION['user'] = $_POST['username']; $_SESSION['website'] = $obj -> siteurl; $_SESSION['description'] = $obj -> description; $_SESSION['email'] = $obj -> email; $_SESSION['paypalemail'] = $obj -> paypalemail; $_SESSION['banner'] = $obj -> bannerurl; } else { $_SESSION['logged'] = false; } ?> UserCP: <?php require_once("modules/header.php"); require_once("modules/stat.php"); ?> <tr> <td align="center" class="regular"> <? if(!$_SESSION['logged']) { ?> You are not logged in. [<a href="login.php">Login</a>] <? } else { ?> <u>User Control Panel</u> <br /><br /> <a href="details.php">Change Details</a> <br /> <a href="purchase.php">New Advertisement</a> <? $sql = mysql_query("SELECT * FROM `paddle` WHERE username = '" . $_SESSION['user'] . "'") or die('Error: ' . mysql_error()); if($obj = mysql_fetch_object($sql)) { ?> <table width="100%" cellpadding="0" cellspacing="0" border="0" align="center" class="tusercp"> <tr> <td>Status</td> <td>Website</td> <td>Featured</td> <td>PayPal Email</td> <td>Description</td> </tr> <tr> <td><? echo $obj -> status; ?></td> <td><? echo $obj -> siteurl; ?></td> <td><? echo $obj -> featured; ?></td> <td><? echo $obj -> paypalemail; ?></td> <td><? echo $obj -> description; ?></td> </tr> </table> <? } ?> <a href="logout.php">Logout</a> <? } ?> </td> </tr> <? require_once('modules/footer.php'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/73807-few-issues/#findComment-372357 Share on other sites More sharing options...
Wolphie Posted October 18, 2007 Author Share Posted October 18, 2007 I think it could be the session variables not registering. Quote Link to comment https://forums.phpfreaks.com/topic/73807-few-issues/#findComment-372535 Share on other sites More sharing options...
Wolphie Posted October 18, 2007 Author Share Posted October 18, 2007 Still needing help. Sorry to be a pain. *blushes* Quote Link to comment https://forums.phpfreaks.com/topic/73807-few-issues/#findComment-372758 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.