Search Results

Search found 42698 results on 1708 pages for 'php in array'.

Page 52/1708 | < Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >

  • PHP Array Not Working in Function

    - by lemonpole
    Hello all. I'm currently experimenting with arrays in PHP, and I created a fake environment where a team's information will be displayed. $t1 = array ( "basicInfo" => array ( "The Sineps", "December 25, 2010", "lemonpole" ), "overallRecord" => array (0, 0, 0, 0), "overallSeasons" => array ( 1 => array (14, 0, 0), 2 => array (9, 5, 2), 3 => array (12, 4, 0), 4 => array (3, 11, 2) ), "games" => array ( "<img src=\"images/cs.gif\" alt=\"Counter-Strike\" />", "<img src=\"images/cs.gif\" alt=\"Counter-Strike\" />", "<img src=\"images/cs.gif\" alt=\"Counter-Strike\" />", "<img src=\"images/cs.gif\" alt=\"Counter-Strike\" />" ), "seasonHistory" => array ( "Season I", "Season II", "Season III", "Season IV" ), "divisions" => array ( "Open", "Main", "Main", "Invite" ) ); // Displays the seasons the team has been in along // with the record of each season. function seasonHistory() { // Make array variable local-scope. global $t1; // Count the number of seasons. $numrows = count($t1["seasonHistory"]); // Loop through all the variables until // it reaches the last entry made and display // each item seperately. for($v = 0; $v <= $numrows; $v++) { // Echo each season. echo "<tr><td>{$t1["games"][$v]}</td>"; echo "<td>{$t1["seasonHistory"][$v]}</td>"; echo "<td>{$t1["divisions"][$v]}</td></tr>"; } } I have tested several possible problems out and after narrowing them down I have come down to one conclusion and that is my function is not connecting to the array for some reason. I don't know what else to do because I thought making the array global would fix that problem. What works: I can echo $t1["games"][0] on the page I need it to display and it gives me the content. I tried echo $t1["games"][0] INSIDE the function and then calling the function and it doesn't display anything.

    Read the article

  • Help with refactoring PHP code

    - by Richard Knop
    I had some troubles implementing Lawler's algorithm but thanks to SO and a bounty of 200 reputation I finally managed to write a working implementation: http://stackoverflow.com/questions/2466928/lawlers-algorithm-implementation-assistance I feel like I'm using too many variables and loops there though so I am trying to refactor the code. It should be simpler and shorter yet remain readable. Does it make sense to make a class for this? Any advice or even help with refactoring this piece of code is welcomed: <?php /* * @name Lawler's algorithm PHP implementation * @desc This algorithm calculates an optimal schedule of jobs to be * processed on a single machine (in reversed order) while taking * into consideration any precedence constraints. * @author Richard Knop * */ $jobs = array(1 => array('processingTime' => 2, 'dueDate' => 3), 2 => array('processingTime' => 3, 'dueDate' => 15), 3 => array('processingTime' => 4, 'dueDate' => 9), 4 => array('processingTime' => 3, 'dueDate' => 16), 5 => array('processingTime' => 5, 'dueDate' => 12), 6 => array('processingTime' => 7, 'dueDate' => 20), 7 => array('processingTime' => 5, 'dueDate' => 27), 8 => array('processingTime' => 6, 'dueDate' => 40), 9 => array('processingTime' => 3, 'dueDate' => 10)); // precedence constrainst, i.e job 2 must be completed before job 5 etc $successors = array(2=>5, 7=>9); $n = count($jobs); $optimalSchedule = array(); for ($i = $n; $i >= 1; $i--) { // jobs not required to precede any other job $arr = array(); foreach ($jobs as $k => $v) { if (false === array_key_exists($k, $successors)) { $arr[] = $k; } } // calculate total processing time $totalProcessingTime = 0; foreach ($jobs as $k => $v) { if (true === array_key_exists($k, $arr)) { $totalProcessingTime += $v['processingTime']; } } // find the job that will go to the end of the optimal schedule array $min = null; $x = 0; $lastKey = null; foreach($arr as $k) { $x = $totalProcessingTime - $jobs[$k]['dueDate']; if (null === $min || $x < $min) { $min = $x; $lastKey = $k; } } // add the job to the optimal schedule array $optimalSchedule[$lastKey] = $jobs[$lastKey]; // remove job from the jobs array unset($jobs[$lastKey]); // remove precedence constraint from the successors array if needed if (true === in_array($lastKey, $successors)) { foreach ($successors as $k => $v) { if ($lastKey === $v) { unset($successors[$k]); } } } } // reverse the optimal schedule array and preserve keys $optimalSchedule = array_reverse($optimalSchedule, true); // add tardiness to the array $i = 0; foreach ($optimalSchedule as $k => $v) { $optimalSchedule[$k]['tardiness'] = 0; $j = 0; foreach ($optimalSchedule as $k2 => $v2) { if ($j <= $i) { $optimalSchedule[$k]['tardiness'] += $v2['processingTime']; } $j++; } $i++; } echo '<pre>'; print_r($optimalSchedule); echo '</pre>';

    Read the article

  • php script google maps points from mysql (google example)

    - by user1637477
    I have recently added style information to my maps script, and it stopped working. Have I done something wrong? Guess you can tell I'm very new to this. Any help appreciated. <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="content-type" content="text/html; charset=utf-8"><title>Google Maps AJAX + mySQL/PHP Example</title> <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ ( *******************I INSERTED HERE ) var styles = [ { stylers: [ { hue: "#00ffe6" }, { saturation: -20 } ] },{ featureType: "road", elementType: "geometry", stylers: [ { lightness: 100 }, { visibility: "simplified" } ] },{ featureType: "road", elementType: "labels", stylers: [ { visibility: "off" } ] } ];**( ******************************** THROUGH TO HERE ) map.setOptions({styles: styles}); var customIcons = { restaurant: { icon: 'http://labs.google.com/ridefinder/images/mm_20_blue.png', shadow: 'http://labs.google.com/ridefinder/images/mm_20_shadow.png' }, bar: { icon: 'http://labs.google.com/ridefinder/images/mm_20_red.png', shadow: 'http://labs.google.com/ridefinder/images/mm_20_shadow.png' } }; function load() { var map = new google.maps.Map(document.getElementById("map"), { center: new google.maps.LatLng(-37.7735, 175.1418), zoom: 10, mapTypeId: 'roadmap' }); var infoWindow = new google.maps.InfoWindow; // Change this depending on the name of your PHP fileBHBHBHBHBHBHBHBBBBBBBBBBBBBBBBBBBBBBBBBBB downloadUrl("mywebsite-no i did this just a minute ago", function(data) { var xml = data.responseXML; var markers = xml.documentElement.getElementsByTagName("marker"); for (var i = 0; i < markers.length; i++) { var name = markers[i].getAttribute("name"); var address = markers[i].getAttribute("address"); var type = markers[i].getAttribute("type"); var point = new google.maps.LatLng( parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng"))); var html = "<b>" + name + "</b> <br/>" + address; var icon = customIcons[type] || {}; var marker = new google.maps.Marker({ map: map, position: point, icon: icon.icon, shadow: icon.shadow }); bindInfoWindow(marker, map, infoWindow, html); } }); } function bindInfoWindow(marker, map, infoWindow, html) { google.maps.event.addListener(marker, 'click', function() { infoWindow.setContent(html); infoWindow.open(map, marker); }); } function downloadUrl(url, callback) { var request = window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest; request.onreadystatechange = function() { if (request.readyState == 4) { request.onreadystatechange = doNothing; callback(request, request.status); } }; request.open('GET', url, true); request.send(null); } function doNothing() {} //]]> </script><!--Adobe Edge Runtime--> <script type="text/javascript" charset="utf-8" src="map500x1000_edgePreload.js"></script> <style> .edgeLoad-EDGE-12956064 { visibility:hidden; } </style> <!--Adobe Edge Runtime End--> </head> <body onload="load()"> <div id="map" style="width: 1000px; height: 1000px;" class="edgeLoad-EDGE-12956064"></div> </body></html>

    Read the article

  • How to check a complex condition in Smarty(PHP)

    - by php html
    I need to display a section or another in a smarty template. My condition is simple: if a smarty value starts with a string I should display one section, otherwise the other smarty section should be displayed. I can change only the tpl files. {php} if (substr($url,0,4) != 'http') { {/php} section 1 {php} } else { {/php} section 2 {php} } {/php} The problem is that I can not read the url varible which was previously assigned using $smarty-assign. Basically, I'm looking for the smarty function that can be used to retrieve a value, or if there is a better solution.

    Read the article

  • EntityRepository not found [migrated]

    - by PachinSV
    I'm new in Doctrine, I'm following the examples in the documentation. I created my entities and everything is working fine until I created a Repository. I have an entity called User and a UserRepository. But when I try to use the User repository I get the error message: Fatal error: Class 'Doctrine\ORM\EntityRepository' not found in C:\xampp\htdocs\excap\repositories\UserRepository.php on line 10 use Doctrine\ORM\EntityRepository; /** * Description of UserRepository * * @author Mario */ class UserRepository extends EntityRepository { How can I solved this? <?php //bootstrap_doctrine.php $isDevMode = true; use Doctrine\ORM\Tools\Setup; require_once 'vendor/autoload.php'; $config = Setup::createAnnotationMetadataConfiguration(array(__DIR__.'/entities'), $isDevMode); $conn = array( 'driver' => 'pdo_mysql', 'user' => 'mydbuser', 'password' => 'mydbpassword', 'dbname' => 'mydbname' ); $entityManager = \Doctrine\ORM\EntityManager::create($conn, $config); ?> <?php //boostrap.php //Entities require_once 'entities/User.php'; require_once 'entities/Gender.php'; require_once 'entities/AccessPoint.php'; //Repositories require_once 'repositories/UserRepository.php'; if(!class_exists("Doctrine\Common\Version", FALSE)) { require_once 'bootstrap_doctrine.php'; } ?> <?php // autoload.php generated by Composer if (!class_exists('Composer\\Autoload\\ClassLoader', false)) { require __DIR__ . '/composer' . '/ClassLoader.php'; } return call_user_func(function() { $loader = new \Composer\Autoload\ClassLoader(); $composerDir = __DIR__ . '/composer'; $map = require $composerDir . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { $loader->add($namespace, $path); } $classMap = require $composerDir . '/autoload_classmap.php'; if ($classMap) { $loader->addClassMap($classMap); } $loader->register(); return $loader; }); ?>

    Read the article

  • Sum multi dimensional array based on a key in php

    - by user1328178
    I have mutiple arrays say for now 2, first array has Cities(Mumbai, Pune. Bangalore, Hyderabad) And 2nd array has Mumbia nad Hyderabd. I want to sum up the values based on the Key. Array ( [Mumbai] = Array ( [ga:pageviews] = 1 [ga:visits] = 1 [ga:newVisits] = 1 [ga:pageviewsPerVisit] = 1 [ga:entranceBounceRate] = 1 [ga:avgTimeOnSite] = 1 [ga:timeOnSite] = 1 [ga:bounces] = 1 ) [Pune] => Array ( [ga:pageviews] => 2 [ga:visits] => 2 [ga:newVisits] => 2 [ga:pageviewsPerVisit] => 2 [ga:entranceBounceRate] => 2 [ga:avgTimeOnSite] => 2 [ga:timeOnSite] => 2 [ga:bounces] => 2 ) [Bangalore] => Array ( [ga:pageviews] => 3 [ga:visits] => 3 [ga:newVisits] => 3 [ga:pageviewsPerVisit] => 3 [ga:entranceBounceRate] => 3 [ga:avgTimeOnSite] => 3 [ga:timeOnSite] => 3 [ga:bounces] => 3 ) [Hyderabad] => Array ( [ga:pageviews] => 4 [ga:visits] => 4 [ga:newVisits] => 4 [ga:pageviewsPerVisit] => 4 [ga:entranceBounceRate] => 4 [ga:avgTimeOnSite] => 4 [ga:timeOnSite] => 4 [ga:bounces] => 4 ) ) 2nd Array: Array ( [Mumbai] = Array ( [ga:pageviews] = 5 [ga:visits] = 5 [ga:newVisits] = 5 [ga:pageviewsPerVisit] = 5 [ga:entranceBounceRate] = 5 [ga:avgTimeOnSite] = 5 [ga:timeOnSite] = 5 [ga:bounces] = 5 ) [Hyderabad] => Array ( [ga:pageviews] => 2 [ga:visits] => 2 [ga:newVisits] => 2 [ga:pageviewsPerVisit] => 2 [ga:entranceBounceRate] => 2 [ga:avgTimeOnSite] => 2 [ga:timeOnSite] => 2 [ga:bounces] => 2 ) ) I want the result as: Array ( [Mumbai] = Array ( [ga:pageviews] = 6 [ga:visits] = 6 [ga:newVisits] = 6 [ga:pageviewsPerVisit] = 6 [ga:entranceBounceRate] = 6 [ga:avgTimeOnSite] = 6 [ga:timeOnSite] = 6 [ga:bounces] = 6 ) [Pune] => Array ( [ga:pageviews] => 2 [ga:visits] => 2 [ga:newVisits] => 2 [ga:pageviewsPerVisit] => 2 [ga:entranceBounceRate] => 2 [ga:avgTimeOnSite] => 2 [ga:timeOnSite] => 2 [ga:bounces] => 2 ) [Bangalore] => Array ( [ga:pageviews] => 3 [ga:visits] => 3 [ga:newVisits] => 3 [ga:pageviewsPerVisit] => 3 [ga:entranceBounceRate] => 3 [ga:avgTimeOnSite] => 3 [ga:timeOnSite] => 3 [ga:bounces] => 3 ) [Hyderabad] => Array ( [ga:pageviews] => 6 [ga:visits] => 6 [ga:newVisits] => 6 [ga:pageviewsPerVisit] => 6 [ga:entranceBounceRate] => 6 [ga:avgTimeOnSite] => 6 [ga:timeOnSite] => 6 [ga:bounces] => 6 ) ) Thanks for your help.... Ruth.

    Read the article

  • Find the right value in recursive array

    - by fire
    I have an array with multiple sub-arrays like this: Array ( [0] => Array ( [Page_ID] => 1 [Page_Parent_ID] => 0 [Page_Title] => Overview [Page_URL] => overview [Page_Type] => content [Page_Order] => 1 ) [1] => Array ( [0] => Array ( [Page_ID] => 2 [Page_Parent_ID] => 1 [Page_Title] => Team [Page_URL] => overview/team [Page_Type] => content [Page_Order] => 1 ) ) [2] => Array ( [Page_ID] => 3 [Page_Parent_ID] => 0 [Page_Title] => Funds [Page_URL] => funds [Page_Type] => content [Page_Order] => 2 ) [3] => Array ( [0] => Array ( [Page_ID] => 4 [Page_Parent_ID] => 3 [Page_Title] => Strategy [Page_URL] => funds/strategy [Page_Type] => content [Page_Order] => 1 ) [1] => Array ( [0] => Array ( [Page_ID] => 7 [Page_Parent_ID] => 4 [Page_Title] => A Class Fund [Page_URL] => funds/strategy/a-class-fund [Page_Type] => content [Page_Order] => 1 ) [1] => Array ( [0] => Array ( [Page_ID] => 10 [Page_Parent_ID] => 7 [Page_Title] => Information [Page_URL] => funds/strategy/a-class-fund/information [Page_Type] => content [Page_Order] => 1 ) [1] => Array ( [Page_ID] => 11 [Page_Parent_ID] => 7 [Page_Title] => Fund Data [Page_URL] => funds/strategy/a-class-fund/fund-data [Page_Type] => content [Page_Order] => 2 ) ) [2] => Array ( [Page_ID] => 8 [Page_Parent_ID] => 4 [Page_Title] => B Class Fund [Page_URL] => funds/strategy/b-class-fund [Page_Type] => content [Page_Order] => 2 ) I need a function to find the right Page_URL so if you know the $url is "funds/strategy/a-class-fund" I need to pass that to a function that returns a single array result (which would be the Page_ID = 7 array in this example). Having a bit of a stupid day, any help would be appreciated!

    Read the article

  • Multiplayer card game using PHP/Ajax and mysql

    - by Alireza Seifi
    I am designing a map game, using PHP and MYSQL. I don't know how to make the players who sign-in to the website to see other players who are also connected to the site and be able to chat with one another. I want to design the game in such a way that 2 players can play with each other and be able to send messages during the game while others groups are playing at the same time. I have designed the map game successfully, but the problem is making the player 1 who log-in to site to see the player 2 who will also log-in and both can get connected to play each other. http://i.stack.imgur.com/YyCPG.png I will appreciate your responses.

    Read the article

  • php fopen => 500 Internal Server Error

    - by Ahmed B
    I have a website hosted on a dedicated server, I noticed that Google and other search engines can't access to the most URLs on my website!! On my localhost I have made a small test : var_dump(fopen('http://www.aswat.ma', 'r')); And I got this error : Warning: fopen(http://www.aswat.ma) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in C:\xampp\htdocs\pnowate\public\index.php on line 4 bool(false) If I change the URL "http://www.aswat.ma" by "www.google.co.ma" I got this : resource(3) of type (stream) Any one have any idea about this issue ??

    Read the article

  • Can python and php work together?

    - by user71741
    I am having a mobile app created for ios. The developers built the app in php. The app requires an algorithm so I found another programmer to develop it. The algorithm programmer built the algorithm in python. The developers refuse to finish the app because they say it won't work with python, while the programmer insist it will. The programmer says put the algorithm in its on server and connect then over http. Will this work and I'd so how risky is it to future problems?

    Read the article

  • Good php editor

    - by Web Developer
    i have seen through other questions on the topic but most are a bit old. I looking for a good editor for developing on PHP in Linux(ubuntu). Here is my requirements Basic editor features Free Light-Weight Syntax highlighting Code Folding (class,function,if/else/while/foreach block) Code completion Invalid Syntax/Error highlighting as you type Auto code intending Snippet support(pieces of custom or language specific codes that i can insert) Extendable support It would be great if it had the following Debugging support WYSIWYG Code formatting Framework support(cakephp/yii/zend/smarty) Testing support Todo Native look and feel(Gnome) Flex/ROR support is welcome but not a requirement Mysql support I have tried the following editors Netbeans - it bloated, resource hogging and doesnt not have a native look and feel. Eclipse is okay but i cant fold if/while blocks and slow. Gedit can be extended and i have tried it but still i could not fold code or show error. I currently use Geany but it doesn't inform me of syntax errors as i type. If you have ways to solve the problems with above editors they too are also welcome

    Read the article

  • PHP security regarding login

    - by piers
    I have read a lot about PHP login security recently, but many questions on Stack Overflow regarding security are outdated. I understand bcrypt is one of the best ways of hashing passwords today. However, for my site, I believe sha512 will do very well, at least to begin with. (I mean bcrypt is for bigger sites, sites that require high security, right?) I´m also wonder about salting. Is it necessary for every password to have its own unique salt? Should I have one field for the salt and one for the password in my database table? What would be a decent salt today? Should I join the username together with the password and add a random word/letter/special character combination to it? Thanks for your help!

    Read the article

  • How to build a Singleton-like dependency injector replacement (Php)

    - by Erparom
    I know out there are a lot of excelent containers, even frameworks almost entirely DI based with good strong IoC classes. However, this doesn't help me to "define" a new pattern. (This is Php code but understandable to anyone) Supose we have: //Declares the singleton class bookSingleton { private $author; private static $bookInstance; private static $isLoaned = FALSE; //The private constructor private function __constructor() { $this->author = "Onecrappy Writer Ofcheap Novels"; } //Sets the global isLoaned state and also gets self instance public static function loanBook() { if (self::$isLoaned === FALSE) { //Book already taken, so return false return FALSE; } else { //Ok, not loaned, lets instantiate (if needed and loan) if (!isset(self::$bookInstance)) { self::$bookInstance = new BookSingleton(); } self::$isLoaned = TRUE; } } //Return loaned state to false, so another book reader can take the book public function returnBook() { $self::$isLoaned = FALSE; } public function getAuthor() { return $this->author; } } Then we get the singelton consumtion class: //Consumes the Singleton class BookBorrower() { private $borrowedBook; private $haveBookState; public function __construct() { this->haveBookState = FALSE; } //Use the singelton-pattern behavior public function borrowBook() { $this->borrowedBook = BookSingleton::loanBook(); //Check if was successfully borrowed if (!this->borrowedBook) { $this->haveBookState = FALSE; } else { $this->haveBookState = TRUE; } } public function returnBook() { $this->borrowedBook->returnBook(); $this->haveBookState = FALSE; } public function getBook() { if ($this->haveBookState) { return "The book is loaned, the author is" . $this->borrowedbook->getAuthor(); } else { return "I don't have the book, perhaps someone else took it"; } } } At last, we got a client, to test the behavior function __autoload($class) { require_once $class . '.php'; } function write ($whatever,$breaks) { for($break = 0;$break<$breaks;$break++) { $whatever .= "\n"; } echo nl2br($whatever); } write("Begin Singleton test", 2); $borrowerJuan = new BookBorrower(); $borrowerPedro = new BookBorrower(); write("Juan asks for the book", 1); $borrowerJuan->borrowBook(); write("Book Borrowed? ", 1); write($borrowerJuan->getAuthorAndTitle(),2); write("Pedro asks for the book", 1); $borrowerPedro->borrowBook(); write("Book Borrowed? ", 1); write($borrowerPedro->getAuthorAndTitle(),2); write("Juan returns the book", 1); $borrowerJuan->returnBook(); write("Returned Book Juan? ", 1); write($borrowerJuan->getAuthorAndTitle(),2); write("Pedro asks again for the book", 1); $borrowerPedro->borrowBook(); write("Book Borrowed? ", 1); write($borrowerPedro->getAuthorAndTitle(),2); This will end up in the expected behavior: Begin Singleton test Juan asks for the book Book Borrowed? The book is loaned, the author is = Onecrappy Writer Ofcheap Novels Pedro asks for the book Book Borrowed? I don't have the book, perhaps someone else took it Juan returns the book Returned Book Juan? I don't have the book, perhaps someone else took it Pedro asks again for the book Book Borrowed? The book is loaned, the author is = Onecrappy Writer Ofcheap Novels So I want to make a pattern based on the DI technique able to do exactly the same, but without singleton pattern. As far as I'm aware, I KNOW I must inject the book inside "borrowBook" function instead of taking a static instance: public function borrowBook(BookNonSingleton $book) { if (isset($this->borrowedBook) || $book->isLoaned()) { $this->haveBook = FALSE; return FALSE; } else { $this->borrowedBook = $book; $this->haveBook = TRUE; return TRUE; } } And at the client, just handle the book: $borrowerJuan = new BookBorrower(); $borrowerJuan-borrowBook(new NonSingletonBook()); Etc... and so far so good, BUT... Im taking the responsability of "single instance" to the borrower, instead of keeping that responsability inside the NonSingletonBook, that since it has not anymore a private constructor, can be instantiated as many times... making instances on each call. So, What does my NonSingletonBook class MUST be in order to never allow borrowers to have this same book twice? (aka) keep the single instance. Because the dependency injector part of the code (borrower) does not solve me this AT ALL. Is it needed the container with an "asShared" method builder with static behavior? No way to encapsulate this functionallity into the Book itself? "Hey Im a book and I shouldn't be instantiated more than once, I'm unique"

    Read the article

  • Developing a php system that tracks other websites analytics

    - by CodeCrack
    I want to develop a PHP website feature where users sign up, get a javascript snippet code that display an image on their site, and let's me track the number of visitors, unique hits, clicks and average visitor duration on their page. Is that something that should be done with some open source analytic software such as http://piwik.org/ or it's pretty doable on your own? If I had to do it myself from scratch, I would use image/pixel as a way to track the visit, drop a cookie with javascript snippet to track uniques, track clicks based on image click and redirect, and not sure about the bounce rate. Any thoughts or opinions are welcome.

    Read the article

  • enabling php in apache

    - by user343282
    I have installed apache 2.2 and php 5.3. when I run a simple php code like <?php phpinfo();?> instead of the simple php information page the code shows up on the screen. My php it seems is not running. How I can enable it and makes it to run with apache. btw. I am newbee thanks

    Read the article

  • Image Magic Make Fails - PHP extension

    - by Kyle Adams
    So I was doing the following: sudo apt-get install php-pear php5-dev sudo apt-get install imagemagick libmagickwand-dev sudo pecl install imagick It all works till I get the error: make: *** [imagick_class.lo] Error 1 ERROR: `make' failed Which according to blog posts and forms is because of libmagick9-dev, how ever when trying to install this I get: sudo apt-get install libmagick9-dev Reading package lists... Done Building dependency tree Reading state information... Done Package libmagick9-dev is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: graphicsmagick-libmagick-dev-compat E: Package 'libmagick9-dev' has no installation candidate Thoughts?

    Read the article

  • how to upload & preview multiple images at single input and store in to php mysql [closed]

    - by Nilesh Sonawane
    This is nilesh , i am newcomer in this field , i need the script for when i click the upload button then uploaded images it should preview and store into db like wise i want to upload 10 images at same page using php mysql . #div { border:3px dashed #CCC; width:500px; min-height:100px; height:auto; text-align:center: } Multi-Images Uploader '.$f.''; } } } ? </div> <br> <font color='#3d3d3d' size='small'>By: Ahmed Hussein</font> this script select multiple images and then uplod , but i need to upload at a time only one image which preview and store into database like wise min 10 image user can upload .......

    Read the article

  • Flaws in my PHP development setup - sharing sources causing lags

    - by Wiktor
    I have following development setup for my PHP projects: Working station running on Windows 7 with PhpStorm IDE. GIT for version controlling. CentOS on virtual machine (VirtualBox) with Apache and MySQL (copy of production server). So far, I've been sharing project's source folders between host and guest systems and it was working quite well only really slow. The reason behind this is that Apache was reading files from remote folder (mounted locally). After doing some research, I found out that this set up can be improved by using disk mapping (Samba) instead of folder sharing. So I did that change. I configured my PhpStorm to automatically deploy files to mapped drive. Everything works like a charm now, except for one problem - when I change branches I need to synchronize project's local folder with the one on mapped drive and that takes time, a lot of time (like branching in SVN). Is there another way to handle this than just working on files directly on mapped drive?

    Read the article

  • PHP to SharePoint roadmap

    - by Daryl Gubler
    I'm a PHP developer with familiarity with Rails and a focus on MVC development. My company is moving more and more to SharePoint and I feel I need to learn to build application within the SharePoint system. I have some brief introduction to C# but that's about it. I've used some SharePoint Designer and the web interface but not that heavily (most of my "development" so far for SharePoint has been html/css/javascript page manipulation in SPDesigner). What, and in what order should I be learning to eventually develop applications for SharePoint? Also, any good resources for each step?

    Read the article

  • Have lampp use PHP code in a directory not under /opt/lampp

    - by Sundeep
    I have my lampp installed in the default /opt/lampp directory and the PHP code is in the htdocs folder. Now, to edit any of the files I have to use sudo permissions and have to type my password (or use sudo -i) which I do not want to do. All I want is to know if I can somehow make lampp use the code that is residing in a folder not located under /opt/lampp/. I tried giving full path and using a '..' relative path - both did not seem to work. Or is it okay to do my work in /opt/lampp/ folder by using sudo all the the time?

    Read the article

  • OpenID implementation - PHP, Javascript, MySQL

    - by Marc A.
    Hello, I've started doing some research on the technologies that I will need for my website. I'm trying to implement a really simple website with OpenID user registration. The website will store a block of text for each user. I imagine this means that I will need a database with: User ID Open ID url Data Having said that, I'm still having trouble deciding what I really need to do this. I know that I will need the following for the actual site: Javascript JQuery CSS But on the back end, I'm kind of lost at the moment. I've been looking at the OpenID-Selector, which is coded in Javascript. It seems like it's exactly what is used on this site. Will I actually need PHP? MySQL for the data and user registration? Thanks for the kickstart!

    Read the article

  • PHP city-sim castle layout

    - by Gert
    I am currently contemplating the layout system for my php based game but i've run into a couple of worries. So my idea is a 9X9 grid where the center 3X3 are inner castle. The inner castle will be 6X6 if you enter it(click on it). and with the option to expand the inner castle converting one of the 9X9 tiles to a 4X4 inner castle tile. So here is my question: What is the best way to tackle this type of layout? my original idea was a 18X18 grid and saving it in the db as (idCastle, Y, X) where X is a string of 18 numbers long telling me if the tile is an inner/outer tile or a inner/outer building. but i am not really fond of this idea and would like to hear some other ideas on how to tackle this. Thanks in Advance, Gert

    Read the article

  • Zend Server Cannot restart PHP: permission denied for user

    - by user30115
    When I click "Restart PHP" in Zend Server web interface, I get this error in the logs: PHP Warning: Cannot restart PHP: permission denied for user IIS APPPOOL\DefaultAppPool. in C:\Program Files (x86)\Zend\ZendServer\GUI\application\CE\models\ZwasComponents\Util\Api\UserServer.php on line 86 Based on http://kb.zend.com/index.php?View=entry&EntryID=426 I tried to give permissions to user IIS APPPOOL\DefaultAppPool to the folder C:\Program Files (x86)\Zend\ZendServer\, however it still gives the same error. Do you know to what resources the application pool does not have permissions to?

    Read the article

  • How does PHP internally represent strings?

    - by Jim Thio
    UTF8? UTF16? Do strings in PHP also keep track of the encoding used? Let's look at this script for example. Say I run: $original = "??????????????"; What actually happens? Obviously I think $original will not contain just 7 characters. Those glyphs must each be represented by several bytes there. Then I do: $converted = mb_convert_encoding ($original , "UTF-8"); What will happen to $converted? How will $converted be different from $original? Will it be just the exact same byte sequence as $original but with a different encoding?

    Read the article

< Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >