PHP echo placement

APMANAGER

New Member
Messages
19
Reaction score
0
Points
0
So im pretty new to php and im trying to learn. Im currently working on a login site i have everything figured out except that when u login it echos a logout link at the top left hand corner of the logged into page. I know i have to define the echo to be able to place the logout link anywhere i want. Does anyone have a script tthat can help me. Thank you in advance.
 

diabolo

Community Advocate
Community Support
Messages
1,682
Reaction score
32
Points
48
I don't get what you are trying to look for, if you are looking to echo:

echo "string of text";
echo $myvariable;
 

APMANAGER

New Member
Messages
19
Reaction score
0
Points
0
well what i have is

echo "<a href=logout.php>Logout</a>";

and all it does is put a hyperlink at the top left of the logged into page. So what if i wanted to put the link in a form in the middle right of the logged in page. What would do to get that to happen. My idea is that i would have to add something to this to define it and then put a script in the form where i want the echo to take place "the logout link", but like i said im still in the learning stages of php so im not sure. thank you
 

easykey

New Member
Messages
45
Reaction score
0
Points
0
You are echoing a standard html hyperlink, not really php. Usually when you want to write straight html you would keep it outside your php script and not use echo, but its a matter of choice really...

e.g.
<?php
//some script
?>
<table border="0">
<tr><td><a href=logout.php>Logout</a></td></tr>
</table>
<?php
//some script
?>

You can position the link either using html tables or, preferably for new web designers, CSS.

It's hard to give specific code advice on positioning without knowing exactly what you want. Is this logout link part of a side bar etc. etc.?

If you don't know much about this you should check out the w3schools tutorials first.
 
Last edited:

VPmase

New Member
Messages
914
Reaction score
0
Points
0
Or you can give it a specific style attrib.

echo '<a href="logout.php" style="position:absolute; top:50px; left: 70%;">Logout</a>';
 

APMANAGER

New Member
Messages
19
Reaction score
0
Points
0
Thank you Vp that was exactly what i was looking for. I know it was very simple I just didnt know how to do it. Thank you again.
 
Top