Login From Another Site?
#31
Rohan Shenoy Wrote:You can do that. Insert the below HTML/PHP code snippet where you would like to have the login forms.
<form action="http://domain/MyBBforums/member.php" method="post">
<table border="0" cellspacing="1" cellpadding="4" class="tborder">
<tr>
<td class="thead" colspan="2"><strong>Login</strong></td>

</tr>
<tr>
<td class="trow1"><strong>Username:</strong></td>
<td class="trow1"><input type="text" class="textbox" name="username" size="25" maxlength="30" style="width: 200px;" /></td>
</tr>
<tr>
<td class="trow2"><strong>Password:</strong><br /><span class="smalltext">Please note that passwords are case sensitive.</span></td>
<td class="trow2"><input type="password" class="textbox" name="password" size="25" style="width: 200px;" /></td>
</tr>
</table>

<br />
<div align="center"><input type="submit" class="button" name="submit" value="Login" /></div>
<input type="hidden" name="action" value="do_login" />
<?php
$domain=$_SERVER['HTTP_HOST'];$relativePath=$_SERVER["PHP_SELF"];
$curpurl=$domain$relativePath;


?>
<input type="hidden" name="url" value="<?php echo $curpurl; ?>" />
</form>




Hello everyone! I've been trying to get a login form on my site (http://65inf.apotpr.com) for some time now and I haven't yet found a way to get it to work. I used the code above and the first time I tried it I got this error:

Parse error: syntax error, unexpected T_VARIABLE in /data/11/0/75/96/890911/user/911782/htdocs/65infantry/test.php on line 83

My line 83 is the following line on your code:
$curpurl=$domain$relativePath;

Im pretty much new to PHP but I have exp on programing in general so it was my guess that the line was missing a ";" between $domain and $relativePath

I worte it like this:

$curpurl=$domain;$relativePath;

Now it appears fine on the site. You can see it here. http://65inf.apotpr.com/test.php

The thing is that when I log on I see the "You have successfully been logged in.
You will now be taken back to where you came from." message but after that I get a 404 Page not found error
When I look in the address bar this is what I have:

http://65inf.apotpr.com/forum/65inf.apotpr.com

I dont understand why I get re-directed to that which is a URL that doesnt exist.

CAN ANY1 HELP ME WITH THIS PLEASE???

just some background info on the site:
My site is on the root dir of the URL and the forum is on the "/forum" dir.
#32
Try this:
$curpurl=$domain.$relativePath;
Dennis Tsang
Former MyBB Team Member
Web: http://dennistt.net


Forum Jump:


Users browsing this thread: 1 Guest(s)