|
Thanks alot for all the input I have tried a couple of the solutions. I have had different outcomes
with the same result. At the moment I am using Marc Firth's solution and getting
"-Invalid username / password"
with a wrong or correct password.
With no values entered it returns
"You must supply a username and password."
Am not really good at reading and understanding the "IF" "ELSE" working but would appreciate if someone
gives a clue to what to do.
|
|
|
|
|
Try to output the hashed (sha1) password, and compare it to the one in the database. i.e. for user "joe" with password "bloggs" run the following code and compare the output to the mysql query below
First get the hash you are creating when you log in (notice the "die"):
<?php
require_once("../includes/ikobe.php");
if (isset($_POST['username']) && isset($_POST['password'])) {
$username = $_POST['username'];
$password = $_POST['password'];
$pass = sha1($password);
die($pass);
if (!empty($username) && !empty($password)) {
$query = "SELECT id FROM users WHERE username = '$username' AND password='$pass' LIMIT 1";
$query_run = mysql_query($query);
$query_num_row = mysql_num_rows($query_run);
if (mysql_num_rows($query_run) == 0) {
echo 'Invalid username / password combination';
} else {
echo 'Ok.';
}
} else {
echo 'You must supply a username and password.';
}
}
?>
Then compare it to the one in the database:
<?php
$query = "SELECT password FROM users WHERE username = 'joe' LIMIT 1";
$query_run = mysql_query($query);
while($row = mysql_fetch_array($query_run)){
echo $row['password'];
}
?>
The two results should match.
|
|
|
|
|
This works (tested):
<?php
session_start();
mysql_connect('localhost', 'user', 'pass');
mysql_select_db('dbname');
if (isset($_POST['username']) && isset($_POST['password'])) {
$username = $_POST['username'];
$password = sha1($_POST['password']);
if (!empty($username) && !empty($password)) {
$query_run = mysql_query("SELECT id, password FROM users WHERE username = '$username' AND password = '$password' LIMIT 1");
if (mysql_num_rows($query_run) == 0) {
echo 'Invalid username / password combination';
} else {
echo 'Ok.';
}
} else {
echo 'You must supply a username and password.';
}
}
?>
<form action="" method="post">
<label>Username:</label>
<input type="text" name="username" size="10" value="<?php echo htmlentities("$username"); ?>" />
<label>Password:</label>
<input type="password" name="password" size="10" value="<?php echo htmlentities("$password"); ?>" />
<input type="submit" name="login" value="Log In" />
<input type="submit" name="join" value="Join" />
</form>
|
|
|
|
|
Thanks Marc and all the rest that worked and put in all the help. the code finally works and now I will have some fun adding levels to the login accounts.
|
|
|
|
|
I am using Ubuntu 10.04 LTS with OpenConnect to connect to my work (Cisco VPN). All was working fine and today morning it just fails 'Error fetching SSL response. SSL connection failed).
I am sure they are using a self-signed SSL which has been working fine all along. Any ways to fix this issue?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
Any ways to make Google Unicode (Tamil/Hindi etc) fonts to appear properly in Chrome (Ubuntu Linux). Installed the Microsoft TTF fonts as suggested in Ubuntu forums by experts but to no avail yet. I admit:: I have restarted the system too not just the GUI.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
Does Tamil or Hindi text appear correctly elsewhere (e.g.) Firefox or not? I.e. is the problem limited to Chrome?
With Ubuntu, you can install the Hindi and Tamil localisations of the operating system. Also the fonts will be installed.
|
|
|
|
|
Firefox is no problem. Only Chrome is a headache.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
Goto fonts & encodings settings, and change all the fonts to use Tamil Unicode font. I mean the Serif and Sans Serif drop downs. That should be good enough.
Best wishes,
Navaneeth
|
|
|
|
|
Can some one share a few tips on what are the unneeded services that could be removed off in Ubuntu 10.04 (LTS) and Ubuntu 11.04 when using like a personal desktop operating system? The typical use of the computer would be the following:
1) Moderate use of Geany -- Programming IDE
2) Light to Moderate use of MySQL 5.1
3) Moderate use of Apache (for PHP)
4) Google Chrome (for Internet Browsing)
I am pretty sure not to require those bloated services like cron, Akonadi, KDE crap which are annoying my old resource-challenged computer.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
Vasudevan Deepak Kumar wrote: KDE crap which are annoying my old resource-challenged computer.
KDE on a resource challenged computer?
I'd suggest to move away from Ubuntu. Try something like Arch Linux with simple desktop environments like XFCE.
Best wishes,
Navaneeth
|
|
|
|
|
Easy, install a bare version of Debian, then install things such as X Windows and then a Desktop like XFCE. (Ubuntu is basically a rebranded version of Debian.)
See if you can crack this: b749f6c269a746243debc6488046e33f So far, no one seems to have cracked this!
The unofficial awesome history of Code Project's Bob!
"People demand freedom of speech to make up for the freedom of thought which they avoid."
|
|
|
|
|
Hi,
In my PHP application i want to call a asp page and then redirect to php page.
I used include_once,require_once,header but still getting an error.
How can i do it ?
Thanks in advance.
|
|
|
|
|
look at the functions file() and file_get_contents()
Chris J
www.redash.org
|
|
|
|
|
Not sure including an ASP would serve the purpose because PHP might not be able to parse it.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
Why not you call that asp page by using ? e.g: <iframe height="%100" width="%100" src="http://yourserver/yourfile.aspx">. But if really want to use your own method,you need to setup your http.conf and install asp extension for apache. Below are the step to run asp on your apache:
1.install Mod_AspDotNet
2.
Add at the end of C:\Program Files\Apache Group\Apache2\conf\httpd.conf the following lines
#asp.net
LoadModule aspdotnet_module "modules/mod_aspdotnet.so"
AddHandler asp.net asax ascx ashx asmx aspx axd config cs csproj licx rem resources resx soap vb vbproj vsdisco webinfo
<IfModule mod_aspdotnet.cpp>
# Mount the ASP.NET /asp application
AspNetMount /SampleASP "c:/SampleASP"
#/SampleASP is the alias name for asp.net to execute
#"c:/SampleASP" is the actual execution of files/folders in that location
# Map all requests for /asp to the application files
Alias /SampleASP "c:/SampleASP"
#maps /SampleASP request to "c:/SampleASP"
#now to get to the /SampleASP type http://localhost/SampleASP
#It'll redirect http://localhost/SampleASP to "c:/SampleASP"
# Allow asp.net scripts to be executed in the /SampleASP example
<Directory "c:/SampleASP">
Options FollowSymlinks ExecCGI
Order allow,deny
Allow from all
DirectoryIndex index.htm index.aspx
#default the index page to .htm and .aspx
</Directory>
# For all virtual ASP.NET webs, we need the aspnet_client files
# to serve the client-side helper scripts.
AliasMatch /aspnet_client/system_web/(\d+)_(\d+)_(\d+)_(\d+)/(.*) "C:/Windows/Microsoft.NET/Framework/v$1.$2.$3/ASP.NETClientFiles/$4"
<Directory "C:/Windows/Microsoft.NET/Framework/v*/ASP.NETClientFiles">
Options FollowSymlinks
Order allow,deny
Allow from all
</Directory>
</IfModule>
#asp.net
3. Test it by create your index.aspx and restart apache.
|
|
|
|
|
|
i have a knowledge about c,c++ in linux but i want to learn gui programming in linux.
please provide me starting lesson about GUI programming in linux environment?
witch library is better and how to use graphic libraries in linux ?
thnx
modified on Thursday, September 8, 2011 5:46 AM
|
|
|
|
|
Try Java you can do many thing in that. (Web Development or Desktop Application)
|
|
|
|
|
I can't change programming language in my project. I should use C++
|
|
|
|
|
Hi!
You can use Qt for graphics programming with C++ in Linux.
Regards!
|
|
|
|
|
To start program with Qt, You can use 2 free IDEs: CodeBlocks and CodeLite; Both of them work on Linux, and provide the startup creator for Qt4; I have tested CodeBlocks 10.04 and codeLite 2.10 under Debian 6.0.2 and Scientific Linux 6.1; CodeLite 3.0 didn't work due to the lack of wxWidgets 2.9, but with wxWidets 2.8 everything worked well on 32 bit Linux-es. Under 64-bit Debian 6.0.2 worked CodeBlocks, but CodeLite had some bug when tried to read integers with cin under Console application mode.
Rgds!
|
|
|
|
|
You can try to use the Qt Creator provided by Qt itself. It integrates a decent C++ editor,
several wizards for startup plus it integrates the Qt API documentation.
I can definitely recommend it: we used it for working on a multi-platform Qt project and it worked like a charm.
Best regards
|
|
|
|
|
mohammad masood ashrafi wrote: how to use graphic libraries in linux ?
Posting your question to Google reveals this[^].
|
|
|
|
|
You can learn Qt with c++. It provides qtcreator as IDE along with documentation. Begin with Tutorial in documentation.
|
|
|
|