|
-
Aug 18th, 2005, 01:41 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] help
i dont no wats wrong with these code samples...
Code:
session_name ('User');
session_start();
$_SESSION['username'] = 'testing';
$_SESSION['loggedin'] = time();
header ('Location: http://$_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/welcome.php');
exit ();
} else {
echo '<p>The submittes username and password do not match those on file.<br />
Go back and try again.</p>';
and
Code:
<?php
session_start();
require ('header.php');
echo '<h3>Welcome to Distorted View, ' . ucfirst($_SESSION['username']) . '!</h3>;
echo '<p>You have been logged in since:<br /> ' . date ('g:i a', $_SESSION['loggedin']) . '</p>';
echo '<p><a href="logout.php" title="Log Out">Log Out</a></p>';
require ('footer.php');
?>
they both contain parse errors ( an unexpected T_STRING error in the first where the header (line 15ish)i s and an unexpected '>' in the second one (line 7ish))
-
Aug 18th, 2005, 02:59 AM
#2
-
Aug 18th, 2005, 03:22 AM
#3
Thread Starter
Hyperactive Member
Re: help
it says the problem is on line 7 for the second one... this is line 7
echo '<p>You have been logged in since:<br /> ' . date ('g:i a', $_SESSION['loggedin']) . '</p>';
the first one worx now thanx but the second is still weird
-
Aug 18th, 2005, 03:28 AM
#4
Hyperactive Member
Re: help
Ah look here is the problem :0
echo '<h3>Welcome to Distorted View, ' . ucfirst($_SESSION['username']) . '!</h3>;
You do not terminate the string after </H3>;
A syntax highlighter would have shown this problem !!
-
Aug 18th, 2005, 03:30 AM
#5
Thread Starter
Hyperactive Member
Re: help
so wat should it be? sry im new
-
Aug 18th, 2005, 03:31 AM
#6
Thread Starter
Hyperactive Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|