masrawy Posted February 14, 2009 Author Share Posted February 14, 2009 plz help me Link to comment Share on other sites More sharing options...
masrawy Posted February 16, 2009 Author Share Posted February 16, 2009 dear : justsomeguyi don't finde any one but you help me Link to comment Share on other sites More sharing options...
justsomeguy Posted February 16, 2009 Share Posted February 16, 2009 Yeah take it easy, I'm busy and I don't come here on weekends. Posting on this forum is not the only thing I do.What is the hgi_site/login.html file? Post the code for that, or at least the first few lines. Link to comment Share on other sites More sharing options...
masrawy Posted February 18, 2009 Author Share Posted February 18, 2009 that is login file sir<html dir="rtl"><meta http-equiv="Content-Type" content="text/html; charset=windows-1256"><meta http-equiv="Content-Language" content="ar-sa"><meta name="GENERATOR" content="Microsoft FrontPage 5.0"><meta name="ProgId" content="FrontPage.Editor.Document">{include file="$config_style/headws-1256"; {if ($erro_insert_all_filds or $login_out or $login)} <div>{$erro_insert_all_filds}{$login_out}{$login}</div> {/if} <h3>الدخول للموقع</h3><br /> <p style="text-align: justify;">يرجى إدخال اسم المستخدم وكلمة السر في النموذج التالي:</p><br /> {if not $login}<div align="center"><div class="boxH" style="width: 420px;">الدخول للموقع</div><div class="boxB" style="width: 420px;"><div class="row" style="margin-top: 10px;"> <div id="showithere_log"></div><div id="showithere_log2"> <table border="0" width="100%"> <tr> <td width="99" height="25">اسم المستخدم</td> <td> <input type="text" id="login_username" size="25" dir="ltr"></td> </tr> <tr> <td width="99" height="25">كلمة المرور</td> <td> <input type="password" id="login_userpass" size="25" dir="ltr"></td> </tr> <tr> <td width="99" height="25"> </td> <td> <input type="button" value="دخول" onclick="java script: HGI_show('showithere_log'),HGI_hide('showithere_log2'),makeRequest_log();"></td> </tr> </table> <div style="text-align: center;margin-top: 10px;">| <a href="forget.html">نسيت كلمة المرور</a> | <a href="active_mail.html">تفعيل البريد</a> | <a href="active_mob.html">تفعيل الجوال</a> | <a href="register.html">تسجيل</a> |</div> </div></div></div></form> </td>{else} <!--META HTTP-EQUIV=Refresh CONTENT=1;URL=index.html--> {/if}{include file="$config_style/footer.html"}this file is under this directory/templates\hgi_site/login.html Link to comment Share on other sites More sharing options...
justsomeguy Posted February 18, 2009 Share Posted February 18, 2009 I'm not sure specifically how Smarty works, but you probably need to add a closing } to that first "include" statement. Link to comment Share on other sites More sharing options...
masrawy Posted February 18, 2009 Author Share Posted February 18, 2009 you mean {include file="$config_style/headws-1256"; be that {include file="$config_style/headws-1256"; } Link to comment Share on other sites More sharing options...
justsomeguy Posted February 18, 2009 Share Posted February 18, 2009 Right. It might not need the semicolon. This one doesn't have one:{include file="$config_style/footer.html"} Link to comment Share on other sites More sharing options...
masrawy Posted February 18, 2009 Author Share Posted February 18, 2009 sir this is login.html code {include file="$config_style/header.html"} {if ($erro_insert_all_filds or $login_out or $login)} <div>{$erro_insert_all_filds}{$login_out}{$login}</div> {/if} <h3>الدخول للموقع</h3><br /> <p style="text-align: justify;">يرجى إدخال اسم المستخدم وكلمة السر في النموذج التالي:</p><br /> {if not $login}<div align="center"><div class="boxH" style="width: 420px;">الدخول للموقع</div><div class="boxB" style="width: 420px;"><div class="row" style="margin-top: 10px;"> <div id="showithere_log"></div><div id="showithere_log2"> <table border="0" width="100%"> <tr> <td width="99" height="25">اسم المستخدم</td> <td> <input type="text" id="login_username" size="25" dir="ltr"></td> </tr> <tr> <td width="99" height="25">كلمة المرور</td> <td> <input type="password" id="login_userpass" size="25" dir="ltr"></td> </tr> <tr> <td width="99" height="25"> </td> <td> <input type="button" value="دخول" onclick="java script: HGI_show('showithere_log'),HGI_hide('showithere_log2'),makeRequest_log();"></td> </tr> </table> <div style="text-align: center;margin-top: 10px;">| <a href="forget.html">نسيت كلمة المرور</a> | <a href="active_mail.html">تفعيل البريد</a> | <a href="active_mob.html">تفعيل الجوال</a> | <a href="register.html">تسجيل</a> |</div> </div></div></div></form> </td>{else} <!--META HTTP-EQUIV=Refresh CONTENT=1;URL=index.html--> {/if}{include file="$config_style/footer.html"}is ther any error in it ? Link to comment Share on other sites More sharing options...
justsomeguy Posted February 18, 2009 Share Posted February 18, 2009 I don't know if there's an error. Does it work? Link to comment Share on other sites More sharing options...
masrawy Posted February 18, 2009 Author Share Posted February 18, 2009 this work is you register english name and you can login with itbuy whene you reguster aeabic name and try to login said : username or pass word not wright Link to comment Share on other sites More sharing options...
justsomeguy Posted February 19, 2009 Share Posted February 19, 2009 Well, assuming the error from Smarty is fixed, check my last post on page 1, you need to set up the second login form and add the PHP code to test what is getting submitted vs. what is in the database. Link to comment Share on other sites More sharing options...
masrawy Posted February 19, 2009 Author Share Posted February 19, 2009 i did sir and the same error user name or password is wrong and the url be like that : http://localhost/mst3ml/index.php?action=sloginif you please can i sebd you copy of script to see it pls ? Link to comment Share on other sites More sharing options...
masrawy Posted February 19, 2009 Author Share Posted February 19, 2009 this is the code of file : slogin.html<p align="center">{if ($erro_insert_all_filds or $login_out or $login)} <div>{$erro_insert_all_filds}{$login_out}{$login}</div> {/if}</p> Link to comment Share on other sites More sharing options...
justsomeguy Posted February 19, 2009 Share Posted February 19, 2009 I don't think you're understanding what I'm asking you to do. It's not going to help me to look at the script. I need you to set up a new login form, that submits to the index page, it looks like you're doing that. You need to add code to the index page for the login so that it prints out the username and password that you tried to login with, and also the username and password from the database. That's the first step in trying to figure this out. I don't know how to explain it any better. If it's telling you the username and password is wrong, then print everything out and look at why it's wrong! Link to comment Share on other sites More sharing options...
masrawy Posted February 19, 2009 Author Share Posted February 19, 2009 i'm sorry siryou need me to put the code into index.php ?i put the code in file and name it login.html Link to comment Share on other sites More sharing options...
justsomeguy Posted February 19, 2009 Share Posted February 19, 2009 The form to use is in this post:http://w3schools.invisionzone.com/index.ph...st&p=129209The code to add to index.php is in this post:http://w3schools.invisionzone.com/index.ph...st&p=129184 Link to comment Share on other sites More sharing options...
masrawy Posted February 19, 2009 Author Share Posted February 19, 2009 no help her sir ? Link to comment Share on other sites More sharing options...
masrawy Posted February 19, 2009 Author Share Posted February 19, 2009 i put the code sirand this is the source code <!--submitted user name: submitted password: No database selected Link to comment Share on other sites More sharing options...
masrawy Posted February 19, 2009 Author Share Posted February 19, 2009 i put the code in the begining of index.php file after : <?php Link to comment Share on other sites More sharing options...
justsomeguy Posted February 19, 2009 Share Posted February 19, 2009 You might need to put it a little farther down, in the area after it says this:if ($action == 'slogin'){I think that's what it said.Did you type the username and password in the form? It didn't print the values from it: <!--submitted user name: submitted password: Link to comment Share on other sites More sharing options...
masrawy Posted February 19, 2009 Author Share Posted February 19, 2009 this is the source code<!--submitted user name: submitted password: Table 'ms.users' doesn't exist Link to comment Share on other sites More sharing options...
justsomeguy Posted February 20, 2009 Share Posted February 20, 2009 You need to change this line:$result = mysql_query("SELECT * FROM users WHERE username='testuser'") or exit(mysql_error());I think "users" should be "hgi_member", and "username" should be "member_name". You'll also need to change "testuser" to the actual name you're trying to log in with. So if you type "user123" into the username box on the login form, change "testuser" to "user123". So it should look something like this:$result = mysql_query("SELECT * FROM hgi_member WHERE member_name='user123'") or exit(mysql_error());Make sure to use the correct user name though. Link to comment Share on other sites More sharing options...
masrawy Posted February 20, 2009 Author Share Posted February 20, 2009 like that echo "<!--\n";echo 'submitted user name: ' . $_POST['username'] . "\n";echo 'submitted password: ' . $_POST['password'] . "\n";$result = mysql_query("SELECT * FROM hgi_member WHERE member_name='user123'") or exit(mysql_error());if ($row = mysql_fetch_assoc($result)){ echo 'database user name: ' . $row['username'] . "\n"; echo 'database password: ' . $row['password'] . "\n";}else echo 'test user not found';echo "\n-->";is that code write ? Link to comment Share on other sites More sharing options...
justsomeguy Posted February 20, 2009 Share Posted February 20, 2009 Yes, but make sure to change the user name to the actual name you're trying to log in with. Link to comment Share on other sites More sharing options...
masrawy Posted February 20, 2009 Author Share Posted February 20, 2009 i did i putecho "<!--\n";echo 'submitted user name: ' . $_POST['username'] . "\n";echo 'submitted password: ' . $_POST['password'] . "\n";$result = mysql_query("SELECT * FROM hgi_member WHERE member_name='عمرو'") or exit(mysql_error());if ($row = mysql_fetch_assoc($result)){ echo 'database user name: ' . $row['username'] . "\n"; echo 'database password: ' . $row['password'] . "\n";}else echo 'test user not found';echo "\n-->";عمرو=user123is that write if write tell me the user or basword wrongethis is sourse code<!--submitted user name: submitted password: database user name: database password: --><p align="center"> <div>إما أن يكون أسم المستخدم خطأ أو تكون كلمة المرور خطأ<br />يرجى المحاولة مرة أخرى<br /><a href="#" onclick="java script: HGI_show('showithere_log2'),HGI_hide('showithere_log');">للعودة لصفة تسجيل الدخول مرة أخرى</a></div> </p> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.