/    Sign up×
Community /Pin to ProfileBookmark

Show a html/php-page instead of print?

Hello. My login system is almost working now. But I have one problem.

When a user logs on to my page the script I use only print a sentence:

“You are now loged on” (Shows it in Norwegian)

But instead I want it to show my “top secret” html page. Is there another command I have to use?

Here’s my php code:

<?php
session_start();
if($_SESSION[‘brukernavn’] && $_SESSION[‘passord’])
{
//Logger på databasen. Legg inn din egen info
$hostname = “localhost”;
$user = “xxxxxx”;
$password = “xxxxxxx”;
$db = “xxxxxxxxxxx”;
$connection = @mysql_connect($hostname, $user, $password) or die(“Umulig
å få kontakt med database”);
@mysql_select_db($db);
//Sjekker passord og brukernavn med database
$henter_bruker = @mysql_query(“SELECT brukerid FROM brukere WHERE brukernavn='{$_SESSION[‘brukernavn’]}’
AND passord='{$_
SESSION[‘passord’]}'”);
if(@mysql_num_rows($henter_bruker) == 0)
{

print(“Feil brukernavn og/eller passord!”); ? Here’s the problem. I want this to show a page not a sentence ?

}
else
{
//Nå er brukeren logget inn!
print(“Du er nå logget inn”);
//Her må du fortsette å skreddersy funksjonen
mysql_close($connection);
}
}
else
{
print(“Du må være innlogget for å nå disse sidene!”);
}
?>

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@GenixdeaeMar 09.2005 — require or include the page

require("page");

or

include("page");

where page is the page you wish to display.
Copy linkTweet thisAlerts:
@m2stianauthorMar 09.2005 — thanks.

worked out great!?
×

Success!

Help @m2stian spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...