Autor Zpráva
kuba95
Profil
Zdravím,
mám problém s délkou stránky. Mám tuto stránku: http://1g.707.cz/register.php
Text stránky by správně měl být jenom na zeleném poli, jako je tomu zde: http://1g.707.cz/how.php, ale nevím, proč to tak není...

Prosím o radu

html stránky:
<?

session_start();
if($_GET['r'] and !$_SESSION['r']) { $_SESSION['r'] = $_GET['r']; }
if(($_SESSION['r'] and !$_GET['r']) or (($_SESSION['r'] and $_GET['r']) and $_GET['r'] != $_SESSION['r'])) { $_GET['r'] = $_SESSION['r']; }
include "config.php";
global $c;
include "data.php";
global $config;
?>
<? include "header2.php"; ?>
<div id="gbox">
<div id="gbox-top"> </div>
<div id="gbox-bg">
<div id="gbox-grd">
<!-- content begin here -->
<h3>Register</h3>
<br>
<?
if(isset($_COOKIE["usNick"]) && isset($_COOKIE["usPass"]))
{
?>
<b><center><a href="#" onClick="window.location.reload()">It seems you are logged in, click here to refresh. Also note you may not have 2 accounts per IP, or both will be deleted</a> <br /><br />
( this has been logged &amp; will be verified soon by the staff ) <br />
<br />
<a href="index.php?action=logout">Or if you are logged in, click here to logout.</a><br /><br /><br /></center></b>
<?
include "footer.php";
exit();
}
?>
<?
require('funciones.php');
if ($_POST) {
//round 1
$username = $_POST["username"];
$password = $_POST["password"];
$cpassword = $_POST["cpassword"];
$email = $_POST["email"];
$cemail = $_POST["cemail"];
$pemail = $_POST["pemail"];
$country = $_POST["country"];
//round 2
$username = uc($username);
$password = uc($password);
$cpassword = uc($cpassword);
$email = securedata($email);
$cemail = securedata($cemail);
$pemail = securedata($pemail);
$country = securedata($country);
//round 3
$laip = getRealIP();
$username=limitatexto($username,15);
$password=limitatexto($password,15);
$cpassword=limitatexto($cpassword,15);
$email=limitatexto($email,100);
$cemail=limitatexto($cemail,100);
$pemail=limitatexto($pemail,100);
$country=limitatexto($country,15);
$checkip = mysql_query("SELECT ip FROM tb_users WHERE ip='$laip'");
$ip_exist = mysql_num_rows($checkip);
minimo($username);
minimopass($password);
ValidaMail($email);
ValidaMail($pemail);
$checkuser = mysql_query("SELECT username FROM tb_users WHERE username='$username'");
$username_exist = mysql_num_rows($checkuser);
$checkemail = mysql_query("SELECT email FROM tb_users WHERE email='$email'");
$email_exist = mysql_num_rows($checkemail);
$checkpemail = mysql_query("SELECT pemail FROM tb_users WHERE pemail='$pemail'");
$pemail_exist = mysql_num_rows($checkpemail);
$referer = securedata($_SESSION["r"]);
$referer=limitatexto($referer,15);
$checkref = mysql_query("SELECT username FROM tb_users WHERE username='$referer'");
$referer_exist = mysql_num_rows($checkref);
if(!$username)
{
$error = 1;
$errormsg .= "<h4 style=\"color:red;\"><b>Error </b>- Please supply a username.</h4>";
}
if(!$password)
{
$error = 1;
$errormsg .= "<h4 style=\"color:red;\"><b>Error </b>- Please supply a password.</h4>";
}
if(!$_POST['tos'])
{
$error = 1;
$errormsg .= "<h4 style=\"color:red;\"><b>Error </b>- You must agree to the TOS to sign up.</h4>";
}
if(strlen($password) < 6)
{
$error = 1;
$errormsg .= "<h4 style=\"color:red;\"><b>Error </b>- Your password must be over 6 characters.</h4>";
}
if(!$cpassword)
{
$error = 1;
$errormsg .= "<h4 style=\"color:red;\"><b>Error </b>- Please supply a confirm password.</h4>";
}
if(!$email)
{
$error = 1;
$errormsg .= "<h4 style=\"color:red;\"><b>Error </b>- Please supply a email.</h4>";
}
if(!$cemail)
{
$error = 1;
$errormsg .= "<h4 style=\"color:red;\"><b>Error </b>- Please supply a confirmation email.</h4>";
}
if(!$pemail)
{
$error = 1;
$errormsg .= "<h4 style=\"color:red;\"><b>Error </b>- Please supply an Alertpay email.</h4>";
}
if(!$country)
{
$error = 1;
$errormsg .= "<h4 style=\"color:red;\"><b>Error </b>- Please supply a country.</h4>";
}
if ($referer_exist<1 and $_POST['referer'] != "")
{
$error = 1;
$errormsg .= "<h4 style=\"color:red;\"><b>Error </b>- That referrer does not exist, Please leave it blank if you cannot find a referer.</h4>";
$_SESSION['r'] = false;
$_GET['r'] = false;
}
if ($pemail_exist>0) {
$error = 1;
$errormsg .= "<h4 style=\"color:red;\"><b>Error </b>- That Alertpay address is already in use.</h4>";
}
if($password!=$cpassword) {
$error = 1;
$errormsg .= "<h4 style=\"color:red;\"><b>Error </b>- The passwords do not match.</h4>";
}
if($email!=$cemail) {
$error = 1;
$errormsg .= "<h4 style=\"color:red;\"><b>Error </b>- The emails do not match.</h4>";
}
if($_POST['code']!=$_SESSION['string']){
$error = 1;
$errormsg .= "<h4 style=\"color:red;\"><b>Error </b>- The captcha was entered incorrectly.</h4>";
$_SESSION['string'] = false;
}
if($laip=="127.0.0.1")
{
$error = 1;
$errormsg .= "<h4 style=\"color:red;\"><b>Error </b>- The IP 127.0.0.1 is disabled to use.</h4>";
}

if ($ip_exist>0)
{
$error = 1;
$errormsg .= "<h4 style=\"color:red;\"><b>Error </b>- You already have one account</h4>";
}
if ($email_exist>0)
{
$error = 1;
$errormsg .= "<h4 style=\"color:red;\"><b>Error </b>- That email address is already in use.</h4>";
}
if($username_exist>0) {
$error = 1;
$errormsg .= "<h4 style=\"color:red;\"><b>Error </b>- That username is already in use.</h4>";
}
if($error == 1)
{
print $errormsg;
} else {
// If it has introduced a referer see that there
if ($_POST["referer"] != "") {
// Sanitizamos la variable
$referer = securedata($_SESSION["r"]);
$referer=limitatexto($referer,15);
$checkref = mysql_query("SELECT username FROM tb_users WHERE username='$referer'");
$referer_exist = mysql_num_rows($checkref);
if ($referer_exist>0) {
// If everything seems fine proceed with the insertion
$sqlz = "SELECT * FROM tb_users WHERE username='$referer'";
$resultz = mysql_query($sqlz);
$myrowz = mysql_fetch_array($resultz);
$numero=$myrowz["referals"];
$sqlex = "UPDATE tb_users SET referals='$numero'+1 WHERE username='$referer'";
$resultex = mysql_query($sqlex);
}
}
// Si todo parece correcto procedemos con la inserccion
$joindate=time();
$query = "INSERT INTO tb_users (username, password, ip, email, pemail, referer, country, joindate, money,visits) VALUES('$username','$password','$laip','$email','$pemail','$referer','$country','$joindate', '0', '0')";
mysql_query($query) or die(mysql_error());
$alertpay=include "alertpay.php";
$alertpaye=$config["Alertpay"];
echo "You have been registered correctly <b>$username</b>. Now you must pay $$alertpay on Alertpay account $alertpaye";
?>
<?
include "footer.php";
exit();
}
}
?>
<form action="register.php" method="POST">
<div style="padding-left:20px; float:left;">
<font color="9c1515">*</font>Username (3 - 15 characters - no special characters):<br>
<input type="text" size="25" maxlength="15" name="username" class="form" autocomplete=
shaggy
Profil
Prečo námmm sem dávaš stovky riadkov php kódu a píšeš, že je to html (keď to html nie je)?
Myslíš, že si z toho vyčítame výstupný kód? PHP je pre nás irelevantné + zdroják si vieme pozrieť na stránke, kde to nefunguje.
YOYO
Profil
problém je v tom formuláři, který je plovoucí, zjisti si něco o plovoucích prvcích, třeba na http://www.pixy.cz/pixylophone/2003_12_archiv.html#1071056082
problém vyřešíš třeba přidáním <br style="clear:both"> za ten <form>
kuba95
Profil
YOYO:
Děkuju mnohokrát... dal jsem to style="clear:both" do toho <div> a funguje to...

Vaše odpověď

Mohlo by se hodit


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm:

0