Jump to content

jfs0479

Members
  • Posts

    31
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jfs0479's Achievements

Member

Member (2/5)

0

Reputation

  1. There isnt any error message being given, and the connections to the db is perfect
  2. Hi Guys Im having this porblem with a script where it is completly resisting to insert the data into the mysql database. I know in the example below i havent used all of the variables i set but i wanted to see if it would work without it! Thanks <?php require 'cookie.php'; include("db.php"); $departingicao = $_POST['departingicao']; $arrivingicao = $_POST['arrivingicao']; $query = "SELECT departing, arriving FROM arab_routes WHERE departingicao='$departingicao' AND arrivingicao='$arrivingicao' LIMIT 1"; $result = mysql_query($query); while($row = mysql_fetch_array($result)) { $departing = $row['departing']; $arriving = $row['arriving']; $date = $_POST['date']; $date2 = explode("/", $date); $newdate = $date2[2].$date2[1].$date2[0]."000000"; $today = strtotime($newdate); $pax = $_POST['pax']; $fuelused = $_POST['fuelused']; $machspeed = $_POST['machspeed']; $aircraft = $_POST['aircraft']; $reg = $_POST['reg']; $routeid = $_POST['routeid']; $routetaken = $_POST['routetaken']; $comments = $_POST['comments']; $hours2 = $_POST['hours']; $minutes2 = $_POST['minutes']; $hour2 = "60"; $hour = $hour2 * $hour2; $hseconds = $hours2 * $hour; $secs = "60"; $mseconds = $minutes2 * $secs; $total = $mseconds + $hseconds; $vatsim = $_POST['vatsim']; mysql_query("INSERT INTO arab_flights (departing, departingicao, arriving, arrivingicao) VALUES('$departing', '$departingicao', '$arriving', '$arrivingicao' ) ") or die(mysql_error()); } ?>
  3. I have just tried something new. What i have done in a seperate page was to call $_SESSION['forename']; which is another of my variables in the session it churned it out good so i tried it with the $_SESSION['memberid']; and it just has a blank page
  4. Hi All, I have developed this problem as to where i am unable to call the session up in a page. The script below is the check_login.php which creates the session and all its variables. The way i am calling it is by $memberid = $_SESSION['memberid']; Thanks James <? session_start(); header("Location: home.php"); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Arabian Login Check</title> </head> <body> <?php include 'db.php'; $id = $_POST["username"]; $password = $_POST["password"]; $getmember = "SELECT memberid FROM arab_members WHERE id='$id' AND password='$password'"; $memberid = mysql_query($getmember); if((!$id) || (!$password)){ echo "Please enter ALL of the information for your login! <br />"; include 'index.php'; exit(); } $sql = mysql_query("SELECT * FROM $tablemembers WHERE id='$id' AND password='$password' AND level='1'"); $login_check = mysql_num_rows($sql); if($login_check > 0){ while($row = mysql_fetch_array($sql)){ foreach( $row AS $key => $val ){ $$key = stripslashes( $val ); } //Register session variables. session_register('memberid'); $_SESSION['memberid'] = $memberid2; session_register('forename'); $_SESSION['forename'] = $forename; session_register('surname'); $_SESSION['surname'] = $surname; session_register('email'); $_SESSION['email'] = $email; session_register('sex'); $_SESSION['sex'] = $sex; session_register('hub'); $_SESSION['hub'] = $hub; session_register('password'); $_SESSION['password'] = $password; session_register('reason'); $_SESSION['reason'] = $reason; mysql_query("UPDATE $tablemembers SET lastactive=now() WHERE memberid='$memberid'"); } } ?> </body> </html>
  5. Hi All, I am quite new to php but can understand most things..however this script has really stomped me. I am simply trying to insert this data into the database and all the names and everthing is correct. It has worked fine for me before but i am completly unsure why it is not working now. Heres The script. <? session_start(); session_checker(); function session_checker(){ if(!session_is_registered('memberid')){ include 'index.php'; exit(); } } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> </head> <body> <?php $departing = $_POST["departing"]; $departingicao = $_POST["departingicao"]; $arriving = $_POST["arriving"]; $arrivingicao = $_POST["arrivingicao"]; $pax = $_POST["pax"]; $aircraft = $_POST["aircraft"]; $reg = $_POST["reg"]; $fuelused = $_POST["fuelused"]; $id = $_POST["id"]; $route = $_POST["route"]; $eta = $_POST["eta"]; $date = date('d/m/y'); $memberid = $_SESSION['memberid']; include("db.php"); $result = mysql_query( "insert into arab_flights (departing, departingicao, arriving, arrivingicao, pax, aircraft, reg, fuelused, id, route, eta, date, memberid) values ('$departing', '$departingicao', '$arriving', '$arrivingicao', '$pax', '$aircraft', '$reg', '$fuelused', '$id', '$route', '$eta', '$date', '$memberid')" ); if ($result) { print <<<EOT EOT; } else { print "We are currently having connection problems."; } mysql_close(); ?> </body> </html> The error i get is the one i have set which is the We are Currently having connection problems however all of the database details are correct and connections through db.php on other pages is ok and displaying it ok. Thank for your help James
  6. Yea all of the extra information in the table is being shown in the table thats wht is making it so strange as it worked on my localhost but not on a shared host provider ...thanks
  7. Well i have just tried that method but it is still not working but now it is displaying just the image of images/status_atgate.jpg which is really annying as everything is being entered in the correct format into the database...??? Anybody know?
  8. The way that i suggest you do this is actualy by integrating a bit of javascript with the php. All you have to do is take a look at this code http://www.dynamicdrive.com/dynamicindex2/memoryscroller.htm and where your allowed to put the content, delete all of it and just put in a simple insert php mysql script. It has worked for me before so it should for you
  9. Hi all, I am trying out thid else if statement in my php script and i have entered all of the details manually and in the correct format into the database to test. However each time the script loads, the image says error which is the last else (images/_status_error.jpg). It is really driving me round the best. The other thing is that i have it working superb on my local host and displays the correct message but now it is on someone elses shared host provider it is not working ??? Thanks James <?php include("db.php"); $nowdate = date('d/m/Y'); $query = "SELECT * FROM arab_flights ORDER BY flightid DESC LIMIT 5"; $result= mysql_query($query); $timenow = date('H:i:s'); //Applying the variables for the extraction while($myrow = mysql_fetch_array($result)) { $flightid = $myrow['flightid']; $departing = $myrow['departing']; $arriving = $myrow['arriving']; $aircraft = $myrow['aircraft']; $memberid = $myrow['memberid']; $time_startgate = $myrow['time_startgate']; $time_starttaxi = $myrow['time_starttaxi']; $time_startclimb = $myrow['time_startclimb']; $time_startcruise = $myrow['time_startcruise']; $time_startapproach = $myrow['time_startapproach']; $time_arrivedgate = $myrow['time_arrivedgate']; //Working Out Their Status if ($timenow >= $time_startgate) { $status=('<img src="images/status_atgate.jpg" />'); } elseif ($timenow >= $time_starttaxi) { $status=('<img src="images/status_taxi.jpg" />'); } elseif ($timenow >= $time_startclimb) { $status=('<img src="images/status_climbing.jpg" />'); } elseif ($timenow >= $time_startcruise) { $status=('<img src="images/status_cruise.jpg" />'); } elseif ($timenow >= $time_startapproach) { $status=('<img src="images/status_approach.jpg" />'); } elseif ($timenow >= $time_arrivedgate) { $status=('<img src="images/status_arrived.jpg" />'); } else { $status=('<img src="images/status_error.jpg" />'); } $data =("$status"); echo '<td height="28" class="content_table" align="center">' . $flightid . '</td> <td width="143" class="content_table" align="center">' . $departing . '</td> <td width="135" class="content_table" align="center">' . $arriving . '</td> <td width="134" class="content_table" align="center">' . $aircraft . '</td> <td width="102" class="content_table" align="center">' . $memberid . '</td> <td width="149" class="content_table" align="center">' . $data . '</td>'; } mysql_close() ; ?>
  10. Just tried removing this closing } but it still is showing the error
  11. Hi All, I am having this problem at the moment with this script below. The probelm is that it keeps on chucking out an error: Online 559 is just the close of the html tag outside of the php. Thanks for the help James <?php include("db.php"); $nowdate = date('d/m/Y'); $query = "SELECT * FROM arab_flights WHERE date='$nowdate' ORDER BY flightid DESC"; $result= mysql_query($query); $timenow = date('H:i:s'); //Applying the variables for the extraction while($myrow = mysql_fetch_array($result)) { $flightid = $myrow['flightid']; $departing = $myrow['departing']; $arriving = $myrow['arriving']; $aircraft = $myrow['aircraft']; $memberid = $myrow['memberid']; $time_startgate = $myrow['time_startgate']; $time_starttaxi = $myrow['time_starttaxi']; $time_startclimb = $myrow['time_startclimb']; $time_startcruise = $myrow['time_startcruise']; $time_startapproach = $myrow['time_startapproach']; $time_arrivedgate = $myrow['time_arrivedgate']; //Working Out Their Status if ($timenow > $time_startgate) { $status=("At Gate"); } elseif ($timenow > $time_starttaxi) { $status=("Taxi"); } elseif ($timenow > $time_startclimb) { $status=("Climbing"); } elseif ($timenow > $time_startcruise) { $status=("cruise"); } elseif ($timenow > $time_startapproach) { $status=("approach"); } elseif ($timenow > $time_arrivedgate) { $status=("Arrived"); } else { $status=("NA"); } $data =("$status"); $dislpay = '<td height="28" class="content_table">' . $flightid . '</td> <td width="143" class="content_table">' . $departing . '</td> <td width="135" class="content_table">' . $arriving . '</td> <td width="134" class="content_table">' . $aircraft . '</td> <td width="102" class="content_table">' . $memberid . '</td> <td width="149" class="content_table">' . $data . '</td>'; echo "$display"; mysql_close() ?>
  12. Hey Guys, Ths may sound very simple but im completly stuck :-\ What i would like to know is how with php can i create a subdirecty and copy some files into there??? Thanks James
  13. Thank you ever so much for your replies!
  14. Hi Guys, Just a quick query, please could someone instruct me as i am new to php coding how to limit the number of charcters when displaying something and having the ending as "..." For example displaying news articles and then a link saying Click Here For More Thanks James
×
×
  • 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.