PDA

View Full Version : OurHabbo system Help



Jamieb
21-03-2008, 03:20 PM
IF YOU ARE GOING TO SAY IT IS UNSAFE AND DONT USE IT STOP READING NOW!

Hi Habboxers

I have contact.php works find but i want it so it can be used when logged out..

At the moment u have to login and once on the page u just get a drop down menu with problem then a message can some one help by doing this


dont have to login and you can do this...

Name:
dropdown menu stay same
message stay same

--------------------------------------------------------------------

Basicly i want it so u dont login and u have to put your name in..

---------------------------------------------------------------------

Heres the PHP for it.


<html>
<head>
<title>Home</title>
<style type="text/css">
a {
font-size: 10px;
color: #000000;
}
a:link {
text-decoration: none;
color: #000000;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: underline;
color: #000000;
}
a:active {
text-decoration: none;
color: #000000;
}
body,td,th,p {
font-family: Verdana;
font-size: 10px;
color: #000000;
}
.12 { color: red; }
.11 { color: navy; }
.10 { color: ; }
.9 { color: darkorchid; }
.8 { color: darkorchid; }
.7 { color: darkorchid; }
.6 { color: darkorchid; }
.5 { color: green; }
.4 { color: green; }
.3 { color: green; }
.2 { color: green; }
.1 { color: black; }
input {
font-family: Tahoma, Arial;
font-size: 8pt;
font-weight: bold;
width: 200;
color: #000000;
background-color: #FFFFFF;
border: 1px solid #000000;
}
select {
background-color: #ffffff;
font-family: Arial, Helvetica, sans-serif;
font-size: 8pt;
color: #000000;
width: 200;
border: 1px solid #000000;
}
textarea {
background-color: #ffffff;
font-family: Arial, Helvetica, sans-serif;
font-size: 8pt;
color: #000000;
width: 200;
height: 100;
border: 1px solid #000000;
}

</style>
</head>
<body bgcolor="#ffffff">
<?
include("config.php");
if($logged[username]){
?>
<p>OurHabbo Help Tool</p>
<p>Please fill out the information below as needed, and send us your problem. We
will reply within 24hours of your request being sent.</p>
<form action='helptool.php' method='post'>

<p><img border='0' src='images/1_hi.gif' align='left' width='51' height='42'>UserName<br>



<input type='text' size='40' name='name' value='' style=\"font-size: 10px\" tabindex=\"1\"></p>
<br>
<p><img border='0' src='images/2_hi.gif' align='left' width='51' height='42'>Your Email<br>
<input type='"email' size='40' name='email' value='' style=\"font-size: 10px\" tabindex='2'><br>
<br>
<br>

<img border='0' src='images/3_hi.gif' align='left' width='51' height='42'>

Message Type<br>



<select size='1' name='type' tabindex='3'>
<option>Please Select An Option...</option>
<option>I have technical problems with the site</option>
<option>I have a Billing/Sale Query</option>
<option>I think I've been banned</option>
<option>I have forgotten my password</option>
<option>I want to report an illegal site</option>
<option>I've been scammed!</option>
<option>I have an idea/thought</option>
<option>Something else</option>
</select><br>

<br><br>

<img border='0' src='images/pass.gif' align='left' width='51' height='42'>

Message<br>



<textarea rows='10' cols='24' name='message' tabindex='4'></textarea><br>

<br>

<input type='submit' value='Email Us' name='submit' style=\"font-size: 10px\"></p>
</form>

<?
}else{
echo ("You are not logged in, or are banned.");
}
?>
</body>
</html>

Thanks Jamieb

QuickScriptz
21-03-2008, 03:51 PM
Basically what you would do is take the below part of the script and place it accordingly on the page so that if the user isn't logged in then there's a field for 'username' or something and when they are logged in it auto-assigns a username value...



<!-- Open Form Tag -->
<form>

<!-- Start PHP Conditionals -->
<?
include("config.php");
if($logged[username]){

// Whatever the username session variable is should go below
$username = $_SESSION['username'];
?>

<!-- This will happen if the user is logged in -->
<input type="hidden" name="username" value="<?=$username?>">

<?
}else{
?>

<!-- This will happen if the user is not logged in -->
Username:<br/>
<input type="text" name="username" maxlength="30">

<?php
}
?>
<!-- End PHP Conditionals -->

<!-- This is where the rest of your form would go -->

<!-- Close Form Tag -->
</form>


That should give you a general idea :)

Hypertext
21-03-2008, 03:56 PM
Would it be easier to do


<?
include("config.php");
if(!$logged[username]){
header("Location: login.php");
exit();
}instead of all the jive at the end?

Jamieb
21-03-2008, 03:57 PM
I dont know php really at all so that didnt make alot of sence to me and +rep (scriptz)

Unpredictible.1
21-03-2008, 04:47 PM
its unsafe

QuickScriptz
22-03-2008, 03:51 AM
Would it be easier to do


<?
include("config.php");
if(!$logged[username]){
header("Location: login.php");
exit();
}instead of all the jive at the end?

I think you might have missed what the original post was asking for. He doesn't just want to redirect users if they aren't logged in, he wants to add an additional form field for their 'name'.


its unsafe

Am I missing something? What is unsafe? There's no real security related code happening here or anything to do with a MySQL Database?

Anyway, just to try and clarify what I said above.... The original form would stay the same and you would just put it where in my code example it says:


<!-- This is where the rest of your form would go -->

Only other issue would be that to handle the additional field you would require some more backend PHP stuff to handle it...

cunning
22-03-2008, 03:56 AM
its unsafe

That's L!nk trying to annoy someone.

Independent
22-03-2008, 07:53 AM
I'm not gonna' say it's unsafe.. But why does everyone use this system, it's rubbish?

Unpredictible.1
22-03-2008, 01:31 PM
I think you might have missed what the original post was asking for. He doesn't just want to redirect users if they aren't logged in, he wants to add an additional form field for their 'name'.



Am I missing something? What is unsafe? There's no real security related code happening here or anything to do with a MySQL Database?

Anyway, just to try and clarify what I said above.... The original form would stay the same and you would just put it where in my code example it says:



Only other issue would be that to handle the additional field you would require some more backend PHP stuff to handle it...
wow ok.. :eusa_clap


That's L!nk trying to annoy someone.
It's cunning trying to attention seek.
actually your post is correct, and its working ;)

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