Fix this before I shoot myself please

Discussion in 'HTML & Website Design' started by Xtrapsp, Dec 19, 2010.

  1. #1
    Ok I've been working with this oh so crappy coding. And I've had enough. I use notepad so this is why it is being difficult for me.


    http://poorn.info/Host/

    In Ie it moves... All over the place


    <?php
    extract($HTTP_GET_VARS);
    extract($HTTP_POST_VARS);
    session_start(); // start up your PHP session!
    if($action=="contact"||$action=="send_mail"){
    ob_start();  
    }
    
    $sess_id=session_id();
    include("conf.php");
    $db=mysql_connect($db_host,$database_user,$database_pass) or die("<b>MySQL Error:</b> Unable to connect to database please check that you have provided the correct <li>Database Login username<li>Database Login Password");	//Connect to database or give error if failed
    mysql_select_db($db_name,$db)or die("<b>MySQL Error:</b> Unable to select database please check that you have provided the correct <li>Database name");
    if($action=="logout"){
    if(isset($_SESSION['loged'])){
    @session_destroy();
    echo "You are loged out.";
    echo "<Table><TD><img src='img/host.gif'></TD><TD><FONT SIZE=4 COLOR=#000000>Members Login</FONT></TD></Table><br><form method=post action=members.php><Table cellspacing=4 style=\"BORDER:#3399FF 1px solid;BACKGROUND:#F9F9F9;\" width=35%><tr><td width=14% ><font size=-1>Username:</font></td><td width=187><input type=text name=username size=20></td></tr><tr><td width=14%>Password:</td><td><input type=password name=password ></td></tr><tr><td width=59></td><td><input type=submit name=submit value=Submit></td></tr></table><BR><Table border=0><TR><TD>Not a member? <A HREF=\"?action=join\">Join</A></TD></TR><TR><TD><a href='?action=forgot'>Forgot Password</a></TD></TR></Table>";
    }
    }
    ?>
    <HTML>
    <HEAD>GrimyHost </TITLE>
    <style>
    BODY {
    BACKGROUND-COLOR: #000
    }
    TD{
    FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: Arial, Helvetica, sans-serif
    }
    A:link {
    	COLOR: #BA0000; TEXT-DECORATION: none
    }
    A:visited {
    	COLOR: #BA0000; TEXT-DECORATION: none
    }
    A:hover {
    	COLOR: #BA0000; TEXT-DECORATION: underline
    }
    INPUT {
    	BACKGROUND-COLOR: #fff; COLOR: #000000; FONT-FAMILY: Verdana, Helvetica, Arial; FONT-SIZE: 9pt
    }
    A.white:link {
    	COLOR: #ffffff; TEXT-DECORATION: none
    }
    A.white:visited {
    	COLOR: #ffffff; TEXT-DECORATION: none
    }
    A.white:active {
    	COLOR: #ffffff; TEXT-DECORATION: none
    }
    A.white:hover {
    	COLOR: #ffffff; TEXT-DECORATION: none
    }
    </style>
    <META NAME="Keywords" CONTENT="LustHosted">
    <META NAME="Description" CONTENT="15 Mb of free webhosting.">
    
    <script type="text/javascript">
    function clearform(which){
    if (which.value=="Google Search")
    which.value=''
    }
    function sf(which){
    if (which.value=="")
    which.value='Google Search'
    }
    </script>
    </HEAD>
    <BODY>
    <!-- <TR bgcolor="#C20000" height=5> -->
    <table width=97.5% align=left cellspacing=0 cellpadding=0 border=0><TR bgcolor=#000 ><td align=left width=2%><img src="images/leftup.gif"></td><td width=98% style="BORDER-TOP: #949494 0px solid"><a href="?hm"><img src="images/Header.png" border=0 alt="Free PHP Hosting"></a></td>
    <td align=right width=2%><img src="images/rightup.gif"></td></TR></table>
    <TABLE width="97.5%" cellspacing=0 cellpadding=0><TR bgcolor="#BA0000" height=5><TD width=2% bgcolor=#000></TD><TD valign=top><img src="images/llt.gif" width=5 height=5></TD><TD></TD><TD></TD></TR>
    </TABLE>
    <TABLE width="97.5%" cellspacing=0 cellpadding=0><TR bgcolor="#f9f9f9" height=5><TD width=2% bgcolor=#000></TD><TD valign=middle align=center bgcolor=#BA0000 width=22%>&nbsp;</TD><TD bgcolor=#f9f9f9 width="47%" height=5 valign=top><table cellpadding=0 cellspacing=0 width=100% valign=top><TR bgcolor=#BA0000width=100% height=7 valign=top><TD></TD></TR></table></TD><TD align=right bgcolor=#BA0000>
    <table cellspacing=0 cellpadding=0 bgcolor=#BA0000 width=100% align=right><TR bgcolor="#BA0000" height=25><TD align=left valign=bottom><img src="images/seb.gif"></TD><TD align=left width=35% valign=top><a href="?hm"><FONT SIZE="2" COLOR="#FFFFFF">Home</FONT></a> <font color="#FFFFFF">::</font> <a href="?action=contact"><FONT SIZE="2" COLOR="#FFFFFF">Contact Us</FONT></a></TD></TR></TABLE>
    </TD></TR>
    </TABLE>
    <TABLE width="97.5%" cellspacing=0 cellpadding=0><TR><TD width=2% bgcolor=#000></TD>
    <TD bgcolor="#BA0000" width="22%" style="BORDER-LEFT: #949494 1px solid;" valign=top>
    <table cellspacing=3 cellpadding=4 bgcolor=#f9f9f9 align=center style="BORDER-LEFT: #949494 1px solid;BORDER-RIGHT: #949494 1px solid;BORDER-TOP: #949494 1px solid;BORDER-BOTTOM: #949494 1px solid" width=100%><TR><TD><a href=?home><B>Home</B></a></TD></TR><TR><TD style="BORDER-TOP: #949494 1px solid"><a href="?action=login"><B>Login</B></a></TD></TR><TR><TD style="BORDER-TOP: #949494 1px solid"><a href="?action=join"><B>Signup</B></a></TD></TR><TR><TD style="BORDER-TOP: #949494 1px solid"><a href="?action=contact"><B>Contact Us</B></TD></TR></TABLE><BR>
    <CENTER>
    <!-- Ad Space -->
    
    <!-- End Ad Space -->
    </CENTER>
    
    
    </TD>
    <TD width="1%" bgcolor=#f9f9f9><img src="images/spacer.gif" width=1 height=350>&nbsp;</TD>
    <TD width="75%" bgcolor=#f9f9f9 valign=top style="BORDER-RIGHT: #949494 1px solid">
    <?php
    if($action=="join"){
    if($do!="donr"){
    echo "<H2>Signup, its FREE!</H2>";
    echo "<form method=post action=members.php?action=join><center><Table cellspacing=4 style=\"BORDER:#AFC6DB 1px solid;BACKGROUND:#F9F9F9;\" width=80%>
    <TR><TD width=30%>Full Name:</TD><TD><input type=text name=name></TD></TR>
    <TR><TD width=30%>Login ID:</TD><TD><input type=text name=id> 4-10 characters</TD></TR>
    <TR><TD width=30%>Email:</TD><TD><input type=text name=email> Must be valid</TD></TR>
    <TR><TD width=30%>Password:</TD><TD><input type=password name=pass> 4-10 characters</TD></TR>
    <TR><TD width=30%>Confirm Password:</TD><TD><input type=password name=cpass></TD></TR>
    <TR><TD><BR></TD><TD>By clicking the button below you agree to our <a href='?action=terms'><B>terms and conditions</B></a></TD></TR>
    <TR><TD><BR>All fields are required<BR></TD><TD><input type=submit value=' Signup '></TD></TR>
    </Table><BR></Center></form>";
    }
    }
    if($action=="terms"){
    include "terms.txt";
    }
    if($action=="contact"){
    include "contact.txt";
    }
    if($action=="verify"){
    ////////////////////////////////////Verification Starts Here///////////////
    if($cid!=""){
    $seek=mysql_query("SELECT * FROM mhp_user WHERE uid='$uid' AND status='unconfirmed'");
    $cvou=mysql_num_rows($seek);
    if($cvou=="1"){
    $nimo=mysql_fetch_array($seek);
    $seek=mysql_query("UPDATE mhp_user SET status='confirmed' WHERE uid='$uid'");
    @mkdir("users/$uid");
    $mk=@fopen("users/$uid.txt","w");
    @fwrite($mk,"0");
    @fclose($mk);
    $mk=@fopen("users/$uid/index.html","w");
    @fwrite($mk,"<HTML><HEAD><TITLE>$uid Homepage</TITLE></HEAD><BODY><H3>You are seeing this webpage, since you have not yet uploaded your home page, please upload your website as soon as possible, all inactive users are deleted without any warning.</H3></BODY></HTML>");
    @fclose($mk);
    echo "<b>Your email has been verified, you may now login to your account and upload your website.</b>";
    $link1=getenv(HTTP_HOST);
    $link2=$_SERVER["PHP_SELF"];
    $blink=$link1.$link2;
    $link="http://$blink?action=login";
    $bc=mysql_query("SELECT * FROM mhp_admin");
    $adminifo=mysql_fetch_array($bc);
    $mess="Dear $nimo[uname],\nThank you for your registration at $adminifo[company]\nHere is your login information:\nUsername:$nimo[uid]\nPassword:$nimo[upass]\nYou may now start uploading your website by logging on to:\n$link\nHere is the link for your homepage:\nhttp://$link1/users/$nimo[uid]\nRegards\n$adminifo[company]";
    $subject="Thank you for your registration at $adminifo[company]";
    $mailheaders="Return-path: $adminifo[company] <$adminifo[admin_email]>\n";
    $mailheaders.="From: $adminifo[company] <$adminifo[admin_email]>\n";
    $mailheaders.="Reply-To: $adminifo[admin_email]\n";
    $set=mail(trim($nimo[uemail]), $subject, $mess, $mailheaders);
    }
    }else{
    echo "Error!, please paste the given link in your browser.";
    }
    ////////////////////////////////////Ends Here///////////////////////////////
    }
    if($action=="forgot"){
    ////////////////////////////////////Forgot///////////////
    if($_POST['email']==true){
    $seek=mysql_query("SELECT * FROM mhp_user WHERE uemail='$email' AND status='confirmed'");
    $cvou=mysql_num_rows($seek);
    if($cvou=="1"){
    $nimo=mysql_fetch_array($seek);
    //////////////////////////////////////
    $bc=mysql_query("SELECT * FROM mhp_admin");
    $adminifo=mysql_fetch_array($bc);
    $mess="Dear $nimo[uname],\nHere is your login information:\nUsername:$nimo[uid]\nPassword:$nimo[upass]\nRegards\n$adminifo[company]";
    $subject="Your login details at $adminifo[company]";
    $mailheaders="Return-path: $adminifo[company] <$adminifo[admin_email]>\n";
    $mailheaders.="From: $adminifo[company] <$adminifo[admin_email]>\n";
    $mailheaders.="Reply-To: $adminifo[admin_email]\n";
    $set=mail(trim($nimo[uemail]), $subject, $mess, $mailheaders);
    if($set){
    echo "<center>Email has been sent to your email with your login details.</center>";
    }else{
    echo "Mail could not be sent, please contact the administrator and inform about this error.";
    }
    
    //////////////////////////////////////
    }else{
    echo "<form method=post action=?action=forgot><BR><font color=red><b>This email does not exist in our database.</b></font><BR><BR><Table cellspacing=4 style=\"BORDER:#3399FF 1px solid;BACKGROUND:#F9F9F9;\" width=35%><tr><td width=14%><font size=-1>Email:</font></td><td width=187><input type=text name=email size=28></td><TR><TD></TD><TD><input type=submit value=' Submit '></TD></TR></Table></form>";
    
    }
    }else{
    echo "<Table><TD><img src='img/host.gif'></TD><TD><FONT SIZE=4 COLOR=#000000>Forgot Password?</FONT></TD></Table><br>Enter your email address you used for signup, your login details will be emailed to you.<form method=post action=members.php?action=forgot><Table cellspacing=4 style=\"BORDER:#3399FF 1px solid;BACKGROUND:#F9F9F9;\" width=35%><tr><td width=14%><font size=-1>Email:</font></td><td width=187><input type=text name=email size=28></td><TR><TD></TD><TD><input type=submit value=' Submit '></TD></TR></Table>";
    }
    
    
    
    ////////////////////////////////////Ends Here///////////////////////////////
    }
    if($action=="login"){
    echo "<Table><TD><img src='img/host.gif'></TD><TD><FONT SIZE=4 COLOR=#000000>Members Login</FONT></TD></Table><br><form method=post action=members.php><Table cellspacing=4 style=\"BORDER:#3399FF 1px solid;BACKGROUND:#F9F9F9;\" width=35%><tr><td width=14% ><font size=-1>Username:</font></td><td width=187><input type=text name=username size=20></td></tr><tr><td width=14%>Password:</td><td><input type=password name=password ></td></tr><tr><td width=59></td><td><input type=submit name=submit value=Submit></td></tr></table><BR><Table border=0><TR><TD>Not a member? <A HREF=\"?action=join\">Join</A></TD></TR><TR><TD><a href='?action=forgot'>Forgot Password</a></TD></TR></Table>";
    }
    if($action==""){
    ?>
    <BR><center>
    <script type="text/javascript"><!--
    google_ad_client = "pub-3971272619441070";
    google_ad_width = 468;
    google_ad_height = 60;
    google_ad_format = "468x60_as";
    google_ad_type = "text_image";
    google_ad_channel ="";
    google_color_border = "3399CC";
    google_color_bg = "FFFFFF";
    google_color_link = "333333";
    google_color_text = "000000";
    google_color_url = "666666";
    //--></script>
    <script type="text/javascript"
      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script></center>
    <Table cellpadding=3 cellspacing=0>
    <img src="/Host/images/Content.gif"alt="Details" />
    </Table>
    <BR>To prevent from abuse, we have restricted filesize limit to 400 Kb.	<BR>
    <BR><B>Please note that we do not allow media content (mp3, mpeg, wav etc.) to be uploaded on our server.</B><BR><center><a href="?action=join"><img src="images/signup.gif" border=0 alt="Click here to Signup"></a><BR><BR>
    </center>
    <!-- Main content starts here -->
    	<?php
    }
    ?>
    </TD>
    </TR>
    </TABLE>
    <TABLE width="97.5%" cellspacing=0 cellpadding=0><TR bgcolor="#BA0000" height=5><TD width="2%" bgcolor=#000></TD><TD valign=bottom><img src="images/llb.gif"></TD><TD></TD><TD></TD></TR>
    </TABLE>
    <table width=95% align=center cellspacing=0 cellpadding=0 border=0><TR style="background: url('/Host/images/middle_Footer.gif') repeat-x; width:100%; height:33px;" ><td align=left width=2%><img src="images/leftdown.gif"></td><td width=98% style="BORDER-BOTTOM: #949494 0px solid;BORDER-TOP: #949494 0px solid"> Copyright &copy <?php echo date("Y"); ?> <a href="?hm"><FONT SIZE="2" COLOR="#000000">Grimyhost.com</FONT></a>. All rights reserved. <a href="?action=terms"><FONT SIZE="2" COLOR="#000000">Terms and Conditions</FONT></a></td><td align=right width=2%><img src="images/rightdown.gif"></td></TR></table>
    </BODY>
    </HTML>
    
    Code (markup):
    Can someone Help me out before I kill myself?
     
    Xtrapsp, Dec 19, 2010 IP
  2. CSM

    CSM Active Member

    Messages:
    1,047
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    55
    #2
    First of all.. OMG, what's that?

    Ok, try to add a DOCTYPE. IE jumps into quirks mode without doctype.

    I do not use tables for layout.
     
    CSM, Dec 19, 2010 IP
  3. jeremyhowell

    jeremyhowell Member

    Messages:
    379
    Likes Received:
    7
    Best Answers:
    2
    Trophy Points:
    45
    #3
    I suggest you start again from scratch, or hire a programmer. Tables for layout is a big no no. Center, bgcolor, etc is deprecated.

    Use divs to contain your content, and use CSS for styling.
     
    jeremyhowell, Dec 19, 2010 IP
  4. Xtrapsp

    Xtrapsp Active Member

    Messages:
    716
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    90
    #4
    its a crappy script someone wants me to recode for them. Im going to try what CSM said.

    and im not starting from scratch... its way to hard to do that.
     
    Xtrapsp, Dec 19, 2010 IP
  5. jeremyhowell

    jeremyhowell Member

    Messages:
    379
    Likes Received:
    7
    Best Answers:
    2
    Trophy Points:
    45
    #5
    I could code you that page with valid CSS in well under an hour no problem, and in the long run it will definitely be worth it.

    Tables for layout are archaic, if you keep down this track, expect to always have a problem. And the code is an absolute nightmare, 63 errors!

    http://validator.w3.org/check?uri=h...(detect+automatically)&doctype=Inline&group=0

    Good luck with it anyway, let me know if you fix your problem.
     
    jeremyhowell, Dec 19, 2010 IP
  6. Xtrapsp

    Xtrapsp Active Member

    Messages:
    716
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    90
    #6
    Would you want payment? because I don't have a budget...
     
    Xtrapsp, Dec 19, 2010 IP
  7. jeremyhowell

    jeremyhowell Member

    Messages:
    379
    Likes Received:
    7
    Best Answers:
    2
    Trophy Points:
    45
    #7
    I'm assuming your recoding it for a friend, or is it a paid job?
     
    jeremyhowell, Dec 19, 2010 IP
  8. Xtrapsp

    Xtrapsp Active Member

    Messages:
    716
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    90
    #8
    a bit of both. but im not being paid in cash.
    I'm trying to do this for him and in return he's going to teach me some video editing.
     
    Xtrapsp, Dec 19, 2010 IP
  9. jeremyhowell

    jeremyhowell Member

    Messages:
    379
    Likes Received:
    7
    Best Answers:
    2
    Trophy Points:
    45
    #9
    Ill talk over PM.
     
    jeremyhowell, Dec 19, 2010 IP
  10. logoland

    logoland Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    you can fix the table layout for starters table-layout: fixed;
     
    logoland, Dec 19, 2010 IP