Jump to content

Cooper94

Members
  • Posts

    107
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Cooper94's Achievements

Member

Member (2/5)

0

Reputation

  1. I have created a html form that when the image is pressed it will echo somthing out. But the code that is below seems to not work for what ever reason. I thank you all for your help and for your time! <form action="" method="POST"> <center> <table> <tr> <td>Callsign:</td> <td><input type="text" name="username" value="RPA" size="10" style="width: 79px;" /></td> </tr> <tr> <td>Password:</td> <td><input type="password" name="password" size="10" max-size="5" /></td> </tr> <tr> <td><input name="login" type="image" src="images/login.png" width="58" height="20"></td> </tr> </table> </center> </form> <?php if(isset($_POST['login'])) { echo "lol"; } ?>
  2. Hello I am trying to make a function script for my website and it seems that even when I put this into the function page it gives me a 500 error. I thank you all for you time and for helping me out! * Code is below* <?php function Date(){ $timestamp = $row['dateRegistered']; $date = date("m-d-Y", $timestamp); echo $date; } ?>
  3. Below is my code that switches through a gallery a pictures via a click of a button. My question is how would I get it to move automaticly to the next picture after a certain amount of time? Below is my code, thank you for all your time and help! $(function() { $('input.field'). focus(function() { if(this.title==this.value) { this.value = ''; } }). blur(function(){ if(this.value=='') { this.value = this.title; } }); var currentPage = 1; $('#slider .buttons span').live('click', function() { var timeout = setTimeout(function() {$("img").trigger("slidermove")}, 300); var fragments_count = $(this).parents('#slider:eq(0)').find('.fragment').length; var fragmet_width = $(this).parents('#slider:eq(0)').find('.fragment').width(); var perPage = 1; var numPages = Math.ceil(fragments_count/perPage); var stepMove = fragmet_width*perPage; var container = $(this).parents('#slider:eq(0)').find('.content'); var firstPosition = 0; var lastPosition = -((numPages-1)*stepMove); if ($(this).hasClass('next')) { currentPage ++; if (currentPage > numPages) { currentPage = 1; container.animate({'left': firstPosition}); return; }; container.animate({'left': -((currentPage - 1)*stepMove)}); }; if ($(this).hasClass('prev')) { currentPage --; if (currentPage < 1) { currentPage = numPages; container.animate({'left': lastPosition}); return; }; container.animate({'left': -((currentPage-1)*stepMove)}); }; }); });
  4. Ok I got it to display something but it dosnt display all of it, it gives me this error: The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. Only one top level element is allowed in an XML document. Error processing resource 'http://www.purified-designs.com/V2/aca... <flights><Departure></Departure><Arrival>KSDF</Arrival><Aircraft>E145</Aircraft>&l... Here is the code!Thank you! <?php include '../includes/db.php'; $result = mysql_query("SELECT * FROM reports WHERE callsign = '$_GET[pilot]' AND status = '0'"); $num = mysql_num_rows($result); while ($row = mysql_fetch_array($result)){ $data[] = $row; } $dom = new DOMDocument("1.0"); header("Content-Type: text/plain"); foreach ($data as $flights){ $root = $dom->createElement("flights"); $dom->appendChild($root); $item = $dom->createElement("Departure"); $root->appendChild($item); $text = $dom->createTextNode($flight['dep_icao']); $item->appendChild($text); $item = $dom->createElement("Arrival"); $root->appendChild($item); $text = $dom->createTextNode($flights['arr_icao']); $item->appendChild($text); $item = $dom->createElement("Aircraft"); $root->appendChild($item); $text = $dom->createTextNode($flights['aircraft']); $item->appendChild($text); } echo $dom->saveXML(); ?>
  5. Lol its alot but I went through it and it is all right! Thank you array(2) { [0]=> array(40) { [0]=> string(2) "15" ["id"]=> string(2) "15" [1]=> string(0) "" ["date"]=> string(0) "" [2]=> string(7) "RPA1001" ["callsign"]=> string(7) "RPA1001" [3]=> string(7) "RPA3265" ["flight_num"]=> string(7) "RPA3265" [4]=> string(4) "E170" ["aircraft"]=> string(4) "E170" [5]=> string(0) "" ["online"]=> string(0) "" [6]=> string(0) "" ["duration"]=> string(0) "" [7]=> string(4) "KPHL" ["pilot_hub"]=> string(4) "KPHL" [8]=> string(0) "" ["fuel_used"]=> string(0) "" [9]=> string(0) "" ["pax"]=> string(0) "" [10]=> string(0) "" ["money"]=> string(0) "" [11]=> string(0) "" ["rate"]=> string(0) "" [12]=> string(0) "" ["method"]=> string(0) "" [13]=> string(4) "KALB" ["dep_icao"]=> string(4) "KALB" [14]=> string(0) "" ["dep_time"]=> string(0) "" [15]=> string(4) "KCLT" ["arr_icao"]=> string(4) "KCLT" [16]=> string(0) "" ["arr_time"]=> string(0) "" [17]=> string(26) "PWL CMK J75 GVE LYH SUDSY3" ["route"]=> string(26) "PWL CMK J75 GVE LYH SUDSY3" [18]=> string(1) "0" ["status"]=> string(1) "0" [19]=> string(0) "" ["comments"]=> string(0) "" } [1]=> array(40) { [0]=> string(2) "14" ["id"]=> string(2) "14" [1]=> string(0) "" ["date"]=> string(0) "" [2]=> string(7) "RPA1001" ["callsign"]=> string(7) "RPA1001" [3]=> string(7) "RPA3049" ["flight_num"]=> string(7) "RPA3049" [4]=> string(4) "E145" ["aircraft"]=> string(4) "E145" [5]=> string(0) "" ["online"]=> string(0) "" [6]=> string(0) "" ["duration"]=> string(0) "" [7]=> string(4) "KPHL" ["pilot_hub"]=> string(4) "KPHL" [8]=> string(0) "" ["fuel_used"]=> string(0) "" [9]=> string(0) "" ["pax"]=> string(0) "" [10]=> string(0) "" ["money"]=> string(0) "" [11]=> string(0) "" ["rate"]=> string(0) "" [12]=> string(0) "" ["method"]=> string(0) "" [13]=> string(4) "KCLT" ["dep_icao"]=> string(4) "KCLT" [14]=> string(0) "" ["dep_time"]=> string(0) "" [15]=> string(4) "KSDF" ["arr_icao"]=> string(4) "KSDF" [16]=> string(0) "" ["arr_time"]=> string(0) "" [17]=> string(0) "" ["route"]=> string(0) "" [18]=> string(1) "0" ["status"]=> string(1) "0" [19]=> string(0) "" ["comments"]=> string(0) "" } }
  6. I did as asked and I get a 500 Internal Server Error... Any thoughts and I really do thank you once again for all of this help!!!!
  7. Ok is there anyway you could help me with this? I am grabing this information from a database and so far I only have this. I thank you again for all the help! <?php include '../includes/db.php'; $result = mysql_query("SELECT * FROM reports WHERE callsign = '$_GET[pilot]' AND status = '0'"); while ($row = mysql_fetch_array($result)) { } $dom = new DOMDocument("1.0"); header("Content-Type: text/plain"); $root = $dom->createElement("flights"); $dom->appendChild($root); $item = $dom->createElement("Departure"); $root->appendChild($item); $text = $dom->createTextNode("KLGA"); $item->appendChild($text); $item = $dom->createElement("Arrival"); $root->appendChild($item); $text = $dom->createTextNode("KPHL"); $item->appendChild($text); $item = $dom->createElement("Aircraft"); $root->appendChild($item); $text = $dom->createTextNode("E170"); $item->appendChild($text); echo $dom->saveXML(); ?>
  8. <?php $dom = new DOMDocument("1.0"); header("Content-Type: text/plain"); $root = $dom->createElement("flights"); $dom->appendChild($root); $item = $dom->createElement("Departure"); $root->appendChild($item); $text = $dom->createTextNode("KLGA"); $item->appendChild($text); $item = $dom->createElement("Arrival"); $root->appendChild($item); $text = $dom->createTextNode("KPHL"); $item->appendChild($text); $item = $dom->createElement("Aircraft"); $root->appendChild($item); $text = $dom->createTextNode("E170"); $item->appendChild($text); echo $dom->saveXML(); ?> Is there anyway to create more than one element? Like say I want another element named Flights but just with different information in the nodes with that be possible? Thank you all for your time!
  9. I know this is old but I did setup a cron job for a script that runs and checks to see if the user has reached its limit but it does not work. But if I go to the url the script is located on it will update the database no problem! Below is my script: <?php include '../includes/db.php'; session_start(); $inactive = 60; if(isset($_SESSION['timeout']) ) { $session_life = time() - $_SESSION['timeout']; if($session_life > $inactive) { mysql_query("UPDATE pilots SET online = '0' WHERE callsign = '$_SESSION[username]'"); }} ?> The $_SESSION['timeout'] is a vairable that that equavilant to time() which is set when the person refreshs any page on the site, I have tested that in an echo and it is outputing a number. Like I said it does work when I go to the script location in my browser. Any help would be great! Thank You
  10. Is there any way you can help me out? Thank You
  11. Is it possible to have a script check every minute to make sure the user is still online? <?php $inactive = 60; if(isset($_SESSION['timeout']) ) { $session_life = time() - $_SESSION['timeout']; if($session_life > $inactive) { mysql_query("UPDATE pilots SET online = '0' WHERE callsign = '$_SESSION[username]'"); }} $_SESSION['timeout'] = time(); mysql_query("UPDATE pilots SET online = '1' WHERE callsign = '$_SESSION[username]'"); ?> This does the tick but the client needs to refresh the page to online = 0. Is it possible to have it go to 0 before they refresh? So that when they do refresh the page from being back it will than upate the status to online = 1? Thank you for your time and all your help!
  12. $result = mysql_query("SELECT * FROM flights"); while ($row = mysql_fetch_array($result)) { if ($flight_num == $row['flight_num']){ echo "<center>Flight Number Used!</center>"; }else{ $sql=mysql_query("INSERT INTO flights (`flight_num`, `dep_icao`, `dep_time`, `dep_name`, `arr_icao`, `arr_time`, `arr_name`, `route`, `aircraft`, `days`, `duration`, `status`) VALUES ('$flight_num','$dep','$dep_time','$dep_name','$arr','$arr_time','$arr_name','$route','$aircraft','$days','$duration','$status')"); header ('Location: ?page=flt_ctr'); }} When I run this code it puts several rows of the same information. Say I press submit it will output more than 1 row in the database. Any help would be great, thank you for your time.
  13. Cooper94

    Tables

    I would like it so that first amount of Airports is on the left and than the next set is on the right.
×
×
  • 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.