Search Results

Search found 1909 results on 77 pages for 'die'.

Page 45/77 | < Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >

  • PHP comparion doesnt work..why?

    - by user248959
    Hi, i have this code: $password_introducido = sfContext::getInstance()->getUser()->getGuardUser()->setPassword($value['password_actual']); $password_almacenado = sfContext::getInstance()->getUser()->getGuardUser()->getPassword(); var_dump("kfjsdlkjf"); var_dump($password_almacenado); var_dump($password_almacenado); if($password_introducido == $password_almacenado){ die("entrosopi"); } that prints this: string 'kfjsdlkjf' (length=9) string 'c9c40d11b29ac0f5bdef3be51ce61187582c3ae1' (length=40) string 'c9c40d11b29ac0f5bdef3be51ce61187582c3ae1' (length=40) IMHO, it should print "entrosopi", but it doesnt. Why? If i instead write if(!$password_introducido == $password_almacenado) it prints "entrosopi". Javi

    Read the article

  • How does opendir work in Perl 6?

    - by sid_com
    Hello! Can someone tell me, why the "opendir" doesn't work? #!/usr/bin/env perl6 use v6; my $file = 'Dokumente/test_file'; if ( my $fh = open $file, :r ) { for $fh.lines -> $line { say $line; } } else { say "Could not open '$file'"; } my $dir = 'Dokumente'; my $dh = opendir $dir err die "Could not open $dir: $!"; Output: Hello, World! Line 2. Last line. Could not find non-existent sub &opendir current instr.: '_block14' pc 29 (EVAL_1:0) called from Sub '!UNIT_START' pc 1163 (src/glue/run.pir:20) called from Sub 'perl6;PCT;HLLCompiler;eval' pc -1 ((unknown file):-1) called from Sub 'perl6;PCT;HLLCompiler;evalfiles' pc 1303 (compilers/pct/src/PCT/HLLCompiler.pir:707) called from Sub 'perl6;PCT;HLLCompiler;command_line' pc 1489 (compilers/pct/src/PCT/HLLCompiler.pir:794) called from Sub 'perl6;Perl6;Compiler;main' pc -1 ((unknown file):-1)

    Read the article

  • the query is breaking. How to skip rows PHP

    - by Victor
    Hello all. I have a question probably lame but it made me stuck I have the a db query $query_Recordset10 = "SELECT * FROM products WHERE razdel='mix' AND ID='$ID+1' AND litraj='$litri' ORDER BY ID ASC"; $Recordset10 = mysql_query($query_Recordset10, $victor) or die(mysql_error()); $row_Recordset10 = mysql_fetch_array($Recordset10); $totalRows_Recordset10 = mysql_num_rows($Recordset10); This is the query for the next product in the line based in the ID of the current product thats on the page. But if the next product matching the criteria in the query is 2 or more ID's ahead my cycle breaks. So is there a way for skipping this rows and get the next ID matching the criteria. Thank you very much.

    Read the article

  • weakref list in python

    - by Dan
    I'm in need of a list of weak references that deletes items when they die. Currently the only way I have of doing this is to keep flushing the list (removing dead references manually). I'm aware there's a WeakKeyDictionary and a WeakValueDictionary, but I'm really after a WeakList, is there a way of doing this? Here's an example: import weakref class A(object): def __init__(self): pass class B(object): def __init__(self): self._references = [] def addReference(self, obj): self._references.append(weakref.ref(obj)) def flush(self): toRemove = [] for ref in self._references: if ref() is None: toRemove.append(ref) for item in toRemove: self._references.remove(item) b = B() a1 = A() b.addReference(a1) a2 = A() b.addReference(a2) del a1 b.flush() del a2 b.flush()

    Read the article

  • PHP: How to use mysql fulltext search and handle fulltext search result

    - by garcon1986
    Hello, I have tried to use mysql fulltext search in my intranet. I wanted to use it to search in multiple tables, and get the independant results depending on tables in the result page. This is what i did for searching. $query = " SELECT * FROM testtable t1, testtable2 t2, testtable3 t3 WHERE match(t1.firstName, t1.lastName, t1.details) against(' ".$value."') or match(t2.others, t2.information, t2.details) against(' ".$value."') or match(t3.other, t2.info, t2.details) against(' ".$value."') "; $result = mysql_query($query)or die('query error'.mysql_error()); while($row = mysql_fetch_assoc($result)){ echo $row['firstName']; echo $row['lastName']; echo $row['details'].'<br />'; } Do you have any ideas about optimizing the query and format the output of search results?

    Read the article

  • Perl open call failing.

    - by benjamin button
    I am new to perl coding. I am facing a problem while executing a small script i have: open is not able to find the file which i am giving as an argument.Please see below: File is available: ls -l DLmissing_months.sql -rwxr-xr-x 1 tlmwrk61 aimsys 2842 May 16 09:44 DLmissing_months.sql My perl script: #!/usr/local/bin/perl use strict; use warnings; my $this_line = ""; my $do_next = 0; my $file_name = $ARGV[0]; open( my $fh, '<', '$file_name') or die "Error opening file - $!\n"; close($fh); executing the perl script : > new.pl DLmissing_months.sql Error opening file - No such file or directory what is the problem with my perl script.

    Read the article

  • Adding LDAP OU using Net::LDAP

    - by lupindeterd
    What is the correct syntax of adding an OU using Net::LDAP, I tried the following: #!/usr/bin/perl -w use 5.10.1; use strict; use Net::LDAP; use Data::Dumper; my $ldap = Net::LDAP->new("192.168.183.2") or die "$@"; my $mesg = $ldap->bind( "cn=admin,dc=lab,dc=net", password => 'xxx' ); $mesg = $ldap->add( "ou=Users,dc=lab,dc=net", attrs => [ 'ou' => 'dc=Users', 'objectClass' => [ 'top', 'organizationalUnit' ] ] ); say $mesg->error; say $mesg->code; And got the following error: value of naming attribute 'ou' is not present in entry 64 However using the ldapmodify command line, and using this following ldif, works: dn: ou=Users,dc=lab,dc=net changetype: add objectclass: top objectclass: organizationalUnit ou: Users

    Read the article

  • How can I run a command on a remote machine with Perl?

    - by Bharath Kumar
    I'm using following code to connect to a remote machine and try to execute one simple command on remote machine. cat tt.pl #!/usr/bin/perl #use strict; use warnings; use Net::Telnet; $telnet = new Net::Telnet ( Timeout=>2, Errmode=>'die'); $telnet->open('172.168.12.58'); $telnet->waitfor('/login:\s*/'); $telnet->print('admin'); $telnet->waitfor('/password:\s*/'); $telnet->print('Blue'); #$telnet->cmd('ver > C:\\log.txt'); $telnet->cmd('mkdir gy'); You have new mail in /var/spool/mail/root [root@localhost]# But when I'm executing this script it is throwing error messages [root@localhost]# perl tt.pl command timed-out at tt.pl line 12 [root@localhost]# Please help me in this

    Read the article

  • Function returns CSV File: How to go about checking it ?

    - by Rachel
    I am doing something like: $outputFile = getCurrentDBSnapshot($data); where $data is the resource stream that am passing in, basically from command prompt am passing an file and am opening it using fopen for writing with 'w+' permissions, now getCurrentDBSnapshot would get the current state of a table and would update the $data csv file, so basically $outputFile would be updated with the current state of database table, now I want to var_dump or print the value of $outputFile to see the data present into it. But when I do $this->fout = fopen($outputFile,'r') or die('Cannot open file'); $test = fgetcsv($outputFile,5000,":"); var_dump($test); It gives me an error saying that it expects parameter 1 to be a string type and am passing resource. My goal to see the contains of $outputFile and so my question is that How can I see the contains present in $outputFile or how can I see what getcurrentDBSnapshot function is returning me ?

    Read the article

  • I would like to build an app that alerts me when road traffic is high or low. Where can I get the r

    - by MedicineMan
    I'm sitting at work, waiting for traffic to die down. The thought occurred to me. I know when I want to go home, why don't I have an app that watches traffic for me? I also know that there are a lot of smart people on stackoverflow. Where can I get live traffic data for the san francisco bay area region? The data source should be timely, accurate, and as high resolution as possible. I would like to build an app on top of a service, rather than watch google maps or watch another website. I would prefer that I not have to scrape the data, but I have been know to do this in the past when no other option exists.

    Read the article

  • unexpected T_TRY, expecting T_FUNCTION error message, not sure why ?

    - by Rachel
    I am getting unexpected T_TRY, expecting T_FUNCTION error message and am not sure as too why am getting that, can't we use try and catch block inside class like this: class Processor { protected $dao; protected $fin; try { public function __construct($file) { //Open File for parsing. $this->fin = fopen($file,'w+') or die('Cannot open file'); // Initialize the Repository DAO. $this->dao = new Dao('some name'); } public function initiateInserts() { while (($data=fgetcsv($this->fin,5000,";"))!==FALSE) { $initiate_inserts = $this->dao->initiateInserts($data); } } public function initiateCUpdates() { while (($data=fgetcsv($this->fin,5000,";"))!==FALSE) { $initiate_updates = $this->dao->initiateCUpdates($data); } } public function initiateExecuteIUpdates() { while (($data=fgetcsv($this->fin,5000,";"))!==FALSE) { $initiate_updates = $this->dao->initiateIUpdates($data); } } } catch (Exception $e) { } }

    Read the article

  • Header already sent error in PHP joomla

    - by Leo
    hi all, $dbhost = 'localhost'; $dbuser = 'EhpEngineUser'; $dbpass = 'password'; $conn = mysql_pconnect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); $dbname = 'joomladb'; mysql_select_db($dbname); // include 'config.php'; // include 'opendb.php'; above code works fine, if i comment DB connection part and inculde config.db and Opendb, then i get the error as Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\Joomla\Config.php:8) in C:\xampp\htdocs\Joomla\ConfXml.php on line 103 Both file are used for opening DB only. regards, Leo

    Read the article

  • PHP SQL Server Connection

    - by ajithperuva
    I am using SQL Server as my backend for program.when i am try to connect with database which not shows any type of errors,but it is not working.Which is not getting connection. My code is like mssql_connect('servername', 'db_user', 'db_password') or die('Error'); The funny thing is which is not connecting and also which is not show message Error. How can we enable SQL Server configuration using php program (what is the script for that.not manually). How could we know the actual status of SQL Server in server? My application is working properly in local;the problem is about public hosting.

    Read the article

  • How to avoid duplication entry via form into database

    - by DAFFODIL
    <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("form", $con); $reb = "select count(*) from customer where name = '$name';" if (mysql_result($reb,0) > 0) { echo "Item Already Added!<br>"; } else { // add the item } mysql_close($con); header( 'Location: http://localhost/cus.php' ); ?> Parse error: parse error in C:\wamp\www\c.php on line 10

    Read the article

  • do while is breaking. How to skip rows PHP

    - by Victor
    Hello all. I have a question probably lame but it made me stuck I have the a db query $query_Recordset10 = "SELECT * FROM products WHERE razdel='mix' AND ID='$ID+1' AND litraj='$litri' ORDER BY ID ASC"; $Recordset10 = mysql_query($query_Recordset10, $victor) or die(mysql_error()); $row_Recordset10 = mysql_fetch_array($Recordset10); $totalRows_Recordset10 = mysql_num_rows($Recordset10); I have do while loop in my page and the idea i to show products matching this criteria. But if the next product is 2 or more ID's ahead my cycle breaks. So is there a way for skipping this row and get the next ID matching the criteria. Thank you very much.

    Read the article

  • Not able to open a file in php

    - by ehsanul
    The following code works when invoking through the command line with php -f test.php, from root. It does not work though when being invoked via apache when loading the php page. The code chokes at fopen() and the resulting web page just says "can't open file". <?php $fp = fopen("/path/to/some_file.txt","a") or die("can't open file"); fwrite($fp,"some text"); fclose($fp); ?> I tried to play with the file permissions, but to no avail. I changed the user/group with chown apache:apache test.php and changed permissions with chmod 755 test.php. Here is the relevant result of ls -l /path/to/some_file.txt: -rwxr-xr-x 1 apache apache 0 Apr 12 04:16 some_file.txt

    Read the article

  • perl split on empty file

    - by Casey
    I have basically the following perl I'm working with: open I,$coupon_file or die "Error: File $coupon_file will not Open: $! \n"; while (<I>) { $lctr++; chomp; my @line = split/,/; if (!@line) { print E "Error: $coupon_file is empty!\n\n"; $processFile = 0; last; } } I'm having trouble determining what the split/,/ function is returning if an empty file is given to it. The code block if (!@line) is never being executed. If I change that to be if (@line) than the code block is executed. I've read information on the perl split function over at http://perldoc.perl.org/functions/split.html and the discussion here about testing for an empty array but not sure what is going on here. I am new to Perl so am probably missing something straightforward here. Thanks.

    Read the article

  • jQuery - Trigger click event on links with spacebar?

    - by Herb Caudill
    It looks like in most browsers, an <input type="submit"> treats both [spacebar] and [enter] as a click, but an <a> link only treats [enter] as a click. My app uses a number of links formatted to simulate buttons, so a user that is accustomed to tabbing to a button and pressing [spacebar] will be frustrated. This bit of jQuery solves the problem: $("a.Button").die("keypress").live("keypress", function(e) { if (e.which == 32) { $(this).trigger("click"); e.preventDefault(); } }); My question: Is this a reason not to do this? I'm a little reluctant to override the browser's default behavior on something as basic as this, but since I'm already abusing the link tag to make it look like a button, at least this way I'm not violating the user's expectations any further.

    Read the article

  • MySQL query, SUM of multiple colums

    - by Mick
    Hi I have multiple columns in a mySQL table. Three of the columns are named i100s, i60s and i25s and what I want to do is get the sum of all three entries . currently I have this code '$query= "SELECT SUM(i100s),SUM(i60s),SUM(i25s) AS tkit FROM event WHERE acc='100' " ; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_assoc($result) ; $total = $row['tkit'];' But it is not returning the correct result , can anyone help me please ? Thanks Mick

    Read the article

  • Grouping a query with php

    - by Tom Hoad
    Basic question! I have 2 tables FRUIT id | fruit_name ------------------- 1 | Apple 2 | Banana 3 | Carrot VARIETIES id | fk_fruit_id | variety_name --------------------------------------- 1 1 Cox 2 1 Braeburn 3 2 Chester 4 3 Kotaka 5 3 Imperial 6 3 Oneal I'd like to output a list of varieties per fruit e.g. APPLE - Cox, Braeburn BANANA - Chester CARROT - Kotaka, Imperial, Oneal My current code is $query = "SELECT * FROM produce, varieties WHERE produce.id = varieties.fk_fruit_id"; $result = mysql_query($query) or die('Error : ' . mysql_error()); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $produce_fruit_code = $row['fruit_code']; $variety_name = $row['variety_name']; echo $produce_fruit_code.' - '.$variety_name.'<br/>'; } which outputs: Apple - Cox Apple - Braeburn Banana - Chester Carrot - Kotaka Carrot - Imperial Carrot - Oneal Not a million miles away, but still not there. Any help is much appreciated, thanks!

    Read the article

  • Problems in php coding

    - by anwar
    Hi there everyone im new to PHP and Joomla and I have developed a component in Joomla but my code is giving me errors. I have tried to solve the problem but I’am unable to solve it. So can anyone suggest me what is the problem with my code? Thanks in advance. Here are my two files: 1st view.html.php defined('_JEXEC') or die('=;)'); jimport('joomla.application.component.view'); class namnamViewlistrestaurant extends JView { function display($tpl = null) { $item = 'item'; RestUser::RestrictDirectAccess(); //-- Custom css JHTML::stylesheet( 'style.css', 'components/com_namnam/assets/css/' ); $cuisine=Lookups::getLookup('cuisine'); $lists['cuisine'] = JHTML::_('select.genericlist', $cuisine, 'idcuisine[]', 'class="inputbox" size="7"', 'value', 'text', $item->idcuisine); $category=Lookups::getLookup('restcategory'); $lists['category'] = JHTML::_('select.genericlist', $category, 'idcategory[]', 'class="inputbox" multiple="multiple" size="7"', 'value', 'text', $item->idcategory); $items = & $this->get('Data'); $pagination =& $this->get('Pagination'); $lists = & $this->get('List'); $this->assignRef('items', $items); $this->assignRef('pagination', $pagination); $this->assignRef('lists', $lists); parent::display($tpl); }//function }//class And 2nd is listrestaurant.php defined('_JEXEC') or die('=;)'); jimport('joomla.application.component.model'); class namnamModellistrestaurant extends JModel { var $_data; var $_total = null; var $_pagination = null; function __construct() { parent::__construct(); global $mainframe, $option; $limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' ); $limitstart = $mainframe->getUserStateFromRequest( $option.'.limitstart', 'limitstart', 0, 'int' ); $limitstart = ($limit != 0 ? (floor($limitstart / $limit) * $limit) : 0); $this->setState('limit', $limit); $this->setState('limitstart', $limitstart); } function _buildQuery() { $where = array(); $where[]=" idowner=".RestUser::getUserID()." "; if ($this->search) { $where[] = 'LOWER(name) LIKE \''. $this->search. '\''; } $where =( count($where) ) ? ' WHERE ' . implode( ' AND ', $where ) : ''; $orderby = ''; #_ECR_MAT_FILTER_MODEL1_ if (($this->filter_order) && ($this->filter_order_Dir)) { $orderby = ' ORDER BY '. $this->filter_order .' '. $this->filter_order_Dir; } $this->_query = ' SELECT *' . ' FROM #__namnam_restaurants ' . $where . $orderby ; return $this->_query; } function getData() { if (empty($this->_data)) { $query = $this->_buildQuery(); $this->_data = $this->_getList($query, $this->getState('limitstart'), $this->getState('limit')); } return $this->_data; } function getList() { // table ordering $lists['order_Dir'] = $this->filter_order_Dir; $lists['order'] = $this->filter_order; // search filter $lists['search']= $this->search; return $lists; } function getTotal() { // Load the content if it doesn't already exist if (empty($this->_total)) { $query = $this->_buildQuery(); $this->_total = $this->_getListCount($query); } return $this->_total; } function getPagination() { // Load the content if it doesn't already exist if (empty($this->_pagination)) { jimport('joomla.html.pagination'); $this->_pagination = new JPagination($this->getTotal(), $this->getState('limitstart'), $this->getState('limit') ); } return $this->_pagination; } }//class And the errors are: Notice: Trying to get property of non-object in C:\wamp\www\namnam.com\components\com_namnam\views\listrestaurant\view.html.php on line 26 Notice: Trying to get property of non-object in C:\wamp\www\namnam.com\components\com_namnam\views\listrestaurant\view.html.php on line 29 Notice: Undefined property: namnamModellistrestaurant::$search in C:\wamp\www\namnam.com\components\com_namnam\models\listrestaurant.php on line 38 Notice: Undefined property: namnamModellistrestaurant::$filter_order in C:\wamp\www\namnam.com\components\com_namnam\models\listrestaurant.php on line 48 Notice: Undefined property: namnamModellistrestaurant::$search in C:\wamp\www\namnam.com\components\com_namnam\models\listrestaurant.php on line 38 Notice: Undefined property: namnamModellistrestaurant::$filter_order in C:\wamp\www\namnam.com\components\com_namnam\models\listrestaurant.php on line 48 Notice: Undefined property: namnamModellistrestaurant::$filter_order_Dir in C:\wamp\www\namnam.com\components\com_namnam\models\listrestaurant.php on line 76 Notice: Undefined property: namnamModellistrestaurant::$filter_order in C:\wamp\www\namnam.com\components\com_namnam\models\listrestaurant.php on line 77 Notice: Undefined property: namnamModellistrestaurant::$search in C:\wamp\www\namnam.com\components\com_namnam\models\listrestaurant.php on line 80

    Read the article

  • HASH reference error with HTTP::Message::decodable

    - by scarba05
    Hi, I'm getting an "Can't use an undefined value as a HASH reference" error trying to call HTTP::Message::decodable() using Perl 5.10 / libwww installed on Debian Lenny OS using the aptitude package manager. I'm really stuck so would appreciate some help please. Here's the error: Can't use an undefined value as a HASH reference at (eval 2) line 1. at test.pl line 4 main::__ANON__('Can\'t use an undefined value as a HASH reference at enter code here`(eval 2)...') called at (eval 2) line 1 HTTP::Message::__ANON__() called at test.pl line 6 Here's the code: use strict; use HTTP::Request::Common; use Carp; $SIG{ __DIE__ } = sub { Carp::confess( @_ ) }; print HTTP::Message::decodable();

    Read the article

  • PHP MSSql Connection

    - by ajithperuva
    I am usign mssql as my backend for program.when i am try to connect with database which not shows any type of errors,but it is not working.Which is not getting connection. My code is like mssql_connect('localhost', 'db_user', 'db_password') or die('Error'); The funny thing is which is not connecting and also which is not show message Error.Why it is?Anybody can help me...please.... How can we enable mssql configuration using php program(what is the script for that.not manually).How could we know the actual status of mssql in server? Please help me.My application is working properly in local;the problem is about public hosting.

    Read the article

  • Why does HTTP::Message::decodable complain about "Can't use an undefined value as a HASH reference"?

    - by scarba05
    I'm getting a Can't use an undefined value as a HASH reference error trying to call HTTP::Message::decodable() using Perl 5.10 / libwww installed on Debian Lenny OS using the aptitude package manager. I'm really stuck so would appreciate some help please. Here's the error: Can't use an undefined value as a HASH reference at (eval 2) line 1. at test.pl line 4 main::__ANON__('Can\'t use an undefined value as a HASH reference at enter code here`(eval 2)...') called at (eval 2) line 1 HTTP::Message::__ANON__() called at test.pl line 6 Here's the code: use strict; use HTTP::Request::Common; use Carp; $SIG{ __DIE__ } = sub { Carp::confess( @_ ) }; print HTTP::Message::decodable();

    Read the article

  • How can I parse this configuration file format (allowing comments) in Perl?

    - by rockyurock
    I am reading some parameters (from user input) from a .txt file and want to make sure that my script could read it even a space or tab is left before that particular parameter by user. Also if I want to add a comment for each parameter followed by # , after the parameter (e.g 7870 # this is default port number) to let the user know about the parameter How can I achieve it in same file? Right now, I am using split /\|\s/. Code: $data_file="config.txt"; open(RAK, $data_file)|| die("Could not open file!"); @raw_data=<RAK>; @Ftp_Server =split(/\|\s/,$raw_data[32]); config.txt (user input file) PING_TTL | 1 CLIENT_PORT | 7870 FTP_SERVER | 192.162.522.222 Could any body suggest me a robust way to do it? /rocky

    Read the article

< Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >