got it on the front BLOG page. now how about on my main page?
I think i need to do a <?php include ___ ?>
any help?
got it on the front BLOG page. now how about on my main page?
I think i need to do a <?php include ___ ?>
any help?
basically, i just want a login form, where it says member login, on the left side of http://macuser914.com
no one knows how to call the script on the main page?
I got AuthUI working on the BLOG, but how do I include it on the main homepage, in a different directory.
the blog is in /blog. the main homepage is in the root directory.
SOMEONE PLEASE HELP!
Got it working with THIS: (replace site url with your BLOG url)
<form name="loginform" id="loginform" action="(SITEURL)" method="post">
<label>Username:<input type="text" name="log" id="log" value="" size="20" tabindex="1" /></label>
<label>Password: <input type="password" name="pwd" id="pwd" value="" size="20" tabindex="2" /></label>
<label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="3" />Remember me</label>
<input type="submit" name="submit" id="login" value="Login »" tabindex="4" />
</form>
problem now is that it shows the form even if the user logged in.
if ( !is_user_logged_in() ) {
// show login form
<!-- add html for form here -->
} else {
// user is logged in, so let's show a search form
<!-- add search form html here -->
}
Simple as that.
Or, you can change up the second part to show a welcome message, or whatever you want instead of a login.
<?php if ( !is_user_logged_in() ) {
LINE 64: <form name="loginform" id="loginform" action="http://macuser9214.com/blog/wp-login.php" method="post">
<label>Username:
<input type="text" name="log" id="log" value="" size="20" tabindex="1" /></label>
<label>Password:
<input type="password" name="pwd" id="pwd" value="" size="20" tabindex="2" /></label>
<label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="3" />Remember me</label>
<input type="submit" name="submit" id="login" value="Login »" tabindex="4" />
</form>
} else {
// user is logged in, so let's show logout button
LOGOUT
}
?>
Thats what I have now, and it returns:
Parse error: parse error, unexpected '<' in /www/(PATH)/index.php on line 64
Bump ->Anyone?
look for why the computer might be confused by the ''<'' and there's your answer
no clue. I don't know php at all.. Just some HTML.
So please help me. The only thing I see is the { in the top line. Is that doing it?
Looks like it needs
?><form>
and later</form><?php
now it's saying line 78, which is my link to the logout button. How do I make it show the logout, only if someone is logged in?
Same thing, maybe,
</form>
<?php
} else {
// user is logged in, so let's show logout button
?>
LOGOUT HTML
<?php
}
?>
Now I get
Fatal error: Call to undefined function: is_user_logged_in() in
Replace
<?php if ( !is_user_logged_in() ) {
with
<?php global $user_level;
if ( isset($user_level) ) {
whoops, add a ! if needed to
if ( isset($user_level) ) {
become
if ( !isset($user_level) ) {
now it logs me in but doesn't show the logout button once I do, and doesn't get rid of the login form. Here's my whole code:
Member Login:<br>
<?php global $user_level;
if ( !isset($user_level) ) {
?><form name="loginform" id="loginform" action="http://macuser9214.com/blog/wp-login.php" method="post">
<label>Username:
<input type="text" name="log" id="log" value="" size="20" tabindex="1" /></label>
<label>Password:
<input type="password" name="pwd" id="pwd" value="" size="20" tabindex="2" /></label>
<label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="3" />Remember me</label>
<input type="submit" name="submit" id="login" value="Login »" tabindex="4" />
</form>
<?php
} else {
// user is logged in, so let's show logout button
?>
LOGOUT
<?php
}
?>
Works for me. Try emptying browser cache.
no, the form works, but when you log in, it doesn't show a logout button, and it doesn't get rid of the account.
I'll make a test account for you to test it with:
username: test123
Password: wordpress
come on! I'm so close!
anyone?
• the plugin mentioned above works for me.
• did you ever check the homeland stupidity?this should work with, no problem.
'<li id="login">
<?php
global $user_ID, $user_identity;
get_currentuserinfo();
if (!$user_ID):
?>
<h2><?php _e('Login'); ?></h2>
<form name="loginform" id="loginform" action="<?php echo get_settings('siteurl'); ?>/wp-login.php" method="post">
<div><label><?php _e('Login') ?>:
<input type="text" name="log" id="log" value="" size="20" tabindex="7" /></label>
<label><?php _e('Password') ?>:
<input type="password" name="pwd" id="pwd" value="" size="20" tabindex="8" /></label>
<label><input type="checkbox" name="rememberme" value="forever" tabindex="9" /> <?php _e("Remember me"); ?></label>
<input type="submit" name="submit" value="<?php _e('Login'); ?> »" tabindex="10" />
<?php wp_register('', ''); ?>
<input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>"/></div>
</form>
<?php
else:
?>
<h2><?php echo $user_identity; ?></h2>
<?php
endif;
?>
'
Nope,
Fatal error: Call to undefined function: get_currentuserinfo() in /www/(PATH)/index.php on line 70
Kinda got it, because I'm using SMF with it, andI can use SSI logout for SMF, and it will log me out, but the form still shows
Doesn't there have to be a part that basically says:
The user logged in, now we need to get rid of the login form?
if ( !is_user_logged_in() ) {
// login form
} else {
// logged in info
}
Then I have:
Member Login:<br>
(LINE 66)---> <?php if ( !is_user_logged_in() ) { ?>
<form name="loginform" id="loginform" action="http://macuser9214.com/blog/wp-login.php" method="post">
<label>Username:
<input type="text" name="log" id="log" value="" size="20" tabindex="1" /></label>
<label>Password:
<input type="password" name="pwd" id="pwd" value="" size="20" tabindex="2" /></label>
<label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="3" />Remember me</label>
<input type="submit" name="submit" id="login" value="Login »" tabindex="4" />
</form>}
<?php }
else { ?>
LOGOUT (if logged in)
<?php } ?>
which gives me: Fatal error: Call to undefined function: is_user_logged_in() in /www/PATH/index.php on line 66
can someone just post a working copy of the code? My blog URL is http://macuser9214.com/blog, and this page for the login form is http://macuser9214.com/index.php.
How does the script know to call Wordpress to get the user_logged_in function? I think I'm missing something in the beginning of my index.php file....
SOMEONE HELP! I wanna get this working!
How does the script know to call Wordpress to get the user_logged_in function?
Because it's supposed to be called from a WP template?
If you're outside of WordPress, that's a whole nother ball of wax.
THAT was the problem then.. Yeah I'm' outside of wordpress....
Any help?
« Previous 1 2 3 4 Next »