0

When i used it on localhost it works perfactly fine but when I move the same SEOstats-master directory to my server it give me following error in the errorlog file and the browser page becomes blank.

  PHP Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/abctest/public_html/example.net/SEOstats-master/example/get-alexa-graphs.php on line 15

Can anyone help ??

the code in the get-alexa-graphs.php is

 <?php
  /**
   * SEOstats Example - Get Alexa Traffic Metrics' Graphs
   *
   * @package    SEOstats
   * @author     Stephan Schmitz <eyecatchup@gmail.com>
   * @copyright  Copyright (c) 2010 - present Stephan Schmitz
   * @license    http://eyecatchup.mit-license.org/  MIT License
   * @updated    2013/08/17
   */

  // Bootstrap the library / register autoloader
  require_once (__DIR__ . '\..') . '\SEOstats\bootstrap.php';

  use \SEOstats\Services\Alexa as Alexa;

try {
$url = 'http://www.nahklick.de/';

// Create a new SEOstats instance.
$seostats = new \SEOstats\SEOstats;

// Bind the URL to the current SEOstats instance.
if ($seostats->setUrl($url)) {

    /**
     *  Print HTML code for the 'daily traffic trend'-graph.
     */
    echo Alexa::getTrafficGraph(1);

    /**
     *  Print HTML code for the 'daily pageviews (percent)'-graph.
     */
    echo Alexa::getTrafficGraph(2);

    /**
     *  Print HTML code for the 'daily pageviews per user'-graph.
     */
    echo Alexa::getTrafficGraph(3);

    /**
     *  Print HTML code for the 'time on site (in minutes)'-graph.
     */
    echo Alexa::getTrafficGraph(4);

    /**
     *  Print HTML code for the 'bounce rate (percent)'-graph.
     */
    echo Alexa::getTrafficGraph(5);

    /**
     *  Print HTML code for the 'search visits'-graph, using
     *  specific graph dimensions of 320*240 px.
     */
    echo Alexa::getTrafficGraph(6, false, 320, 240);
}
 }
  catch (\Exception $e) {
echo 'Caught SEOstatsException: ' .  $e->getMessage();
}

and the code at the line 15 is:

 use \SEOstats\Services\Alexa as Alexa; 
Shah Rukh
  • 3,046
  • 2
  • 19
  • 27
  • Can you paste the contents of lines 14 - 16? – Malcolm Diggs Nov 01 '13 at 19:01
  • updated my question above – Shah Rukh Nov 01 '13 at 19:12
  • okay I think its the problem with php version installed on the server I read about this here , http://stackoverflow.com/questions/17156251/unexpected-character-in-input-ascii-92-state-1?answertab=oldest#tab-top the version installed on my server is 5.2.17 and this may work on 5.3 because 5.3 or greater support namespace. – Shah Rukh Nov 01 '13 at 19:28

0 Answers0