Jump to content

bogaert-y

New Members
  • Posts

    5
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

bogaert-y's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thanks hansford, however still does not seem to be working the echo returns nothing. I have hardcoded a contract number in the query where I know it should return a value. Any idea's?
  2. HI guys, I have made a query in oci which works, the result should be a date format as in "2015-10-13" for example, the query can only return 1 "answer" however how can I get the result in a variable? the query is: $start = oci_parse($conn, " SELECT TO_CHAR(MIN(FLT_COM_DEP_BLK),'YYYY-MM-DD') FROM MASTER.FLIGHTS WHERE FLT_LFS_ID=100 AND INSTR(UPPER(FLT_TEXT_AS_SPECIAL),'_CID='||'$contractnr')>0 "); oci_execute($start); I want this result in a variable called $startd. thanks for the help. Yannick
  3. Ohhh crap I had put: <? session_start(); if(isset($_SESSION['myusername'])){ header("location:main_login.php"); } ?> In the index.php BUT, offcoure the index.php page has to check if the $_SESSION['myusername'] contains the correct information. When I just change that header also to index.php?page=intro I think the page just goes into a loop I think, since it's constantly opening the same page. How can I do this when the $_SESSION['myusername'] is correct continue with the index.php?page=intro, when it's not go back to main_login.php. thanks allready :-)
  4. Indeed, i nowhere in the page have a link to main_login.php anymore. But the strange thing is offcourse if i change the header index.php?page=intro into test.php it does go to test.php. That's what is the strangest thing off all why work with one header but not with the other one...
  5. Hello everyone, I have changed a login script to make it a bit more up to date. ( SQL injection, SHA1 encoding, $_SESSION ) Since i am new to all this there will be some stupid things in the code, so don't shoot me yet on the details, but do tell them since I want to learn offcourse. After a simple login form you get directed to checklogin.php <?php session_start(); $host = "localhost"; $username = "admin"; $password = "admin"; $db_name = "request"; $tbl_name = "member"; mysql_connect($host, $username, $password)or die("cannot connect"); mysql_select_db($db_name)or die("cannot select DB"); $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $encrypted_mypassword = sha1($mypassword); $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$encrypted_mypassword'"; $result=mysql_query($sql); if(mysql_num_rows($result) == 1){ $_SESSION['myusername'] = $myusername; $_SESSION['mypassword'] = $encrypted_mypassword; header("location:login_success.php"); } else { echo "Wrong Username or Password"; } ?> So far so good, when the wrong username is used it gives the correct echo, and with the good one it directs you to login_succes.php Now login_succes.php: <? session_start(); if(isset($_SESSION['myusername'])){ header("location:index.php?page=intro""); } ?> <html> <body> Login Successful </body> </html> For some reason strange reason this allways redirects me to the login form called main_login.php If i put another header in like test.php it redirects me to test.php Since both are links how can it work for the one but not the other... I am clueless, i think its a small little thing somewhere that is not correct but not 100% sure. Any ideas? thanks for the help allready, Yannick
×
×
  • 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.