Hi
Apache, PHP, and mysql working together nicely. All php pages being parsed, except one!! All i get is a blank output. The source view from the browser gives:
</body></html>
Here's what i get from the command prompt:
# php register.php3
X-Powered-By: PHP/4.1.2
Content-type: text/html
</body></html>
And thats it. No errors, no nothing.
Anybody knows whats going on here??
Your help would be appreciated
thanx
-Saqib
Blank result of a php page - help!
Moderator: General Moderators
Ive checked the php.ini, the error reporting is set to ALL_ERRORS (or something like that) The ini seems fine. If I deliberately add a ; or a { etc, it does generate errors.
I am using db connectivity here.
Here's the code
Thanx for the help..
----------------------------------------------------------
mod_edit: added php tags
I am using db connectivity here.
Here's the code
Thanx for the help..
----------------------------------------------------------
Code: Select all
<?php
function intrTab(){
topTab("Welcome to XtremWeb.",400) ?>
This page will help you to get an account on the Xtremweb server.<br>
Once, this few questions answered, you will be able to download
and run the XtremWeb softwares.<br>
This will also permit you to access the online statistics of your
machine. And as many project of this kind you may organise yourself
and your friends as team.
<?php
bottomTab();
}
function validTab( $l,$p,$e,$f,$n,$t,$c,$cfgBase )
{
// echo "l:" . $l ." p: " . $p . " e: " . $e . "<br>\n";
if ((!$l)||(!$p)||(!$e)) {
headerRegister(1);
topTab("Bad Filling.",400) ;
?>
<CENTER><h2><font color=red><bf>ERROR</bf></font></h2></CENTER>
You must fill the following fields to get an account on XtremWeb ! <br>
<ul>
<?php
if (!$l)
echo "<li><font color=red><bf>Login</bf></font><br></li>";
if (!$p)
echo "<li><font color=red><bf>Password</bf></font><br></li>";
if (!$e)
echo "<li><font color=red><bf>Email</bf></font><br></li>";
?>
</ul>
Please, update the next part and repost your form.
<?php
bottomTab();
return 0;
} else {
$sql = "SELECT code FROM users WHERE login = '". $l ."'";
$resultat = mysql_db_query($cfgBase, $sql);
$nb_enr = mysql_num_rows($resultat);
if ($nb_enr>0) {
headerRegister(1);
topTab("Bad Filling.",400) ;
echo "<CENTER><h2><font color=red><bf>ERROR</bf></font></h2></CENTER>";
echo "Sorry, but user <font color=red>". $l ."</font> has already registred to XtremWeb.<br> Please choose a different login.\n";
bottomTab();
return 0;
} else {
$sql = "INSERT INTO users VALUES ( '" . $l ."', '". codePassword ($p) . "', '" . $e . "', '" . $f ."', '" . $n ."', '" . $t ."', '" . $c ."', NULL)";
$resultat = mysql_db_query($cfgBase, $sql);
return makeSession($l);
}
}
}
function confirmRegister($l,$s) {
headerRegister(0);
topTab("Operation successfull.",400) ;
echo " You have been successfully registred to XtremWeb with
login <font color=red>". $l ."</font>.<br>No go to the download page.\n ";?>
<FORM method="Get" action="download.php3">
<TABLE border="0">
<INPUT TYPE=HIDDEN NAME=login VALUE=<?php echo $l; ?>>
<INPUT TYPE=HIDDEN NAME=session VALUE=<?php echo $s; ?>>
<TR><TD><INPUT type="submit" value="Continue"></TD></TR>
</TABLE></FORM>
<?php
bottomTab();
}
function surveyTab( $l,$p,$e,$f,$n,$t,$c ){
topTab("Identity. Field in red are Required.",400);
?>
Please fill this little survey .</TR></TD>
<tr><td ALIGN = 'CENTER'>
<TABLE ALIGN="TOP">
<form method="POST" action="register.php3" >
<TR><TD CLASS='required' > Login </TD><TD ALIGN='LEFT'>
<input
type=text name=login
<?php if ($l) echo " value=".$l; ?>
size=+15></TD></TR>
<TR><TD CLASS='required'> Password </TD><TD
ALIGN='LEFT'>
<input
type=password
name=password
<?php if ($p) echo " value=".$p; ?>
size=+15></TD></TR>
<TR><TD CLASS='required' > Email </TD><TD ALIGN='LEFT'>
<input type=text
name=email
<?php if ($e) echo " value=".$e; ?>
size=+15></TD></TR>
<TR><TD> </TD></TR>
<TR><TD> First Name </TD><TD ALIGN='LEFT'>
<input type=text name=fname
<?php if ($f) echo " value=".$f; ?>
size=+15></TD></TR>
<TR><TD> Last Name </TD><TD ALIGN='LEFT'>
<input type=text name=lname
<?php if ($n) echo " value=".$n; ?>
size=+15></TD></TR>
<TR><TD> </TD></TR>
<TR><TD> Team </TD><TD ALIGN='LEFT'>
<input type=text name=team
<?php if ($t) echo " value=".$t; ?>
size=+15></TD></TR>
<TR><TD> Country </TD><TD ALIGN='LEFT'>
<input type=text name=country
<?php if ($c) echo " value=".$c; ?>
size=+15></TD></TR>
<TR><TD ALIGN='CENTER' COLSPAN=2><input type=submit value="submit"></TD></TR>
</TD></TR></TABLE>
</form>
</CENTER>
<?php bottomTab();
}
?>
<?php
//-------------------------------------------
require("./XWlib.php3");
require("./header.php3");
require("./config.php3");
$connecte = @mysql_connect($cfgHote, $cfgUser, $cfgPass);
if ($connecte) {
// intrTab();
if (($login || $password || $email)) {
$session =
validTab($login,$password,$email,$fname,$lname,$team,$country,$cfgBase);
if ($session)
confirmRegister($login,$session);
else
surveyTab($login,$password,$email,$fname,$lname,$team,$country);
} else {
headerRegister(0);
intrTab();
surveyTab($login,$password,$email,$fname,$lname,$team,$country);
}
}
//fin if
print_footer();
?>maybe the mysql connection has been refused?
Code: Select all
if ($connecte) {
...
}
else
die(mysql_error());thanks for the mod edit 
Why not put a
behind the
and
and on other places an echo "IntrTab works"; etcetera throughout the script to see what works does and what not..
I'd like to advise you to use " " using input tags, to be sure it goes right..
Sorry i just don't understand this pile of code. People should comment a lot more
I wonder if you'd still understand your own code in 2 years. Could be me though, i have a problem with reading large texts.
Why not put a
Code: Select all
or die();Code: Select all
mysql_db_query($cfgBase, $sql);Code: Select all
$nb_enr = mysql_num_rows($resultat);I'd like to advise you to use " " using input tags, to be sure it goes right..
Code: Select all
<input type=text name=team .. to <input type="text" name="team"