PDA

View Full Version : When I...



Panther
18-11-2006, 07:03 PM
When I try to add an Image to a PHP File it comes up liek this.

http://www.habbostudio.co.uk/uk/register.php

Can any body help me out the code it:


<html>
<head>
<title>Register</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;
}
.5 { color: #ff0000; font-weight: bold; }
.4 { color: #ff6600; font-weight: bold; }
.3 { color: #006600; font-weight: bold; }
.2 { color: #000099; font-weight: bold; }
.1 { color: #000000; }
input {
font-family: Tahoma, Arial;
font-size: 8pt;
font-weight: bold;
color: #000000;
background-color: #FFFFFF;
border: 1px solid #000000;
}
select {
background-color: #ffffff;
font-family: Arial, Helvetica, sans-serif;
font-size: 8pt;
color: #000000;
border: 1px solid #000000;
}
textarea {
background-color: #ffffff;
font-family: Arial, Helvetica, sans-serif;
font-size: 8pt;
color: #000000;
width: 400;
border: 1px solid #000000;
}
</style>
<?php
ob_start();
// allows you to use cookies
include("config.php");
//gets the config page
if ($_POST[register]) {
// the above line checks to see if the html form has been submitted
$username = $_POST[username];
$password = $_POST[pass];
$cpassword = $_POST[cpass];
$email = $_POST[emai1];
//the above lines set variables with the user submitted information
if($username==NULL|$password==NULL|$cpassword==NUL L|$email==NULL) {
//checks to make sure no fields were left blank
echo "A field was left blank.";
}else{
//none were left blank! We continue...
if($password != $cpassword) {
// the passwords are not the same!
echo "Passwords do not match";
}else{
// the passwords are the same! we continue...
$password = md5($password);
// encrypts the password
$checkname = mysql_query("SELECT username FROM users WHERE username='$username'");
$checkname= mysql_num_rows($checkname);
$checkemail = mysql_query("SELECT email FROM users WHERE email='$email'");
$checkemail = mysql_num_rows($checkemail);
if ($checkemail>0|$checkname>0) {
// oops...someone has already registered with that username or email!
echo "The username or email is already in use";
}else{
// noone is using that email or username! We continue...
$username = htmlspecialchars($username);
$password = htmlspecialchars($password);
$email = htmlspecialchars($email);
// the above lines make it so that there is no html in the user submitted information.
//Everything seems good, lets insert.
$query = mysql_query("INSERT INTO users (username, password, email) VALUES('$username','$password','$email')");
// inserts the information into the database.
echo "You have successfully registered!";
}
}
}
}
else
{
// the form has not been submitted...so now we display it.
echo ("
<img src="userimages\pirates_group.gif" alt="Pirates" align="right" border="0">Members of HabboStudio are given the oppurtunity to use several features which are not available to guests. These features include, Studio-Mail, Your own gallery of badges which you can collect from attending regular HabboStudio events and Much Much More.
There are plenty of other features which are top secret up until you become a member. Registration has been made nice, easy and completely free; just use the form below to create your username.
<form method=\"POST\">
Username<br>
<input type=\"text\" size=\"15\" maxlength=\"25\" name=\"username\"><br />
Password<br>
<input type=\"password\" size=\"15\" maxlength=\"25\" name=\"pass\"><br />
Confirm Password<br>
<input type=\"password\" size=\"15\" maxlength=\"25\" name=\"cpass\"><br />
Email Adress:<br>
<input type=\"text\" size=\"15\" maxlength=\"25\" name=\"emai1\"><br />
Habbo Username:<br>
<input type=\"text\" size=\"15\" maxlength=\"25\" name=\"habbo\"><br /><BR>
<input name=\"register\" type=\"submit\" value=\"Register\">
</form>
");
}
?>

-1.
18-11-2006, 07:05 PM
try this



<html>
<head>
<title>Register</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;
}
.5 { color: #ff0000; font-weight: bold; }
.4 { color: #ff6600; font-weight: bold; }
.3 { color: #006600; font-weight: bold; }
.2 { color: #000099; font-weight: bold; }
.1 { color: #000000; }
input {
font-family: Tahoma, Arial;
font-size: 8pt;
font-weight: bold;
color: #000000;
background-color: #FFFFFF;
border: 1px solid #000000;
}
select {
background-color: #ffffff;
font-family: Arial, Helvetica, sans-serif;
font-size: 8pt;
color: #000000;
border: 1px solid #000000;
}
textarea {
background-color: #ffffff;
font-family: Arial, Helvetica, sans-serif;
font-size: 8pt;
color: #000000;
width: 400;
border: 1px solid #000000;
}
</style>
<?php
ob_start();
// allows you to use cookies
include("config.php");
//gets the config page
if ($_POST[register]) {
// the above line checks to see if the html form has been submitted
$username = $_POST[username];
$password = $_POST[pass];
$cpassword = $_POST[cpass];
$email = $_POST[emai1];
//the above lines set variables with the user submitted information
if($username==NULL|$password==NULL|$cpassword==NUL L|$email==NULL) {
//checks to make sure no fields were left blank
echo "A field was left blank.";
}else{
//none were left blank! We continue...
if($password != $cpassword) {
// the passwords are not the same!
echo "Passwords do not match";
}else{
// the passwords are the same! we continue...
$password = md5($password);
// encrypts the password
$checkname = mysql_query("SELECT username FROM users WHERE username='$username'");
$checkname= mysql_num_rows($checkname);
$checkemail = mysql_query("SELECT email FROM users WHERE email='$email'");
$checkemail = mysql_num_rows($checkemail);
if ($checkemail>0|$checkname>0) {
// oops...someone has already registered with that username or email!
echo "The username or email is already in use";
}else{
// noone is using that email or username! We continue...
$username = htmlspecialchars($username);
$password = htmlspecialchars($password);
$email = htmlspecialchars($email);
// the above lines make it so that there is no html in the user submitted information.
//Everything seems good, lets insert.
$query = mysql_query("INSERT INTO users (username, password, email) VALUES('$username','$password','$email')");
// inserts the information into the database.
echo "You have successfully registered!";
}
}
}
}
else
{
?>
<img src="userimages\pirates_group.gif" alt="Pirates" align="right" border="0">Members of HabboStudio are given the oppurtunity to use several features which are not available to guests. These features include, Studio-Mail, Your own gallery of badges which you can collect from attending regular HabboStudio events and Much Much More.
There are plenty of other features which are top secret up until you become a member. Registration has been made nice, easy and completely free; just use the form below to create your username.
<form method=\"POST\">
Username<br>
<input type=\"text\" size=\"15\" maxlength=\"25\" name=\"username\"><br />
Password<br>
<input type=\"password\" size=\"15\" maxlength=\"25\" name=\"pass\"><br />
Confirm Password<br>
<input type=\"password\" size=\"15\" maxlength=\"25\" name=\"cpass\"><br />
Email Adress:<br>
<input type=\"text\" size=\"15\" maxlength=\"25\" name=\"emai1\"><br />
Habbo Username:<br>
<input type=\"text\" size=\"15\" maxlength=\"25\" name=\"habbo\"><br /><BR>
<input name=\"register\" type=\"submit\" value=\"Register\">
</form>
<?php
}
?>

Panther
18-11-2006, 07:06 PM
Thanks Ill +rep you

EDIT: Its not showing the register "button"

-1.
18-11-2006, 07:14 PM
Change the HTML bit to


<form method="POST">
Username<br>
<input type="text" size="15" maxlength="25" name="username"><br />
Password<br>
<input type="password" size="15" maxlength="25" name="pass"><br />
Confirm Password<br>
<input type="password" size="15" maxlength="25" name="cpass"><br />
Email Adress:<br>
<input type="text" size="15" maxlength="25" name="emai1"><br />
Habbo Username:<br>
<input type="text" size="15" maxlength="25" name="habbo"><br /><BR>
<input name="register" type="submit" value="Register">
</form>

try that.

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