Search Results

Search found 45255 results on 1811 pages for 'php connect'.

Page 95/1811 | < Previous Page | 91 92 93 94 95 96 97 98 99 100 101 102  | Next Page >

  • How to connect to the database in Magento?

    - by Click Upvote
    I'm trying to build a simple Magento Module that needs to connect to the database at the start of each page request. All tables need to be accessible to it. I've been pulling my hair out trying to understand how to do it. The best I could figure out was that I need to set this in the config.xml file of my module, but exactly what that command is/how it may be used, i haven't been able to figure out. Can someone please guide me or show me how to accomplish this? If not, would it be too bad a practice to include a custom config.php file which connects to the database manually?

    Read the article

  • Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

    - by Fotis
    I am a newbie programmer, so I will need your help! Locally the webapp works ok with the db on it! When I uploaded the application on the cloudcontrol, it comes up with the following error: CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)! I suppose I have not uploaded the db. This is the very first time I upload a webapp on a server so I do not know the exact steps that I have to follow in order to upload the db on a server. Cloudcontrol has documentation about mysql! I did follow the steps but the webapp comes with the same error! Could you please tell me what steps I have to follow in order to make it working? I am sure that this error is due to lack of knowledge!

    Read the article

  • Connect android to database

    - by danny
    I am doing a school project where we need to create an android application which needs to connect to a database. the application needs to gain and store information for people's profiles on the database. But unfortunatly we are a little bit stuck at this point because there are numerous ways to link the application such as http request through apache or through the SOAP/REST protocol. But it's really hard to find good instructions or tutorials on the problem since I can't really find them. Maybe that's cause i'm probably using the wrong words on google. Unfortunately I have little relevant information. So if anyone can help me with finding relevant links to good online tutorials or howto's than those are very welcome.

    Read the article

  • Facebook connect access_token

    - by Guillaume Santacruz
    Hi i ve got the same issue than this guy: Acces token from facebook is not retrived for sign up? access_token (trying to get propert of non object ) Apparently he found a solution but I do not clearly understand it. Just need you help to understand what should i do. Problem is access_token trying to get property of a non object when i try to log in with facebook connect. the solution I don't understand is this one. "Its was an database error due to session have not created due to facebook app not live."

    Read the article

  • What is corret way to connect to MySQL?

    - by sky
    what is the correct way to connect to MySQL database without the mysql_fetch_assoc() error? Getting [Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource] with mysql_connect('localhost', 'name', 'pass'); mysql_select_db('dbname'); getting mysql_fetch_assoc() error without mysql_select_db any suggest? CODE are: $result= mysql_query('SELECT DISTINCT username FROM users'); $somethings= array(); while ($row= mysql_fetch_assoc($results)) { $somethings[]= $row['something']; } ? var somethings= ;

    Read the article

  • How does PHP5 fare with the earlier versions of the language

    - by Pankaj Upadhyay
    Many times, I like to learn PHP for web development but been drawn back due to comments like the following :- (Comments are just for reference and does not invite Flame-war) "PHP is good but generates spaghetti code" "PHP is nice but Python is marriage material" "PHP lags stuff that you get in other languages like C# or JAVA" But for PHP5 i have seen some promising comments. So, What my question is how does PHP5 fare with the earlier versions of the language and is it good enough now to learn for web development. NOTE:- No comparison of PHP with other languages is sorted here. Please comment just on PHP and it's comparison with itself

    Read the article

  • Apple pushnotification [closed]

    - by VIVEK
    I have a PHP script located in path like /var/www/vhosts/hostname/httpdocs/webservices, I have both PHP script and .pem files there, and I have called the .pem file in the script properly, but still when I run the script , I don't get push notification , instead i get warnings such as: Warning: stream_socket_client() [function.stream-socket-client]: Unable to set local cert chain file `ck_push_test.pem'; Check that your cafile/capath settings include details of your certificate and its issuer in /var/www/vhosts/ipartyapps.com/httpdocs/webservices/testPush.php on line 12 Warning: stream_socket_client() [function.stream-socket-client]: failed to create an SSL handle in /var/www/vhosts/ipartyapps.com/httpdocs/webservices/testPush.php on line 12 Warning: stream_socket_client() [function.stream-socket-client]: Failed to enable crypto in /var/www/vhosts/ipartyapps.com/httpdocs/webservices/testPush.php on line 12 Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to ssl://gateway.push.apple.com:2195 (Unknown error) in /var/www/vhosts/ipartyapps.com/httpdocs/webservices/testPush.php on line 12 Failed to connect 0 I double checked everything path, permissions and owner/group of both script and .pem files, still not getting push notification. Any suggestions please, as it's urgent.

    Read the article

  • Best way to trigger editing and dynamically show editing features? [on hold]

    - by Tim Marshall
    Page In Question: http://rafflebananza.com/admin/StatisticalData/expenses/expenses.html Hiya Everyone, On my page, I have an 'Actions' drop down to the top-right hand side of the page. This actions drop down I would like to have an action to 'Enable Editing'. Upon clicking to enable editing, I would like a PHP variable modified from 'EnableEditing = false' to 'EnableEditing = true'. Why I would like to use PHP maybe questionable, here is why I would like to use PHP under my understanding to clarify; Sections on my page will show to different administrators depending on their level. Upon enabling editing mode, certain contents will then dynamically. <?php if ($_SESSION['user_level_status'] < 2) { if ($editing = enabled) { show this } else { show this } } ?> Something similar to this, I'm new at PHP so this may look incorrect. The question really is, is PHP the correct language to use to trigger editing and how can I do this please? Best Regards, Tim

    Read the article

  • I am trying to link my php form and my sql but having difficulties

    - by user1912599
    I am not sure what I am doing wrong as far as my php goes but I can't get my form to link with my sql. Here are the codes for my form and php code for my link to sql <?php echo displayform(); function displayForm() { $r = ''; //build it $r .='<form action="database.php" method="post">'; //table $r .=displayNiceFormBegin(); $r .=displayRow('FirstName:', '<input type="text" name="fname" id="fname"/>'); $r .=displayRow('LastName:', '<input type="text" name="lname" id="lname"/>'); $r .=displayRow('Address:', '<input type="text" name="address" id ="address"/>'); $r .=displayRow('Phone:', '<input type="text" name="phone" id ="phone"/>'); $r .=displayRow('Deparment:', '<input type="text" name="department"id="department"/>'); $r .=displayRow('', '<input type="submit" value="Submit Registration" />'); $r .=displayNiceFormEnd(); $r .='</form>'; return $r; } function displayRow($left, $right) { $r .= ''; //build it $r .='<tr>'; $r .= '<td>' . $left . '</td>'; $r .= '<td>' . $right . '</td>'; $r .='</tr>'; return $r; } function displayNiceFormBegin(){ $r .=''; //build it $r .= '<table style="background-color: beige; border: 1px dashed #999"><tr><td>'; $r .='<table style="margin:10px">'; return $r; } function displayNiceFormENd() { $r .=''; //build it $r .='</table>'; $r .='</td></tr><table>'; return $r; } ?> <?php $host="localhost"; // Host name $username="695788_ogems"; // Mysql username $password="opd69715"; // Mysql password $db_name="ottawaglandorfems_zzl_ogems"; // Database name $tbl_name=".*"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // Get values from form $fname=$_POST['fname']; $lname=$_POST['lname']; $address=$_POST['address']; $phone=$_POST['phone']; $department=$_POST['deparment']; // Insert data into mysql $sql="INSERT INTO $tbl_name(FirstName,LastName,Address,Phone,Department)VALUES('$fname', '$lname', '$address','$phone','$deparment')"; $result=mysql_query($sql); // if successfully insert data into database, displays message "Successful". if($result){ echo "Successful"; echo "<BR>"; echo "<a href='ottawa-glandorfems.org/form3.php'>Back to main page</a>"; } else { echo "ERROR"; } ?> <?php // close connection mysql_close(); ?> I keep getting an error. Thank you!!!!

    Read the article

  • php variable scope in oop

    - by mr o
    Hi, I wonder if anyone can help out here, I'm trying to understand how use an objects properties across multiple non class pages,but I can't seem to be able to get my head around everything i have tried so far. For example a class called person; class person { static $name; } but i have a number of different regular pages that want to utilize $name across the board. I have trying things like this; pageone.php include "person.php"; $names = new Person(); echo person::$name; names::$name='bob'; pagetwo.php include "person.php"; echo person::$name; I can work with classes to the extent I'm OK as long as I am creating new instances every page, but how can make the properties of one object available to all, like a shared variable ? Thanks

    Read the article

  • PHP invalid image's and error handling

    - by Emdiesse
    Using PHP's Image and GD functions you can use the following method to finally output the php image imagepng($image); Sometimes, for whatever reason the image may not be displayed typically the error is not with the image but with the actual php functions not executing successfully. However this causes a blank image to be returned which doesn't help me. What I want to know is, is there a way to detect a blank or an invalid image and create a new image, write the errors to the new image using imagestring() and then display this new (debug) image instead. for example, a successfully displayed image with no errors: $image = imagecreate(256, 256); //create image imagecolortransparent($image, $BLUE); //set transparent imagefilledrectangle($image, 0, 0, 256, 256, $BLUE); //fill with 'transparent colour' //Draw a border round the image imageline($image, 0, 0, 0, 255, $Black); imageline($image, 0, 0, 255, 0, $Black); imageline($image, 255, 0, 255, 255, $Black); imageline($image, 0, 255, 255, 255, $Black); imagestring($image, 1, 10, 10, "I am an image!", $Black); imagepng($image); imagedestroy($image); but if I then introduce some errors in the php script that may or may not be to do with the actual image creation then the php script fails and the image will not be visible... $image = imagecreate(256, 256); //create image imagecolortransparent($image, $BLUE); //set transparent imagefilledrectangle($image, 0, 0, 256, 256, $BLUE); //fill with 'transparent colour' //Draw a border round the image imageline($image, 0, 0, 0, 255, $Black); imageline($image, 0, 0, 255, 0, $Black); imageline($image, 255, 0, 255, 255, $Black); imageline($image, 0, 255, 255, 255, $Black); imagestring($image, 1, 10, 10, "I am an image!", $Black); /* I am here to cause problems with the php script ** and cause the execution to fail, I am a function ** that does't exist... ** ** and I am missing a semi colon! ;)*/ non_existant_function() imagepng($image); imagedestroy($image); At this point I want to create a new image like above but in replacement of the I am an image! text I would put the actual error that has occured.

    Read the article

  • Calling Msbuild from Php - Wrong Codepage and Culture

    - by miasbeck
    I have a Php script that calls Msbuild via System: <?php system( "msbuild umlaut.proj" ); ?> This is the project file: <?xml version="1.0" encoding="UTF-8"?> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="EchoUmlaut" ToolsVersion="3.5"> <Target Name="EchoUmlaut"> <Message Text="Umlaute: Ä Ö Ü ä ö ü ß" /> </Target> </Project> When I call Msbuild directly from the command line the output of msbuild is in German (as excpected) and the umlauts come out OK (I chcp to 1252). But when I use php to call msbuild the umlauts are wrong, and the output of msbuild is changed to English. I wonder what I can do to prevent this. C:\>chcp Aktive Codepage: 1252. C:\>msbuild umlaut.proj Microsoft (R)-Buildmodul, Version 3.5.30729.1 [Microsoft .NET Framework, Version 2.0.50727.3607] Copyright (C) Microsoft Corporation 2007. Alle Rechte vorbehalten. Das Erstellen wurde am 13.04.2010 08:57:04 gestartet. Projekt "D:\Cvsroot\projekte\e4elaui\v1.0\umlaut.proj" auf Knoten 0 (Standardziele). Umlaute: Ä Ö Ü ä ö ü ß Die Erstellung von Projekt "D:\Cvsroot\projekte\e4elaui\v1.0\umlaut.proj" ist abgeschlossen (Standardziele). Das Erstellen war erfolgreich. 0 Warnung(en) 0 Fehler Vergangene Zeit 00:00:00 C:\>php call_from_php.php Microsoft (R) Build Engine Version 3.5.30729.1 [Microsoft .NET Framework, Version 2.0.50727.3607] Copyright (C) Microsoft Corporation 2007. All rights reserved. Build started 13.04.2010 08:57:11. Project "D:\Cvsroot\projekte\e4elaui\v1.0\umlaut.proj" on node 0 (default targets). Umlaute: Ž ™ š „ ” á Done Building Project "D:\Cvsroot\projekte\e4elaui\v1.0\umlaut.proj" (default targets). Build succeeded. 0 Warning(s) 0 Error(s) Time Elapsed 00:00:00

    Read the article

  • How often are design patterns used in the workplace using PHP

    - by Metropolis
    Hey everyone, I read a book awhile back called PHP Design Patterns and Practice, and ever since then I have been using design patterns whenever I think they are needed. However it just occurred to me that maybe most companies do not use design patterns very often for PHP, or at all. What I was wondering is, do most companies use design patterns to help improve code flexibility? And if so, what are the best design patterns to learn for PHP? Thanks for any help on this, Metropolis

    Read the article

  • php imap get connection failed error

    - by Bharanikumar
    Warning: imap_open() [function.imap-open]: Couldn't open stream {imap.gmail.com:993/imap/ssl}INBOX in /home/happy/public_html/source/imap/fet_mail_from_email_add.php on line 7 can't connect: Can't connect to gmail-imap.l.google.com,993: Connection timed out my snippet is $mbox = imap_open("{imap.gmail.com:993/imap/ssl}INBOX", "[email protected]","somesecretpassword") or die("can't connect: " . imap_last_error());

    Read the article

  • how to install posix in php

    - by Nizzy
    posix does not appear when I run php -m cmd, however, I see it from the phpinfo() –enable-posix=shared on Linux with Plesk 9. Basically, I can't use posix_*() functions as described at http://www.php.net/manual/en/ref.posix.php this shows doesn't exists: if (function_exists(‘posix_getuid’)) { echo “posix_getuid available”; } else { echo “posix_getuid not available”; // this prints in my server. } could someone show me how to install it? thank you [PHP Modules] bz2 calendar ctype curl date dbase dom exif fileinfo filter ftp gd geoip gettext gmp hash iconv imap ionCube Loader json libxml mbstring mcrypt memcache mhash mysql mysqli openssl pcntl pcre PDO pdo_mysql pdo_sqlite readline Reflection session shmop SimpleXML sockets SPL sqlite standard tokenizer wddx xml xmlreader xmlwriter xsl zip zlib

    Read the article

  • Text mining with PHP

    - by garyc40
    Hi, I'm doing a project for a college class I'm taking. I'm using PHP to build a simple web app that classify tweets as "positive" (or happy) and "negative" (or sad) based on a set of dictionaries. The algorithm I'm thinking of right now is Naive Bayes classifier or decision tree. However, I can't find any PHP library that helps me do some serious language processing. Python has NLTK (http://www.nltk.org). Is there anything like that for PHP? I'm planning to use WEKA as the back end of the web app (by calling Weka in command line from within PHP), but it doesn't seem that efficient. Do you have any idea what I should use for this project? Or should I just switch to Python? Thanks

    Read the article

  • PHP - can a method return a pointer?

    - by Kerry
    I have a method in a class trying to return a pointer: <?php public function prepare( $query ) { // bla bla bla return &$this->statement; } ?> But it produces the following error: Parse error: syntax error, unexpected '&' in /home/realst34/public_html/s98_fw/classes/sql.php on line 246 This code, however, works: <?php public function prepare( $query ) { // bla bla bla $statement = &$this->statement; return $statement; } ?> Is this just the nature of PHP or am I doing something wrong?

    Read the article

  • Twitter Oauth home timeline display with php

    - by Srinivas Tamada
    $hometime= $Twitter-get_statusesHome_timeline(); Fatal error: Uncaught exception 'Exception' with message 'SimpleXMLElement::__construct() expects parameter 1 to be string <?php include 'EpiCurl.php'; include 'EpiOAuth.php'; include 'EpiTwitter.php'; include 'key.php'; $Twitter = new EpiTwitter($consumerKey, $consumerSecret); $oauthToken='xxxxxxxxxxxxxxxxxxxxxxx'; $oauthSecret='xxxxxxxxxxxxxxxxxxxxxxxxx'; // user switched pages and came back or got here directly, stilled logged in $Twitter->setToken($oauthToken,$oauthSecret); $user= $Twitter->get_accountVerify_credentials(); echo "<img src=\"{$user->profile_image_url}\">"; echo "{$user->name}"; $hometime= $Twitter->get_statusesHome_timeline(); $twitter_status = new SimpleXMLElement($hometime); foreach($twitter_status->status as $status){ echo '<div class="twitter_status">'; foreach($status->user as $user){ echo '<img src="'.$user->profile_image_url.'" class="twitter_image">'; echo '<a href="http://www.twitter.com/'.$user->name.'">'.$user->name.'</a>: '; } echo $status->text; echo '<br/>'; echo '<div class="twitter_posted_at"><strong>Posted at:</strong> '.$status->created_at.'</div>'; echo '</div>'; } ?>

    Read the article

  • Intercept page request behind firewall return altered content with php and apache

    - by Matthew
    I'm providing free wifi service and need an ad to be added to all page requests. Currently I have a router forwarding all http requests to an apache server, which redirects all requests to an index.php page. The index.php page reads the request, fetches the content from the appropriate site, and edits the content to include the ad. The problem is that all images and css files etc. cannot be accessed, because when the browser tries to get the image <img src="site.com/image.jpg"> it's just redirected back to the index.php. I can change settings for the router (running dd-wrt) and the webserver (apache2 and php 5.2). Is there a solution that allows content to be edited before returning to the client, and allows css and images to be accessed?

    Read the article

  • Inversion of Control Container for PHP?

    - by George Mauer
    I am trying to code TDD style in PHP and one of my biggest stumbling blocks (other than lack of a decent IDE) is that I have to make my own hacked together IoC container just to inject all my mock objects properly. Has anyone used an Ioc container in php? All I've been able to find is PHP IOC on the ever-annoying phpclasses.org and it seems to have almost no documentation and not much of a following.

    Read the article

  • Trying to connect to QuickBooks via Web Connect in asp.net

    - by ile
    I don't know if any of you have had experience with QuickBooks integration, but I have to try :) I downloaded QuickBooks Free Simple Start, Quickbooks Web Connector and Web Service sample code ... I've read Web Connector manual and followed instructions but, when using authenticate function, I always get error "nvu", meaning that username or password are not valid. Following instructions, I added this QWC file to QBWC: <?xml version="1.0"?> <QBWCXML> <AppName>My application</AppName> <AppID></AppID> <AppURL>http://localhost/QBWC/Service1.asmx</AppURL> <AppDescription>My application web service</AppDescription> <AppSupport>http://localhost/QBWC/Service1.asmx?wsdl</AppSupport> <OwnerID>{87EDAAF8-637E-4203-867F-4BA79C2F8998}</OwnerID> <FileID>{CA1C3EB8-1B61-4747-A743-8D5B438B83AC}</FileID> <UserName>test</UserName> <QBType>QBFS</QBType> <Style>Document</Style> <AuthFlags>0xF</AuthFlags> </QBWCXML> After adding this this file to QBWC, I also added password "1234". After that, I opened my web service: http://localhost/WCWebService/WCWebService.asmx?op=authenticate and in field "strUserName" entered "test", in field "strPassword" entered: "1234". But "nvu" is always returned as a result. If someone is familiar with this I would appreciate for help!

    Read the article

  • Convert old NuSoap code into PHP core soap functions

    - by Enrique
    Hi I've been testing nuSoap with codeIgniter (PHP Framework) but seems nuSoap isn't prepared to work with latest php 5.3, even if I download a patched nusoap version for php 5.3 I have the following code: require_once(APPPATH.'libraries/NuSOAP/lib/nusoap'.EXT); //includes nusoap $n_params = array('CityName' => 'San Juan', 'CountryName' => 'Argentina'); $client = new nusoap_client('http://www.webservicex.net/globalweather.asmx?WSDL'); $client->setHTTPProxy("10.2.0.1",6588,"",""); $result = $client->call('GetWeather', $n_params); Can any1 help me to convert these functions into php soap functions? Including proxy function? Thanks a lot

    Read the article

  • Salesforce/PHP - outbound messages (SOAP) - memory limit issue

    - by Phill Pafford
    I'm using Salesforce to send outbound messages (via SOAP) to another server. The server can process about 8 messages at a time, but will not send back the ACK file if the SOAP request contains more than 8 messages. SF can send up to 100 outbound messages in 1 SOAP request and I think this is causing a memory issue with PHP. If I process the outbound messages 1 by 1 they all go through fine, I can even do 8 at a time with no issues. But larger sets are not working. ERROR in SF: org.xml.sax.SAXParseException: Premature end of file Looking in the HTTP error logs I see that the incoming SOAP message looks to be getting cut of which throws a PHP warning stating: Premature end of data in tag ... PHP Fatal error: Call to a member function getAttribute() on a non-object This leads me to believe that PHP is having a memory issue and can not parse the incoming message due to it's size. I was thinking I could just set: ini_set('memory_limit', '64M'); But would this be the correct approach? Is there a way I could set this to increase with the incoming SOAP request dynamically? UPDATE: Adding some code $data = fopen('php://input','rb'); $headers = getallheaders(); $content_length = $headers['Content-Length']; $buffer_length = 1000; $fread_length = $content_length + $buffer_length; $content = fread($data,$fread_length); /** * Parse values from soap string into DOM XML */ $dom = new DOMDocument(); $dom->loadXML($content); ....

    Read the article

< Previous Page | 91 92 93 94 95 96 97 98 99 100 101 102  | Next Page >