Jump to content

Cooper94

Members
  • Posts

    107
  • Joined

  • Last visited

    Never

Everything posted by Cooper94

  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.
  14. Cooper94

    Tables

    <table width="100%" cellpadding="1" cellspacing="1"> <tr> <td>Albany, NY (ALB)</td> <td>Atlanta, GA (ATL)</td> <td>Baltimore, MY (BWI)</td> <td>Bangor, MA (BGR)</td> <td>Boston, MA (BOS)</td> <td>Buffalo, NY (BUF)</td> <td>Burlington, VT (BTV)</td> <td>Birmingham, NY (BGM)</td> <td>Charleston, SC (CHS)</td> <td>Charlotte, NC (CLT) HUB</td> <td>Chicago, IL (ORD)</td> <td>Cleveland, OH (CLE) </td> <td>Columbus, OH (CMH)</td> <td>Dallas Fort Worth, TX (DFW)</td> <td>Detroit, MI (DTW)</td> <td>Greensboro, NC (GSO)</td> <td>Houston, TX (HOU)</td> <td>Huntsville, AL (HSV)</td> <td>Indianapolis, IN (IND)</td> <td>Jacksonville, FL (JAX)</td> <td>Kansas City, MO (MCI)</td> <td>Key West, FL (EYW)</td> <td>Manchester, NH (MHT)</td> <td>Milwaukee, WI (MKE)</td> <td>Minneapolis, MN (MSP)</td> <td>Montreal, QC, CA (YUL)</td> <td>Myrtle Beach, (MYR)</td> <td>Nashville, TN (BNA)</td> <td>New Orleans, (MSY)</td> <td>New York, NY (JFK)</td> <td>New York, NY (LGA)</td> <td>Newark, NJ (EWR)</td> <td>Norfolk, VA (ORF)</td> <td>Orlando, FL (MCO)</td> <td>Ottawa, OT, CA (YOW)</td> <td>Pensacola, FL (PNS)</td> <td>Philadelphia, PA (PHL) HUB</td> <td>Pittsburgh, PA (PIT)</td> <td>Portland, OR (PDX)</td> <td>Providence, RI (PVD)</td> </tr> <tr> <td>Raleigh, NC (RDU)</td> <td>Richmond, VA (RIC)</td> <td>Rochester, NY (ROC)</td> <td>San Antonio, TX (SAT)</td> <td>Savannah, GA (SAV)</td> <td>Springfield, MO (SGF)</td> <td>St. Louis, MO (STL)</td> <td>Syracuse, NY (SYR)</td> <td>Toronto, OT, CA (YYZ)</td> <td>Washington D.C., WA (DCA) HUB</td> <td>West Palm Beach, FL (PBI)</td> <td>Wilmington, NC (ILM)</td> </tr> </table> It isnt showing up in two lines it goes out to the right, I am trying to make it go into two lines line one is the first <tr> and the second collum or line is the last <tr> Any help I would be very greatful! Thank You
  15. Cooper94

    Div Width

    The overflow wored but it just earses it after it reaches that point. Is it possible to have it go to another line and continue the text? Thnk You
  16. Cooper94

    Div Width

    The width works fine on the first div and it cuts of thetext when it reachs 520 but in the second div it keeps going. If you have any suggestins I would be very greatful! Thank you Code Below: <div style="width: 520px;"> Welcome msg to go here!Welcome msg to go here!Welcome msg to go here!Welcome msg to go here!Welcome msg to go here! Welcome msg to go here!Welcome msg to go here!Welcome msg to go here!Welcome msg to go here!Welcome msg to go here! Welcome msg to go here!Welcome msg to go here!Welcome msg to go here!Welcome msg to go here!Welcome msg to go here! </div> <div style="width: 20%;"> testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest </div>
  17. In the database I added a $ symbol so that was what was causing this problem. Once again I will put this topic as to solved and I thank everyone for their help!
  18. Hmm that didnt fix the probelm.... It was really confusing to me as well.
  19. There you go thank you again for all the help! <?php $dbhost = 'localhost'; $dbusername = 'lidjcom_invent'; $database_name = 'lidjcom_invent'; $dbpasswd = '147171'; $connection = mysql_connect("$dbhost","$dbusername","$dbpasswd") or die ("Couldn't connect to server."); $db = mysql_select_db("$database_name", $connection) or die("Couldn't select database."); $sql = "SELECT * FROM `items` WHERE `Item ID` = '{$_GET['id']}'"; $result = mysql_query($sql); $row = mysql_fetch_array($result); $price = $row['Cost']; $box = $_GET['amount']; $finalprice = $box * $price; mysql_query("INSERT INTO cart (`Item`, `Item ID`, `Box Amount`, `Cost`) VALUES ('{$row['Item']}', '{$_GET['id']}', '{$_GET['amount']}','$finalprice')"); ?>
  20. I know I just made this solved but one more thing about multipling. $price = $row['Cost']; $box = $_GET['amount']; $finalprice = $box * $price; I have tested out the variables by echoing them out to make sure they had a number and they both do but when entered into the database it returns a value of 0. Any help would be great, thank you again for all the help.
  21. I am so sorry for wasteing your time, somtimes I just fly right by those simple things. Since it was common sinse I would never thing it would be that, lol. Yet again I am sorry for wasteing your time.
  22. Yes it was the column I am sorry I couldnt find that word in my head lol. Here is the whole php file. <?php $dbhost = 'localhost'; $dbusername = 'lidjcom_invent'; $database_name = 'lidjcom_invent'; $dbpasswd = '147171'; $connection = mysql_connect("$dbhost","$dbusername","$dbpasswd") or die ("Couldn't connect to server."); $db = mysql_select_db("$database_name", $connection) or die("Couldn't select database."); $sql = "SELECT * FROM items WHERE 'Item ID' = '{$_GET['id']}'"; $result = mysql_query($sql); $row = mysql_fetch_array($result); $row['Cost']; ?>
  23. In phpmyadmin I created the table called items and than I created a table name Item ID. Now I want it so that when I call the select function and tell it where to search which is Item ID now in the database the name of the table is Item ID with that space in the middle but when I put the space in the sql select code it dosnt do anything. It just shows the page being blank.
×
×
  • 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.