Author |
Message |
Contempt+ Server Help Squatter
Age:36 Gender: Joined: May 15 2005 Posts: 682 Location: Home Offline
|
Posted: Mon Sep 19, 2005 8:58 pm Post maybe stupid Post subject: Help with PHP |
 |
|
|
|
I know this might piss some of you off, but I've got another question.
I've seen on a couple of other sites, and I've been wanting to do it to mine for a while, but some sites have a login for their phpBB forums on their home page, where it logs you into the forums. I was wondering if anyone knew the "action='link' ".
I've tried a few things, and none work. Would anyone be able to point me in some direction? _________________ SSE Network Administrator |
|
Back to top |
|
 |
CypherJF I gargle nitroglycerin

Gender: Joined: Aug 14 2003 Posts: 2582 Location: USA Offline
|
Posted: Mon Sep 19, 2005 9:47 pm Post maybe stupid Post subject: |
 |
|
|
|
$_GET['action'].. remember to "sanatize" ANY user input; especially when dealing with SQL strings. _________________ Performance is often the art of cheating carefully. - James Gosling |
|
Back to top |
|
 |
Maverick

Age:40 Gender: Joined: Feb 26 2005 Posts: 1521 Location: The Netherlands Offline
|
Posted: Tue Sep 20, 2005 5:46 am Post maybe stupid Post subject: |
 |
|
|
|
huh?
index.php?action=login ? _________________
|
|
Back to top |
|
 |
Contempt+ Server Help Squatter
Age:36 Gender: Joined: May 15 2005 Posts: 682 Location: Home Offline
|
Posted: Tue Sep 20, 2005 6:48 pm Post maybe stupid Post subject: |
 |
|
|
|
I understand what Cypher is saying, at least 90%.. But I don't understand what you're trying to say Mav.
So I have to use $_GET['action'] in my /index.htm, or in the /forums/index.php? /forums/index.php, right? |
|
Back to top |
|
 |
Pests Novice
Joined: Feb 24 2003 Posts: 84 Offline
|
Posted: Tue Sep 20, 2005 8:10 pm Post maybe stupid Post subject: |
 |
|
|
|
Im assuming you want a form to log you into a phpbb forum on your homepage.
Taking a look at the html for the login box on these forums:
Quote: |
<form action="login.php" method="post" target="_top">
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
<tr>
<td align="left" class="nav"><a href="index.php" class="nav">Server Help Forum Index</a></td>
</tr>
</table>
<table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center">
<tr>
<th height="25" class="thHead" nowrap="nowrap">Please enter your username and password to login</th>
</tr>
<tr>
<td class="row1"><table border="0" cellpadding="3" cellspacing="1" width="100%">
<tr>
<td colspan="2" align="center"> </td>
</tr>
<tr>
<td width="45%" align="right"><span class="gen">Username:</span></td>
<td>
<input type="text" name="username" size="25" maxlength="40" value="" />
</td>
</tr>
<tr>
<td align="right"><span class="gen">Password:</span></td>
<td>
<input type="password" name="password" size="25" maxlength="25" />
</td>
</tr>
<tr align="center">
<td colspan="2"><span class="gen">Log me on automatically each visit: <input type="checkbox" name="autologin" /></span></td>
</tr>
<tr align="center">
<td colspan="2"><input type="hidden" name="redirect" value="" /><input type="submit" name="login" class="mainoption" value="Login" /></td>
</tr>
<tr align="center">
<td colspan="2"><span class="gensmall"><a href="profile.php?mode=sendpassword" class="gensmall">I forgot my password</a></span></td>
</tr>
</table></td>
</tr>
</table>
</form>
|
The importaint parts are in bold and they are all that we need, so were left with:
Quote: |
<form action="login.php" method="post" target="_top">
<input type="text" name="username" size="25" maxlength="40" value="" />
<input type="password" name="password" size="25" maxlength="25" />
Log me on automatically each visit: <input type="checkbox" name="autologin" />
<input type="hidden" name="redirect" value="" />
<input type="submit" name="login" class="mainoption" value="Login" />
</form>
|
But we still need to change some things:
Quote: |
<form action="login.php" method="post" target="_top">
Username: <input type="text" name="username" size="25" maxlength="40" value="" />
Password: <input type="password" name="password" size="25" maxlength="25" />
Log me on automatically each visit: <input type="checkbox" name="autologin" />
<input type="hidden" name="redirect" value="***" />
<input type="submit" name="login" class="mainoption" value="Login" />
</form>
|
Blue
This needs to be changed to the location of your forums login.php file. Either a absolute url such as "http://www.example.com/phpbb/login.php" or a relative url such as "forums/login.php"
Green
This redirects the user to a page after they have logged in. If left blank the user is sent to the forum index after logging in. If you supply a url here then after the user has logged in they will be redirected back to this page.
I'm not sure if the green value can be an absolute url, might need to be relative. The *** I placed in the last example is just so you can see the color. If you want them to redirect to the main forum page remove those and replace with nothing.
Hope this is what you want. You would still need to format it and everything to your liking. |
|
Back to top |
|
 |
Contempt+ Server Help Squatter
Age:36 Gender: Joined: May 15 2005 Posts: 682 Location: Home Offline
|
Posted: Tue Sep 20, 2005 9:10 pm Post maybe stupid Post subject: |
 |
|
|
|
Ok, I tried something like that before, I just didn't have the redirects. I'll try it again and see what happens. |
|
Back to top |
|
 |
Contempt+ Server Help Squatter
Age:36 Gender: Joined: May 15 2005 Posts: 682 Location: Home Offline
|
Posted: Tue Sep 20, 2005 9:18 pm Post maybe stupid Post subject: |
 |
|
|
|
Ok, I tried that, but it didn't work. I had a feeling that there was some more work to be done than that.
Thanks for trying though pests.
I'll look around on the login.php page and see what I can find. More help would be appreciated. |
|
Back to top |
|
 |
Pests Novice
Joined: Feb 24 2003 Posts: 84 Offline
|
Posted: Tue Sep 20, 2005 10:09 pm Post maybe stupid Post subject: |
 |
|
|
|
That works if done correctly. Show me your html. |
|
Back to top |
|
 |
Contempt+ Server Help Squatter
Age:36 Gender: Joined: May 15 2005 Posts: 682 Location: Home Offline
|
|
Back to top |
|
 |
Donkano Server Help Squatter
Gender: Joined: Jul 02 2003 Posts: 763 Offline
|
Posted: Tue Sep 20, 2005 11:08 pm Post maybe stupid Post subject: |
 |
|
|
|
Contempt+ wrote: | <form action="/forums/login.php" method="post"><FONT face=Verdana><b>
<font size="1" face="Verdana">Forums Login Here</font></b>
<FONT face=Verdana size=2><BR><BR></FONT>
<font size="1"><b>Username: <br> </b></font>
<INPUT class=form maxLength=35 size=19 name=q><BR>
<font size="1"><b>Password: <br></b></font>
<INPUT class=form type = "password" maxLength=35 size=19 name=q1><BR>
<input type="hidden" name="redirect" value="">
</FONT> <FONT face=Verdana><INPUT class=form type=submit value="Login"><BR><INPUT
name=s type=hidden value=SS></FONT><font size="1" face="Verdana"><b></b></font></FORM> |
|
Try:
<form action="/forums/login.php" method="post" enctype="multipart/form-data">
<font size="1" face="Verdana"><b>Forums Login Here<br><br>
Username:<br><input class="form" type="text" maxlength="35" size="19" name="q"><br>
Password:<br><input class="form" type="password" maxLength="35" size="19" name="q1"><br>
<input type="hidden" name="redirect" value="">
<input class="form" type="submit" value="Login"><br>
<input name="s" type="hidden" value="SS"></b></font>
</form> |
I cleaned some stuff up on it and may clerify things. |
|
Back to top |
|
 |
Contempt+ Server Help Squatter
Age:36 Gender: Joined: May 15 2005 Posts: 682 Location: Home Offline
|
Posted: Tue Sep 20, 2005 11:35 pm Post maybe stupid Post subject: |
 |
|
|
|
Tried that too, didn't work.. MGB, you should know how to do this, right? Oh, and is IPB coded in php? If so, Syrus might know this. |
|
Back to top |
|
 |
Purge Episode I > Eposide III Jar-Jar is kool

Age:35 Gender: Joined: Sep 08 2004 Posts: 2019 Offline
|
Posted: Tue Sep 20, 2005 11:37 pm Post maybe stupid Post subject: |
 |
|
|
|
Most of the popular forums like IPB and PHPbb are done in PHP. |
|
Back to top |
|
 |
Solo Ace Yeah, I'm in touch with reality...we correspond from time to time.

Age:37 Gender: Joined: Feb 06 2004 Posts: 2583 Location: The Netherlands Offline
|
Posted: Wed Sep 21, 2005 2:23 am Post maybe stupid Post subject: |
 |
|
|
|
Heh, Cypher, I always satanize my input, look through these forums and you'll see.
Tell us, next to the fact that "it doesn't work", what doesn't work, exactly.
What kind of error are you getting? Which problems is it giving you?
Don't change the forums' code, your single index.html should be enough.
How can you still have issues with silly things like these? You've been doing stuff like this for several weeks, and you're still asking...
Contempt+ wrote: | So I have to use $_GET['action'] in my /index.htm, or in the /forums/index.php? /forums/index.php, right? |
It may just be a simple path problem. |
|
Back to top |
|
 |
Contempt+ Server Help Squatter
Age:36 Gender: Joined: May 15 2005 Posts: 682 Location: Home Offline
|
Posted: Wed Sep 21, 2005 1:45 pm Post maybe stupid Post subject: |
 |
|
|
|
First off, I haven't been doing things like this for several weeks. I jump around between php, c++, java, html, ect.
When I put in what Don gave me, and I have the redirect in, it just sends me to the /forums/login.php page without logging me in. |
|
Back to top |
|
 |
Mine GO BOOM Hunch Hunch What What

Age:41 Gender: Joined: Aug 01 2002 Posts: 3615 Location: Las Vegas Offline
|
Posted: Wed Sep 21, 2005 1:59 pm Post maybe stupid Post subject: |
 |
|
|
|
Want to try posting your homepage and a link to your forums? The homepage link in your profile goes to a non-existing domain. |
|
Back to top |
|
 |
Donkano Server Help Squatter
Gender: Joined: Jul 02 2003 Posts: 763 Offline
|
Posted: Wed Sep 21, 2005 4:02 pm Post maybe stupid Post subject: |
 |
|
|
|
Contempt+ wrote: | First off, I haven't been doing things like this for several weeks. I jump around between php, c++, java, html, ect.
When I put in what Don gave me, and I have the redirect in, it just sends me to the /forums/login.php page without logging me in. |
I gave you nothing but the enctype="multipart/form-data" the other stuff was useless so I just right out removed it. |
|
Back to top |
|
 |
Contempt+ Server Help Squatter
Age:36 Gender: Joined: May 15 2005 Posts: 682 Location: Home Offline
|
|
Back to top |
|
 |
Solo Ace Yeah, I'm in touch with reality...we correspond from time to time.

Age:37 Gender: Joined: Feb 06 2004 Posts: 2583 Location: The Netherlands Offline
|
Posted: Wed Sep 21, 2005 8:01 pm Post maybe stupid Post subject: |
 |
|
|
|
Stupid how nobody (yeah, I didn't see it either, until just now) noticed how the names for the login fields aren't matching those on the real phpBB login pages. |
|
Back to top |
|
 |
Contempt+ Server Help Squatter
Age:36 Gender: Joined: May 15 2005 Posts: 682 Location: Home Offline
|
Posted: Wed Sep 21, 2005 8:33 pm Post maybe stupid Post subject: |
 |
|
|
|
Hey, Solo helped me out, and we got it working. Had a few errors in the form. Also thanks to the others that helped. |
|
Back to top |
|
 |
Pests Novice
Joined: Feb 24 2003 Posts: 84 Offline
|
Posted: Thu Sep 22, 2005 3:28 pm Post maybe stupid Post subject: |
 |
|
|
|
Solo Ace wrote: | Stupid how nobody (yeah, I didn't see it either, until just now) noticed how the names for the login fields aren't matching those on the real phpBB login pages. |
Talking about the code he posted? Yeah, I just noticed it too. |
|
Back to top |
|
 |
|