 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
dieheart567
Joined: 04 Oct 2007 Posts: 14
|
Posted: Fri Feb 15, 2008 3:18 am url stays the same and secure |
|
|
|
hi
i have been wondering, if you were making a website with the code,
| Code: |
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="">
<p>Username:
<input name="user" type="text" id="user">
</p>
<p>Password:
<input name="pass" type="text" id="pass">
</p>
<p>
<input type="submit" name="Submit" value="login">
</p>
</form>
<?php
$user=$_POST['user'];
$pass=$_POST['pass'];
if (($user=='Dieheart567') && ($pass=='password')) echo 'Login Success';
else echo 'Login Failure"';
?>
</body>
</html>
|
does anyone know how i can make it secure also does anyone know a code i can use so the url stays the same on each page?
for example..
i go onto a website and then click on a page called gallery. the url would then be ..
http://www.domainname.com/gallery
does anyone know a code so if i would click on gallery the url would stay as
http://www.domainname.com
please help
 |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8255 Location: Castle Rock CO USA
|
|
dieheart567
Joined: 04 Oct 2007 Posts: 14
|
Posted: Sun Mar 16, 2008 1:32 am |
|
|
|
| How do i make a https? |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8255 Location: Castle Rock CO USA
|
|
rsleventhal

Joined: 19 Mar 2008 Posts: 20
|
Posted: Wed Mar 19, 2008 5:19 am |
|
|
|
One way to do this, sorta, is to use a reference index.
using PHP and CSS, you could make the site's URLs look something like:
http://www.example.com/index.php?somename
where somename is a pointer to a page called somename.php. The only thing that changes is the reference being passed after the ? character.
Sample code:
[code]
<?php
//
// $page contains the parameter contained in the URL, e.g.
// /mypage.php?somevalue
// $page = somevalue
//
// $pagename is the value used in an include statement which
// is responsible for populating the content are of the website.
// the include populates <div class="contentarea">
//
// this value is built (usually) by appending $page with '.txt'
//
$page = basename( $_SERVER['QUERY_STRING'] );
if ( !$page )
{
header( "Location: index.php" );
}
else // some exceptions to the rule
{
if ( $page == 'search' )
{
$pagename = '/search.php';
header($pagename);
} // the 'rule'
if ( file_exists( 'content/' . $page . '.txt' ) )
{
$pagename = "content/$page" . ".txt";
}
else // what to do if there's a 404
{
$page = "404";
$pagename = "content/404.txt";
}
}
I'm not sure this is what you're looking for, but I find it a very nice and easy way to limit the amount of server load by only loading nav, header, footer once..the only thing that changes is the content section (<div>) which is called by 'includes' in the main document.
As for secure connections, Corey Bryant's got that answer for you, using SSL (https) calls will do the trick.
HTH,
-Ray |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
|
 |
|
|
|
|
|
|
|