PDA

View Full Version : .htaccess



alex126
01-09-2005, 05:06 PM
Hi,

Well I need help on making a .htaccess file for my site http://schoolbypass.com.

Can some one make me the script.

I would pay furni on habbo

If wanting to help me click on my sig, and chat to me.

splintercell!
01-09-2005, 05:49 PM
What do you want to do In it ill get you script within a second :)

alex126
01-09-2005, 06:01 PM
So it will have a password and user name , and only to be logged in throught http://login.spyonline.co.uk


And the usernames and passwords have to be able to be multipul, I want add more and more as a go along


Hope thats ok :P

splintercell!
01-09-2005, 06:04 PM
why not just do it through cpanel "/ it creates it for you.

alex126
01-09-2005, 06:05 PM
why not just do it through cpanel "/ it creates it for you.


Well I have access thorugh FTP only so....

Can you do it?>???

nelly
01-09-2005, 06:11 PM
ur cpanel details are ur ftp :S

splintercell!
01-09-2005, 06:12 PM
you cant with FTP I dont think because it involves files outside the public directory. Why not make a php script.

alex126
01-09-2005, 06:13 PM
ur cpanel details are ur ftp :S


Lisen n00b.

I have FTP ONLY!!!!

Getit or would you like that in writing

Tommy
01-09-2005, 06:15 PM
Lisen n00b.

I have FTP ONLY!!!!

Getit or would you like that in writing

no need to be rude! - rep

alex126
01-09-2005, 06:17 PM
no need to be rude! - rep


No he gave me a load a few days ago, I am giving it him back.

and -rep to you.

I couldnt give a rats *** is you gave me -rep


:eusa_pray :eusa_pray :eusa_pray :eusa_pray Please all -rep me!!! :eusa_pray :eusa_pray :eusa_pray :eusa_pray

iRoss
01-09-2005, 06:41 PM
Hope it helps ^^

http://www.spoono.com/php/tutorials/tutorial.php?id=30

alex126
01-09-2005, 06:42 PM
Hope it helps ^^

http://www.spoono.com/php/tutorials/tutorial.php?id=30

Thanks!!! +rep


But it didnt really help

iRoss
01-09-2005, 06:45 PM
What's wrong with it? It looks ok to me?

alex126
01-09-2005, 06:49 PM
What's wrong with it? It looks ok to me?


It just doesmt seem right,

I need a simple login and a a little bit of code so you cant go to the files, but only throught the login.

Can anyone help??

iRoss
01-09-2005, 06:50 PM
Yes, that's it.

alex126
01-09-2005, 06:54 PM
Yes, that's it.

Hmmmmm, I will have another look.

Are you sure that you cant use a .htacess??

Just a user and passwrod will do, and to make multpal user names and pass's by editing the file

splintercell!
01-09-2005, 06:56 PM
Ok here is the login bit


<?php
session_start();
$_SESSION['name'] = $name;
{
$name = $_POST['name'];
$password = $_POST['password'];

$user = test;
$pass = test;

if(($name == $user) && ($pass == $password)){
echo "Your logged in";
Header("Location: private.php");
}else{
echo "Your details where wrong please try again!";
}
}
?> and then in the file you want it to go to private.php in this case add this atthe top :)


<?php
session_start();
if (!$_SESSION['name']) {
echo "You aren't logged in.";
include("login_form.html");
exit();
}
?>

alex126
01-09-2005, 06:59 PM
Hmmm Ill try and write you something not sure it will work though :)


:) :) :) Anything at the moment is good,

Or A javascript login.

Then I little code that will stop people hotlinking the page so say I didnt want anyone coming to habbox.com I would put a code in the page and then they can only get in through the javascript login.

splintercell!
01-09-2005, 07:02 PM
Also the login for is

<form method="post" action="login.php">
Name: <input name="name" type="text" /><br>
Password: <input name="password" type="password" /><br>
<input name="submit" value="Login" type="submit" />
</form>

alex126
01-09-2005, 07:07 PM
Also the login for is

<form method="post" action="login.php">
Name: <input name="name" type="text" /><br>
Password: <input name="password" type="password" /><br>
<input name="submit" value="Login" type="submit" />
</form>


OMG!!!!! Thank you !!!

SOOOOO much, One more question, id I want to put more login details what do I do??


I will be giving you furni for defo,!!

splintercell!
01-09-2005, 07:10 PM
Ok this proably isnt the best style script for multi user login but:


<?php
session_start();
$_SESSION['name'] = $name;
{
$name = $_POST['name'];
$password = $_POST['password'];

$user = test;
$pass = test;

if(($name == $user) && ($pass == $password)){
echo "Your logged in";
Header("Location: private.php");
}else{
echo "Your details where wrong please try again!";
}

$user2 = test2;
$pass2 = test2;
if(($name == $user2) && ($pass2 == $password)){
echo "Your logged in";
Header("Location: private.php");
}else{
echo "Your details where wrong please try again!";
}
}
?>

that should work but because the password wont match with the original sort may not. I used a javascript redirect to get around it when I used this script. Instead of Header();

alex126
01-09-2005, 07:12 PM
Ok this proably isnt the best style script for multi user login but:


<?php
session_start();
$_SESSION['name'] = $name;
{
$name = $_POST['name'];
$password = $_POST['password'];

$user = test;
$pass = test;

if(($name == $user) && ($pass == $password)){
echo "Your logged in";
Header("Location: private.php");
}else{
echo "Your details where wrong please try again!";
}

$user2 = test2;
$pass2 = test2;
if(($name == $user2) && ($pass2 == $password)){
echo "Your logged in";
Header("Location: private.php");
}else{
echo "Your details where wrong please try again!";
}
}
?>

that should work but because the password wont match with the original sort may not. I used a javascript redirect to get around it when I used this script. Instead of Header();



So all I would do is keeping on adding the bit with the pass and all??

splintercell!
01-09-2005, 07:14 PM
You just need to keep adding this bit with different variables :)
$user2 = test2;
$pass2 = test2;
if(($name == $user2) && ($pass2 == $password)){
echo "Your logged in";
Header("Location: private.php");
}else{
echo "Your details where wrong please try again!";
}

alex126
01-09-2005, 07:17 PM
You just need to keep adding this bit with different variables :)
$user2 = test2;
$pass2 = test2;
if(($name == $user2) && ($pass2 == $password)){
echo "Your logged in";
Header("Location: private.php");
}else{
echo "Your details where wrong please try again!";
}


Thanks!!!


Will you please start a chat with me, just click my sig!!!

Mentor
01-09-2005, 08:26 PM
Ok this proably isnt the best style script for multi user login but:


<?php
session_start();
$_SESSION['name'] = $name;
{
$name = $_POST['name'];
$password = $_POST['password'];

$user = test;
$pass = test;

if(($name == $user) && ($pass == $password)){
echo "Your logged in";
Header("Location: private.php");
}else{
echo "Your details where wrong please try again!";
}

$user2 = test2;
$pass2 = test2;
if(($name == $user2) && ($pass2 == $password)){
echo "Your logged in";
Header("Location: private.php");
}else{
echo "Your details where wrong please try again!";
}
}
?>

that should work but because the password wont match with the original sort may not. I used a javascript redirect to get around it when I used this script. Instead of Header();


Woulnt be very secure, since its just redirecting and would be complty bypassable "/ plus wold be more efficant puting the username and passwords in a array then looping the rest of it "/.

alex126
01-09-2005, 09:09 PM
Woulnt be very secure, since its just redirecting and would be complty bypassable "/ plus wold be more efficant puting the username and passwords in a array then looping the rest of it "/.


Well the protected page is saying , UR NOT LOGGED IN , so how is it bypassable,

So my login is http://login.spyonline.co.uk and then once I have logged in it goes to schoolbypass.com/proxy.php.

Which you will find that has a you are not logged in.

Am I wrong.

Post back if I am :P

Mentor
01-09-2005, 09:16 PM
oh yea, it works, i thoght it was just the script, aka the page in question not checking session data etc etc

alex126
01-09-2005, 09:19 PM
oh yea, it works, i thoght it was just the script, aka the page in question not checking session data etc etc


NOOOO, I am tinkering with it, I tried to add another user and pass and its gone on one.

can any of you help :@


Edit:

I am going to see if I can fix it ;)

splintercell!
02-09-2005, 06:58 AM
you have to place the password in an array then :) Its because the user and pass your putting in dosent match the other ones.

alex126
02-09-2005, 08:56 AM
you have to place the password in an array then :) Its because the user and pass your putting in dosent match the other ones.



Its fine now, all fixed :)

Want to hide these adverts? Register an account for free!