Jump to content

thumbliner

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Everything posted by thumbliner

  1. Yes, but it wasn't working in the first place. I tried this $firstname = mysql_result('firstname'); $_SESSION['firstname'] = $firstname; And on the other page echo $_SESSION['firstname']; Nothing returned. I have 1000s of lines of PHP code saved in a file. I just pick up chunks from here and there and design my own system. Not the right way of doing it, I know, but thats all I am capable of.
  2. I want to go to the database and fetch the firstname of the pilot who is logging in. This is what I could come up with but where to put it? $salman = $_SESSION['MM_Username']; mysql_select_db($database_brn_system, $brn_system); $query_rsPilot = "SELECT pilots.firstname, FROM pilots WHERE pilots.pilot_callsign = '$salman'"; $rsPilot = mysql_query($query_rsPilot, $brn_system) or die(mysql_error()); $row_rsPilot = mysql_fetch_assoc($rsPilot); session_register('firstname'); $_SESSION['firstname'] = $row_rspilot['firstname']; NOTE: When I am echoing $_SESSION['MM_Username'] on the admin_lounge.php page, its working. But when I echo $_SESSION['firstname'], its not working. Check the files also. [attachment deleted by admin]
  3. Problem Solved!! I have cracked it. No better feeling than this. There was a VERY small error which was failing everything. In the login form, I had set the id=pilot_callsign2 where it should have been id=callsign My bad. But what I don't understand is, how come I was able to login all this while?
  4. Guys, I am not an expert like you but I can assure that there is no problem with that code. Dreamweaver coded it. And its very basic stuff. First is a login form and the second is a page restricted for Admin users. Everything is working fine. Like 1. I have to login to use that page 2. Users other than Admin level can't access the page 3. The page data is shown perfectly on successful login. Everything is fine. Problem is with asking the server to ECHO the already declared session variable. Thats all. I have already attached the files in the previous post. Just see if you can declare the session variable on admin_lounge.php page. If it works, my problem is solved.
  5. Thanks for the responses but it still doesn't solve anything. Here are both the files. [attachment deleted by admin]
  6. Need help declaring some session variable guys. I have a login form where the member enters his 1. Pilot Callsign 2. Password I want to declare that Pilot Callsign as the session variable on authentication. Using that Pilot Callsign session variable, I will fetch data from the database relevant to his profile. I already have the whole login page coded along with the restricted access pages (not coded by me). Check this out 1. Page is coded like this and working PERFECTLY --- <?php // *** Validate request to login to this site. if (!isset($_SESSION)) { session_start(); } $loginFormAction = $_SERVER['PHP_SELF']; if (isset($_GET['accesscheck'])) { $_SESSION['PrevUrl'] = $_GET['accesscheck']; } if (isset($_POST['pilot_callsign'])) { $loginUsername=$_POST['pilot_callsign']; $password=$_POST['password']; mysql_select_db($database_brn_system, $brn_system); $LoginRS__query=sprintf("SELECT pilot_callsign, password, staff_level, firstname FROM pilots WHERE activated = 1 AND pilot_callsign=%s AND password=%s", GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); $LoginRS = mysql_query($LoginRS__query, $brn_system) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { $loginStrGroup = mysql_result($LoginRS,0,'staff_level'); if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();} //declare two session variables and assign them $_SESSION['MM_Username'] = $loginUsername; $_SESSION['MM_UserGroup'] = $loginStrGroup; ?> --- 2. As you can see, there already is a session variable declared for Pilot Callsign But on the next page "Restricted Access Page", when I try to call this same Session Variable, it doesn't work. I tried doing this <?php echo $_SESSION['MM_Username'] ?> Moreover, I even tried to fetch data from the table like this - SELECT * FROM pilots WHERE pilot_callsign=$_SESSION['MM_Username'] Doesn't work :-\
  7. The irritating novice is back!! Hey guys, need your help again. I just coded an INSERT records page. But after all was done, this is the error I am getting. I fill the form and when I click, INSERT. I get this error. Why? [attachment deleted by admin]
  8. Found something http://www.pc-help.org/pub/airports.txt
  9. Hi guys, I am designing an aviation related website and need certain databases for us like airports, airplanes and airlines data. I dont have the time to make 50000 entries myself and generate my own database. Are there any libraries where I can get someone else's work? I know a place where I have to pay around 400 dollars to get the database but I want something that will fit my pocket size which is close to 0
  10. Have a look and please explain [attachment deleted by admin]
  11. Alright, problem solved. Thanks everyone.
  12. Oopss!!!! I thought those were not suppose to be there so I erased all manually.
  13. Have a look at the attachment, please. [attachment deleted by admin]
  14. To get a syntax error, I should at least put the wrong code. Anyways, this is what I am trying. <?php $image = "<img src="images/flags/{$row_rsPilots['country']}.gif" alt="" name="Flag" width="20" height="20" />"; $link = "http://www.domain.com/{$row_rsPilots['country']}"; ?> <?php if (isset(($rsPilots['country'])); { echo <a href="?><?php echo $link; ?>"><?php echo $image; ?><?php</a>; ?>
  15. :-\ I am new to PHP but not new to common sense. That much I know. I am having trouble with this sort of stuff <?php If (isset($row_rsPilots['country'])); { WHAT DO I WRITE HERE? } ?> The problem I am facing is that I have already opened a 'php' tag <?php When I use that as an extension for the domain or image, the repetition is creating a mess.
  16. My forms allow around 120 countries and I have flags for all. That is not the problem. Even if it is infinite, lets assume I have flags for all. I am more concerned about the link www.domain.com/country
  17. Hello everyone, I am new to this forum and PHP world. Doing my first project, a pretty complicated one to start with. I will be needing your help a lot to accomplish it. Here is the first one. 1. I have a certain field called 'country' 2. I have small flag icons for every country. WHAT DO I WANT TO DO? Example - If the country is U.S.A., the U.S. flag shows up and is a link to www.domain.com/usa If the country is Germany, the German flags shows up and is a link to www.domain.com/germany If the country is not set, no flag shows up. END. How do I execute this? This is what I am doing to get the image <img src="images/flags/<?php echo $row_rsPilots['country']; ?>.gif" alt="" name="Flag" width="20" height="20" id="Flag" /> How do make it a link to www.domain.com/'country' Thanks in advance
×
×
  • 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.