The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> HTML and PHP
Hittce
post 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> &bull;
<a href="member_account.php">Account</a> &bull;
<a href="logout.php">Log Out</a>';
} else {
$toplinks = '<a href="join_form.php">Register</a> &bull; <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 tongue.gif thanks.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Nov 6 2011, 07:00 AM
Post #2


.
********

Group: WDG Moderators
Posts: 9,628
Joined: 10-August 06
Member No.: 7



See http://php.net/manual/en/function.echo.php
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post 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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th March 2024 - 02:10 AM