HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
url stays the same and secure
Post new topic   Reply to topic    HTML Help Forum Index -> PHP
View previous topic :: View next topic  
Author Message
dieheart567



Joined: 04 Oct 2007
Posts: 14

PostPosted: Fri Feb 15, 2008 3:18 am     url stays the same and secure Reply with quote

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

Very Happy
Corey Bryant
Site Admin


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

PostPosted: Fri Feb 15, 2008 9:30 am     Reply with quote



I did not see where you referenced https:// for security, but the example you gave was mainly dealing with URLs.

If you are wanting the URL to stay the same in the address bar, you would need to use frames (which I would not recommend).

_________________
Corey
Toll Free Solutions | Mile High Merchant Accounts | Expression Web Blog
dieheart567



Joined: 04 Oct 2007
Posts: 14

PostPosted: Sun Mar 16, 2008 1:32 am     Reply with quote

How do i make a https?
Corey Bryant
Site Admin


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

PostPosted: Sun Mar 16, 2008 6:13 am     Reply with quote

You point the URL to a secure URL
Code:
<a href="https://www.example.com">Secure</a>

_________________
Corey
Toll Free Solutions | Mile High Merchant Accounts | Expression Web Blog
rsleventhal



Joined: 19 Mar 2008
Posts: 20

PostPosted: Wed Mar 19, 2008 5:19 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> PHP All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial