Search Results

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

Page 88/1708 | < Previous Page | 84 85 86 87 88 89 90 91 92 93 94 95  | Next Page >

  • PHP Notice: Undefined index when looping array...

    - by Jonathan
    Hi, I'm looping a two-dimensional array like this: if (!empty($aka)) { foreach ($aka as $ak) { if($ak["lang"]=="es") { $sptitle=$ak["title"]; } } } Pretty simple. If the array ($aka) is not empty I loop trough it and when it finds that the "lang" index is equal to "es" I just save the "title" value for that index in $sptitle. The problem is that the array ($aka) contains a lot of information and sometimes there is no "lang" index... and I get this error: Notice: Undefined index: lang. How can I fix this??? This is a extract of the array to help you understand. Notice that [1] doesn't have a [lang] index but [2] does have: [1] =&gt; Array ( [title] =&gt; The Lord of the Rings: The Motion Picture [year] =&gt; [country] =&gt; USA [comment] =&gt; promotional title ) [2] =&gt; Array ( [title] =&gt; Señor de los anillos: La comunidad del anillo, El [year] =&gt; [country] =&gt; Argentina [comment] =&gt; Chile, Mexico, Peru, Spain [lang] =&gt; es ) Thanks!

    Read the article

  • Read from plist insted of Code array

    - by BoSoud
    Hi Guys am Using [URL="http://www.iphonesdkarticles.com/2009/01/uitableview-searching-table-view.html"]UITableView - Searching table view[/URL] its really nice easy tutorial but i really have bad time try to read from plist that what i did change - (void)viewDidLoad { [super viewDidLoad]; //Initialize the array. listOfItems = [[NSMutableArray alloc] init]; TableViewAppDelegate *AppDelegate = (TableViewAppDelegate *)[[UIApplication sharedApplication] delegate]; listOfItems = [AppDelegate.data objectForKey:@"Countries"]; //Initialize the copy array. copyListOfItems = [[NSMutableArray alloc] init]; //Set the title self.navigationItem.title = @"Countries"; //Add the search bar self.tableView.tableHeaderView = searchBar; searchBar.autocorrectionType = UITextAutocorrectionTypeNo; searching = NO; letUserSelectRow = YES; } and This How i read plist from My AppDelegate.m - (void)applicationDidFinishLaunching:(UIApplication *)application { NSString *Path = [[NSBundle mainBundle] bundlePath]; NSString *DataPath = [Path stringByAppendingPathComponent:@"Data.plist"]; NSDictionary *tempDict = [[NSDictionary alloc] initWithContentsOfFile:DataPath]; self.data = tempDict; [tempDict release]; // Configure and show the window [window addSubview:[navigationController view]]; [window makeKeyAndVisible]; } and this my plist <plist version="1.0"> <dict> <key>Countries</key> <array> <array> <string>USA</string> </array> <dict/> </array> </dict> </plist> and i get this error *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFArray objectForKey:]: unrecognized selector sent to instance 0x1809dc0' help please am stock with this

    Read the article

  • powershell missing member methods in array

    - by Andrew
    Hi Guys I have (yet another) powershell query. I have an array in powershell which i need to use the remove() and split commands on. Normally you set an array (or variable) and the above methods exist. On the below $csv2 array both methods are missing, i have checked using the get-member cmd. How can i go about using remove to get rid of lines with nan. Also how do i split the columns into two different variables. at the moment each element of the array displays one line, for each line i need to convert it into two variables, one for each column. timestamp Utilization --------- ----------- 1276505880 2.0763250000e+00 1276505890 1.7487730000e+00 1276505900 1.6906890000e+00 1276505910 1.7972880000e+00 1276505920 1.8141900000e+00 1276505930 nan 1276505940 nan 1276505950 0.0000000000e+00 $SystemStats = (Get-F5.iControl).SystemStatistics $report = "c:\snmp\data" + $gObj + ".csv" ### Allocate a new Query Object and add the inputs needed $Query = New-Object -TypeName iControl.SystemStatisticsPerformanceStatisticQuery $Query.object_name = $i $Query.start_time = $startTime $Query.end_time = 0 $Query.interval = $interval $Query.maximum_rows = 0 ### Make method call passing in an array of size one with the specified query $ReportData = $SystemStats.get_performance_graph_csv_statistics( (,$Query) ) ### Allocate a new encoder and turn the byte array into a string $ASCII = New-Object -TypeName System.Text.ASCIIEncoding $csvdata = $ASCII.GetString($ReportData[0].statistic_data) $csv2 = convertFrom-CSV $csvdata $csv2

    Read the article

  • php code works with mamp but not on ubuntu server

    - by user355510
    Hello, I have start looking at a twitter php library http://github.com/abraham/twitteroauth, but i can't get it to work on my ubuntu server, but on my mac, with mamp it works without any problems. This is the code that don't won't to work on my server, but in mamp. Yes i have edit config file <?php /* Start session and load library. */ session_start(); require_once('twitteroauth/twitteroauth.php'); require_once('config.php'); /* Build TwitterOAuth object with client credentials. */ $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET); /* Get temporary credentials. */ $request_token = $connection->getRequestToken(OAUTH_CALLBACK); /* Save temporary credentials to session. */ $_SESSION['oauth_token'] = $token = $request_token['oauth_token']; $_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret']; /* If last connection failed don't display authorization link. */ switch ($connection->http_code) { case 200: /* Build authorize URL and redirect user to Twitter. */ $url = $connection->getAuthorizeURL($token); header('Location: ' . $url); break; default: /* Show notification if something went wrong. */ echo 'Could not connect to Twitter. Refresh the page or try again later.'; } I have enable php session on my ubuntu server, because this code works <?php session_start(); $_SESSION["secretword"] = "hello there"; $secretword = $_SESSION["secretword"] ; ?> <html> <head> <title>A PHP Session Example</title> </head> <body> <?php echo $secretword; ?> </body> </html>

    Read the article

  • Why doesn't this short php script send email?

    - by RoryG
    I can't seem to get my php script to send email. <?php echo "Does this page work?"; mail('my email address', 'test subject', 'test message'); ?> First, I have set the mail function settings in the php.ini file as follows: I checked my email account settings on outlook. It does not require authentication, its port is 25, and its type of encrypted connection is 'Auto'. Given this I configured my php.ini file accordingly: SMTP = ssl://smtp1.iis.com smtp_port = 25 Then I set: sendmail_from: my email address The echo statement prints out in the browser, so I know the php file is recognized and processed. But the browser also shows the following error: Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\mailtest.php on line 3 I have clearly set the sendmail_from so I don't know what else to do. I have also tried removing the 'ssl://' part from the SMTP setting in the php.ini file, and configuring the php5.ini file. Which of these .ini files should I be configuring anyways?

    Read the article

  • Frames with PHP

    - by user562123
    Hi guys Can I use HTML Frames with PHP? I presumed I can do this by.. <?php session_start(); require("auth.php"); require("do_html_header.php"); if($_SESSION['SESS_admin'] == 0) require("do_menu.php"); else require("do_menu3.php"); do_html_header(); print"<h1>Welcome ". $_SESSION['SESS_FIRST_NAME']."!</h1>"; do_menu(); ?> </body> <frameset rows="50%,50%"> <frame noresize="noresize" src="limits.php" /> <frame noresize="noresize" src="limits.php" /> </frameset> </html> I have put it everywhere but it seems not to show up.. Google just confused me. Thanks in Advance :D

    Read the article

  • Recursion Problem in PHP

    - by streetparade
    I need to create a valid xml from a given array(); My Method looks like this, protected function array2Xml($array) { $xml = ""; if(is_array($array)) { foreach($array as $key=>$value) { $xml .= "<$key>"; if(is_array($value)) { $xml .= $this->array2Xml($value); } $xml .= "</$key>"; } return $xml; } else { throw new Exception("in valid"); } } protected function createValidXMLfromArray($array,$node) { $xml = '<?xml version="1.0" encoding="ISO-8859-1"?>'; $xmlArray = $this->array2Xml($array); $xml .= "<$node>$xmlArray</$node>"; return $xml; } if i execute the above i just get keys with empty values; like <node> <name></name> </node> What i need is if i pass this array("name"=>"test","value"=>array("test1"=>33,"test2"=>40)); that it return this <node> <name>test</name> <value> <test1>33</test1> <test2>40</test2> </value> </node> Where is the error what did i wrong in the above recursion?

    Read the article

  • best PHP programming approach?

    - by Nazmin
    Hello guys, i guess that many of us has acceptable years of experience in PHP programming, me myself got 5 years programming in PHP since in University (not very solid), i just want to gather some suggestion here, what is better approach in PHP OOP? Since there is a lot of PHP framework out there as well as javascript framework, can anyone share their experience in using one of them as well as using both of the PHP and javascript framework together especially for developing enterprise system? (my company want to start using framework, ISP company) if someone has his/her own framework or class or php file so on and so forth, mind to share? now I've only database connection class. I've never use any php framework before, just jquery as javascript framework, my company has a messed up of programming approach because they did not actually a software house, so all the files are scattered across the server, I see that there are some question before about the framework but i just want to know you all approaches on OOP and in developing massive web apps using PHP, or maybe someone kind enough to share their solid written class. Also pro's and con's of all this things. Thanks in advance.

    Read the article

  • Nginx - Treats PHP as binary

    - by Think Floyd
    We are running Nginx+FastCgi as the backend for our Drupal site. Everything seems to work like fine, except for this one url. http:///sites/all/modules/tinymce/tinymce/jscripts/tiny_mce/plugins/smimage/index.php (We use TinyMCE module in Drupal, and the url above is invoked when user tries to upload an image) When we were using Apache, everything was working fine. However, nginx treats that above url Binary and tries to Download it. (We've verified that the file pointed out by the url is a valid PHP file) Any idea what could be wrong here? I think it's something to do with the NGINX configuration, but not entirely sure what that is. Any help is greatly appreciated. Config: Here's the snippet from the nginx configuration file: root /var/www/; index index.php; if (!-e $request_filename) { rewrite ^/(.*)$ /index.php?q=$1 last; } error_page 404 index.php; location ~* \.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$ { deny all; } location ~* ^.+\.(jpg|jpeg|gif|png|ico)$ { access_log off; expires 7d; } location ~* ^.+\.(css|js)$ { access_log off; expires 7d; } location ~ .php$ { include /etc/nginx/fcgi.conf; fastcgi_pass 127.0.0.1:8888; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; } location ~ /\.ht { deny all; }

    Read the article

  • PHP, MySQL, Memcache / Ajax Scaling Problem

    - by Jeff Andersen
    I'm building a ajax tic tac toe game in PHP/MySQL. The premise of the game is to be able to share a url like mygame.com/123 with your friends and you play multiple simultaneous games. The way I have it set up is that a file (reload.php) is being called every 3 seconds while the user is viewing their game board space. This reload.php builds their game boards and the output (html) replaces their current game board (thus showing games in which it is their turn) Initially I built it entirely with PHP/MySQL and had zero caching. A friend gave me a suggestion to try doing all of the temporary/quick read information through memcache (storing moves, and ID matchups) and then building the game boards from this information. My issue is that, both solutions encounter a wall when there is roughly 30-40 active users with roughly 40-50 games running. It is running on a VPS from VPS.net with 2 nodes. (Dedicated CPU: 1.2GHz, RAM: 752MB) Each call to reload.php peforms 3 selects and 2 insert queries. The size of the data being pulled is negligible. The same actions happen on index.php to build the boards for the initial visit. Now that the backstory is done, my question is: Would there be a bottleneck in that each user is polling the same file every 3 seconds to rebuild their gameboards, and that all users are sitting on index.php from which the AJAX calls are made within the HTML. If so, is it possible to spread the users' calls out over a set of files designated to building the game boards (eg. reload1.php 2, 3 etc) and direct users to the appropriate file. Would this relieve the pressure? A long winded explanation; however, I didn't have anywhere else to ask. Thanks very much for any insight.

    Read the article

  • change php variable on click event

    - by Claudiu
    I want to change php variable ($start and $end called by var b1 and var b2) if the user clicks on button. Now I know that php is server side, but how can I do it? I read something about using $get but I don't know how to implement it: <?php if ( is_user_logged_in() ) { ?> <input type="submit" value="Start Chat" id="start_chat" style="position: absolute; top: 30px; left: 10px;" /> <?php } ?> <script> jQuery('#start_chat').click(function(){ $(this).data('clicked', true); }); var b1 = '<?php echo $start; ?>'; var b2 = '<?php echo $end; ?>'; if(jQuery('#start_chat').data('clicked')) { // change var b1 and b2 } else { // do not change anything } </script> <div id="eu_la"> <?php $start = strtotime('9:30'); $end = strtotime('12:30'); $timenow = date('U'); if((date('w') == 4) && ($timenow >= $start && $timenow <= $end)) { // day 2 = Tuesday include('facut_mine.php'); } else { do_shortcode('[upzslider usingphp=true]'); } ?>

    Read the article

  • Delay PHP execution until JavaScript cookie set?

    - by Adam184
    I am trying to delay PHP execution until a cookie is set through JavaScript. The code is below, I trimmed the createCookie JavaScript function for simplicity (I've tested the function itself and it works). <?php if(!isset($_COOKIE["test"])) { ?> <script type="text/javascript"> $(function() { // createCookie script createCookie("test", 1, 3600); }); </script> <?php // Reload the page to ensure cookie was set if(!isset($_COOKIE["test"])) { header("Location: http://localhost/asdf.php/"); } } ?> At first I had no idea why this didn't work, however after using microtime() I figured out that the PHP after the <script> was executing before the jQuery ready function. I reduced my code significantly to show a simple version that is answerable, I am well aware that I am able to use setcookie() in PHP, the requirements for the cookie are client-side. I understand mixing PHP and JavaScript is incorrect, but any help on how to make this work (is there a PHP delay? - I tried sleep(), didn't work and didn't think it would work, since the scripts would be delayed as well) would be greatly appreciated.

    Read the article

  • JavaScript two-dimensional Array to PHP

    - by vi
    Hi I have to send a two-dimensional JavaScript Array to a PHP page. Indeed, I'm working on a form-builder, in which the user can add or remove fields. These fields are added (or removed) using JavaScript (jQuery). When the user is done and hit a 'publish' button, I have to get all the fields concerned and send them to a PHP page which would build a real form with it. I found a way to do it but I'm pretty sure it's not very clean : addedFields = new Array(); $("#add-info .field").each(function() { addedFields.push(new Array($(this).find('.name').val(), $(this).find('.type').val(), $(this).find('.size').val())); }); Basically, the ".field" class objects are <tr> and the ".name", ".type" and ".size" objects are inputs. So I get an array of [name, type, size], then I convert it into a string using addedFields = addedFields.join(";"); Finally, I go to the PHP form that way ; document.location.href = "create.php?addedfields=" + addedFields; Concerning the PHP code, I create a PHP array using the explode() function: $addedFields = explode(";", $_GET['addedfields']); and then I use it again for each element in the array: foreach ($addedFields as $field) { $field = explode(",", $field); echo "<li>Field with name : '$field[0]', of '$field[1]' type and with a size of $field[2]"; }

    Read the article

  • PHP | Online Notepad

    - by user2947423
    I recently made a Chat application in Visual Basic using PHP. I used this code: <?php $msg = $_GET['w']; $logfile= 'Chats.php'; $fp = fopen($logfile, "a"); fwrite($fp, $msg); fclose($fp); ?> I'm now trying to make a Online Notepad. What i want to do is in Visual Basic create a unique ID. That unique ID, has to be his filename. I'm not very good with PHP so what i want to know is: I want the unique ID to be the filename of the "Note". Like: $logfile= '{uniqueID.php}'; Whenever the user opens the program, it'll open his uniqueID.php file and he can edit that in my program. Long Story Short (TL;DR) Program generates uniqueID uniqueID is going to be a new file; {uniqueID}.php On next open it will check if {uniqueID}.php of him/her exists else it will make a new one. I know this isn't really secure but it's to learn something for myself.

    Read the article

  • Multidimensional Array To Mysql Codeigniter

    - by rochellecanale
    A little help how can I create an input query using this array? Or how can I pass it in the table? my table layout sample is this: sales_table id | product_name | price | qty | subtotal This is derived from the var_dump() function. Here is my code in array //array code from unserialized function $products = unserialize($this->session->userdata('product_list')); //This is the output. Array ( [2] => Array ( [id] => 2 [product_name] => NOKIA 5110 [product_desc] => Cellphone [product_price] => 500.00 [product_qty] => 1 [product_amount] => 500 [product_code] => NOKI2012-84353 ) [3] => Array ( [id] => 3 [product_name] => HP IPAQ RW6828 [product_desc] => Cellphone [product_price] => 1500.00 [product_qty] => 1 [product_amount] => 1500 [product_code] => HP I2012-08386 ) )

    Read the article

  • Do I need to echo html inside included php file

    - by UmeRonaldo
    I just learned how to include php .Here's the index or main php file <!DOCTYPE HTML> <html> <head> </head> <body> <?php include 'header.php'; ?> </body> </html> now in header.php file which way is better to print html Way 1 directly use html without php <header> <h1>Header</h1> </header> Way 2 Using php and echo <?php echo ' <header> <h1>Header</h1> </header> ' ?> Another quick question. Will it work if I use .html for the base or index file ?? sorry for my bad english

    Read the article

  • Duplicate values multi array

    - by BETA911
    As the title states I'm searching for a unique solution in multi arrays. PHP is not my world so I can't make up a good and fast solution. I basically get this from the database: http://pastebin.com/vYhFCuYw . I want to check on the 'id' key, and if the array contains a duplicate 'id', then the 'aantal' should be added to each other. So basically the output has to be this: http://pastebin.com/0TXRrwLs . Thanks in advance! EDIT As asked, attempt 1 out of many: function checkDuplicates($array) { $temp = array(); foreach($array as $k) { foreach ($array as $v) { $t_id = $k['id']; $t_naam = $k['naam']; $t_percentage = $k['percentage']; $t_aantal = $k['aantal']; if ($k['id'] == $v['id']) { $t_aantal += $k['aantal']; array_push($temp, array( 'id' => $t_id, 'naam' => $t_naam, 'percentage' => $t_percentage, 'aantal' => $t_aantal, ) ); } } } return $temp; }

    Read the article

  • Troubleshooting PHP email sending?

    - by darkAsPitch
    I created a website that occasionally emails users when they register/change their password/etc. Every other person however cannot or does not receive the emails. They are telling me that they are not even hitting their spam folders. I don't know a ton about MX records or email sending, but when I "Edit DNS Zone" for this domain in particular there is 1 MX record listed there. How do you go about troubleshooting botched PHP mail actions? UPDATE: Here is my super-simple php mailing code: $subject = "Subject Here"; $message = "Emails Message"; $to = $verified_user_data["email_address"]; $headers = "From: [email protected]\r\n" . "Reply-To: [email protected]\r\n" . "X-Mailer: PHP/" . phpversion(); //returns true on success, false on failure $email_result = mail($to, $subject, $message, $headers); re: "are you saying that some do and some do not?" @ Jacob Yes, basically. I send the emails containing the user's login username/password using similar code above. And I sell to fairly tech-savvy people. About 50% of the time, my customers claim they cannot find their welcome emails in their inbox OR in their spam box. It's as if it never arrived. I have the largest problem with Yahoo email addresses accepting my emails or so it seems. re: "The MX record at your end doesn't factor in, although the SPF record (or lack of it) will. How much access and control do you have on the server itself?" @ John Gardeniers I rent a dedicated server from Codero. Running CentOS 5, WHM + cPanel. I have full root access to the entire thing. Don't know much about MX records and/or SPF records. I just want the PHP mail function to work. It doesn't say much about that on the php mail function's help page. re: "What are you using for the SMTP server?" @ JonLim No idea. I use the code above when I need to fire off an email to a loyal customer, and that's it. Do I need to be worrying about SMTP servers? re: "Could be many, many things. Can you describe how you're sending mail in your code? i.e. are you relaying off of another mail server somewhere, using the local sendmail or postfix? Any consistency in domains that can/cannot receive email? Do you have a PTR record setup from the IP address that you're sending mail out as? What about SPF records?" @ gravyface I just described my simple code above! I believe I have been having the most trouble with Yahoo domains, however "independent" domains (probably running spamassasin) ex. [email protected] as opposed to [email protected] seem to give a lot of trouble as well. I do not know if I have a PTR record setup from the IP address I'm sending my mail from. It's probably the same IP address that I setup my domain on, because I didn't do anything extra special. No idea about SPF records either, where can I go to create one? Side Note: It's a crying shame what havoc the spammers have brought upon our beloved email system.

    Read the article

  • Getting sendmail to install/work for using php mail()

    - by harryg
    I'm running WordPress on a Ubuntu VPS. When WordPress tries to send an email like a password reset or registration email it never gets delivered. WordPress uses php's mail() function. I figure it's not working as my VPS didn't have sendmail installed. So I went into SSH and installed it with sudo apt-get install sendmail which appeared to succeed. Following more googled advice I edited the php.ini file to have the sendmail path. I located it as being /usr/sbin/sendmail which I believe is typical for many *nix servers. To check I browsed to this directory on FTP. The "sendmail" directory appears to be a shortcut. Is this correct/expected? Either way the php mail function is not working. I have created a phpinfo file and a test mail php file which contains just a mail() function with my email as the recipient. Note: my VPS doesn't yet have a domain, just an IP address. Would this affect sendmail functionality? My phpinfo is here for your reference: http://95.142.166.209/phpinfo.php Do I also need postfix? I don't think I have it... Here is some of the mail log. I executed the mail function towards the end: Nov 27 18:41:02 sergeserver sm-msp-queue[5450]: unable to qualify my own domain name (sergeserver) -- using short name Nov 27 19:00:01 sergeserver sm-msp-queue[5497]: My unqualified host name (sergeserver) unknown; sleeping for retry Nov 27 19:01:01 sergeserver sm-msp-queue[5497]: unable to qualify my own domain name (sergeserver) -- using short name Nov 27 19:20:01 sergeserver sm-msp-queue[5532]: My unqualified host name (sergeserver) unknown; sleeping for retry Nov 27 19:21:01 sergeserver sm-msp-queue[5532]: unable to qualify my own domain name (sergeserver) -- using short name Nov 27 19:40:01 sergeserver sm-msp-queue[5568]: My unqualified host name (sergeserver) unknown; sleeping for retry Nov 27 19:41:01 sergeserver sm-msp-queue[5568]: unable to qualify my own domain name (sergeserver) -- using short name Nov 27 20:00:01 sergeserver sm-msp-queue[5605]: My unqualified host name (sergeserver) unknown; sleeping for retry Nov 27 20:01:01 sergeserver sm-msp-queue[5605]: unable to qualify my own domain name (sergeserver) -- using short name Nov 27 20:20:01 sergeserver sm-msp-queue[5641]: My unqualified host name (sergeserver) unknown; sleeping for retry Nov 27 20:21:01 sergeserver sm-msp-queue[5641]: unable to qualify my own domain name (sergeserver) -- using short name Nov 27 20:40:01 sergeserver sm-msp-queue[5675]: My unqualified host name (sergeserver) unknown; sleeping for retry Nov 27 20:41:01 sergeserver sm-msp-queue[5675]: unable to qualify my own domain name (sergeserver) -- using short name Nov 27 21:00:01 sergeserver sm-msp-queue[5712]: My unqualified host name (sergeserver) unknown; sleeping for retry Nov 27 21:01:01 sergeserver sm-msp-queue[5712]: unable to qualify my own domain name (sergeserver) -- using short name Nov 27 21:20:02 sergeserver sm-msp-queue[5747]: My unqualified host name (sergeserver) unknown; sleeping for retry Nov 27 21:21:02 sergeserver sm-msp-queue[5747]: unable to qualify my own domain name (sergeserver) -- using short name Nov 27 21:40:01 sergeserver sm-msp-queue[5782]: My unqualified host name (sergeserver) unknown; sleeping for retry Nov 27 21:41:01 sergeserver sm-msp-queue[5782]: unable to qualify my own domain name (sergeserver) -- using short name Nov 27 22:00:01 sergeserver sm-msp-queue[5831]: My unqualified host name (sergeserver) unknown; sleeping for retry Nov 27 22:01:01 sergeserver sm-msp-queue[5831]: unable to qualify my own domain name (sergeserver) -- using short name Nov 27 22:20:01 sergeserver sm-msp-queue[5866]: My unqualified host name (sergeserver) unknown; sleeping for retry Nov 27 22:21:01 sergeserver sm-msp-queue[5866]: unable to qualify my own domain name (sergeserver) -- using short name Nov 27 22:37:19 sergeserver sendmail[5903]: My unqualified host name (sergeserver) unknown; sleeping for retry Nov 27 22:38:19 sergeserver sendmail[5903]: unable to qualify my own domain name (sergeserver) -- using short name Nov 27 22:38:19 sergeserver sendmail[5903]: qARLcJYI005903: from=adminftp, size=158, class=0, nrcpts=0, msgid=<201211272138.qARLcJYI005903@sergeserver>, relay=adminftp@localhost

    Read the article

  • RAID Array performance on an HP Proliant ML350 G5 Smart Array E200i

    - by Nate Pinchot
    We have a client who is complaining about performance of an application which utilizes an MS SQL database. They do not believe the performance issues are the fault of the application itself. The Smart Array E200i RAID controller has 128MB cache and we have the cache set to 75% read/25% write. The disk array set to enable write caching. Recently we ran a disk performance test using SQLIO based on this guide. We used a 10 GB file for the test found that the average sequential read rate was ~60 MB/sec (megabytes/sec) and the average random read rate was ~30 MB/sec. Are these numbers on par for what the server should be performing? Better than on par? Horrible? Amazing?

    Read the article

  • PHP Session Class and $_SESSION Array

    - by Gianluca Bargelli
    Hello, i've implemented this custom PHP Session Class for storing sessions into a MySQL database: class Session { private $_session; public $maxTime; private $database; public function __construct(mysqli $database) { $this->database=$database; $this->maxTime['access'] = time(); $this->maxTime['gc'] = get_cfg_var('session.gc_maxlifetime'); session_set_save_handler(array($this,'_open'), array($this,'_close'), array($this,'_read'), array($this,'_write'), array($this,'_destroy'), array($this,'_clean') ); register_shutdown_function('session_write_close'); session_start();//SESSION START } public function _open() { return true; } public function _close() { $this->_clean($this->maxTime['gc']); } public function _read($id) { $getData= $this->database->prepare("SELECT data FROM Sessions AS Session WHERE Session.id = ?"); $getData->bind_param('s',$id); $getData->execute(); $allData= $getData->fetch(); $totalData = count($allData); $hasData=(bool) $totalData >=1; return $hasData ? $allData['data'] : ''; } public function _write($id, $data) { $getData = $this->database->prepare("REPLACE INTO Sessions VALUES (?, ?, ?)"); $getData->bind_param('sss', $id, $this->maxTime['access'], $data); return $getData->execute(); } public function _destroy($id) { $getData=$this->database->prepare("DELETE FROM Sessions WHERE id = ?"); $getData->bind_param('S', $id); return $getData->execute(); } public function _clean($max) { $old=($this->maxTime['access'] - $max); $getData = $this->database->prepare("DELETE FROM Sessions WHERE access < ?"); $getData->bind_param('s', $old); return $getData->execute(); } } It works well but i don't really know how to properly access the $_SESSION array: For example: $db=new DBClass();//This is a custom database class $session=new Session($db->getConnection()); if (isset($_SESSION['user'])) { echo($_SESSION['user']);//THIS IS NEVER EXECUTED! } else { $_SESSION['user']="test"; Echo("Session created!"); } At every page refresh it seems that $_SESSION['user'] is somehow "resetted", what methods can i apply to prevent such behaviour?

    Read the article

  • How to loop an array with strings as indexes in PHP

    - by Axel Lambregts
    I had to make an array with as indexes A-Z (the alphabet). Each index had to have a value 0. So i made this array: $alfabet = array( 'A' => 0, 'B' => 0, 'C' => 0, 'D' => 0, 'E' => 0, 'F' => 0, 'G' => 0, 'H' => 0, 'I' => 0, 'J' => 0, 'K' => 0, 'L' => 0, 'M' => 0, 'N' => 0, 'O' => 0, 'P' => 0, 'Q' => 0, 'R' => 0, 'S' => 0, 'T' => 0, 'U' => 0, 'V' => 0, 'W' => 0, 'X' => 0, 'Y' => 0, 'Z' => 0 ); I also have got text from a file ($text = file_get_contents('tekst15.txt');) I have putted the chars in that file to an array: $textChars = str_split ($text); and sorted it from A-Z: sort($textChars); What i want is that (with a for loop) when he finds an A in the textChars array, the value of the other array with index A, goes up by one (so like: $alfabet[A]++; Can anyone help me with this loop? I have this atm: for($i = 0; $i <= count($textChars); $i++){ while($textChars[$i] == $alfabet[A]){ $alfabet[A]++; } } echo $alfabet[A]; Problem 1: i want to loop the alfabet array to, so now i only check for A but i want to check all indexes. Problem2: this now returns 7 for each alphabet index i try so its totally wrong :) I'm sorry about my english but thanks for your time.

    Read the article

  • Sort array by two specifics values in PHP

    - by Roger
    The folks have already showed me how to sort an array by a specific value using usort and a fallback function in PHP. What if this specifc value doesn't exist and we have to use two values? in the example bellow the values [4] and [5]... In other words, I want to do this: order all objects numericaly by the fith value of each object from the highest to the lowest, and addicionally, for those objects that have the fifht value is empty (in the examplem '-'), order them by the fourth value. Array( [0] => Array( [0] => links-patrocinados [1] => adwords [2] => 0,5 [3] => R$92,34 [4] => 823000 [5] => 49500 ) [1] => Array( [0] => adwords [1] => google adwords como funciona [2] => 0,38 [3] => R$0,20 [4] => 480 [5] => 480 ) [2] => Array( [0] => links-patrocinados [1] => adword [2] => 0,39 [3] => R$58,77 [4] => 49500 [5] => 2900 ) [3] => Array( [0] => agencia [1] => agencias viagens espanholas [2] => - [3] => R$0,20 [4] => 58 [5] => - ) [4] => Array( [0] => agencia [1] => era agencia imobiliaria [2] => - [3] => R$0,20 [4] => 73 [5] => - ) )

    Read the article

  • PHP will not Echo

    - by user2981166
    I've tried to look into why this isn't echoing but every result the persons trying use php on an html page so this is why I'm here asking. I have 3 php files, a login file, a global config file, and a theme file. The login page echo's the login script but it connects to the global file. The global file connects to the theme file and the db config file. The theme file is a simple table. Here's my files <? include('../tools/global.php'); switch($_POST[act]){ case "setlogin": set($login); break; case "refresh": refresh(); break; case "logout": lout(); break; default: login($mes); break; } function login($mes){ if (isset($_COOKIE["user"])){ $out[body]="<br /> <center> <table width='90%' border='0' cellspacing='1' cellpadding='1' bgcolor='#BDBDBD'> <tr bgcolor='##ff80ff'> <td width='100%' valign='center' align='left' colspan='2' background='#BDBDBD'> <strong>Login</strong> </td> </tr> <tr bgcolor='#BDBDBD'> <td width='100%' valign='center' align='left'><center> <b>You are already logged in! Would you like to <a href='http://www.fivedesignguys.com/dir/panel/login.php?act=refresh&type=logout'>Logout?</a></center></td></tr> </table> </center><br /><br /><br /><br />"; }else{ $out[body]=" <br /> <center> <table width='400' border='0' cellspacing='1' bgcolor='#BDBDBD' cellpadding='1'> <form method='post'> <tr bgcolor='$config[altcolor]'> <td background='#BDBDBD' width='100%' valign='center' align='left' colspan='2'> <strong>Login</strong>"; It continues but I know it's going to echo me the first option, Heres the global php file <?php include('../theme/default.php'); include('config.php'); ?> and finally the default.php theme file <table border='0'> <tr> <td colspan='2'> <center>bar</center> </td> </tr> <tr> <td width='10%'> hey<br>hey<br> </td> <td> hello <?php echo $out[body]; ?> </td> </tr> </table> as you can tell I want it to echo $out[body] but it doesn't want to. Yes all the files are PHP but this is where I'm stuck.

    Read the article

  • How to get the stream of a public Facebook fanpage in php?

    - by Bundy
    Hi, I want to display my public fanpage feed onto my website via the Facebook API without requiring a login. I'm doing this require_once('../includes/classes/facebook-platform/php/facebook.php'); $fb = new Facebook($api_key, $secret); $fb->api_client->stream_get('',$app_id,'0','0','','','','','')); But I get this error Fatal error: Uncaught exception 'FacebookRestClientException' with message 'user id parameter or session key required' in includes/classes/facebook-platform/php/facebookapi_php5_restlib.php:3065 Stack trace: #0 includes/classes/facebook-platform/php/facebookapi_php5_restlib.php(1915): FacebookRestClient->call_method('facebook.stream...', Array) #1 facebook/api.php(12): FacebookRestClient->stream_get('', 13156929019, '0', '0', 30, '', '', '', '') #2 {main} thrown in includes/classes/facebook-platform/php/facebookapi_php5_restlib.php on line 3065 Then I figured, because of 'user id parameter or session key required', to add my user id to the call require_once('../includes/classes/facebook-platform/php/facebook.php'); $fb = new Facebook($api_key, $secret); $fb->api_client->stream_get(502945616,13156929019,$app_id,'0','0','','','','','')); But then I got this error Fatal error: Uncaught exception 'FacebookRestClientException' with message 'Session key invalid or no longer valid' I'm totally clueless :)

    Read the article

< Previous Page | 84 85 86 87 88 89 90 91 92 93 94 95  | Next Page >