HTML and PHP |
HTML and PHP |
Hittce |
Nov 6 2011, 04:47 AM
Post
#1
|
Group: Members Posts: 1 Joined: 6-November 11 Member No.: 15,788 |
I'm new to all this and basically what I'm trying to do is get my website to execute this code:
<?php session_start(); $toplinks = ""; if (isset($_SESSION['id'])) { $userid = $_SESSION['id']; $username = $_SESSION['username']; $toplinks = '<a href="member_profile.php?id=' . $userid . '">' . $username . '</a> • <a href="member_account.php">Account</a> • <a href="logout.php">Log Out</a>'; } else { $toplinks = '<a href="join_form.php">Register</a> • <a href="login.php">Login</a>'; } ?> within a .html webpage how would i do that? can I convert what this is doing to html ? what do you suggest and if it is converting it could you please show me how or just do it thanks. |
Christian J |
Nov 6 2011, 07:00 AM
Post
#2
|
. Group: WDG Moderators Posts: 9,628 Joined: 10-August 06 Member No.: 7 |
|
Brian Chandler |
Nov 6 2011, 07:32 AM
Post
#3
|
Jocular coder Group: Members Posts: 2,460 Joined: 31-August 06 Member No.: 43 |
(I can't see that the PHP manual entry for echo is particularly useful...)
You need more program than this, and a database-backed server to store the information. Where did this fragment come from? No, you cannot "convert" this to html. |
Lo-Fi Version | Time is now: 19th March 2024 - 02:10 AM |