Jump to content

Recommended Posts

i need help, making a website login with PHP. Ok, and i need to know how to host a server with apache to test it.

I know nothing about php. :(

Any help appreciated.

 

Website is here

http://ghoztnetwork.x10hosting.com/index.html

(not finished yet, havent even made the main page :P )

simple one.

 

<?php
$username = "admin";
$password = "pass";
if ($_POST['txtusername'] != $username || $_POST['txtpassword'] != $password) {
?>

 

<form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">

<table border="1" cellspacing="0" cellpadding="0" align="center">

<tr><td><label for="txtusername">Username:</label><br />

<input type="text" title="Enter your Username" name="txtusername" value="admin" /></td></tr>

<tr><td><label for="txtpassword">Password:</label><br />

<input type="password" title="Enter your password" name="txtpassword" /></td></tr>

<tr><td align="center"><input type="submit" name="Submit" value="Login" /></td></tr>

</table>

</form>

 

 

 

 

<?php
}
else {
?>

<?php
header( 'Location: http://www.website addy.com' ) ;
?>

<?php
}
?> 

 

bascailly. if user & admin = correct  go to <  header. >  good for a single admin login page :P

 

 

What have you done so far?

 

P.S. - Your link gives me an "Address Not Found" error.

 

nothing, just messed around by following a tutorial, failed miserably.

 

address not found ??? i get it fine. Idk, anyone else get address not found ?

Ok, if some one could walk me through making it please do. It would really be appreciated.

 

There are literally thousands of these tutorials on the net, were not here to write more of them.

 

If you have problems with code, post it, otherwise I suggest googling a tutorial.

I started learning here from these guys:

 

http://www.w3schools.com/

 

Look down the left menu until you see "Learn PHP" - I've not linked directly to that page so you can see what else they have on there.

 

Very informative with easy step-by-step guides.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.