Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
hiya everyone... please help me on abit of info i need...
Old 06-08-2005, 02:42 PM hiya everyone... please help me on abit of info i need...
-_darkranger_-'s Avatar
Super Talker

Posts: 122
Location: bolton...
Trades: 0
hiya everyone *does cheesy wave*...

so far when doing web stuff i have only used HTML and abit of JScript but i want to make a gothic style profile website like www.vampirefreaks.com (thats an ok website but the creator loves himself to much) and www.gonegothic.com (thats a brill site but its only small... i talk to the creator and hes a really nice person ^-^) using PHP but i dont no anything about PHP...

the problem i have is i usually learn stuff by getting a simple code and editing it (thats what i did with HTML) but i cant find any simple PHP code for loging in and out... also i dont no how to install PHP and MySQL on my computer... please help me by telling me how to install PHP and MySQL and also could some give me a simple code for loging in and out...? pleaseee ill love you for ever


xxx thx in advance for any replies...
-_darkranger_- is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-08-2005, 03:53 PM
Uche's Avatar
Extreme Talker

Posts: 174
Location: Nigeria/Lagos
Trades: 0
Ok man i could tell u how to install that.. but u really need to install apache, mySQL, PHP just need to go here www.apachefriends.org and you will surely find how to install that.. very easy to understand download it or u go here as well www.apache2triad.net


And also here is the login scirpt. first u must learn how to create a DB
PHP Code:
<?php
session_start
();
include 
'config.php';

if(isset(
$_POST['login']))
{

$username trim(addslashes($_POST['username']));
$password md5(trim($_POST['password']));

$query mysql_query("SELECT * FROM Users WHERE Username = '$username' AND Password = '$password' LIMIT 1") or die(mysql_error());

$row mysql_fetch_array($query);

// now we check if they are activated

if(mysql_num_rows($query) > 0)
{

if(
$row['Activated'] > 0)
{

$_SESSION['s_logged_n'] = 'true';
$_SESSION['s_username'] = $username;
$_SESSION['s_name'] = $row['Name'];

header("Location: member.php");

} else {

echo 
'
<html>
<head>
<title>Login</title>
<link href="style.css" rel="stylesheet" type="text/css">

</head>

<body>
<div id="error"><p>Sorry, you must activate your account first. Please check your email for the email.</p>
<p>Didn'
."'".'t get your validation email? <a href="resend.php">Click here</a> to resend the validation email.</p></div>
</body>
</html>
'
;

}

} else {

echo 
'
<html>
<head>
<title>Login</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>

<body>
<div id="error"><p>There was an error processing your login, it appears that your username and/or password was incorrect. Please try again.</p>
<p>Didn'
."'".'t get your validation email? <a href="resend.php">Click here</a> to resend the validation email.</p>

</div>
</body>
</html>
'
;

}

} else {

?>
<html>
<head>
<title>Login</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>

<body>

<div id="wrapper">

<div id="head">the login page</div><br>
<div id="main"> 
<p>You must login to view this page. Enter your username and password below and hit submit:</p>
<form method="post" action="<?= $_SERVER['PHP_SELF'?>">
<p>Username:<br>
<input name="username" type="text" Cid="username">

<p>Password:<br>
<input name="password" type="password" id="password">
</p>
<p>
<input name="login" type="submit" id="login" value="Submit">
</p>
</form>
<p>Didn't get your validation email? <a href="resend.php">Click here</a> to resend the validation email.</p>
<p>Need an account? <a href="register.php">Click here</a> to register, it's completely free! </p>
</div>

</div>

</body>
</html>
<? mysql_close($l); ?>

And also here is ur logout script


PHP Code:
<?php

session_start
();

$_SESSION['s_logged_n'] = '';
$_SESSION['s_name'] = '';
$_SESSION['s_username'] = '';

session_destroy();


header("Location: login.php");

?>

i could give u my complete script and database if u want

cheers !
__________________
Life is just lyke a school where everybody goes to learn one or two thing. the more u school, the more u learn more about school..The more we live our lifes.. the more we learn more about life.

Please login or register to view this content. Registration is FREE

Last edited by Uche; 06-08-2005 at 04:09 PM..
Uche is offline
Reply With Quote
View Public Profile Visit Uche's homepage!
 
Old 06-12-2005, 09:26 AM
-_darkranger_-'s Avatar
Super Talker

Posts: 122
Location: bolton...
Trades: 0
thx... does that apachefriends thing automaticaly install php and mysql...?
-_darkranger_- is offline
Reply With Quote
View Public Profile
 
Old 06-13-2005, 11:34 AM
-_darkranger_-'s Avatar
Super Talker

Posts: 122
Location: bolton...
Trades: 0
php isnt working and im getting confuzled (my way of saying confused)
-_darkranger_- is offline
Reply With Quote
View Public Profile
 
Old 06-15-2005, 01:18 PM
-_darkranger_-'s Avatar
Super Talker

Posts: 122
Location: bolton...
Trades: 0
please someone reply... does apachefriends install php and mysql...?
-_darkranger_- is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to hiya everyone... please help me on abit of info i need...
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.26520 seconds with 12 queries