UK Webmaster Talk - Online Marketing - SEO


 

hyperlinks from db

This is a discussion on hyperlinks from db within the Php and MySQL forums, part of the Programming / Scripting / Coding category; PHP Code: <?php ob_start (); session_start (); $password  =  $_SESSION [ 'password' ]; $username  =  $_SESSION [ 'username' ]; echo  ...


Go Back   UK Webmaster Talk - Online Marketing - SEO > Website Design & Development > Programming / Scripting / Coding > Php and MySQL

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Notices

Reply

 

LinkBack Thread Tools Display Modes
Old 22-04-2005, 19:09   #1 (permalink)
WMT Addict
 
Join Date: Apr 2005
Location: Brighton,UK
Posts: 162
iTrader: 0 / 0%
asgsoft is on a distinguished road
Default hyperlinks from db

PHP Code:
<?php
ob_start
();
session_start();
$password $_SESSION['password'];
$username $_SESSION['username'];
echo 
"<html>
        <head>
            <title>Member List</title>
        </head>
        <body>"
;
$db mysql_connect("localhost""root""");
mysql_select_db("logsys",$db);
$result mysql_query("SELECT * FROM logsys WHERE username='$username' AND password='$password'",$db);
if(
mysql_num_rows($result) == 1){//Checks there is only 1 user
    
$get_users mysql_query("SELECT * FROM logsys ORDER BY date");//Queries for every user
    
if(mysql_num_rows($get_users) > 0){
            while (
$rec mysql_fetch_row($get_users)) {
                echo(
"ID: " $rec[0] . "<br>\n");
                echo(
"Username Name: " $rec[1] . "<br>\n");
                echo(
"Email " $rec[3] . "<br>\n");
             echo(
"Date Joined: " $rec[4] . "<br><br>\n");
            }
    }else{
        echo 
"No Users";
    }
}else {
//hmmm we didnt find there data? error time! :eek:
    
echo("<center><font face=\"Verdana\">Sorry, your not logged in, proceed <a href=\"/logsys/login.php\">here</a> to login.");
}
echo
"
    </body>
</html>"
;
ob_end_flush();
?>
asgsoft is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 22-04-2005, 19:11   #2 (permalink)
Moderator
 
Join Date: Jan 2005
Location: post is there >>
Posts: 1,586
iTrader: 0 / 0%
robertall is just really nice
Send a message via AIM to robertall Send a message via MSN to robertall
Default

Can you explain how it works, some people do not understand what the raw code does?
__________________
Free .org domain - Click for details!
Do not pm asking for things. My inbox is full. Add me to MSN!
robertall is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 22-04-2005, 19:28   #3 (permalink)
WMT Addict
 
Join Date: Apr 2005
Location: Brighton,UK
Posts: 162
iTrader: 0 / 0%
asgsoft is on a distinguished road
Default

it is an addition to mck user system part 1 tutorial. this gets data from the db such as username,id,email,date joined and maked a member list out of them.
asgsoft is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 25-04-2005, 23:39   #4 (permalink)
Newbie
 
Join Date: Jan 2005
Location: Lincolnshire, United Kingdom
Posts: 12
iTrader: 0 / 0%
jren207 is on a distinguished road
Default

You might want to MD5 the password for security.

For example, running the original password through MD5

PHP Code:
<?php 
$password_out 
MD5($password_in); 
echo(
'' $password_out ''); 
?>
then inserting
PHP Code:
$password_out 
into a database by hand with phpmyadmin for example, or
setting up a mysql insert to do it...

then making your script compare the MD5 instead...

PHP Code:
<?php 
$password_out 
MD5($password); 
?>
...

PHP Code:
<?php 
$result 
mysql_query("SELECT * FROM logsys WHERE username='$username' AND password='$password_out'",$db); 
?>
jren207 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
hyperlinks

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


All times are GMT +1. The time now is 19:40.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
UK Webmaster Forum © WebmasterTalk.co.uk | Design by Forbairt

Ad Management by RedTyger

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41