Jump to content

hamburgerlove413

Members
  • Posts

    29
  • Joined

  • Last visited

hamburgerlove413's Achievements

Member

Member (2/5)

0

Reputation

  1. Hello, So I have this program I'm trying to create where there are 9 articles (the html tag) and I want 3 random ones to display at any one time. When you click the link in the article, it should bring up that link in an iframe. A skip button then appears and when you click it, the iframe should disappear and three different random articles should come up. It works fine for the first time you click, but any time after that it just gets more and more messed up. If anyone can look at my code and tell me where I've gone wrong, it would be a great help. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>New Path Page</title> <meta name="description" content="The HTML5 Herald"> <meta name="author" content="SitePoint"> <!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <!-- CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous"> <!-- JavaScript --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" integrity="sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ==" crossorigin="anonymous"></script> <style> article { color: white; } article a, article a:visited, article a:hover { color: white; } .offer-one, .offer-two, .offer-three, .offer-four, .offer-five, .offer-six, .offer-seven, .offer-eight, .offer-nine { height: 300px; padding-top: 18px; text-align: center; font-size: 20px; } .offer-one { background-color: #93104d; } .offer-two { background-color: #285b6c; } .offer-three { background-color: #368a2c; } .offer-four { background-color: #93104d; } .offer-five { background-color: #285b6c; } .offer-six { background-color: #368a2c; } .offer-seven { background-color: #93104d; } .offer-eight { background-color: #285b6c; } .offer-nine { background-color: #368a2c; } iframe { width: 100%; border: none; } </style> </head> <body> <div class="container"> <iframe></iframe> <a class="skip">SKIP</a> <div class="offers"> <div class="row"> <article class="col-md-4 offer-one"> <h2>test</h2> <a href="/newpath-sample.php">CLICK HERE</a> </article> <article class="col-md-4 offer-two"> <h2>test2</h2> <a href="/newpath-sample.php">CLICK HERE</a> </article> <article class="col-md-4 offer-three"> <h2>tes3</h2> <a href="/newpath-sample.php">CLICK HERE</a> </article> <article class="col-md-4 offer-four"> <h2>test4</h2> <a href="/newpath-sample.php">CLICK HERE</a> </article> <article class="col-md-4 offer-five"> <h2>test5</h2> <a href="/newpath-sample.php">CLICK HERE</a> </article> <article class="col-md-4 offer-six"> <h2>tes6</h2> <a href="/newpath-sample.php">CLICK HERE</a> </article> <article class="col-md-4 offer-seven"> <h2>test7</h2> <a href="/newpath-sample.php">CLICK HERE</a> </article> <article class="col-md-4 offer-eight"> <h2>test8</h2> <a href="/newpath-sample.php">CLICK HERE</a> </article> <article class="col-md-4 offer-nine"> <h2>tes9</h2> <a href="/newpath-sample.php">CLICK HERE</a> </article> </div> <? // end of row ?> </div> </div> <? //end of container ?> </body> </html> and the Jquery: <script> $(window).load(function() { $('.offers article').hide(); $('iframe').hide(); $('.skip').hide(); var offers = [".offer-one",".offer-two",".offer-three",".offer-four",".offer-five",".offer-six",".offer-seven",".offer-eight",".offer-nine"]; var offerOne = ""; var offerTwo = ""; var offerThree = ""; while (offerOne == offerTwo || offerOne == offerThree || offerTwo == offerThree) { var offerOne = offers[Math.floor(Math.random()*offers.length)]; var offerTwo = offers[Math.floor(Math.random()*offers.length)]; var offerThree = offers[Math.floor(Math.random()*offers.length)]; } $(offerOne).fadeIn(1); $(offerTwo).delay(200).fadeIn(1); $(offerThree).delay(400).fadeIn(1); $('.offers article a').click(function(e) { e.preventDefault(); var setSRC = $(this).attr('href'); $('iframe').attr('src',setSRC); $(offerOne).fadeOut(1); $(offerTwo).delay(200).fadeOut(1); $(offerThree).delay(400).fadeOut(1, function() { $('iframe').fadeIn(1, function() { $('.skip').show(); }); }); }); $('.skip').click(function(e) { e.preventDefault(); $('.offers article').hide(); $('.skip').hide(); $('iframe').fadeOut(1); $('iframe').hide(); var offerOne = ""; var offerTwo = ""; var offerThree = ""; while (offerOne == offerTwo || offerOne == offerThree || offerTwo == offerThree) { var offerOne = offers[Math.floor(Math.random()*offers.length)]; var offerTwo = offers[Math.floor(Math.random()*offers.length)]; var offerThree = offers[Math.floor(Math.random()*offers.length)]; } $(offerOne).fadeIn(1); $(offerTwo).delay(200).fadeIn(1); $(offerThree).delay(400).fadeIn(1); }); }); </script>
  2. Hello, I'm creating a website that takes flickr photos from areas that you click on the map and loads them into a jquery carousel called Slick Carousel. Everything works fine except for I have this strange issue where the autoplay only begins if you click to another window or you manually move the thumbnails to the left or right. Then it works fine. Can anyone look at the code and see if they can see what I'm doing wrong? <!DOCTYPE html> <html> <head> <!-- google maps api key --> <script src="http://maps.google.com/maps/api/js?key=AIzaSyAM4sSbWxrbwyXvGHvbH6piG5AlqLjtAMc&sensor=true" type="text/javascript"></script> <!-- jquery --> <script src="js/jquery.1.11.1.min.js"></script> <script src="js/jquery.ui.map.full.min.js"></script> <!-- scripts for lightbox --> <script src="js/lightbox.min.js"></script> <!-- script for actual display of images --> <!-- fonts --> <link href='http://fonts.googleapis.com/css?family=Pacifico|Open+Sans' rel='stylesheet' type='text/css'> <link rel="stylesheet" type="text/css" href="http://cdn.jsdelivr.net/jquery.slick/1.3.15/slick.css"/> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <link href="css/lightbox.css" rel="stylesheet" /> <link href="css/styles.css" rel="stylesheet" type="text/css"> </head> <body> <header> <h1>Time Capsule <i class="fa fa-space-shuttle"></i> </h1> <div id="drop_instructions"> <p>Ever wonder what a certain area looked like from the world's point of view? Now you can find out! Click on an area in the map and we'll show you that spot as the locals see it.</p> </div> </header> <section class="clearfix"> <div id="map_canvas"></div> <div id="imagebox" class="slider-for"> </div> </section> <div class="slider-nav"> </div> <script type="text/javascript" src="http://cdn.jsdelivr.net/jquery.slick/1.3.15/slick.min.js"></script> <script src="js/map.js"></script> </body> </html> $(document).ready(function() { $('#drop_instructions').hide(); $('#header').click(function(){ $('#drop_instructions').fadeToggle( "fast", "linear" ); }); //define lat and long globally so they can be used elsewhere var lat=0; var lng=0; var city=''; var state=''; var StartLatLng = new google.maps.LatLng(28.4158, -81.2989); $('#map_canvas').gmap({ 'center': StartLatLng, zoom: 10, styles: [{"featureType":"landscape","stylers":[{"saturation":-100},{"lightness":65},{"visibility":"on"}]},{"featureType":"poi","stylers":[{"saturation":-100},{"lightness":51},{"visibility":"simplified"}]},{"featureType":"road.highway","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"road.arterial","stylers":[{"saturation":-100},{"lightness":30},{"visibility":"on"}]},{"featureType":"road.local","stylers":[{"saturation":-100},{"lightness":40},{"visibility":"on"}]},{"featureType":"transit","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"administrative.province","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"labels","stylers":[{"visibility":"on"},{"lightness":-25},{"saturation":-100}]},{"featureType":"water","elementType":"geometry","stylers":[{"hue":"#ffff00"},{"lightness":-25},{"saturation":-97}]}] }) .bind('init', function(event, map) { $(map).click( function(event) { //define date var year = $("#year").val(); var month = $("#month").val(); var day = $("#day").val(); //give current value to lat/long on click lat=event.latLng.lat(); lng=event.latLng.lng(); var latlng= event.latLng; //input box with coordinates $('#latlng').val(lat+', '+lng); geocoder = new google.maps.Geocoder(); geocoder.geocode({'latLng': latlng}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { //Check result 0 var result = results[0]; //look for locality tag and administrative_area_level_1 for(var i=0, len=result.address_components.length; i<len; i++) { var ac = result.address_components[i]; if(ac.types.indexOf("locality") >= 0) city = ac.long_name; if(ac.types.indexOf("administrative_area_level_1") >= 0) state = ac.long_name; } //only report if we got Good Stuff if(city != '' && state != '' && year != '') { console.log("Hello to you are in "+city+", "+state+"! The date you chose is: " + month + " " + day + ", " + year); } else { console.log("YOU FORGOT TO PICK A YEAR!"); } } //end of getting city //==============Image generation================= //get location from map click and inject data into URL var locationURL = "https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=a0f6800f62ea920f00472805d767ac5c&lat="+lat+"&lon="+lng+"&format=json&nojsoncallback=1"; $.ajax({ url: locationURL, dataType: "json", success:function(data){ var farmId; var serverId; var photoId; var secret; var title; //hide instructions once content is generated $('#instructions').fadeOut(500); //title the images for the city clicked on $('#images_title').append('<h3>'+city+' , '+state+'</h3>'); console.log(data); //generate thumbnails user can click on for (i=0; i < 20; i++){ farmId = data.photos.photo[i].farm; serverId = data.photos.photo[i].server; photoId = data.photos.photo[i].id; secret = data.photos.photo[i].secret; title = data.photos.photo[i].title; // make the urls for the DOM photoURL = "https://farm"+farmId+".staticflickr.com/"+serverId+"/"+photoId+"_"+secret+"_z.jpg"; thumbURL = "https://farm"+farmId+".staticflickr.com/"+serverId+"/"+photoId+"_"+secret+"_s.jpg"; //append the clickable thumbnails to the dom $('.slider-for').slickAdd('<div><img src="'+photoURL+'" alt="'+title+'" /></div>'); $('.slider-nav').slickAdd('<div><img src="'+thumbURL+'" class="image_thumb" alt="'+title+'" /></a></div>'); } //change background of page to an image that is displayed $("body").css("background-image", "url('"+photoURL+"')"); } }); }); }); }); }); $('.slider-for').slick({ slidesToShow: 1, slidesToScroll: 1, arrows: true, fade: true, asNavFor: '.slider-nav' }); $('.slider-nav').slick({ arrows: true, slidesToShow: 3, slidesToScroll: 1, asNavFor: '.slider-for', dots: true, centerMode: true, focusOnSelect: true, autoplay: true, autoplaySpeed: 2000 });
  3. Hello, I'm trying to send a variable that gets its text from an xml file to a markers information box, and I can't seem to get it to work. Can someone look at my code and tell me what I'm doing wrong? its the one marked "address" (line 52 and down). $(document).ready(function () { //google maps api $('#map_canvas').gmap({'zoom':3, 'center': new google.maps.LatLng(39.8282,-98.5795)}).bind('init', function(ev, map) { //last.fm api $( "#artistSearch" ).submit(function( event ) { $('#map_canvas').gmap('clear', 'markers'); //clear previous results $("#tourList h2").empty(); $("#artist").empty(); //name to send to API var artistName = $("#artistName").val(); //get API response $.get("http://ws.audioscrobbler.com/2.0/?method=artist.getevents&artist=" + artistName + "&api_key=69d935120d26cbcbaeed4fac6f59dfb6", function(xml) { var resLength = $(xml).find("venue"); if (resLength.length != 0) { //attach heading $("#tourList").prepend("<h2>Tour List</h2>"); //find venues $(xml).find("venue").each( function() { title = $(this).find("name").text(); //build a list of the venues $("#artist").append("<li>" + title + "</li>"); }); } else { $("#artist").append("<li>No Results Found</li>"); } //grab lat and long $(xml).find("location").each( function() { geolat = $(this).find("geo\\:lat").text(); geolong = $(this).find("geo\\:long").text(); address = $(this).find("city").text(); $('#map_canvas').gmap('addMarker', { 'position': new google.maps.LatLng(geolat,geolong) } ).click(function() { $('#map_canvas').gmap('openInfoWindow', { 'content': address }, this); }); //end of markers }); //end of locations }); event.preventDefault(); }); }); });
  4. well, the problem with changing append is that I need it to append so I can build a list of the events. It's only when I change the band name in the input box that I would like all of that to clear. I haven't tried onchange yet.
  5. Also, is there a way to do something like "when this API has sent back a response with xml in it, do this"?
  6. Hello, i wasn't sure of a good way to title this post but, I have this app that for right now, you type in band name and it grabs that band's concerts from last.fm API (without using a submit button). This part works, but then when i type a new band/artist in to the input box, instead of replacing the previous band's concerts, it just adds to it. Does anyone know of a way to delete the previous information once a new band name is typed in? the html: <!doctype html> <html> <head> <meta charset="utf-8"> <title>Assignment 03 Mashup – Nicholas Barna</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="js/script.js"></script> <link href="css/styles.css" rel="stylesheet" type="text/css"> </head> <body> <div id="container" class="globalWidth"> <form name="artistSearch" id="artistSearch" method="get"> <label for="artistName">Artist or band name:<input type="text" name="artistName" id="artistName" /></label> </form> <span id="searchTitle">search for:</span><span id="searchItem"></span> <div id="artist"> </div> </div> </body> </html> the Javascript: $(document).ready(function () { $("#artistName").on("keyup change", function() { artistName = this.value; $.get("http://ws.audioscrobbler.com/2.0/?method=artist.getevents&artist=" + artistName + "&api_key=69d935120d26cbcbaeed4fac6f59dfb6", function(xml) { $(xml).find("venue").each( function() { title = $(this).find("name").text(); $("#artist").append(title); }); }); $("#searchItem").text(this.value); }); });
  7. Hello, I'm getting an XML tag node value using var dropOption = document.createTextNode(title[0].firstChild.nodeValue); and after I want to be able to split that certain places like you can with a string using split. Is this possible? I tried using split on dropOption after I get the value but it doesn't work. Maybe I'm doing something wrong though, because wouldn't the nodeValue become a string after it's assigned to the variable? Edit: nevermind, I've got it figured out, i needed to assign the nodeValue to a variable before using that to create the text node, this post can be deleted.
  8. Hello, I have an xml file that I then convert to json, and save it as a text file. What I'm trying to do is to then take this text and insert all of it into one field in a table. When I do, a record is added, but its blank, theres no data. I can add it through phpmyadmin, and i can change what I'm adding to a simple string and it gets added through php, but when I try to add the actual text it's not there. Anyone have any ideas what I'm doing wrong? I'm also getting this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't Remember To Forget You, Shakira Featuring Rihanna","link":"http:\/\/www1.billb' at line 1 (its Billboards Hot 100 rss feed) I don't even need it converted to Json, if thats simpler, I just need to save the contents of the XML into a table. my code to get and save the file: $billboardFile = "http://www1.billboard.com/rss/charts/hot-100"; $loadBillboard = simplexml_load_file($billboardFile); $loadBillboard->asXML("data/billboard.xml"); $url = 'data/billboard.xml'; $billboardLoad = file_get_contents($url); $billboardLoad = str_replace(array("\n", "\r", "\t"), '', $billboardLoad); $billboardLoad = trim(str_replace('"', "'", $billboardLoad)); $loadBB = simplexml_load_string($billboardLoad); $bbJson = json_encode($loadBB); $fileName = 'data/bbJson.txt'; if (file_exists($fileName)) { $lBillboard = file_get_contents($file); $lBillboard = $bbJson; file_put_contents($fileName, $lBillboard); } my main page: <!doctype html> <?php //include folder path $incPath = 'includes/'; include $incPath . 'getFile.php'; include $incPath . 'conn.php'; ?> <html> <head> <meta charset="utf-8"> <title>Assignment 01 AJAX – Nicholas Barna</title> </head> <body> <?php $dataBB = file_get_contents('data/bbJson.txt'); $query="INSERT INTO xmladd (id,text) VALUES (null,'$dataBB')"; $result=$mysqli->query($query) or die ($mysqli->error); ?> <div id="listings"></div> <!--<script type="text/javascript" src="js/javascript.js"></script>--> </body> </html> theres also a connection file, and then the xml and txt files. I'm attaching the txt file that it creates. bbJson.txt
  9. just out of curiousity, i tried to add unset($act) at the end of the if $action='save' statement, but this doesn't seem to work, why doesn't it? when i click save, it should unset $act, and then it would run back through and end up at the part of the main if statement that's for when $act has no value, right?
  10. thank you! That worked, but now there's a new problem. When I click save, it's supposed to go back to the main screen which shows all the records, but instead it just stays on the edit screen. I thought because the form is submitted would mean $action's value would be lost, and therefore go back to the main screen but it doesnt.
  11. Hello, I'm making a simple program that adds homework assignments to a database table and then displays them. I'm trying to add the ability to edit them, but I can't figure it out. Here's what I have right now, but after I go to the edit screen, change the value, and hit save, it doesn't update the table. Sorry for the amount of code, i didnt know what I needed to include or not. <html> <head> <title>untitled</title> <link href="css/styles.css" rel="stylesheet" type="text/css"> </head> <body> <form method='post'> <?php function showlist($mysqli,$last='') { if ($last) $myquery="SELECT * FROM homeworklist WHERE course LIKE '$last%'"; else $myquery="SELECT * FROM homeworklist"; $result=$mysqli->query($myquery) or die ($mysqli->error); $count=$result->num_rows; if($count > 0) { $output="<table><tr><th>Task Nr:</th><th>assign-date</th><th>due-date</th><th>priority</th><th>course</th><th>prof</th><th>title</th><th>description</th></tr>"; while ($row=$result->fetch_assoc()) { $tasknr=$row['tasknr']; $assigndate=$row['assigndate']; $duedate=$row['duedate']; $priority=$row['priority']; $course=$row['course']; $prof=$row['prof']; $title=$row['title']; $description=$row['description']; $output.= "<tr><td align='center'>$tasknr</td><td>$assigndate</td><td>$duedate</td><td>$priority</td><td>$course</td><td>$prof</td><td>$title</td><td>$description</td></tr>"; } $output.= "</table> <br />"; print $output; } #count else print "There are no homework items in the list.<br />"; } #showlist function drawinputs() { print "<dl>"; print "<dt><label for='assigndate'>Assign Date:</label></dt><dd><input type='text' name='assigndate'></dd> <dt><label for='duedate'>Due Date:</label></dt><dd><input type='text' name='duedate'></dd> <dt><label for='priority'>Priority:</label></dt><dd><input type='text' name='priority'></dd> <dt><label for='course'>Course:</label></dt><dd><input type='text' name='course'></dd> <dt><label for='prof'>Professor:</label></dt><dd><input type='text' name='prof'></dd> <dt><label for='title'>Title:</label></dt><dd><input type='text' name='title'></dd> <dt><label for='description'>Description:</label></dt><dd><input type='text' name='description'></dd> <input type='submit' name='action' value='Add Task'> <dt><label for='matchlast'>Filter the displayed list. Only display courses with names that begin with this string:</label></dt> <dd><input type='text' name='matchlast'></dd> <input type='submit' name='action' value='Filter List'><br /><br /> <dl> <dt><label for='delsel'>Item number to be deleted:</label></dt><dd><input type='text' name='delsel' size=2></dd> </dl> <input type='submit' name='action' value='Delete Task'><br /> <dl> <dt><label for='editsel'>Item number to be edited:</label></dt><dd><input type='text' name='editsel' size=2></dd> </dl> <input type='submit' name='action' value='Edit Record'><br /> "; print "</dl>"; } # drawinputs function addtask($mysqli) { $assigndateX=$_POST['assigndate']; $duedateX=$_POST['duedate']; $priorityX=$_POST['priority']; $courseX=$_POST['course']; $profX=$_POST['prof']; $titleX=$_POST['title']; $descriptionX=$_POST['description']; // ESSENTIAL cleaning to avoid SQL Injectin Attack $assigndate=$mysqli->real_escape_string($assigndateX); $duedate=$mysqli->real_escape_string($duedateX); $priority=$mysqli->real_escape_string($priorityX); $course=$mysqli->real_escape_string($courseX); $prof=$mysqli->real_escape_string($profX); $title=$mysqli->real_escape_string($titleX); $description=$mysqli->real_escape_string($descriptionX); // The 'null' in the VALUES list allows the auto-incrementing idnumber to work $query="INSERT INTO homeworklist VALUES (null,'$assigndate','$duedate','$priority','$course','$prof','$title','$description')"; $result=$mysqli->query($query) or die ($mysqli->error); } #addtask // STARTER item for deleterecord function function deleterecord($mysqli,$deletenumber) { $query="DELETE FROM homeworklist WHERE tasknr=$deletenumber"; $result=$mysqli->query($query) or die ($mysqli->error); } function edittask($mysqli, $editnumber) { $myquery="SELECT * FROM homeworklist WHERE tasknr=$editnumber"; $result=$mysqli->query($myquery) or die ($mysqli->error); while ($row=$result->fetch_assoc()) { $tasknr=$row['tasknr']; $assigndate=$row['assigndate']; $duedate=$row['duedate']; $priority=$row['priority']; $course=$row['course']; $prof=$row['prof']; $title=$row['title']; $description=$row['description']; } print "<h1>Edit " . $title . "</h1>"; print "<input type='text' name='editassigndate' value='$assigndate' />"; print "<input type='text' name='editduedate' value='$duedate' />"; print "<input type='text' name='editpriority' value='$priority' />"; print "<input type='text' name='editcourse' value='$course' />"; print "<input type='text' name='editprof' value='$prof' />"; print "<input type='text' name='edittitle' value='$edittitle' />"; print "<input type='text' name='editdescription' value='$description' />"; print "<input type='submit' name='action' value='cancel' />"; print "<input type='submit' name='saveTable' value='save' />"; $action = $_POST['saveTable']; if ($action == "save") { $assigndateX=$_POST['editassigndate']; $duedateX=$_POST['editduedate']; $priorityX=$_POST['editpriority']; $courseX=$_POST['editcourse']; $profX=$_POST['editprof']; $titleX=$_POST['edittitle']; $descriptionX=$_POST['editdescription']; // ESSENTIAL cleaning to avoid SQL Injectin Attack $editassigndate=$mysqli->real_escape_string($assigndateX); $editduedate=$mysqli->real_escape_string($duedateX); $editpriority=$mysqli->real_escape_string($priorityX); $editcourse=$mysqli->real_escape_string($courseX); $editprof=$mysqli->real_escape_string($profX); $edittitle=$mysqli->real_escape_string($titleX); $editdescription=$mysqli->real_escape_string($descriptionX); $query = "UPDATE homeworklist SET assigndate=$editassigndate, duedate=$editduedate, priority=$editpriority, course=$editcourse, prof=$editprof, title=$edittitle, description=$editdescription WHERE tasknr=$editnumber"; $result=$mysqli->query($query) or die ($mysqli->error); } } // MAIN PROGRAM // Create the mysqli object $mysqli = new mysqli('localhost', 'nick', 'n1ck8arna', 'homework'); // Check for any errors. $errnum=mysqli_connect_errno(); if ($errnum) { $errmsg=mysqli_connect_error(); print "Connect failed. error number=$errnum<br /> error message=$errmsg"; exit(); } // Now interact with the user print "<h2>Project 4</h2>"; $act=$_POST['action']; if ($act == 'cancel') { unset($act); } if ($act=='Add Task') { drawinputs(); addtask($mysqli); showlist($mysqli); } else if ($act=='Filter List') { drawinputs(); $matchlastX=$_POST['matchlast']; $matchlast=$mysqli->real_escape_string($matchlastX); showlist($mysqli,$matchlast); } else if ($act=='Delete Task') { $deletenumberX=$_POST['delsel']; $deletenumber=$mysqli->real_escape_string($deletenumberX); if (!$deletenumber) { print "You need to enter a task number!"; } else { deleterecord($mysqli,$deletenumber); } showlist($mysqli); drawinputs(); } else if ($act == 'Edit Record') { $editnumberX = $_POST['editsel']; $editnumber = $mysqli->real_escape_string($editnumberX); if (!$editnumber) { print "You need to enter a task number!"; showlist($mysqli); drawinputs(); } else { edittask($mysqli,$editnumber); } } else { showlist($mysqli); drawinputs(); } ?> </form> </body> </html>
  12. gah, that was it. I hate trying to find an issue for hours and than have it turn out to be something like that. It's strange though, the example page they provide that works has slashes before each path.
×
×
  • 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.