PHP - Problems With Js Carousel
Hello,
I have problem with JS slider. Here is demo website http://goo.gl/bPzpAo I can't make the slider to have similar size items (seems cutted). I can't get, what's wrong there? Someone could help me with this?? I tried to resize images, also li elements modifications, but no solution. If someone could help me, will be much appreciated!
Regards,
Zox
Similar TutorialsHi all This is my first post but I hope someone can help. I am building a website using a theme that uses a template builder that includes a client scrolling carousel. When using it once it works fine... I need to use it 3 times. The second and third instance doesn't scroll and appears huge on the page. I am a novice at php but after a bit of research I believe its something to do with how the builder calls for the carousel and the ID. I am not sure how to amend the php to make each instance of the carousel have a different ID and consequently js and css div classes are called correctly. I hope this make sense and any help would be much appreciated Craig I have an image carousel where the hyperlink worked just fine in all browsers that I tested UNTIL recently, now it works on IE and Opera; it no longer seems to work on Firefox, Safari and Chrome. Can someone give me an idea as to why that would happen? Here's the webpage: http://www.myalaskacenter.com and here's the coding used: Code: [Select] <?php echo '<div id="slider"><ul id="sliderContent">'; while ($Row = mysqli_fetch_assoc($Result)){ $EventName = $Row['EventTitle']; $url = $Row['ShoWareEventLink']; $image = $Row['eImage']; $description = $Row['BriefDescription']; $promoter = $Row['Presenter']; $starting = $Row['startDATE']; $ending = $Row['endDATE']; echo '<li class="sliderImage"><a href="' . $url . '"><img src="https://alaskapac.centertix.net/UPLImage/' . $image . '" alt="' . $EventName. '" title="' . $EventName . '" height="400" width="900" border="0" /></a><span class="right"><strong>' . $EventName . '</strong><br /><em><br />Presented by ' . $promoter . '</em><br />' . date("l, F j, Y", strtotime($starting)); if ($starting != $ending){ /**IF STARTING=ENDING =>NO ENDING SHOWN **/ echo '<br />to ' . date("l, F j, Y", strtotime($ending)); } echo '<br /><br />' . $description . '<br /><br /><a href="' . $url . '"><img src="https://alaskapac.centertix.net/UPLImage/z_BUY_Tickets_gold.gif" height="40" width="100" border="0" align="right" alt="' . $EventName . '" title="' . $EventName . '" /></a></span></li>'; } echo '<div class="clear sliderImage"></div></ul></div>'; ?>When I click to view the source in the non-working browsers, I cannot find an issue all the HTML looks like it should work. In fact there are two other "image carousels" on that page that do indeed work in these non-working browsers. 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 }); Hi all new to php and this forum i have been looking around and im very impressed most questions get answered not like on some of the forums around.
Is there any one kind enough to help me out i have an api call via php and would like to output the results to owlcarousel where do i start with this.
Code i have is:
<?php error_reporting(E_ALL); // Turn on all errors, warnings and notices for easier debugging // API request variables $endpoint = 'http://svcs.ebay.com/services/search/FindingService/v1'; // URL to call $version = '1.0.0'; // API version supported by your application $appid = 'YourAppID'; // Replace with your own AppID $globalid = 'EBAY-GB'; // Global ID of the eBay site you want to search (e.g., EBAY-DE) $query = 'tools'; // You may want to supply your own query $safequery = urlencode($query); // Make the query URL-friendly // Construct the findItemsByKeywords HTTP GET call $apicall = "$endpoint?"; $apicall .= "OPERATION-NAME=findItemsIneBayStores"; $apicall .= "&SERVICE-VERSION=$version"; $apicall .= "&SECURITY-APPNAME=$appid"; $apicall .= "&GLOBAL-ID=$globalid"; $apicall .= "&keywords=$safequery"; $apicall .= "&storeName=yourstorename"; $apicall .= "&paginationInput.entriesPerPage=6"; $apicall .= "&paginationInput.pageNumber=1"; // Load the call and capture the document returned by eBay API $resp = simplexml_load_file($apicall); // Check to see if the request was successful, else print an error if ($resp->ack == "Success") { $results = ''; // If the response was loaded, parse it and build links foreach ($resp->searchResult->item as $item) { $pic = $item->galleryURL; $link = $item->viewItemURL; $title = $item->title; $price = $item->currentPrice; // For each SearchResultItem node, build a link and append it to $results $results .= "<div id='item'><div class='img-wrap' align='center'><img src=\"$pic\" class='itemimg'></div> <div class='itemtxt' align='center'><a href=\"$link\">$title</a>$price</div></div>"; } } // If the response does not indicate 'Success,' print an error else { $results = "<h3>Oops! The request was not successful. Make sure you are using a valid "; $results .= "AppID for the Production environment.</h3>"; } ?> <html> <head> <body> <table> <tr> <td> <div id="result"> <?php echo $results;?> </div> </td> </tr> </table> </body> </html>Im sure is pretty basic but being new to this i have no idea where to start, any advice would be much appreciated. thanks Edited by didz666, 25 January 2015 - 02:22 PM. I have installed the Carousel code using tutorial at http://www.wolf-howl.com/blogs/how-to-carousel/ now i amfacing a problem that every thing is working expect images thumbnail. here is the site http://www.digpk.com/ where i am try to make carousel. you can see the featured posts at top with missing thumbnails. Thanks in advance. picture of the problem is also attached. I've been working on developing a CMS blog and now I'm trying to create a slideshow wit Bootstrap Carousel on the homepage to present the dynamic content (images + text) using the data from table 'posts'. I tested this code, and it only presents one post. I mean, It's not possible to go to the next slide. I want to show all the posts on the slides. *The DB connection is already on the includes. The connection was written on a small file called DB.php Home.php <header> <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators"> <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li> <li data-target="#carouselExampleIndicators" data-slide-to="1"></li> <li data-target="#carouselExampleIndicators" data-slide-to="2"></li> </ol> <div class="carousel-inner" role="listbox"> <?php // The default SQL query $sql = "SELECT * FROM posts ORDER BY id desc"; $stmt = $ConnectingDB->query($sql); while ($DataRows = $stmt->fetch()) { $Id = $DataRows["id"]; $PostTitle = $DataRows["title"]; $Image = $DataRows["image"]; $PostText = $DataRows["post"]; ?> <!-- Slide --> <div class="carousel-item active" style="background-image: url('uploads/<?php echo $Image; ?>')"> <div class="carousel-caption"> <div class="card-body black"> <h3 class="large-mistral-white"><?php echo $PostTitle; ?></h3> <p class="small-times-white"><?php echo $PostText; ?></p> </div> </div> </div> <?php } ?> </div> <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev"> <span class="carousel-control-prev-icon" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a> <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next"> <span class="carousel-control-next-icon" aria-hidden="true"></span> <span class="sr-only">Next</span> </a> </div> </header> DB.php <?php $DSN='mysql:host = localhost; dbname=everybody_blog'; $ConnectingDB = new PDO($DSN,'root',''); ?>
i have 8 division (div), i want to display 4 rows in 4 division and the remain 4 rows in the next 4 division here is my code structure for carousel
<div class="nyie-outer"> second row third row
fourth row fifth row sixth row seven throw eighth row
</div><!--/.second four rows here-->
sql code
CREATE TABLE product( php code
<?php how can i echo that result in those rows
class curl2{ private $curl_init; private $CURLOPT_URL; public function connect(){ $this->curl_init = curl_init(); } public function debug(){ curl_setopt($this->curl_init, CURLOPT_VERBOSE, TRUE); $fp = fopen("curl2.txt", "w"); curl_setopt($this->curl_init, CURLOPT_STDERR, $fp); curl_setopt($this->curl_init, CURLOPT_RETURNTRANSFER, TRUE); } public function setUrl($url = null){ $this->CURLOPT_URL = $url; curl_setopt($this->curl_init, CURLOPT_URL, $this->CURLOPT_URL); } public function execute(){ $out = curl_exec($this->curl_init); curl_close($this->curl_init); return $out; } } $curl2 = new curl2; $curl2->connect(); $curl2->setUrl("http://www.linuxformat.co.uk"); $curl2->debug(); echo $curl2->execute(); It display a blank page like attachment result1.jpg, but if I move the $fp = fopen("curl2.txt", "w"); curl_setopt($this->curl_init, CURLOPT_STDERR, $fp); curl_setopt($this->curl_init, CURLOPT_RETURNTRANSFER, TRUE); from function debug() and join it with function execute() like this: public function execute(){ $fp = fopen("curl2.txt", "w"); curl_setopt($this->curl_init, CURLOPT_STDERR, $fp); curl_setopt($this->curl_init, CURLOPT_RETURNTRANSFER, TRUE); $out = curl_exec($this->curl_init); curl_close($this->curl_init); return $out; } it return me Linuxformat content ( expected result ) like result2.jpg below is the working code : class curl2{ private $curl_init; private $CURLOPT_URL; public function connect(){ $this->curl_init = curl_init(); } public function debug(){ curl_setopt($this->curl_init, CURLOPT_VERBOSE, TRUE); } public function setUrl($url = null){ $this->CURLOPT_URL = $url; curl_setopt($this->curl_init, CURLOPT_URL, $this->CURLOPT_URL); } public function execute(){ $fp = fopen("curl2.txt", "w"); curl_setopt($this->curl_init, CURLOPT_STDERR, $fp); curl_setopt($this->curl_init, CURLOPT_RETURNTRANSFER, TRUE); $out = curl_exec($this->curl_init); curl_close($this->curl_init); return $out; } } $curl2 = new curl2; $curl2->connect(); $curl2->setUrl("http://www.linuxformat.co.uk"); $curl2->debug(); echo $curl2->execute(); Why I couldn't split "CURLOPT_STDERR, CURLOPT_RETURNTRANSFER" with "curl_exec" Hi I have plans in developing a connect function for remote login to my web side. I can't find any useful on Google. Some idees on how to code a API connect button? Something similiar to Facebook connect, Twitter connect etc. BUT this should not rely on facebook api. I'm going to make my own stand alone api. I know I need to use REST in backend, but I'm missing the knowledge to know how to send / recive the login data, and how to know when a user are online or not. I'm greatfull for any help. Also links. And also tips on how to make a developer plattform for apps, much like the way Facebook have it. Hello, Alright I am having a few issues here. Let me explain what I am doing...this is a script that allows a customer to split an order..he can split certain items out of one order and it will create another order with the items he split added to this order, and then subtracting the items from the old order. The products are stored in one field called products, they are stored in a delimited list like this qty, product name, price each, product id | qty, product name, price each, product id |etc. Now, before you say why are you storing your products like that?? The reason I have to store my products like so is because the customer does not want the products stored in the order table to be dependent off the products table like they were before. In that case if he modified a product it would modify all of the orders with that product stored in them. Make sense? I am aware a delimited list probably wasn't the best way to do this but it was the best way I could think of. Ok here is my list of issues. 1) Everytime you split an order, it is not creating a new order to store the items that were split into. It created an order the first time I did it, and now all it does is it keeps updating the products field in that order, rather than creating a new order. 2) Next I do not know how I can update the old products (stored in the $prod array). It needs to update the products qtys after the order was split, and then if all of the qty for that product were moved to the new order it just needs to remove that product from the $prod array rather than updating the quantity. The code is below. Please let me know if I can provide any more information to help! Thanks everyone! // Get Old Order $get_order = @mysql_query("SELECT * FROM orders WHERE order_id = {$_POST['order_id']}"); $order = @mysql_fetch_assoc($get_order); // Get Old Order Items $products = $order['products']; //breaking products text down for display $prod = array(); $_products = explode('|', $products); foreach ($_products AS $p) $prod[] = explode(',', $p); /* $get_items = @mysql_query("SELECT product_id, qty FROM order_items WHERE order_id = {$order['order_id']}"); $items = array(); while(($row = @mysql_fetch_assoc($get_items)) !== false) { $items[] = $row; } */ if(empty($prod)) { header("Location: tracking.php"); die(); } // Create New Order mysql_query("INSERT INTO orders SET customer_id = {$order['customer_id']}, order_status = {$order['order_status']}, order_date = '{$order['order_date']}', order_date_paid = '{$order['order_date_paid']}', order_shipping = '{$order['order_shipping']}', order_shipping_fee = '{$order['order_shipping_fee']}', order_insurance = '{$order['order_insurance']}', order_insurance_fee = '{$order['order_insurance_fee']}', order_insurance_total = '{$order['order_insurance_total']}', order_grand_total = '{$order['order_grand_total']}', order_date = '{$order['order_date']}', order_filled = '{$order['order_filled']}', order_ship_date = '{$order['ship_date']}'"); $get_new_order = @mysql_query("SELECT MAX(order_id) AS order_id FROM orders") or die(mysql_error()); $new_order_id = @mysql_result($get_new_order, 'order_id', 0); // Add Items to New Order & Remove Items from Old Order $new_items = array(); $_new_items = ''; foreach($prod as $p2) { for($i = 0; $i < $p2[0]; $i++) { if(!empty($_POST[trim($p2[3]).'_'.$i])) { $new_items[trim($p2[3])]++; } } } //construct new static products list foreach($new_items as $id=>$qty) { $get_product = mysql_query("SELECT name, price FROM products WHERE product_id = '{$id}'"); $got_product = mysql_fetch_assoc($get_product); $_new_items .= $qty.','.$got_product['name'].','.$got_product['price'].','.$id.'|'; //echo $id.' - '.$qty.'<br>'; } //remove last character in products text before going into DB $_new_items = substr_replace($_new_items ,"",-1); //update products field in new order mysql_query("UPDATE orders SET products = '{$_new_items}' WHERE order_id = '{$new_order_id}'"); Hi, I hope someone can help me. I am trying to generate a script for our Intranet that tells me which birthdays = today. My field in my table = d/m/y, eg 09/05/2011 (9 May 2011). How do I get the script to just look at the day & month, not the year? My script looks like this: Code: [Select] <?php echo date("d/m/Y") . "<br />"; $myDate = date('d/m/Y'); $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("dbname", $con); $sql = "SELECT * FROM detail WHERE dob='$mydate'"; $result=mysql_query($sql); echo mysql_num_rows($result); ?> I'm trying to either update my database if some data matches the if statement, or insert the data in a new row if it doesn't match (if possible). The code will update the database just fine if the data matches, but if not, it won't insert the new data. (When I leave off the if statement it will insert just fine). I fear I'm not using the if...else correctly. Thanks for any help. <?php header("Location: admin_schedule.php"); include("opendatabase.php"); $date=("$_POST[gamedate]"); $week=("$_POST[Week]"); $game=("$_POST[Game]"); $hometeam=("$_POST[team_name_1]"); $awayteam=("$_POST[team_name_2]"); $check = mysql_query("SELECT week_id,game_id FROM schedule"); $row[] = mysql_fetch_array($check); if ($row[week_id]='$week' && $row[game_id]='$game') { mysql_query("UPDATE schedule SET week_id = '$week', game_id = '$game', date = '$date', H_team = '$hometeam', A_team = '$awayteam' WHERE week_id = '$week' AND game_id = '$game'"); } else { mysql_query("INSERT INTO schedule (week_id,game_id,date,H_team,A_team) VALUES('$week','$game','$date','$hometeam','$awayteam')"); } mysql_close($con); First Since I first started learning PHP, I've been writing code for forms like this: $name = $_POST["name"]; if ($name == "") { echo "You didn't type anything"; } I've written scripts like this and tested them on a GOdaddy server, and they always worked fine. Now, after testing scripts like that on my own server (WAMP2 [PHP5, Mysql, Apache]), I get an error saying "Unidentified index: name", and so I have to nest that if statement AS WELL AS the variable assignment inside another if statement like this: if (isset ($_POST["name"])) { $name = $_POST["name"]; if ($name == "") { echo "you didn't type anything. } } The error doesn't actually stop the script from running, but a medium sized box appears in the browser with the error message contained that's after the element in the document of which is getting an invalid error. Which way is truly the correct way? Because now that I have to use the second way in order for my scripts to run correctly on my own server, I have to write more code and it all gets disorganized and more complicated to read. So...is this a configuration thing that I can tweak in WAMP2 to stop messages like that from popping up? Or is the second way the way you're supposed to do it? Also, I was wondering why ereg got deprecated and what the replacement of it is in PHP5? I've asked before and even googled it but I simply get taken to a "Pearl" function on PHP.net. I'm not sure what it is, or how to use it, and haven't got any hints from either PHP.net or anywhere else. Any suggestions? I want to gettwitter feeds, this gives me a xml http://twitter.com/statuses/user_timeline.rss?screen_name=fleuragemapvv&count=3 based on this: http://www.w3schools.com/PHP/php_xml_simplexml.asp i try to get the xml with: <?php$xml = simplexml_load_file("http://twitter.com/statuses/user_timeline.rss?screen_name=fleuragemapvv&count=3");?>() i get this error: Quote Warning: simplexml_load_file(http://twitter.com/statuses/user_timeline.rss?screen_name=fleuragemapvv&count=3): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in /home/vhosting/x/vhost0033377/domains/doekewartena.nl/htdocs/www/temp/twitter03.php on line 2 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://twitter.com/statuses/user_timeline.rss?screen_name=fleuragemapvv&count=3" in /home/vhosting/x/vhost0033377/domains/doekewartena.nl/htdocs/www/temp/twitter03.php on line 2 i have no clue, i'm very new to php can i even use simplexml_load_file cause it has no .xml file type extention. the image in my comments box wont show up it gives me an error Code: [Select] Notice: Undefined index: avatar in /home/ecabrera/public_html/profile.php on line 277 and i dont whats wrong with it Code: [Select] // display comments $perpage = 10; $start=0; if(@$_GET['s']) $start = $_GET['s']; $query = mysql_query("SELECT * FROM profile_comments WHERE profile_id='$getid' ORDER BY id DESC LIMIT $start, $perpage"); $numrows = mysql_num_rows($query); if ($numrows > 0){ $next = $start + $perpage; $prev = $start - $perpage; while($row = mysql_fetch_assoc($query)){ $user_id = $row['user_id']; $user_name = $row['user_name']; $comment = nl2br($row['comment']); $date = $row['date']; $avatar = $row['avatar']; echo "<img src='avatars/$avatar'></img><a href='$site/profile?id=$getid'></a> <b> on $date</b><br />"; echo "<div style='margin-left: 10px;'>$comment</div><hr>"; } } else echo "This user has no profile comments.<br />"; // end diplay comment area Hello, I'm having trouble with zip_read. I made a zip of 2 plain 8k text files and zipped them w/ winrar using default settings. I opened the file w/ zip_open and then checked to make sure the return value was a valid resource, which it is. But when I try to use the return value of zip_read I get: Quote Warning: zip_entry_name() expects parameter 1 to be resource, boolean given in xxx It is actually returning "1". According to the zip error codes I think this means "Multi-disk zip archives not supported". I have no idea what a 'multi-disk' zip file is. I've posted my code below. How can I get php to read through a zip file? Thanks Code: [Select] $zip = zip_open($this->upload_path . $filename); if (is_resource($zip)) { $i = 0; while($zip_entry = zip_read($zip) && $i<500 ){ if($this->debug) echo "zip_entry=" . $zip_entry . "<br>"; $basename = basename(zip_entry_name($zip_entry)); $zipped_file = $this->upload_path . $basename; // other unrelated code } } I am trying my hand at using an array i have never done it before, and I am having some problems getting it work work. if someone could point me in the right direction? Thanks <?php $active_keys = array(); foreach($_GET['img'] as $key => $filename) { if(!empty($filename)) { $active_keys[] = $key; } } ?> This script works fine except, the a href only displays baseurl/current_folder instead of baseurl/other_folder/other_folder/current_folder I'm sure it's simple, but I can't figure it out. Code: [Select] function breadcrumbs($separator = '', $home = 'Home') { $path = array_filter(explode('/', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))); $base_url = ($_SERVER['HTTPS'] ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . '/'; $breadcrumbs = array("<p><a href=\"$base_url\">$home</a></p>"); $last = end(array_keys($path)); foreach ($path AS $x => $crumb) { $title = ucwords(str_replace(array('.php', '_'), Array('', ' '), $crumb)); $title = ucwords(str_replace(array('.html', '_'), Array('', ' '), $crumb)); if ($x != $last){ $breadcrumbs[] = "<p><a href=\"$base_url$crumb\">$title</a></p>"; }else{ $breadcrumbs[] = "<p>$title</p>"; } } return implode($separator, $breadcrumbs); } echo breadcrumbs(); I have a config file that lists a file like so.. Code: [Select] $file1 = 'storagefolder/mydatabase.txt'; How can I delete the file "mydatabase.txt" that is in another directory 'storagefolder' ? Code: [Select] unlink($file1);gives an error that says not such file or directory |