Need Help With Html And Php In echo"";

I’m trying to learn php, and I’ve picked up a php/mysql member system type script, and I’m trying to put the login/sign-up forms into my own pages. The problem I’m having though is getting PHP and HTML to work in the same echo"";

[php]echo ’

Home - RageCraft
<body>
	<div class="wrapper">
		<center>
			<div class="top">
				<div class="top-container">
					<div class="login">
						<a href="#"><b>SIGN UP</b></a>
					</div>
					<div class="ip">
						IP: PLAY.RAGECRAFTMC.NET
					</div>
					<div class="logo">
						<a href="#alert"><img src="images/logo1.png"/></a>
					</div>
				</div>
			</div>
			<div class="header">
				<div class="header-container">
					<ul>
						<li class="selected"><a href="/#">Home</a></li>
						<li><a href="#">Forums</a></li>
						<li><a href="#">Store</a></li>
						<li><a href="#">Contact</a></li>
					</ul>
				</div>
			</div>            
				<div class="image">
			</div>
			<div class="container">
			<div id="alert">
				<a class="alert" href="#alert">Go check out PlanetMinecraft!</a>
			</div>
			
				<div class="post">
				
					===========THIS IS THE LINE WHERE THE ERROR IS==========
					<form name="login" action='".$_SERVER['PHP_SELF']."' method="post" class="box login">
					
						<label><strong><font color="#585D5E">Login</font></strong></label>
						<fieldset class="boxBody">
							<label><strong><font color="#2F4A96">Username</font></strong></label>
							<input type="text" name="username" tabindex="1" required>
							<label><br /><strong><font color="#2F4A96">Password</font></strong></label>
							<input type="password" name="password" tabindex="2" required><br />
							<a href="#" class="rLink" tabindex="5">Forget your password?</a>
						</fieldset>
						<footer>
							<center><input type="submit" class="btnLogin" value="Login" tabindex="4"></center>
						</footer>
					</form>
				</div>
			</div>
		</center>
		<div class="push"></div>
	</div>
	<div class="footer">
			<p><center><strong><font color="#18446E"><a href="#alert">Hello</a></font></strong></center></p>
	</div>
</body>
';[/php]

What specifically is the issue?

I’ll point somethings out that are noticeable:
You are missing the document type, using the tag means it should be <!DOCTYPE> for html5.
the tag is removed for html5.
the PHP_SELF is not needed for a form action, it is the default (unless you really want it in there).

The id container is not needed in the tag. You can reference this in CSS with html.
You should also separate your markup (html) from the style (css) unless there is a reason behind mixing it. It makes tracking problems easier when there is one place to look.

There are some starting points for you to look into.

Sponsor our Newsletter | Privacy Policy | Terms of Service