Search Results

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

Page 81/1708 | < Previous Page | 77 78 79 80 81 82 83 84 85 86 87 88  | Next Page >

  • Access Array Element with Smarty

    - by streetparade
    How can i acces an Array Element in Smarty with a second variable as index? Imagine i have an array of language [99] = Array ( [language] = English ) I tryed this : $memberLanguage.id is 99 so logicaly you would acces it this way {$language.$memberLanguage.id.language} but this doesnt work. in PHP i would do it this way $language[$memberLanguage['id']]['language'] How can i access the Array Element Dynamicaly?

    Read the article

  • Order a foreach, by the value of a calculation of values in the array

    - by Mark
    I have an array as follows: $players = array( $player = array( 'name' => 'playername', 'speed' => '10', 'agility' => '10', 'influence' => '10' ) etc Then I calculate a $score, based on the sum of speed, agility and influence. $score = $p['speed'] + $p['agility'] + $p['influence']; How can I loop through my array, but order the results from highest to lowest $score? PS- http://pastebin.com/eUEQ5y4u

    Read the article

  • Compiling PHP with GD crashes with EXC_BREAKPOINT (SIGTRAP) on PPC Mac

    - by Ömer
    First of all, I should say that I have searched the whole Internet for this problem but I couldn't find any solution yet. I have a Mac mini PowerPC (PPC) and I run Apache webserver (httpd-2.2.22) with PHP (5.4.0) and I do all the configure & compilation jobs by myself. If configure with: './configure' '--prefix=/usr/local/php5' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--sysconfdir=/etc' '--with-config-file-path=/etc' '--with-zlib' '--with-zlib-dir=/usr' '--with-openssl=/usr' '--without-iconv' '--enable-exif' '--enable-ftp' '--enable-mbstring' '--enable-mbregex' '--enable-sockets' '--with-mysql=/usr/local/mysql' '--with-pdo-mysql=/usr/local/mysql' '--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-mcrypt' then the PHP works flawlessly. But if I add the GD module by adding these to the script above: '--with-gd' '--with-jpeg-dir=/usr/local/lib' '--with-freetype-dir=/usr/X11R6' '--with-png-dir=/usr/X11R6' '--with-xpm-dir=/usr/X11R6' the PHP gets configured and compiled without any errors but it causes EXC_BREAKPOINT (SIGTRAP) (see the Crash Reporter log below) when I request a page which calls PHP module. It's obvious that something related to the GD module is causing this, probably FreeType module because it's present in the log but it may not be definite of course. When the PHP crashes (or more accurately, httpd) the CPU goes 100% for 10 to 15 seconds until it recovers. I need to use the GD module and keep the Mac mini PowerPC. So, what should I do to solve this problem? Process: httpd [79852] Path: /usr/local/apache2/bin/httpd Identifier: httpd Version: ??? (???) Code Type: PPC (Native) Parent Process: httpd [79846] Date/Time: 2013-11-04 15:44:28.444 +0200 OS Version: Mac OS X 10.5.8 (9L31a) Report Version: 6 Anonymous UUID: 0178B7F8-2241-43F7-A651-9E7234D41A37 Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0000000000000001, 0x0000000093c11e0c Crashed Thread: 0 Application Specific Information: *** single-threaded process forked *** Thread 0 Crashed: 0 com.apple.CoreFoundation 0x93c11e0c __CFRunLoopFindMode + 328 1 com.apple.CoreFoundation 0x93c13d88 CFRunLoopAddSource + 276 2 com.apple.DiskArbitration 0x901a6e8c DAApprovalSessionScheduleWithRunLoop + 52 3 ...ple.CoreServices.CarbonCore 0x9512e67c _FSGetDiskArbSession(__DASession**, __DAApprovalSession**) + 540 4 ...ple.CoreServices.CarbonCore 0x9512e420 CreateDiskArbDiskForMountPath(char const*) + 84 5 ...ple.CoreServices.CarbonCore 0x9512d2c8 FSCacheableClient_GetVolumeCachedInfo(char const*, statfs const*, CachedVolumeInfo*, __DADisk*, __DADisk**) + 280 6 ...ple.CoreServices.CarbonCore 0x9512cca4 MountVolume(char const*, statfs*, unsigned char, unsigned char, __DADisk*, short*) + 352 7 ...ple.CoreServices.CarbonCore 0x9512ca48 MountInitialVolumes() + 172 8 ...ple.CoreServices.CarbonCore 0x9512c4d4 INIT_FileManager() + 164 9 ...ple.CoreServices.CarbonCore 0x9512c390 GetRetainedVolFSVCBByVolumeID(unsigned long) + 48 10 ...ple.CoreServices.CarbonCore 0x9512adf4 PathGetObjectInfo(char const*, unsigned long, unsigned long, VolumeInfo**, unsigned long*, unsigned long*, char*, unsigned long*, unsigned char*) + 184 11 ...ple.CoreServices.CarbonCore 0x9512acc4 FSPathMakeRefInternal(unsigned char const*, unsigned long, unsigned long, FSRef*, unsigned char*) + 64 12 libfreetype.6.dylib 0x0070a0fc FT_New_Face_From_Resource + 56 13 libfreetype.6.dylib 0x0070a3b0 FT_New_Face + 48 14 libphp5.so 0x0118d1a8 fontFetch + 824 15 libphp5.so 0x0118edac php_gd_gdCacheGet + 220 16 libphp5.so 0x0118d6d8 php_gd_gdImageStringFTEx + 360 17 libphp5.so 0x011763c0 php_imagettftext_common + 1504 18 libphp5.so 0x01176494 zif_imagefttext + 20 19 libphp5.so 0x014b9c68 zend_do_fcall_common_helper_SPEC + 1048 20 libphp5.so 0x01452898 _ZEND_DO_FCALL_SPEC_CONST_HANDLER + 440 21 libphp5.so 0x014ba878 execute + 776 22 libphp5.so 0x013f190c zend_execute_scripts + 316 23 libphp5.so 0x013779f4 php_execute_script + 596 24 libphp5.so 0x014bbe64 php_handler + 1972 25 httpd 0x000020c0 ap_run_handler + 96 26 httpd 0x00006ae0 ap_invoke_handler + 224 27 httpd 0x000305c4 ap_process_request + 116 28 httpd 0x0002c768 ap_process_http_connection + 104 29 httpd 0x00012d30 ap_run_process_connection + 96 30 httpd 0x00012ecc ap_process_connection + 92 31 httpd 0x000373e4 child_main + 1220 32 httpd 0x000376a8 make_child + 296 33 httpd 0x000377e4 startup_children + 100 34 httpd 0x000387d4 ap_mpm_run + 3988 35 httpd 0x0000a320 main + 3280 36 httpd 0x000019c0 start + 64

    Read the article

  • APC PHP cache size does not exceed 32MB, even though settings allow for more

    - by hardy101
    I am setting up APC (v 3.1.9) on a high-traffic WordPress installation on CentOS 6.0 64 bit. I have figured out many of the quirks with APC, but something is still not quite right. No matter what settings I change, APC never actually caches more than 32MB. I'm trying to bump it up to 256 MB. 32MB is a default amount for apc.shm_size, so I am wondering if it's stuck there somehow. I have run the following echo '2147483648' > /proc/sys/kernel/shmmax to increase my system's shared memory to 2G (half of my 4G box). Then ran ipcs -lm which returns ------ Shared Memory Limits -------- max number of segments = 4096 max seg size (kbytes) = 2097152 max total shared memory (kbytes) = 8388608 min seg size (bytes) = 1 Also made a change in /etc/sysctl.conf then ran sysctl -p to make the settings stick on the server. Rebooted, too, for good measure. In my APC settings, I have mmap enabled (which happens by default in recent versions of APC). php.ini looks like: apc.stat=0 apc.shm_size="256M" apc.max_file_size="10M" apc.mmap_file_mask="/tmp/apc.XXXXXX" apc.ttl="7200" I am aware that mmap mode will ignore references to apc.shm_segments, so I have left it out with default 1. phpinfo() indicates the following about APC: Version 3.1.9 APC Debugging Disabled MMAP Support Enabled MMAP File Mask /tmp/apc.bPS7rB Locking type pthread mutex Locks Serialization Support php Revision $Revision: 308812 $ Build Date Oct 11 2011 22:55:02 Directive Local Value apc.cache_by_default On apc.canonicalize O apc.coredump_unmap Off apc.enable_cli Off apc.enabled On On apc.file_md5 Off apc.file_update_protection 2 apc.filters no value apc.gc_ttl 3600 apc.include_once_override Off apc.lazy_classes Off apc.lazy_functions Off apc.max_file_size 10M apc.mmap_file_mask /tmp/apc.bPS7rB apc.num_files_hint 1000 apc.preload_path no value apc.report_autofilter Off apc.rfc1867 Off apc.rfc1867_freq 0 apc.rfc1867_name APC_UPLOAD_PROGRESS apc.rfc1867_prefix upload_ apc.rfc1867_ttl 3600 apc.serializer default apc.shm_segments 1 apc.shm_size 256M apc.slam_defense On apc.stat Off apc.stat_ctime Off apc.ttl 7200 apc.use_request_time On apc.user_entries_hint 4096 apc.user_ttl 0 apc.write_lock On apc.php reveals the following graph, no matter how long the server runs (cache size fluctuates and hovers at just under 32MB. See image http://i.stack.imgur.com/2bwMa.png You can see that the cache is trying to allocate 256MB, but the brown piece of the pie keeps getting recycled at 32MB. This is confirmed as refreshing the apc.php page shows cached file counts that move up and down (implying that the cache is not holding onto all of its files). Does anyone have an idea of how to get APC to use more than 32 MB for its cache size?? **Note that the identical behavior occurs for eaccelerator, xcache, and APC. I read here: http://www.litespeedtech.com/support/forum/archive/index.php/t-5072.html that suEXEC could cause this problem.

    Read the article

  • PHP 5.2 to 5.3 not upgrading, no errors

    - by Webnet
    I'm following this guide: http://atik97.wordpress.com/2010/06/12/how-to-upgrade-to-php-5-3-in-ubuntu-9-10/ I've done all the steps, but it's still showing php 5.2.6 - any ideas? I have also tried -cgi instead of -cli, neither have any effect. update I've tried rebooting the server to see if that would have any effect and unfortunately it didn't update Output of dpkg -l *php*: Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad) ||/ Name Version Description +++-=============================================-=============================================-========================================================================================================== un libapache2-mod-php4 <none> (no description available) ii libapache2-mod-php5 5.2.6.dfsg.1-3ubuntu4.6 server-side, HTML-embedded scripting language (Apache 2 module) un libapache2-mod-php5filter <none> (no description available) ii php-pear 5.2.6.dfsg.1-3ubuntu4.6 PEAR - PHP Extension and Application Repository un php4-cli <none> (no description available) un php4-dev <none> (no description available) un php4-mysql <none> (no description available) un php4-pear <none> (no description available) ii php5 5.2.6.dfsg.1-3ubuntu4.6 server-side, HTML-embedded scripting language (metapackage) ii php5-cgi 5.2.6.dfsg.1-3ubuntu4.6 server-side, HTML-embedded scripting language (CGI binary) ii php5-cli 5.2.6.dfsg.1-3ubuntu4.6 command-line interpreter for the php5 scripting language ii php5-common 5.2.6.dfsg.1-3ubuntu4.6 Common files for packages built from the php5 source ii php5-curl 5.2.6.dfsg.1-3ubuntu4.6 CURL module for php5 un php5-dev <none> (no description available) ii php5-gd 5.2.6.dfsg.1-3ubuntu4.6 GD module for php5 ii php5-imap 5.2.6-0ubuntu5.1 IMAP module for php5 un php5-json <none> (no description available) ii php5-mcrypt 5.2.6-0ubuntu2 MCrypt module for php5 ii php5-mysql 5.2.6.dfsg.1-3ubuntu4.6 MySQL module for php5 un php5-mysqli <none> (no description available) ii php5-xsl 5.2.6.dfsg.1-3ubuntu4.6 XSL module for php5 un phpapi-20060613+lfs <none> (no description available) ii phpmyadmin 4:3.1.2-1ubuntu0.2 MySQL web administration tool update The following commands and their outputs: grep php53 /etc/apt/sources.list deb http://php53.dotdeb.org stable all deb-src http://php53.dotdeb.org stable all apt-cache search -f "libapache2-mod-php5" http://pastebin.com/XNXdsXYC update I've updated the question with more details on installed packages.

    Read the article

  • How can I turn a SimpleXML object to array, then shuffle?

    - by Joshua Cody
    Crux of my problem: I've got an XML file that returns 20 results. Within these results are all the elements I need to get. Now, I need to return them in a random order, and be able to specifically work with item 1, items 2-5, and items 6-17. Idea 1: Use this script to convert the object to an array, which I can shuffle through. This is close to working, but a few of the elements I need to get are under a different namespace, and I don't seem to be able to get them. Code: /* * Convert a SimpleXML object into an array (last resort). * * @access public * @param object $xml * @param boolean $root - Should we append the root node into the array * @return array */ function xmlToArray($xml, $root = true) { if (!$xml->children()) { return (string)$xml; } $array = array(); foreach ($xml->children() as $element => $node) { $totalElement = count($xml->{$element}); if (!isset($array[$element])) { $array[$element] = ""; } // Has attributes if ($attributes = $node->attributes()) { $data = array( 'attributes' => array(), 'value' => (count($node) > 0) ? xmlToArray($node, false) : (string)$node // 'value' => (string)$node (old code) ); foreach ($attributes as $attr => $value) { $data['attributes'][$attr] = (string)$value; } if ($totalElement > 1) { $array[$element][] = $data; } else { $array[$element] = $data; } // Just a value } else { if ($totalElement > 1) { $array[$element][] = xmlToArray($node, false); } else { $array[$element] = xmlToArray($node, false); } } } if ($root) { return array($xml->getName() => $array); } else { return $array; } } $thumbfeed = simplexml_load_file('http://gdata.youtube.com/feeds/api/videos?q=skadaddlemedia&max-results=20&orderby=published&prettyprint=true'); $xmlToArray = xmlToArray($thumbfeed); $thumbArray = $xmlToArray["feed"]; for($n = 0; $n < 18; $n++){ $title = $thumbArray["entry"][$n]["title"]["value"]; $desc = $thumbArray["entry"][0]["content"]["value"]; $videoUrl = $differentNamespace; $thumbUrl = $differentNamespace; } Idea 2: Continue using my working code that is getting the information using a foreach, but store each element in an array, then use shuffle on that. I'm not precisely sure hwo to write to an array within a foreach loop and not write over one another, though. Working code: foreach($thumbfeed->entry as $entry){ $thumbmedia = $entry->children('http://search.yahoo.com/mrss/') ->group ; $thumb = $thumbmedia->thumbnail[0]->attributes()->url; $thumburl = $thumbmedia->content[0]->attributes()->url; $thumburl1 = explode("http://www.youtube.com/v/", $thumburl[0]); $thumbid = explode("?f=videos&app=youtube_gdata", $thumburl1[1]); $thumbtitle = $thumbmedia->title; $thumbyt = $thumbmedia->children('http://gdata.youtube.com/schemas/2007') ->duration ; $thumblength = $thumbyt->attributes()->seconds; } Ideas on if either of these are good solutions to my problem, and if so, how I can get over my execution humps? Thanks so much for any help you can give.

    Read the article

  • PHP errors -> Warning: mysqli_stmt::execute(): Couldn't fetch mysqli_stmt | Warning: mysqli_stmt::c

    - by Tunji Gbadamosi
    I keep getting this error while trying to modify some tables. Here's my code: /** <- line 320 * * @param array $guests_array * @param array $tickets_array * @param integer $seat_count * @param integer $order_count * @param integer $guest_count */ private function book_guests($guests_array, $tickets_array, &$seat_count, &$order_count, &$guest_count){ /* @var $guests_array ArrayObject */ $sucess = false; if(sizeof($guests_array) >= 1){ //$this->mysqli->autocommit(FALSE); //insert the guests into guest, person, order, seat $menu_stmt = $this->mysqli->prepare("SELECT id FROM menu WHERE name=?"); $menu_stmt->bind_param('s',$menu); //$menu_stmt->bind_result($menu_id); $table_stmt = $this->mysqli->prepare("SELECT id FROM tables WHERE name=?"); $table_stmt->bind_param('s',$table); //$table_stmt->bind_result($table_id); $seat_stmt = $this->mysqli->prepare("SELECT id FROM seat WHERE name=? AND table_id=?"); $seat_stmt->bind_param('ss',$seat, $table_id); //$seat_stmt->bind_result($seat_id); for($i=0;$i<sizeof($guests_array);$i++){ $menu = $guests_array[$i]['menu']; $table = $guests_array[$i]['table']; $seat = $guests_array[$i]['seat']; //get menu id if($menu_stmt->execute()){ $menu_stmt->bind_result($menu_id); while($menu_stmt->fetch()) ; } $menu_stmt->close(); //get table id if($table_stmt->execute()){ $table_stmt->bind_result($table_id); while($table_stmt->fetch()) ; } $table_stmt->close(); //get seat id if($seat_stmt->execute()){ $seat_stmt->bind_result($seat_id); while($seat_stmt->fetch()) ; } $seat_stmt->close(); $dob = $this->create_date($guests_array[$i]['dob_day'], $guests_array[$i]['dob_month'], $guests_array[$i]['dob_year']); $id = $this->add_person($guests_array[$i]['first_name'], $guests_array[$i]['surname'], $dob, $guests_array[$i]['sex']); if(is_string($id)){ $seat = $this->add_seat($table_id, $seat_id, $id); /* @var $tickets_array ArrayObject */ $guest = $this->add_guest($id,$tickets_array[$i+1],$menu_id, $this->volunteer_id); /* @var $order integer */ $order = $this->add_order($this->volunteer_id, $table_id, $seat_id, $id); if($guest == 1 && $seat == 1 && $order == 1){ $seat_count += $seat; $guest_count += $guest; $order_count += $order; $success = true; } } } } return $success; } <- line 406 Here are the warnings: The person PRSN10500000LZPH has been added to the guest tablePRSN10500000LZPH added to table (1), seat (1)The order for person(PRSN10500000LZPH) is registered with volunteer (PRSN10500000LZPH) at table (1) and seat (1)PRSN10600000LZPH added to table (1), seat (13)The person PRSN10600000LZPH has been added to the guest tableThe order for person(PRSN10600000LZPH) is registered with volunteer (PRSN10500000LZPH) at table (1) and seat (13) Warning: mysqli_stmt::execute(): Couldn't fetch mysqli_stmt in /Users/olatunjigbadamosi/Sites/ST_Ambulance/FormDB.php on line 358 Warning: mysqli_stmt::close(): Couldn't fetch mysqli_stmt in /Users/olatunjigbadamosi/Sites/ST_Ambulance/FormDB.php on line 363 Warning: mysqli_stmt::execute(): Couldn't fetch mysqli_stmt in /Users/olatunjigbadamosi/Sites/ST_Ambulance/FormDB.php on line 366 Warning: mysqli_stmt::close(): Couldn't fetch mysqli_stmt in /Users/olatunjigbadamosi/Sites/ST_Ambulance/FormDB.php on line 371 Warning: mysqli_stmt::execute(): Couldn't fetch mysqli_stmt in /Users/olatunjigbadamosi/Sites/ST_Ambulance/FormDB.php on line 374 Warning: mysqli_stmt::close(): Couldn't fetch mysqli_stmt in /Users/olatunjigbadamosi/Sites/ST_Ambulance/FormDB.php on line 379 PRSN10700000LZPH added to table (1), seat (13)The person PRSN10700000LZPH has been added to the guest tableThe order for person(PRSN10700000LZPH) is registered with volunteer (PRSN10500000LZPH) at table (1) and seat (13) Warning: mysqli_stmt::execute(): Couldn't fetch mysqli_stmt in /Users/olatunjigbadamosi/Sites/ST_Ambulance/FormDB.php on line 358 Warning: mysqli_stmt::close(): Couldn't fetch mysqli_stmt in /Users/olatunjigbadamosi/Sites/ST_Ambulance/FormDB.php on line 363 Warning: mysqli_stmt::execute(): Couldn't fetch mysqli_stmt in /Users/olatunjigbadamosi/Sites/ST_Ambulance/FormDB.php on line 366 Warning: mysqli_stmt::close(): Couldn't fetch mysqli_stmt in /Users/olatunjigbadamosi/Sites/ST_Ambulance/FormDB.php on line 371 Warning: mysqli_stmt::execute(): Couldn't fetch mysqli_stmt in /Users/olatunjigbadamosi/Sites/ST_Ambulance/FormDB.php on line 374 Warning: mysqli_stmt::close(): Couldn't fetch mysqli_stmt in /Users/olatunjigbadamosi/Sites/ST_Ambulance/FormDB.php on line 379 PRSN10800000LZPH added to table (1), seat (13)The person PRSN10800000LZPH has been added to the guest tableThe order for person(PRSN10800000LZPH) is registered with volunteer (PRSN10500000LZPH) at table (1) and seat (13)

    Read the article

  • PHP contact form font color is stuck to black

    - by Richard Hayward
    No matter what i try strangely enough my form and thank you page both php files one with embed font coloring and one with an external style sheet refuse to change font color from black. thank you php file: http://www.richiesportfolio.com/contact/thank-you.php contact form php file: http://www.richiesportfolio.com/contact/contactform.php Everything else works purfectly but changing the contact forms font color contactform.php ` <?PHP require_once("./include/fgcontactform.php"); $formproc = new FGContactForm(); if(isset($_POST['submitted'])) { if($formproc->ProcessForm()) { $formproc->RedirectToURL("thank-you.php"); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"> <head> <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/> <title>Contact us</title> <link rel="stylesheet" type="text/css" href="http://www.richiesportfolio.com/contact/contact.css" /> <script type='text/javascript' src='scripts/gen_validatorv31.js'></script> </head> <body> <!-- Form Code Start --> <form id='contactus' action='<?php echo $formproc->GetSelfScript(); ?>' method='post' accept-charset='UTF-8'> <fieldset > <legend>Contact Me</legend> <input type='hidden' name='submitted' id='submitted' value='1'/> <input type='hidden' name='<?php echo $formproc->GetFormIDInputName(); ?>' value='<?php echo $formproc->GetFormIDInputValue(); ?>'/> <input type='text' class='spmhidip' name='<?php echo $formproc->GetSpamTrapInputName(); ?>' /> <div class='short_explanation'>* required fields</div> <div><span class='error'><?php echo $formproc->GetErrorMessage(); ?></span></div> <div class='container'> <label for='name' >Your Full Name*: </label><br/> <input type='text' name='name' id='name' value='<?php echo $formproc->SafeDisplay('name') ?>' maxlength="50" /><br/> <span id='contactus_name_errorloc' class='error'></span> </div> <div class='container'> <label for='email' >Email Address*:</label><br/> <input type='text' name='email' id='email' value='<?php echo $formproc->SafeDisplay('email') ?>' maxlength="50" /><br/> <span id='contactus_email_errorloc' class='error'></span> </div> <div class='container'> <label for='message' >Message:</label><br/> <span id='contactus_message_errorloc' class='error'></span> <textarea rows="10" cols="50" name='message' id='message'><?php echo $formproc->SafeDisplay('message') ?></textarea> </div> <div class='container'> <input type='submit' name='Submit' value='Submit' /> </div> </fieldset> </form> <!-- client-side Form Validations: Uses the excellent form validation script from JavaScript-coder.com--> <script type='text/javascript'> // <![CDATA[ var frmvalidator = new Validator("contactus"); frmvalidator.EnableOnPageErrorDisplay(); frmvalidator.EnableMsgsTogether(); frmvalidator.addValidation("name","req","Please provide your name"); frmvalidator.addValidation("email","req","Please provide your email address"); frmvalidator.addValidation("email","email","Please provide a valid email address"); frmvalidator.addValidation("message","maxlen=2048","The message is too long!(more than 2KB!)"); // ]]> </script> </body> </html>` contact.css body,table,tr,td,a,p,h1,h2,h3,h4,h5,input,h3 a,h4 a,h5 ul, li, ul, a { color:#FFF; } #contactus fieldset { width:320px; padding:20px; border:20px; -moz-border-radius: 10px; -webkit-border-radius: 10px; -khtml-border-radius: 10px; border-radius: 10px; } #contactus legend, h2 { font-family : Arial, sans-serif; font-size:1.3em; font-weight:bold; color:#FFF; } #contactus label { font-family : Arial, sans-serif; font-size:0.8em; font-weight: bold; color:#FFF; } #contactus input[type="text"],textarea { font-family : Arial, Verdana, sans-serif; font-size: 0.8em; line-height:140%; color : #000; padding : 3px; border : 1px solid; #999; -moz-border-radius: 5px; -webkit-border-radius: 5px; -khtml-border-radius: 5px; border-radius: 5px; } #contactus input[type="text"] { height:18px; width:220px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } #contactus #scaptcha { width:60px; height:18px; } #contactus input[type="submit"] { width:100px; height:30px; padding-left:0px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } #contactus textarea { height:120px; width:310px; -webkit-border-radius:8px; -moz-border-radius: 8px; border-radius: 8px; } #contactus input[type="text"]:focus,textarea:focus { color : #009; border : 1px solid #990000; background-color : #ffff99; font-weight:bold; } #contactus .container { margin-top:8px; margin-bottom:10px; color:#FFF; } #contactus .error { font-family: Verdana, Arial, sans-serif; font-size: 0.7em; color: #900; background-color : #111; } #contactus fieldset#antispam { padding:2px; border-top:1px solid #EEE; border-left:0; border-right:0; border-bottom:0; width:350px; } #contactus fieldset#antispam legend { font-family : Arial, sans-serif; font-size: 0.8em; font-weight:bold; color:#FFF; } #contactus .short_explanation { font-family : Arial, sans-serif; font-size: 0.6em; color:#FFF; } /* spam_trap: This input is hidden. This is here to trick the spam bots*/ #contactus .spmhidip { display:none; width:10px; height:3px; } #fg_crdiv { font-family : Arial, sans-serif; font-size: 0.3em; opacity: .2; -moz-opacity: .2; filter: alpha(opacity=20); } #fg_crdiv p { display:none; }

    Read the article

  • Ruby efficient way of building an array from an array of arrays

    - by randombits
    I have an array of ActiveRecord objects, each one which has its own respective errors array. I want to flatten it all out and get only the unique values into one array. So the top level array might look like: foo0 = Foo.new foo1 = Foo.new foo2 = Foo.new foo3 = Foo.new arr = [foo0, foo1, foo2, foo3] Each one of those objects could potentially have an array of errors, and I'd like to get just the unique message out of them and put them in another array, say called error_arr. How would you do it the "Ruby" way?

    Read the article

  • php + MySQL editing table data.

    - by Jacksta
    This question is relating to 2 php scripts. The first script is called pick_modcontact.php where I choose a contact (from a contact book like phone book), then posts to the script show_modcontact.php When I click the submit button on the form on pick.modcontact.php. As a result of submitting the form I am then taken to show_modcontact.php. As the variables are not present the user is directed back to pick_modcontact.php I can not work out how to correct the code so that it will show the results of the script show_modcontact.php This script shows all contacts in a database which is an "address book" this part works fine. please see below. Name:pick_modcontact.php if ($_SESSION['valid'] != "yes") { header( "Location: contact_menu.php"); exit; } $db_name = "testDB"; $table_name = "my_contacts"; $connection = @mysql_connect("localhost", "admin", "user") or die(mysql_error()); $db = @mysql_select_db($db_name, $connection) or die(mysql_error()); $sql = "SELECT id, f_name, l_name FROM $table_name ORDER BY f_name"; $result = @mysql_query($sql, $connection) or die(mysql_error()); $num = @mysql_num_rows($result); if ($num < 1) { $display_block = "<p><em>Sorry No Results!</em></p>"; } else { while ($row = mysql_fetch_array($result)) { $id = $row['id']; $f_name = $row['f_name']; $l_name = $row['l_name']; $option_block .= "<option value\"$id\">$f_name, $l_name</option>"; } $display_block = "<form method=\"POST\" action=\"show_modcontact.php\"> <p><strong>Contact:</strong> <select name=\"id\">$option_block</select> <input type=\"submit\" name=\"submit\" value=\"Select This Contact\"></p> </form>"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Modify A Contact</title> </head> <body> <h1>My Contact Management System</h1> <h2><em>Modify a Contact</em></h2> <p>Select a contact from the list below, to modify the contact's record.</p> <? echo "$display_block"; ?> <br> <p><a href="contact_menu.php">Return to Main Menu</a></p> </body> </html> This script is for modifying the contact: named show_modcontact.php <?php if (!$_POST['id']) { header( "Location: pick_modcontact.php"); exit; } else { session_start(); } if ($_SESSION['valid'] != "yes") { header( "Location: pick_modcontact.php"); exit; } $db_name = "testDB"; $table_name = "my_contacts"; $connection = @mysql_connect("localhost", "admin", "pass") or die(mysql_error()); $db = @mysql_select_db($db_name, $connection) or die(mysql_error()); $sql = "SELECT f_name, l_name, address1, address2, address3, postcode, prim_tel, sec_tel, email, birthday FROM $table_name WHERE id = '" . $_POST['id'] . "'"; $result = @mysql_query($sql, $connection) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { $f_name = $row['f_name']; $l_name = $row['l_name']; $address1 = $row['address1']; $address2 = $row['address2']; $address3 = $row['address3']; $country = $row['country']; $prim_tel = $row['prim_tel']; $sec_tel = $row['sec_tel']; $email = $row['email']; $birthday = $row['birthday']; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Modify A Contact</title> </head> <body> <form action="do_modcontact.php" method="post"> <input type="text" name="id" value="<? echo $_POST['id']; ?>" /> <table cellpadding="5" cellspacing="3"> <tr> <th>Name & Address Information</th> <th> Other Contact / Personal Information</th> </tr> <tr> <td align="top"> <p><strong>First Name:</strong><br /> <input type="text" name="f_name" value="<? echo "$f_name"; ?>" size="35" maxlength="75" /></p> <p><strong>Last Name:</strong><br /> <input type="text" name="l_name" value="<? echo "$l_name"; ?>" size="35" maxlength="75" /></p> <p><strong>Address1:</strong><br /> <input type="text" name="f_name" value="<? echo "$address1"; ?>" size="35" maxlength="75" /></p> <p><strong>Address2:</strong><br /> <input type="text" name="f_name" value="<? echo "$address2"; ?>" size="35" maxlength="75" /></p> <p><strong>Address3:</strong><br /> <input type="text" name="f_name" value="<? echo "$address3"; ?>" size="35" maxlength="75" /> </p> <p><strong>Postcode:</strong><br /> <input type="text" name="f_name" value="<? echo "$postcode"; ?>" size="35" maxlength="75" /></p> <p><strong>Country:</strong><br /> <input type="text" name="f_name" value="<? echo "$country"; ?>" size="35" maxlength="75" /> </p> <p><strong>First Name:</strong><br /> <input type="text" name="f_name" value="<? echo "$f_name"; ?>" size="35" maxlength="75" /></p> </td> <td align="top"> <p><strong>Prim Tel:</strong><br /> <input type="text" name="f_name" value="<? echo "$prim_tel"; ?>" size="35" maxlength="75" /></p> <p><strong>Sec Tel:</strong><br /> <input type="text" name="f_name" value="<? echo "$sec_tel"; ?>" size="35" maxlength="75" /></p> <p><strong>Email:</strong><br /> <input type="text" name="f_name" value="<? echo "$email;" ?>" size="35" maxlength="75" /> </p> <p><strong>Birthday:</strong><br /> <input type="text" name="f_name" value="<? echo "$birthday"; ?>" size="35" maxlength="75" /> </p> </td> </tr> <tr> <td align="center"> <p><input type="submit" name="submit" value="Update Contact" /></p> <br /> <p><a href="contact_menu.php">Retuen To Menu</a></p> </td> </tr> </table> </form> </body> </html> note for site admin, I am re posting this question with the hope of someone else reading over it. older questions seem to go dead after a while.

    Read the article

  • How to send an array(multidimensional/associative) and some varaibles together through json?

    - by I Like PHP
    i have an multidimensional array $ouptput=Array ( [0] => Array ( [0] => mov_1 [1] => MY FAIR LADY ) [1] => Array ( [1] => mov_10 [2] => love actually ) ) and two variables $avlblQnty=50 $success= true when i send these data via json echo json_encode( array('movieData'=>$output,'stock'=>$avlblQnty,'sucess'=>$success)); it returns {"movieData":[["mov_1","MY FAIR LAD],{"1":"mov_10","2":"love actually"}],"stock":0,"success":true} but i need json encoded data properly so that i can create an select box on movieData using(movieData.length), so for that i want json edcoded data in below format so that i can retrive successfully {"movieData":[{"mov_1":"MY FAIR LAD,mov_10":"love actually"}],"stock":0,"success":true} i want to know how to send an array(multidimensional/associative) and some varaibles together through json?

    Read the article

  • How to find Key and IV value from .Net to PHP

    - by PHP-Prabhu
    Can any one please let me know is there any way to find a solution for the below stuffs. I need to find out the KEY and IV value from the below byte array. the byte array in .net and this has to be convert into KEY(string) and IV(string) via PHP. private static readonly byte[] Key = { 0xda, 0x3c, 0x35, 0x6f, 0xbd, 0xd, 0x87, 0xf0, 0x9a, 0x7, 0x6d, 0xab, 0x7e, 0x82, 0x36, 0xa, 0x1a, 0x5a, 0x77, 0xfe, 0x74, 0xf3, 0x7f, 0xa8, 0xaa, 0x4, 0x11, 0x46, 0x6b, 0x2d, 0x48, 0xa1 }; private static readonly byte[] IV = { 0x6d, 0x2d, 0xf5, 0x34, 0xc7, 0x60, 0xc5, 0x33, 0xe2, 0xa3, 0xd7, 0xc3, 0xf3, 0x39, 0xf2, 0x16 };

    Read the article

  • To not iterate through function of Array object if it is added to Array prototype

    - by Rishat Muhametshin
    According to the way to add indexOf method to Array class in IE6, how do I now reject this method from iterating through any random array? For example: Array.prototype.indexOf = function(needle) { ... }; var array = [1, 2, 3]; for (var i in array) { document.write(i + ': ' + array[i]); } gives output 0: 1 1: 2 2: 3 indexOf: function ... How can I skip indexOf property and stop iterating on it without adding any code to where for(...) is called?

    Read the article

  • Apache Won't Restart After Compiling PHP with Postgres

    - by gonzofish
    I've compiled PHP (v5.3.1) with Postgres using the following configure: ./configure \ --build=x86_64-redhat-linux-gnu \ --host=x86_64-redhat-linux-gnu \ --target=x86_64-redhat-linux-gnu \ --program-prefix= \ --prefix=/usr/ \ --exec-prefix=/usr/ \ --bindir=/usr/bin/ \ --sbindir=/usr/sbin/ \ --sysconfdir=/etc \ --datadir=/usr/share \ --includedir=/usr/include/ \ --libdir=/usr/lib64 \ --libexecdir=/usr/libexec \ --localstatedir=/var \ --sharedstatedir=/usr/com \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --cache-file=../config.cache \ --with-libdir=lib64 \ --with-config-file-path=/etc \ --with-config-file-scan-dir=/etc/php.d \ --with-pic \ --disable-rpath \ --with-pear \ --with-pic \ --with-bz2 \ --with-exec-dir=/usr/bin \ --with-freetype-dir=/usr \ --with-png-dir=/usr \ --with-xpm-dir=/usr \ --enable-gd-native-ttf \ --with-t1lib=/usr \ --without-gdbm \ --with-gettext \ --without-gmp \ --with-iconv \ --with-jpeg-dir=/usr \ --with-openssl \ --with-zlib \ --with-layout=GNU \ --enable-exif \ --enable-ftp \ --enable-magic-quotes \ --enable-sockets \ --enable-sysvsem \ --enable-sysvshm \ --enable-sysvmsg \ --with-kerberos \ --enable-ucd-snmp-hack \ --enable-shmop \ --enable-calendar \ --with-libxml-dir=/usr \ --enable-xml \ --with-system-tzdata \ --with-mime-magic=/usr/share/file/magic \ --with-apxs2=/usr/sbin/apxs \ --with-mysql=/usr/include/mysql \ --without-gd \ --with-dom=/usr/include/libxml2/libxml \ --disable-dba \ --without-unixODBC \ --disable-pdo \ --enable-xmlreader \ --enable-xmlwriter \ --without-sqlite \ --without-sqlite3 \ --disable-phar \ --enable-fileinfo \ --enable-json \ --without-pspell \ --disable-wddx \ --with-curl=/usr/include/curl \ --enable-posix \ --with-mcrypt \ --enable-mbstring \ --with-pgsql=/mnt/mv/pgsql I'm using Postgres 8.4.0 and Apache 2.2.8; I have the following line in my Apache conf file: LoadModule php5_module /usr/lib64/httpd/modules/libphp5.so And when I attempt to restart Apache, I get the following error message: Starting httpd: httpd: Syntax error on line 205 of /etc/httpd/conf/httpd.conf: Cannot load /usr/lib64/httpd/modules/libphp5.so into server: /usr/lib64/httpd/modules/libphp5.so: undefined symbol: lo_import_with_oid Now, I know that this is a problem with Postgres with PHP because lo_import_with_oid is a function in the Postgres source which allows the importing of large objects; also, if I remove the --with-pgsql option, PHP and Apache get along great. I've scoured the Internet looking for answers all day, but to no avail. Does anyone have ANY insight into what is causing my problems.

    Read the article

  • Server appears to have lost ability to read PHP files with LAMP

    - by OtagoHarbour
    I have LAMP installed on a PC that is running Ubuntu 11.10. LAMP was running fine but I had to restart the PC because Unity was messing up (as it often does) and the tool bar had disappeared. When it started up, I was unable to fire up any php files. I have a file index.php in /var/www. It is owned by www-data as is the directory that it is in. The LAN address of the server is 192.168.1.10. However when I type 192.168.1.10 into the URL box on Mozilla FireFox, I get Unable to connect Firefox can't establish a connection to the server at 192.168.1.10 This server is connected to another server on the LAN that has the LAN address 192.168.1.4. When I type 192.168.1.4 into the Firefow URL box on 192.168.1.10, I see the display associated with index.php on 192.168.1.4. Why can it not display its own /var/www/index.php? Any assistance with this would be greatly appreciated, Peter.

    Read the article

  • Ubuntu in VirtualBox File Modified Time in Future and PHP slow file operations

    - by user1750
    For some reason, some of my files have a last modified date in the future. In addition to this, file operations in PHP are SUPER slow. For example, rebuilding the Symfony2 cache can take over 40 seconds (its takes 1-2 on my MacBook Pro). Notice the time for ListingsCRUDController.php. It just says "2012". In order see the date more clearly I ran ls --time-style="full-iso" -l For some reason it shows that this file's last modified date is ~5 hours into the future. System time: To make things more confusing, the system will intermittently speed up. Suddenly, my app will start serving requests in 1-2 seconds (down from 40 seconds) for no apparent reason. I mean I don't do anything to my code/system config - it just changes. Also, during a slow PHP request, the php5-fpm process (nginx) uses 100% of the CPU for the duration of the request. This is the second VM this has happened on and I need to know why its doing this. It has become unusable. Information About My Setup VirtualBox 4.2.0 Host: Macbook Pro Guest: Ubuntu Server 12.04 Package dkms is installed Timezones match for Ubuntu and PHP. Things I've Tried Both Apache and Nginx. APC enabled and disabled. Xdebug enabled and disabled. 1 processor up to 4 processors. 1gb memory up to 4gb memory. I've installed Ubuntu using the regular kernel and the VM kernel.

    Read the article

  • PHP 5.3.5 Windows installer missing php_ldap.dll

    - by nmjk
    I'm working with Windows Server 2008, Apache 2.2. I'm using php-5.3.5-Win32-VC6-x86.msi as the installer, using the threadsafe version. I've gone through the install process four or five times just to make sure that I'm not missing anything ridiculous, but I don't think I am. The problem is that the php_ldap.dll extension simply doesn't seem to exist. It's not present in the installer interface (where the user is asked to choose which extensions to install), and it definitely doesn't appear in the ext/ directory after install. I found a lot of mentions of this issue for 5.3.3, including links to download the extension individually. Those links no longer exist, of course, and besides: they were for 5.3.3. I'd really rather use an extension that belongs with PHP 5.3.5. Anyone else encounter this problem? Any ideas as to what's going wrong? Anyone seen acknowledgement by the PHP folks that the file is indeed missing, and that it's an oversight? It's quite a frustration because the server I'm building has no purpose if I don't have PHP LDAP support. Cheers all, and thanks in advance for your assistance.

    Read the article

  • APACHE - PHP - Bounce emails

    - by user1179459
    I want to improve our mail server lists by handling all the bounces we get in our websites. I have a website which has over 8000+ users and another website which as over 1500+ users, they are emailed various notifications every second, ie. job alerts, email alerts, I am using POP connections with EXIM on APACHE server, most scripts are based on PHP language generates email on the fly. Problems i have But some users has registered long time ago and now quite few has bounce email address Some users register with dummy emails like [email protected] which never existed but a valid email address, any chance of stopping this without asking them login to the email account and clicking links which dont work most times.. (too annoying to the end user) Server is sending unnecessary emails can be avoided if i know they dont exists ? Solutions i need to have Is there a way i can download the bounce email list somewhere (WHM/Cpanel), i know exim mail has it but its not readable (i need a file like CSV or something similar to scan them over and write a php script to delete the users from the database ?) I need to know if there is any function in the PHP that can check the existence of the email address on the fly ? so that i can set the email send function in the mailer class to check before it sends out. On the server will bouncing emails are going to eatup lots of server resources ? like memory/cpu on processing them ? or are they are minimal where we dont have to worry about this at all ? May be a opensoruce or linux software to capture them and view them in a report basis and cleaning them up ? I am not a linux expert or server admin but i do lot of PHP coding, so please be descriptive of the solutions specially if they are linux commands Thank you!

    Read the article

  • How to send mail with PHP [migrated]

    - by roth66
    My litle problem is about mail() function in PHP, it doesnt want to send emails, to my local server, or anywhere else. I don't think that function was supposed to send mail to adresses like: [email protected]; So I've installed a mail server: hmailserver, I installed a client: dream-mail; I installed sendmaill.exe; (actually unzipped it in a folder, then in php.ini set the sendmail_path to point to it) After countless trials and errors, it still doesn't work. my system would comprise in an Apache server 2.2, and PHP (last version I think 5.3 or somehing), running on windows. And now for avoiding the usual questions (Did you make rules in your firewall etc etc), I guess I should mention, that there arent any connectivity issues, everything is set to "local" (localhost), port 25, 110, 143, are all opened, And, after a few days of fiddling with my brand new mail-server, I manage to make it work. THe Dream-mail client, has a test, trough which it would test its connections, and according to it, the SMTP AND POP3 connections are all successful, it even sends an email, for testing. SO ya, it would work. The problem, remains: PHP mail funcion. And I really need it, since on my website there's a contact form, and right now is useless. I've also checked the form it self, and seems to be alright.

    Read the article

  • Unable to remove limit on memory usage for PHP script.

    - by Jess Telford
    The Situation I am having an issue with a PHP script getting the following error message: Fatal error: Out of memory (allocated 359923712) (tried to allocate 72 bytes) in /path/to/piwik/core/DataTable.php on line 969 The script I'm running is: /path/to/piwik/misc/cron/archive.sh I am assuming the numbers are Bytes, which means that total is approximately 360MB. For all intents and purposes, I have increased the memory limits on the server well above 360MB, yet this is the number (give or take a byte) it consistently errors out at. Please note: This question is not about fixing a memory leak in the script, nor about why the script itself is using so much memory. The script is part of the Piwik archiving process, so I cannot just fix any memory leaks, etc. For more info on this script and why I am increasing the memory limit, see "How to setup auto archiving" The question Given that the script is attempting to use over 360MB of memory, which I cannot change, why does it not seem possible for me to increase the amount of memory available to php on my server? What I've tried Increasing PHP's memory_limit Given the php.ini file: php -i | grep php.ini Configuration File (php.ini) Path => /usr/local/lib Loaded Configuration File => /usr/local/lib/php.ini I have edited that file, so the memory_limit directive reads; memory_limit = -1 Restart Apache, and check the new value has stuck; $ php -i | grep memory_limit memory_limit => -1 => -1 Run the script, and get the same error. I've also tried 1G, 768M, etc, all to the same result (ie; no change). Update 22nd June: Based on Vangel's help, I have attempted to set post_max_size to 20M in combination with setting memory_limit. Again, this has no effect. Removing the memory limit on child processes of Apache I have found and edited the httpd.conf file to make sure there is no RLimitMEM directive. I then used WHM's Apache Configuration Memory Usage Restrictions to generate a restriction, which it claimed was at 1000M (and confirmed by checking httpd.conf). Both of these resulted in no change to the script erroring at 360MB. Increasing the per process memory limits of Linux The current limits set on the system: $ ulimit -m 524288 $ ulimit -v 524288 I have attempted to set both of these to unlimited: $ ulimit -m unlimited $ ulimit -v unlimited $ ulimit -m unlimited $ ulimit -v unlimited Once again, this has resulted in absolutely no improvement in my problem. My setup $ cat /etc/redhat-release CentOS release 5.5 (Final) $ uname -a Linux example.com 2.6.18-164.15.1.el5 #1 SMP Wed Mar 17 11:30:06 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux $ php -i | grep "PHP Version" PHP Version => 5.2.9 $ httpd -V Server version: Apache/2.0.63 Server built: Feb 2 2011 01:25:12 Cpanel::Easy::Apache v3.2.0 rev5291 Server's Module Magic Number: 20020903:13 Server loaded: APR 0.9.17, APR-UTIL 0.9.15 Compiled using: APR 0.9.17, APR-UTIL 0.9.15 Architecture: 64-bit Server compiled with.... -D APACHE_MPM_DIR="server/mpm/prefork" -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) -D APR_USE_SYSVSEM_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D HTTPD_ROOT="/usr/local/apache" -D SUEXEC_BIN="/usr/local/apache/bin/suexec" -D DEFAULT_PIDLOG="logs/httpd.pid" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_LOCKFILE="logs/accept.lock" -D DEFAULT_ERRORLOG="logs/error_log" -D AP_TYPES_CONFIG_FILE="conf/mime.types" -D SERVER_CONFIG_FILE="conf/httpd.conf" Output of $ php -i: http://pastebin.com/EiRut6Nm

    Read the article

< Previous Page | 77 78 79 80 81 82 83 84 85 86 87 88  | Next Page >