Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Help with PHP

 
Post new topic   Reply to topic Printable version
 View previous topic  Note to myself Post :: Post ss news site  View next topic  
Author Message
Contempt+
Server Help Squatter


Age:36
Gender:Gender:Male
Joined: May 15 2005
Posts: 682
Location: Home
Offline

PostPosted: Mon Sep 19, 2005 8:58 pm   Post maybe stupid    Post subject: Help with PHP Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2582
Location: USA
Offline

PostPosted: Mon Sep 19, 2005 9:47 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

$_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
View users profile Send private message Add User to Ignore List
Maverick
broken record


Age:40
Gender:Gender:Male
Joined: Feb 26 2005
Posts: 1521
Location: The Netherlands
Offline

PostPosted: Tue Sep 20, 2005 5:46 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

huh?

index.php?action=login ?
_________________
Nickname: Maverick (I changed my name!)
TWCore developer | Subspace statistics
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Contempt+
Server Help Squatter


Age:36
Gender:Gender:Male
Joined: May 15 2005
Posts: 682
Location: Home
Offline

PostPosted: Tue Sep 20, 2005 6:48 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Pests
Novice


Joined: Feb 24 2003
Posts: 84
Offline

PostPosted: Tue Sep 20, 2005 8:10 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List
Contempt+
Server Help Squatter


Age:36
Gender:Gender:Male
Joined: May 15 2005
Posts: 682
Location: Home
Offline

PostPosted: Tue Sep 20, 2005 9:10 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Contempt+
Server Help Squatter


Age:36
Gender:Gender:Male
Joined: May 15 2005
Posts: 682
Location: Home
Offline

PostPosted: Tue Sep 20, 2005 9:18 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Pests
Novice


Joined: Feb 24 2003
Posts: 84
Offline

PostPosted: Tue Sep 20, 2005 10:09 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

That works if done correctly. Show me your html.
Back to top
View users profile Send private message Add User to Ignore List
Contempt+
Server Help Squatter


Age:36
Gender:Gender:Male
Joined: May 15 2005
Posts: 682
Location: Home
Offline

PostPosted: Tue Sep 20, 2005 10:29 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Code: Show/Hide
<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>
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Donkano
Server Help Squatter


Gender:Gender:Male
Joined: Jul 02 2003
Posts: 763
Offline

PostPosted: Tue Sep 20, 2005 11:08 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Contempt+ wrote:
Code: Show/Hide
<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:

Code: Show/Hide
<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
View users profile Send private message Add User to Ignore List
Contempt+
Server Help Squatter


Age:36
Gender:Gender:Male
Joined: May 15 2005
Posts: 682
Location: Home
Offline

PostPosted: Tue Sep 20, 2005 11:35 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Purge
Episode I > Eposide III
Jar-Jar is kool


Age:35
Gender:Gender:Male
Joined: Sep 08 2004
Posts: 2019
Offline

PostPosted: Tue Sep 20, 2005 11:37 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Most of the popular forums like IPB and PHPbb are done in PHP.
Back to top
View users profile Send private message Add User to Ignore List
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:37
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Wed Sep 21, 2005 2:23 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List
Contempt+
Server Help Squatter


Age:36
Gender:Gender:Male
Joined: May 15 2005
Posts: 682
Location: Home
Offline

PostPosted: Wed Sep 21, 2005 1:45 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:41
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3615
Location: Las Vegas
Offline

PostPosted: Wed Sep 21, 2005 1:59 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email
Donkano
Server Help Squatter


Gender:Gender:Male
Joined: Jul 02 2003
Posts: 763
Offline

PostPosted: Wed Sep 21, 2005 4:02 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List
Contempt+
Server Help Squatter


Age:36
Gender:Gender:Male
Joined: May 15 2005
Posts: 682
Location: Home
Offline

PostPosted: Wed Sep 21, 2005 7:44 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

http://www.contempt.ssihosting.com/test is the page that I'm trying to get the login to work. It's just a template that I grabbed off the internet, I'm designing a new page now.

the forums are:
http://www.contempt.ssihosting.com/forums/index.php
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:37
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Wed Sep 21, 2005 8:01 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List
Contempt+
Server Help Squatter


Age:36
Gender:Gender:Male
Joined: May 15 2005
Posts: 682
Location: Home
Offline

PostPosted: Wed Sep 21, 2005 8:33 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Pests
Novice


Joined: Feb 24 2003
Posts: 84
Offline

PostPosted: Thu Sep 22, 2005 3:28 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Trash Talk All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 143 page(s) served in previous 5 minutes.

phpBB Created this page in 0.844479 seconds : 44 queries executed (71.7%): GZIP compression disabled