Neeed Help please Neeed Help please
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Neeed Help please

Started by Justttt, April 20, 2006, 03:11:20 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Justttt

hey i was woundering if somone could please help me. on my home page i have got the code

<?php

define
('IN_COPPERMINE'true);

require(
'album/include/init.inc.php');
<
p><span class="style1">Welcome, </span><? echo USER_NAME?>
</p>

?>


so it says welome and then the persons user name . but when the user is not loged in instead of it showing that i would like it to show the login box.

thank you .
J U S T T T T

Joachim Müller

<?php
if (USER_NAME == TRUE) {
    print 
'<span class="style1">Welcome, 'USER_NAME '</span>';
} else {
    print <<< EOT
              <form action="album/login.php" method="post" name="loginbox" id="cpgform">
<!-- Start standard table -->
<table align="center" width="100%" cellspacing="1" cellpadding="0" class="maintable">
        <tr>
                <td class="tableh1" colspan="2">Enter your username and password to login</td>

        </tr>
                  
                  
                  <tr>
                        <td class="tableb" width="40%">Username</td>
                        <td class="tableb" width="60%"><input type="text" class="textinput" name="username" style="width: 100%" tabindex="1" /></td>
                  </tr>
                  <tr>
                          <td class="tableb">Password</td>
                        <td class="tableb"><input type="password" class="textinput" name="password" style="width: 100%" tabindex="2" /></td>

                  </tr>
                  <tr>
                    <td colspan="2" align="center" class="tableb">Remember me <input name="remember_me" type="checkbox" class="checkbox" value="1" tabindex="3" /></td>
                  </tr>
                  <tr>
                    <td align="center" class="tablef"><a href="forgot_passwd.php" class="topmenu">I forgot my password</a></td>
                    <td align="left" class="tablef"><input name="submitted" type="submit" class="button" value="Login" tabindex="4" /></td>
                  </tr>

</table>
<!-- End standard table -->

</form>
EOT;
}
?>


Has been asked before. Please use the search in the future. Read http://www.php.net/manual/en/language.control-structures.php#control-structures.if for a start.

Justttt

ok sorry. right i have that sorted thanks very much . but when i login using my custermised login page i want it to return on its self if that is possible. any help ?

here is my code

<?php

define
('IN_COPPERMINE'true);

require(
'album/include/init.inc.php');


?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
background-color: #000000;
}
.style1 {color: #FFFFFF}
body,td,th {
color: #FFFFFF;
}
a:link {
color: #990000;
}
-->
</style></head>

<body>
<div align="center"><?php
if (USER_NAME == Anonymous) {
   print <<< EOT
              <form action="album/login.php" method="post" name="loginbox" id="cpgform">
<!-- Start standard table -->
<table align="center" width="100%" cellspacing="1" cellpadding="0" class="maintable">
        <tr>
                <td class="tableh1" colspan="2">U Must Login Or <a href="album/register.php">Click Here ToRegister</a> </td>

        </tr>
                  
                  
                  <tr>
                        <td class="tableb" width="40%">Username</td>
                        <td class="tableb" width="60%"><input type="text" class="textinput" name="username" style="width: 100%" tabindex="1" /></td>
                  </tr>
                  <tr>
                          <td class="tableb">Password</td>
                        <td class="tableb"><input type="password" class="textinput" name="password" style="width: 100%" tabindex="2" /></td>

                  </tr>
                  <tr>
                    <td colspan="2" align="center" class="tableb">Remember me <input name="remember_me" type="checkbox" class="checkbox" value="1" tabindex="3" /></td>
                  </tr>
                  <tr>
                    <td align="center" class="tablef"><a href="forgot_passwd.php" class="topmenu">I forgot my password</a></td>
                    <td align="left" class="tablef"><input name="submitted" type="submit" class="button" value="Login" tabindex="4" /></td>
                  </tr>

</table>
<!-- End standard table -->

</form>
EOT;

} else {
     print 
'<span class="style1">Welcome, 'USER_NAME '</span>';
 ?>

  <p><a href="http://www.trippy-illusion.co.uk/album/thumbnails.php?album=lastup&amp;cat=0" target="_blank">Last Uploads</a> <br />
      <a href="http://www.trippy-illusion.co.uk/album/index.php?cat=2" target="_blank">Main Album</a> <br />
        <a href="http://www.trippy-illusion.co.uk/album/thumbnails.php?album=lastcom&amp;cat=0" target="_blank">Last Comments</a>   <a href="http://www.trippy-illusion.co.uk/album/thumbnails.php?album=mostcom&amp;cat=0" target="_blank"><br />
        Most Active</a><br />
  <a href="http://www.trippy-illusion.co.uk/album/upload.php" target="_blank">Upload Files</a> <br />
  <a href="http://www.trippy-illusion.co.uk/album/search.php" target="_blank">Search</a></p>
  <p>&lt; Your Cp &gt;  </p>
  <p><a href="http://www.trippy-illusion.co.uk/album/profile.php?op=edit_profile" target="_blank">Edit Profile</a> <br />
    <a href="http://www.trippy-illusion.co.uk/album/index.php?pm=check" target="_blank">Private Mssages</a> <br />
    <a href="http://www.trippy-illusion.co.uk/album/thumbnails.php?album=lastcomby&amp;uid=<? echo USER_ID; ?>" target="_blank">Your Comments</a><br />
    <a href="http://www.trippy-illusion.co.uk/album/thumbnails.php?album=lastupby&amp;uid=<? echo USER_ID; ?>" target="_blank">Your Uploads  </a><br />
    <a href="thumbnails.php?album=favpics">My Favorites</a>  </p>
  <p>&nbsp;</p><?

?>

</p>
  <p>&nbsp;</p>
</div>
</body>
</html>
J U S T T T T

Joachim Müller

add a referer var to the <form> target. Take a look at the default login form to get an idea how this works.

Justttt

J U S T T T T