I want this two echo's to stay in one line. One in center and another right like I did but not in new line


echo "<a href=\"http://zafakultet.herobo.com\logout.php\"><font size=+1</font>Click here to logout!</a>"; echo "<p align=right>Username: " . $_SESSION["valid_user"];

I tried with <? ?> and it wont work.

Thanks for help.

Member Avatar for diafol

What are you trying to do?

PHP will spit out html. So if html will not produce a single line, you won't see a single line.

echo "<a href=\"http://zafakultet.herobo.com\logout.php\"><font size=+1</font>Click here to logout!</a>"; echo "<p align=right>Username: " . $_SESSION["valid_user"];

Will produce 2 lines - due to the <p> being a block element. You probably need to use a float in your css if you're determined to use this html syntax. Also close the <p> tag.

but how to align without <p ?

echo "<a href=\"http://zafakultet.herobo.com\logout.php\"><font size=+1</font>Click here to logout!</a>"; echo "Username: " . $_SESSION["valid_user"];

this will make look like this Click here to logout!username:.....

echo "<a href=\"http://zafakultet.herobo.com\logout.php\"><font size=+1</font>Click here to logout!</a>"; echo "<p align=right>Username: " . $_SESSION["valid_user"];

and this will make Click here to logout!
newline but right spot username:....

Member Avatar for diafol

This is a CSS/HTML issue rather than PHP.

However,

echo "<p><a href=\"http://zafakultet.herobo.com\logout.php\"> Click here to logout {$_SESSION["valid_user"]}</a> </p>"

should work. But I'm still confused as to how you want this to look.

I want to have in middle option to logout and in same line but absolute right to show who is loged in and I might add more details later for now this only, you can look http://zafakultet.herobo.com user and pass 12345

Member Avatar for diafol

This is a CSS/HTML issue rather than PHP.

I had a look at the link, no clues there. Couldn't log in with the details (user | 12345).

strange I tried with 12345 and pass 12345 is login every time, try again but nvm I want to have this two commands in same line seperated, how can seperate I heard there is some command &nbsp or something?

Member Avatar for diafol

*stress* THIS IS CSS/HTML NOT PHP

BYE.

there is code to make space betwen text, if you do like 10x space it will still be one space but one simple code read full space.
bye

there is code to make space betwen text, if you do like 10x space it will still be one space but one simple code read full space.
bye

You don't mean the "code" &nbsp; do you? This will allow space between text..

Member Avatar for diafol

hello again.
Read up on the following:
CSS attributes

display
float
position
padding

You DO NOT need to use &nbsp;

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.