Jump to content

register/login scripts


JC5

Recommended Posts

No im not i simply end it later and end the php first which would that cause the error?else{echo "Welcome";echo '<a href="http://www.devwebsites.com/profile/$Username"$Username</a><br />';?><br /><ul><li><a href="http://www.devwebsites.com/forums/usercp.php"Forums UserCP</a></li><li><a href="http://www.devwebsites.com/logout.php"Logout</a></li>}^--Yea..any other ideas?

Link to comment
Share on other sites

figuresk ill go fix it and edit this post when i doedit:<?php}if (isset($_GET['error']) AND !empty($_GET['error'])){ echo 'Invalid login data supplied. Please try again.';}else{echo "Welcome";echo '<a href="http://www.devwebsites.com/profile/$Username"$Username</a><br />'; echo '<br />';echo '<ul>';echo '<li><a href="http://www.devwebsites.com/forums/usercp.php"Forums UserCP</a></li>';echo '<li><a href="http://www.devwebsites.com/logout.php"Logout</a></li>';?>}error is still there :/

Link to comment
Share on other sites

its weird but it displays the admin and stuff even when im logged out. well i hit the logout button and my logout thing heres the logout page

<?phpsession_start();session_unset();session_destroy();if(isset($_COOKIE['DevWebSites']));{$time = time();	setcookie("DevWebSites[username]", $time - 3600);	setcookie("DevWebSites[password]", $time - 3600);}header('Location: [url="http://www.devwebsites.com/');"]http://www.devwebsites.com/');[/url]exit();?>

and heres the index page for the if statement now

<?phpif ($_SESSION['loggedin'] = 0) {?><form method="post" name="cookie" action="process.php"><p><label for="username">Username : <input type="text" name="username" id="username" /></label></p><p><label for="password">Password : <input type="password" name="password" id="password" /></label></p><p><input type="checkbox" name="setcookie" value="setcookie" /> Remember Me</p><p><input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /></p></form><?php}if ($_SESSION['loggedin'] = 1) {echo 'Welcome <a href="http://www.devwebsites.com/profile/$Username">Admin</a><br />';echo '<ul>';echo '<li>';echo '<a href="http://www.devwebsites.com/forums/usercp.php">Forums UserCP</a>';echo '</li>';echo '<li>';echo '<a href="http://www.devwebsites.com/logout.php">Logout</a>';echo '</li>';echo '</ul>';}?>

Link to comment
Share on other sites

Also while i have this thread open I might as well ask

echo "<a href=\"http://www.devwebsites.com/profile/" . $username . ">Edit Your Profile</a>";

I am trying to make it so the person can edit his profile but this code wont display I asked my brother how I would go about using the $username because he told me in order to use php variables I had to use double quotes but I figured i wouldnt because echo "<a href=" would close the quotes and so he told me to use the escape thing which i've never heard of so any suggestions?

Link to comment
Share on other sites

You forgot to add a second quote after to close the href valueecho "<a href=\"http://www.devwebsites.com/profile/" . $username . "-->\"<-->Edit Your Profile</a>";And I already told you before that this line is going to cause you trouble:

if ($_SESSION['loggedin'] = 0) {

If you can't guess why I suggest you check the PHP tutorials on W3Schools.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...