Jump to content

php mysql help


koulaid

Recommended Posts

hey everyone i'm kind of new at this so bare with mw. im trying to script a login page. in my mysql database i have 2 fields "name and password". I have 2 names with two passwords that i inserted into the table. but when i am at the login form and try to login i can only get one name with its password and login but the other doesnt work. for ex.

[u]name[/u] - [u]password[/u]
john - doe
joe - schmoe

i login with the name john and the password is doe, but then i cant login with joe. im not sure what is wrong or what else i need.

heres the url for the script : [url=http://www.2kcodes.com/local/test.txt]http://www.2kcodes.com/local/test.txt[/url]
Link to comment
Share on other sites

[code]
function FormCheck()
{
$data = mysql_query("SELECT * FROM test WHERE name =$_POST['name']"); 
$password = $_POST['password'];
$password_encrypt = md5($password);
$info = mysql_fetch_array( $data );
if (empty($_POST['name']))
{
echo '<center><font color="red">Please enter your name.<br></font></center>';
}
if (empty ($_POST['password']))
{
echo '<center><font color="red">Please enter you password.<br></font></center>';
}
if (isset($_POST['name'] && $_POST['password'] && $_POST['name'] != $info['name'] || $password_encrypt != $info['password'])
{
echo "<center><font color='red'>Sorry your information doesn't match the one that is stored on the database.<br><br></font></center>";
}else {
session_start();
$_SESSION['name'] = $info['name'];
header ('Location: home.php');
}
}
[/code]

try that
Link to comment
Share on other sites

[quote author=mgallforever link=topic=117144.msg477675#msg477675 date=1165094342]
[code]
function FormCheck()
{
$data = mysql_query("SELECT * FROM test WHERE name =$_POST['name']");  
$password = $_POST['password'];
$password_encrypt = md5($password);
$info = mysql_fetch_array( $data );
if (empty($_POST['name']))
{
echo '<center><font color="red">Please enter your name.<br></font></center>';
}
if (empty ($_POST['password']))
{
echo '<center><font color="red">Please enter you password.<br></font></center>';
}
if (isset($_POST['name'] && $_POST['password'] && $_POST['name'] != $info['name'] || $password_encrypt != $info['password'])
{
echo "<center><font color='red'>Sorry your information doesn't match the one that is stored on the database.<br><br></font></center>";
}else {
session_start();
$_SESSION['name'] = $info['name'];
header ('Location: home.php');
}
}
[/code]

try that
[/quote]

theres a parse error where you added in the $data : Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/koulaid2/public_html/local/login.php on line 9
Link to comment
Share on other sites

i have created a web page using MS front page and
ihave uploaded a folder named MIDI containing 600 midi files

is there any method that all the names of midi files in folder MIDI automatically appears on my web page

i dont want to write names of files in source of html page than create hyper link i have to submit nearly 2000 files i.e. (ring tones ,softwares,themes) i am using services of freewebtown.com may web page will me  freewebtown.com/xyz
Link to comment
Share on other sites

[quote author=hazratjee link=topic=117144.msg477688#msg477688 date=1165096059]
i have created a web page using MS front page and
ihave uploaded a folder named MIDI containing 600 midi files

is there any method that all the names of midi files in folder MIDI automatically appears on my web page

i dont want to write names of files in source of html page than create hyper link i have to submit nearly 2000 files i.e. (ring tones ,softwares,themes) i am using services of freewebtown.com may web page will me  freewebtown.com/xyz
[/quote]

y are u in my thread? make ur own and to answer your question. theres no way ok.
Link to comment
Share on other sites

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.