echo "<align=center>Logged in successfully.<br>";
why doesnt that work?
and also:
echo "Click here";
how would i hyperlink the word 'here'
Printable View
echo "<align=center>Logged in successfully.<br>";
why doesnt that work?
and also:
echo "Click here";
how would i hyperlink the word 'here'
1) Align is not an HTML tag, align=center is not valid SGML syntax, and you did not have a closing tag to boot.
HTML Code:<span style="text-align: center;">Logged in successfully</span><br>
2) The usual way - using an anchor tag. Also, read the Don't say Click Here link in my signature.
HTML Code:<a href="somewhere">Somewhere</a>
thanks alot penegate, 1 more question, i wana make the font verdana, size 9, any idea mate?
You should have a stylesheet, which is a .css file you attach using a <link> tag in your <head> section.
In the stylesheet you can put CSS rules such as font etc.HTML Code:<head>
<link rel="stylesheet" type="text/css" href="mypage.css">
</head>
sans-serif is a generic font class which is there as a fallback in case Verdana is not available on the user's system.Code:html {
font: 9pt Verdana, sans-serif;
}
All presentational rules should be set in the CSS file. The only things you should have in the HTML document are classes and id's, which you can use in CSS selection rules. If you are not familiar with this I suggest you go through a CSS tutorial.
oops sorry i meant just the text
<span style="text-align: center;">Logged in successfully</span><br>
just that to be verdana, not all 'fonts'
Ah,
You should give that a class (if it will appear more than once on a page) or ID (if it will appear only once).
Then you can select it in your stylesheet like this:
Code:/* For a class: */
.classname {
font: 9pt Verdana, sans-serif;
}
/* For an ID: */
#id {
font: 9pt Verdana, sans-serif;
}
that centre align is for html but how would it be done in php mate?Quote:
Originally Posted by penagate
PHP is a pre-processor. In most cases, and in this case, you're using it to output HTML code. So there's absolutely no difference. Whether you are using PHP or ASP or no server side language is completely transparent to the browser, which is what does the HTML and CSS parsing.
but my code is like this
and it throws errors when i put ur code inPHP Code:<?
if (empty($Username) || empty($Password)) {
echo "You didn't fully input login details. Please go back and try again";
}
else {
$res = $db->_LOGIN($Username, $Password);
if ($res == 1) {
echo "Logged in successfully.<br>";
echo "Test";
}
else echo "You specified invalid login details, please go back and try again.";
}
?>
You probably have to escape the additional quotes, for example:
If you do not escape the additional quotes in the text, PHP thinks it's the end of the string and thinks that everything after it is PHP code.PHP Code:echo "<span class=\"classNameHere\">Logged in successfully.</span><br>";
Don't use double quotes for strings. Single quotes are more efficient and avoids having to escape most characters. Also, don't use echo to output HTML. Output is what PHP does when it's not doing anything, so just stop the PHP block.
PHP Code:<?php if ($res == 1): ?>
<span style="text-align: center; ">Logged in successfully.</span><br>
<?php endif; ?>
Applying alignment to a span element will not do anything.
Div then. My mistake, forgot it was inline.