-
[RESOLVED] php help
PHP Code:
<?php $title = "MarkHost.Biz - Download"; ?>
<?php require("styles/top.php"); ?>
<div id='full'>
<?php
require("scripts/connect.php");
$query = mysql_query("SELECT * FROM users WHERE username='$username'");
$numrows = mysql_num_rows($query);
If($username)
echo "<a href='http://www.markhost.biz/'><img src='images/banner.gif'></img></a>";
echo "You have now got access to the members page well done!";
else
echo "You need to login to to view the content of this page.";
?>
</div>
<?php require("styles/bottom.php"); ?> #
also how do i do a line brake between the first echo and the second echo.?
-
Re: php help
simply add \n before the close of double quotation..
http://www.tizag.com/phpT/strings.php
-
Re: php help
i tried that but still no joy
PHP Code:
<?php $title = "MarkHost.Biz - Download"; ?>
<?php require("styles/top.php"); ?>
<div id='full'>
<?php
require("scripts/connect.php");
$query = mysql_query("SELECT * FROM users WHERE username='$username'");
$numrows = mysql_num_rows($query);
If($username)
echo "<a href='http://www.markhost.biz/'><img src='images/banner.gif'></img></a>\n";
echo "test";
else
echo "You need to login to to view the content of this page.";
?>
</div>
<?php require("styles/bottom.php"); ?>
i now get this error?
PHP Code:
Parse error: syntax error, unexpected T_ELSE in /home/markhost/public_html/download.php on line 16
i tried the above code but i get this error
Parse error: syntax error, unexpected T_ELSE in /home/markhost/public_html/download.php on line 16
-
Re: php help
well its because you don't use brackets.. and my bad, i thought you wanted it to show a new line in the source code...
if you remove the blank line between the last echo and ?> then i think the error will go away..
if you need a new line to display on the page, then replace the \n with <br /> tag..
-
Re: php help
still geting
Parse error: syntax error, unexpected T_ELSE in /home/markhost/public_html/download.php on line 16
-
Re: php help
hmm try changing
PHP Code:
If($username)
echo "<a href='http://www.markhost.biz/'><img src='images/banner.gif'></img></a>\n";
echo "test";
else
echo "You need to login to to view the content of this page.";
to
PHP Code:
If($username) {
echo "<a href='http://www.markhost.biz/'><img src='images/banner.gif'></img></a>\n";
echo "test";
} else {
echo "You need to login to to view the content of this page.";
}
-
Re: php help
You might want to do some reading on the PHP syntax.
http://www.php.net/manual/en/languag...structures.php
-
Re: php help
Please give your threads proper titles. Every topic in this section is about PHP so "php help" doesn't tell anyone anything.