|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
hiiiiiiii all, i need help.
i have a problem, im using a session, the problem is that all the css in the page has gone sinse i used the session code.
plzzzzzzzzzzzzzzzzzz help. |
|
#2
|
|||
|
|||
|
RE: hiiiiiiii all, i need help.
Hi Abulmais!
It seems to have no relationship between sessions and css. Please post your code so it will be easy to help you! And a tip: Exposing your problem at the title, instead of using "need help", makes everybody's life easier! |
|
#3
|
|||
|
|||
|
RE: hiiiiiiii all, i need help.
<?
session_start(); $errorMessage = ''; if (isset($_POST['username']) && isset($_POST['password'])) { $connection=@mysql_connect('localhost','root',''); @mysql_select_db('aqsa'); $userId = $_POST['username']; $password = $_POST['password']; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1256" /> <title>حماة الاقصى</title> <link href="css/aqsa.css" rel="stylesheet" type="text/css" /> </head> <body> <? // check if the user id and password combination exist in database $sql = "SELECT type FROM users WHERE username= '$userId' AND password = '$password'"; $result = mysql_query($sql) or die('Query failed. ' . mysql_error()); if (mysql_num_rows($result) == 1) { // the user id and password match, // set the session $_SESSION['db_is_logged_in'] = true; $_SESSION['user_id'] = $userId; if ($row = mysql_fetch_array($result)) { // $_SESSION['user_id'] = $row['username']; $_SESSION['type'] = $row['type']; } // after login we move to the main page ?> <meta HTTP-EQUIV="REFRESH" content="0; url=http:after.php"> <? header('Location: after.php'); exit; } else { $errorMessage = 'Sorry, wrong user id / password'; }}?> <table width="750" border="1" bordercolor="#006699" height="auto" align="center"> <? include"header.html"?> <tr> <td> <table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#006699"> <tr> <td width="150" valign="top"> <? include "left.php"?> </td> <td width="450" valign="top"> <table width="100%" border="1" bordercolor="#006699"> <tr> <td align="center"> <table width="100%" border="1" bordercolor="#6699CC"> <tr> <td align="center"> <form action="<? echo $_SERVER['PHP_SELF'];?>" method="get"> <label><h1>اهلا بك في قسم الاعضاء الرجاء الاسم و كلمة السر,اذا لم تكن عضوا, الرجاء <a href="menu.php?action=signup"><h1>التسجيل</h1></a></label><br /> <label><h1>اسم المستخدم</h1><input type="text" name="username" /><br /></label> <label><h1>كلمة السر</h1><input type="password" name="password" /></label><br /> <input type="submit" value="ادخل" /> <input type="hidden" name="action" value="signin" /> </form></td></tr></table> </td></tr></table> </td> <td width="150" valign="top"> <? include "right.php"?> </td> </tr> </table></td></tr> <? include"footer.html"?> </table> </body> </html> Thanks victor |
|
#4
|
|||
|
|||
|
RE: hiiiiiiii all, i need help.
I didn't see any error at all, sorry. You should try putting all PHP code before starting outputting HTML. There are some commands that you use in the middle of the code (like header()) that must be gave before any output to the user.
In fact I don't see relationship with the problem, but try doing this anyway, sometimes... |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Applications > hiiiiiiii all, i need help. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|