PHP Applications
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Applications

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old February 25th, 2007, 08:05 AM
Abulmais Abulmais is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: palestine
Posts: 8 Abulmais User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old February 25th, 2007, 08:11 AM
vg vg is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Fortaleza, CE, Brazil
Posts: 88 vg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 29 sec
Reputation Power: 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!

Reply With Quote
  #3  
Old February 25th, 2007, 08:16 AM
Abulmais Abulmais is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: palestine
Posts: 8 Abulmais User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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 victori will use your advise

Reply With Quote
  #4  
Old February 25th, 2007, 08:29 AM
vg vg is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Fortaleza, CE, Brazil
Posts: 88 vg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 29 sec
Reputation Power: 2
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...

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Applications > hiiiiiiii all, i need help.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway