-5

in index.php i have

<?php

session_start();

include 'includes/config.php' ;



?>

and in includes/config.php

<?php

mysql_connect('localhost','databasename','databasepassword');

mysql_select_db('databasename');

mysql_query('SET CHARACTER SET utf8'); 

mysql_query('SET NAMES utf8'); 

$apiurl='https://mydomain/api/index.php';

$apiurlemail='https://mydomain/email';

?>

when i upload files to my hosting, change config.php to my newly created database(where i imported sql) wont show anything

  • 1
    Well, your code doesn't *output* anything. What are you expecting it to "show"? Why? – David Dec 12 '17 at 19:28
  • Of course you don't see anything. There's nothing in your code that output anything. – Eric Dec 12 '17 at 19:28
  • there is a whole buch of code under include – Badri Rusadze Dec 12 '17 at 19:33
  • 2
    @ProDigy: Then I suggest you try examining and debugging that code. To include enabling error reporting, checking PHP logs, etc. Nobody here can tell you why code you're not showing us doesn't do what you expect it to do. – David Dec 12 '17 at 19:35
  • mysql_* functions are deprecated as of PHP 5.5.0, and removed as of PHP 7.0.0. Switch your code to use [PDO](https://secure.php.net/manual/en/pdo.prepared-statements.php) or [mysqli](http://php.net/manual/en/mysqli.quickstart.prepared-statements.php) instead. – aynber Dec 12 '17 at 19:35
  • https://docs.google.com/document/d/18qRJohOadXVWRICAtfW3JBB9GaDPwcTTUVKehnY3Lno/edit?usp=sharing here is whole code in index.php and i have linux cpanel hosting on godaddy if that helps – Badri Rusadze Dec 12 '17 at 19:38
  • If there's nothing on the page, check the server error logs. I'm betting that it's throwing errors about the `mysql_*` functions – aynber Dec 12 '17 at 19:42

2 Answers2

0

Is the mysql_* functions supported by your hosting?
It was deprecated in PHP 5.5.0 AND it was removed in PHP 7.0.0. Instead PHP Manual of mysql_query If not supported then the scrip is immediately interrupted at the first call of any of mysql_* function.

Good start is to turn on the error reporting.
Put following code at the beginning of your index.php

<?php 
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

How do I get PHP errors to display?

ino
  • 2,345
  • 1
  • 15
  • 27
-1

You are not outputting anything.

You need to print or echo a value to the screen. What are you trying to achieve here?

  • https://docs.google.com/document/d/18qRJohOadXVWRICAtfW3JBB9GaDPwcTTUVKehnY3Lno/edit?usp=sharing here is index.php i guess this must output something – Badri Rusadze Dec 12 '17 at 19:37
  • Ok. You should see something. What do you see on that page. Do you have a screenshot. As well ensure to enable error logging. My guess is you have a syntax error somewhere. Which would cause the screen to show nothing. – Hans-Eric Lippke Dec 12 '17 at 19:41
  • 1
    Welcome to Stack Overflow. This answer would be better as a comment rather than an answer, as you are looking for additional information rather than solving the OP's problem. – fred2 Dec 12 '17 at 19:42