php,codeigniter,google-api,google-plus,google-appsRelated issues-Collection of common programming errors


  • Webnet
    php
    I have this code and I need to make this work:if ($handle = opendir(“images/”)) { $i=0;while (false !== ($file = readdir($handle))){if ($file != “.” && $file != “..” && $file != “Recursive Dir_Renfiles_dirname-filename.php”) {$filename[$i]=$file;$i++;}}}//print_r($filename);foreach($filename as $filename){$percent = 0.5;// Content typeheader(‘Content-Type: image/jpeg’);// Get new dimensionslist($width, $height) = getimagesize($filename);$new_width = $width * $percent;$new_height

  • Emanuil Rusev
    php function
    In CakePHP there is a (quite fundamental) method called find. Most of the time this method would return an array but if you pass count as the first parameter the method would return a different data type – an integer.The method is allowed to return various data types.Isn’t that bad?

  • jela
    php
    given the following script<?phpini_set(‘display_errors’,’On’); error_reporting(E_ALL);thisisanerror?>I get the expectedNotice: Use of undefined constant error – assumed ‘error’ in /htdocs/test.php on line 8but if I add something to the script<?phpini_set(‘display_errors’,’On’); error_reporting(E_ALL);errorfunction test () {echo(‘test’);}?>I getHTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.Why am

  • Alan Moore
    php regex
    I’m working on a simple project to teach about XSS. I’m trying to make a regex that will catch <script>alert(‘anything’)</script>;I crafted: <script>alert\(\'[\w!@#$%^&*()-=+]+\’\);</script> but when i try to implement it in php I get errors yet when I try it in a regex tool it says it matches my string.Anyone know how to make a regex that works?Thanks

  • Mr Biscuit
    php session variables if-statement phpmyadmin
    I am trying to create a user login page. Upon successful registration admins are assigned a value of “A” in my database and customers a “C”. Upon successful login customers will be directed to one page and admins to another. I created three session variables, their userId, userFName and their userType. I want to create an if statement to check the value of userType and have tried everything but I still get the error message “Parse error: syntax error, unexpected T_ELSE…on line 74”.`//create a

  • Dominic Rodger
    php variables scope
    I have a function with a big hierarchy:function func(){$a= 0; // Here the variable is 0while(…){echo $a; // gives me always 0for(…){if(…){if(…){$num = func3();$a = $num; // this $a does not corrospond to $a in the beginning}}}} }Does anyone know how I can change the value of $a from the nested scopes?

  • skaffman
    php exception-handling
    When throwing a new exception is it best to simply return true if no exception needs to be thrown. Alternatively is it best to return false instead of throwing an exception. Im using php.

  • noloader
    php sqlsrv
    I have experience with mysql databases and have successfully connected to them with a couple dozen projects. Now, I’m having trouble connecting to a SQL Server 2007. This works: <?php phpinfo(); ?> and the sqlsrv and pdo_sqlsrv sections appear on this page. Here’s the code that I’m using to connect: <?php $serverName = “serverName\sqlexpress”; //serverName\instanceName $connectionInfo = array( “Database”=>”dbName”, “UID”=>”userName”, “PWD”=>”password”); $conn = sqlsrv_connect(

  • Chimera
    php function types parameters casting
    This might sound like a silly question to many of you, but it keeps me wondering why PHP does not allow typecasting in its function parameters. Many people use this method to cast into their parameters:private function dummy($id,$string){echo (int)$id.” “.(string)$string }Orprivate function dummy($id,$string){$number=(int)$id;$name=(string)$string;echo $number.” “.$name; }But looking at many other programming languages, they accept typecasting into their function parameters. But doing this in PH

  • Sumurai8
    php apache .htaccess codeigniter error-handling
    My website has been slowed down a little last couple of days. I’ve looked into my error log and found lots of these:[Mon Sep 30 00:09:53 2013] [error] [client 66.249.66.205] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use ‘LimitInternalRecursion’ to increase the limit if necessary. Use ‘LogLevel debug’ to get a backtrace. [Mon Sep 30 00:09:53 2013] [debug] core.c(3120): [client 66.249.66.205] r->uri = /home/mysitecom/domains/mysite.com/public_html/

  • Sumurai8
    php apache .htaccess codeigniter error-handling
    My website has been slowed down a little last couple of days. I’ve looked into my error log and found lots of these:[Mon Sep 30 00:09:53 2013] [error] [client 66.249.66.205] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use ‘LimitInternalRecursion’ to increase the limit if necessary. Use ‘LogLevel debug’ to get a backtrace. [Mon Sep 30 00:09:53 2013] [debug] core.c(3120): [client 66.249.66.205] r->uri = /home/mysitecom/domains/mysite.com/public_html/

  • SideDishStudio
    jquery ajax codeigniter jquery-ajax
    So I’m using .load() to call a CI method to load some code into a div like normal. CI loads the correct content into the div UNLESS there is a trailing slash on the class, then it actually ignores the method I am loading and loads the default method in that class … ie:THIS WORKS FINE:I call .load(‘http://domain.com/class/ajaxmethod’)from domain.com/class/methodTHIS DOES NOT:I call .load(‘http://domain.com/class/ajaxmethod’)from domain.com/class/method/It will actually load http://domain.com/cl

  • JJD
    json codeigniter codeigniter-datamapper
    var data = xhr.responseText;When I output this console.log(xhr.responseText). Below is my output [“{id:1,name\”:\”JOHN\”,\”city\”:\”null\”}” ,”{\”id\”:2,\”name\”:\”MICHEAL\,\”city\”:\”null\”}”]How do I get id, name. I tried like this data.id but I get this error jquery JSON.parse: unexpected end of data.UpdateI am using code igniter with data mapper so my data mapper is giving that json response. Do you know, how I can resolve it.

  • Rocket Hazmat
    codeigniter
    I’m trying to get the id of last inserted record in the Db. But i’m getting the errorParse error: syntax error, unexpected T_RETURN in Z:\www\CI4\application\models \report_model.php on line 69my model:function getLastInserted() { $query =”SELECT $id as maxID from info where $id = LAST_INSERT_ID()”return $query; //line 69}my controller:function index(){ $id=$this->report_model->getLastInserted();$this->load->view(‘u_type1’,$id);}

  • hakre
    php codeigniter codeigniter-2
    I am new to codeigniter and trying to access data from mysql databasehere is my model class codefunction model_data($a){ $this->load->database(); $query = $this->db->query(“SELECT* FROM mytable3”); return $query->result(); }function model_data_cat(){ $this->load->database(); $query = $this->db->query(“SELECT* FROM mytable1”); return $query->result(); } Actually i am calling two functions in my controller. one is model_data and the other is model_data_cat. bu

  • Yeshwanth Venkatesh
    php ajax codeigniter form-validation
    I am trying to validate a form and save it in my database. I am using codeigniter’s validation library and it fails. this is the ajax function inside the view function save_form(){ $.ajax({url: ‘/projects/cafe/index.php/welcome/save_form’,type: ‘post’,data: {‘fname’ : $(‘#fname’).val(),’lname’ : $(‘#lname’).val(),’story_name’ : $(‘#story_name’).val(),’email’ : $(‘#email’).val(),’address_street’ : $(‘#address_street’).val(),’city’ : $(‘#city’).val(),’state’ : $(‘#state’).val(),’zip’ : $(‘#zip’)

  • teresko
    php codeigniter error-handling relative-path
    I am using code igniter, and I need to be able to read and/or include some html files, so I created an includes directory in the application folder. Using CI what is the best way to access this directory?In my controller I have tried:private $cms_temp_folder = APPPATH . ‘includes/’;But that gives me the error:Parse error: syntax error, unexpected ‘.’, expecting ‘,’ or ‘;Am I approaching this right, or should I be doing it another way?

  • user2247326
    php css html5 codeigniter zend-framework2
    I always have this error:Parse error: syntax error, unexpected T_STRING in /home/user/public_html/nameofsite/application/libraries/Zend/Barcode/Barcode.php on line 10Here is my controller code for generating barcode:public function testbarcode() {require_once(‘./application/libraries/Zend/Barcode/Barcode.php’);//adjust the above path to the correct location$barcodeOptions = array(‘text’ => ‘ZEND-FRAMEWORK’);$rendererOptions = array();Zend_Barcode::factory(‘code39’, ‘image’, $barcodeOptions, $

  • user1557970
    php mysql json codeigniter getjson
    I have developed a function in my Codeigniter web site, to request data through an API call to retrieve timeline data stored in a mysql table. My json respond is not coming out correctly. I need to create a json response to a $.getJSON, I done this in php . Below is the code that I wrote to get data from mysql and create a json response.public function index_get() {$rs = mysql_query(“SELECT headline, type, text, media, credit, caption FROM media”); $timeline = ‘{ “@headline”: “‘ . $row[ ‘headlin

  • Luis Martin
    php codeigniter inheritance protected
    I can use at least two basic ways to access a protected class method from a child class:parent::myMethod();$this->myMethod();If I don’t need to override it in the child class, in which case I would have to do this:function myMethod() {…parent::myMethod();… }which is the most recommended way to call it? I personally feel more comfortable using parent::myMethod() rather than $this->myMethod, because the first one immediately tells me this method is being inherited. But I’m not sure which wa

  • user2608391
    ios cocoa-touch google-api google-drive-sdk google-api-objc-client
    I’m attempting to follow these instructions: https://developers.google.com/drive/quickstart-ios.Now the first time I tried this, I got the error mentioned on this question, but was able to solve it. The sample app now runs, however it crashes before uploading anything to Google Drive. It stops on the loading screen and gives the following error.Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘unexpected response data (uploading to the wrong URL?)’What does i

  • NumberOfGraham
    ruby-on-rails ruby http google-api
    I’m trying to send a HTTP GET request to a Google API that requires a parameter with the name “end-date” (with a hypen, not underscore). However, the following error gets thrown:unexpected keyword_end, expecting ‘}’end-date: ‘2013-07-24’Here’s the code that I’m trying to use: request = Typhoeus::Request.new(‘https://www.googleapis.com/analytics/v1/reports’,method: :get,params: {end-date: ‘2013-07-24’,start-date: ‘2013-07-01’,access_token: access_token} )Any way to make params: accept the hyphena

  • user1921214
    google-api google-drive-sdk google-drive google-api-java-client
    We accidently deleted an already created OAuth 2.0 client id for a specific package name / certificate hash in an API project. When now trying to re-create this OAuth 2.0 client id for that package name / certificate hash we are getting the error “An unexpected error has occurred. We’re looking into it.”. Is there a way to re-activate such a deleted OAuth 2.0 client-id or to simply re-create it?”Accidently deleted” because we fall into the problem that for testing and developing we used an other

  • Shine
    android google-api google-play-services
    I’m trying to make games API work, with reference to https://github.com/playgameservices/android-samples/blob/master/BaseGameUtils/src/com/google/example/games/basegameutils/BaseGameActivity.java as sample code.Mine is quite similar, basically I’m trying to connect a game client and receive a negative answer. When trying to manage it with startResolutionForResult() this is what I got:E/Volley(15638): [1492] il.a: Unexpected response code 403 for https://www.googleapis.com/games/v1/players/112370

  • bossylobster
    python google-api google-calendar google-api-python-client
    as written on the google api python client documentationDeleting a secondary calendar(under python example)service.calendars().delete(‘secondaryCalendarId’).execute()this function call returns the following: method() takes exactly 1 argument (2 given)Does anyone have a clue what this error means? Clearly I just passed 1 argument and that is the calendarId that needs to be deleted. Or did anyone make this function work? Need help.Thanks.

  • Pedram
    c# .net google-analytics google-api google-api-dotnet-client
    I’m using Google Analytics Core Reporting API. I can successfully run my request with a code like this.DataResource.GaResource.GetRequest requestData = googleAnalyticsService.Data.Ga.Get(profiles, startDateStr, endDateStr, metrics); requestData.Dimensions = dimensions; requestData.MaxResults = Globals.MAX_RESULTS;responseData = requestData.Execute();So in my responseData object I have all the data that I need. But I also need to know when I have an error in my request. So I need to catch a Googl

  • WATTO Studios
    java nullpointerexception google-api gdata-api
    Basically I’m getting this error…java.lang.NullPointerException: Null response body com.google.gdata.util.ServiceException.setResponse(ServiceException.java:222)at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:572)at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:560)at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:538)at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleG

  • user1542876
    google-api go google-bigquery
    I am trying to access data stored in Bigquery through an app I am developing on Google App Engine. However each time I make a request I receive the error “permission denied”. I have added the application as a member of the API team for the project (I added the address @appspot.gserviceaccount.com) and I am accessing bigquery through the package code.google.com/p/google-api-go-client/bigquery/v2The following code is how I append the API key to each query:transport := KeyedTransport{Key: <api

  • user1157812
    visual-studio-2010 google-api visual-studio-addins
    In my Visual Studio 2010 add-in, the Exec method of the IDTCommandTarget interface stops triggering (on the relevant menu click) when I add the following line of code to the Exec method:GwebSearchClient client = new GwebSearchClient(“www.google.com”);On removing the above line, the Exec method gets called as expected. I’m using the google-api-for-dotnet and have (obviously) added the GoogleSearchAPI.dll as a reference to the add-in.If anyone can help, thanks.

  • HK1
    android google-api google-calendar
    I’m a new developer and I’m trying to use the Google Calender API. I followed the insturctions from http://code.google.com/apis/calendar/v3/using.html#setup and copied and pasted the example code. When I try to launch the setup method from my app it crashes with a ClassDefNotFoundException and it’s on the org.codehaus.jackson.JsonFactory class. I’ve tried almost everything. Can somebody give me an idea on what I’m doing wrong?Thanks

  • auino
    javascript ajax api google-chrome-extension google-plus
    I’m developing a Google Chrome extension and I want to retrieve Google+ notifications count for current user, in a script running in the background. Is it possible? I studied the Google+ APIs at https://developers.google.com/+/api/ but it seems not supported yet.How is it possible to retrieve the count value anyway? I tried with a (cross-domain permitted) AJAX request, but the notification value seems generated at runtime, in JavaScript.

  • Amorgos
    android google-plus
    Here is a basic Google+ Android Sign-In button in XML:<com.google.android.gms.common.SignInButtonandroid:id=”@+id/sign_in_button”android:layout_width=”wrap_content”android:layout_height=”wrap_content” />In the class documentation it states that you can specify the size of the button as ICON_ONLY, STANDARD AND WIDE.How do you do this using xml?

  • Lego
    google-plus hangout
    I am trying to build a app using the hangout API, starter app. Does the Hangouts API have support for data fields to be added on runtime?For example,a. If we need to add team members to our app b. Or when we do ‘Create Application’ (https://appengine.google.com/) c. When we enter AppEngine app ID to Gadget URL (https://code.google.com/apis/console/?api=plusHangouts)Can we do the above using Python code and using the API (if there are any)?

  • Kara
    android google-plus android-button
    I created a custom button design to fit my apps theme for google connection.How can I make sure that when the button is pressed that it will go through the correct procedures to present the user with the account select screen/login that would be associated with the Google Sign In Button?if (v.getId() == R.id.sign_in_button && !mPlusClient.isConnected()) {if (mConnectionResult == null) {mConnectionProgressDialog.show();} else {try {mConnectionResult.startResolutionForResult(this,REQUEST_C

  • stivlo
    java google-app-engine xmpp google-plus
    I’ve noticed errors in my Google App Engine Log while parsing messages. The stack trace was unhelpful to diagnose the problem, so I wrote a small message dumper inspired by Google’s implementation of InboundMessageParser.public class ChatRequestParser extends HttpRequestParser {public static Map<String, String> parseMessage(HttpServletRequest request)throws IOException {try {Map<String, String> message = new HashMap<String, String>();MimeMultipart multipart = parseMultipartRequ

  • Midhun MP
    iphone ios google-plus socialshare
    I want to share image on google plus:I have used google+ apiAppDelegate.m[GPPSignIn sharedInstance].clientID = @”MyClientID”; [GPPDeepLink setDelegate:self]; [GPPDeepLink readDeepLinkAfterInstall];and on button actionViewController.mid<GPPShareBuilder> shareBuilder = [[GPPShare sharedInstance] shareDialog];[shareBuilder setURLToShare:[NSURL URLWithString:@”http://dummy.com”]]; [shareBuilder setTitle:@”Some title” description:@”Some description” thumbnailURL:[NSURL URLWithString:@”http://du

  • Eagle
    android google-plus user-feedback
    I’m looking for an .jar or library project that will allow users of my application to easily send feedback from inside the application about their experience.As asked in this question, I am looking for something similar to the crash reporting tool used in Google Plus, that allows the user to get in contact with me, besides leaving bad reviews.Some not-quite there solutions that came up in answers to other questions:ACRA : Application Crash Report for Android (functions as a crash reporting tool)

  • Nicktar
    android google-plus
    I have done my Google+ integration in android I am using Kit Kat version for testing everything is fine when I login to google plus its successfully login but when i want to share something. google Plus is crashed and the error is give below I don’t understand what’s the error meant12-06 17:50:14.827: I/chromium(26490): [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported [05:53:30 PM] Asim Habib: 12-06 17:50:14.907: E/qdutils(26490): FBIOGET_FSCREENINFO failed

  • Waldir Leoncio
    ios google-plus
    I used Google Plus API in my application for sharing content. I used these lines for showing the native share dialog in my application:id<GPPNativeShareBuilder> shareBuilder = [[GPPShare sharedInstance] nativeShareDialog];[shareBuilder setPrefillText:MY_TEXT];[shareBuilder setURLToShare:[NSURL URLWithString:MY_URL];[shareBuilder open];Dialog was shown successfully. When I touched “Public” for changing privacy, crash app immediately.I am using XCode 5 and my iphone is iOS 5.0. XCode shows l

  • Nam G. VU
    google-plus album share
    I can’t find the page where I could see all the albums other users have given me access to on my Google+ albums photo https://plus.google.com/photos

  • Roger
    postfix php5 google-apps
    This is a very basic question but I got to get this solved in order to go further. I have configured my MX reccords with Google Apps dns, so all my domain’s incoming email go to Apps. I have also Postfix installed on my Linux server and I am able to send email from PHP pages using PHPMailler class. I don’t understand. Isn’t email beeing processed by Google as a email hosting? I haven’t made all configurations described in: mailserver for google apps emailThank you.

  • user1745915
    javascript google-apps-script google-apps
    When I develop a Google Apps script, there are some unexpected behavior, Please read below description and kindly advise. Thanks.Description: Developer shared a Google site to User A and User B, there is a Google script in Google Site, When user access this site, the coding will run and save current user name in Spreadsheet document “Test”.The Spreadsheet document “Test” can be only accessed by current developer. User A has Google Dirve/Doc service but not authorized to access Spreadsheet “Test

  • asolberg
    javascript google-apps-script google-apps
    I’m using Google Apps Script and I’m trying to re-use code that calls render so that I don’t have to re-type everything. I’m running into an issue that seems to relate to “this” getting transformed. Code:function render(displayMedium, template_name) {var js = HtmlService.createTemplateFromFile(‘javascript.html’);var css = HtmlService.createTemplateFromFile(‘stylesheet.html’);var t = HtmlService.createTemplateFromFile(template_name);js.config = config;css.config = config;t.config = config;t.appPr

  • David Underhill

  • Zistoloen
    html google-apps
    I’ve bought/registered/verified a domain with Google Apps, setup an email etc. so far so good. Everything works.How to now setup/host a small static page (plain HTML saying “Soon! :)” or something), on that domain using Google Apps?

  • IttayD
    google-apps wordpress
    I have a domain controlled with google-apps. Now I want blog.mydomain.com to be a wordpress blog. How do I do that?

  • Al E.
    google-apps backup download
    I used to browse Google Play apps through my laptop regularly. Is there any way that I can store the Android applications (.apk files) into my laptop? In other words, download the .apk file straight to my PC.I wish to backup my .apk files for my personal testing with my Android simulator.

  • Werner
    google-apps
    We are working simultaneously on some text document using google docs. After one week we need to check some changes so just tried “revision history” (which worked at the beginning) but now it does not work. We tried different browsers and operating systems but it crashes. I would be happy if at least I could get the last version and some other one, so using another “diff” tool I could check the changes. But right now I do not know how to access a previous version. Is it there any way to do this?

  • Gaia
    google google-apps google-apps-email
    I am signed in to multiple google apps accounts. When I go to gmail.com it starts out with the default acct, as expected. If I switch to acct B or C (via drop down menu on top right of the screen), the switch works as expected: I see email for acct B or C.But when I try to switch to acct D I get a sign in screen, with account D LISTED as one of the signed in accts in the blurred area.I can successfully use other google products, such as search, with acct D on the top right of the screen.I can al

  • r.tanner.f
    windows-server-2003 domain-controller password google-apps
    We’re moving to Google Apps and have just installed Google Apps Password Sync. We have yet to roll this out to users and are experiencing some problems.Occasionally after a user changes their password an error message pops up on a domain controller:Microsoft Visual C++ Debug LibraryDebug Error!Program: C:\WINDOWS\system32\lsass.exeHEAP CORRUPTION DETECTED: after Normal block(#1234) at 0x00000000A123456E.CRT detected that the application wrote to memory after end of heap buffer.Press Retry to deb

Web site is in building