php code is not working

Hi Team,
I am new in infinity.net. I uploaded one php project also created mysql database, tables
and did changes in config.php file as well
But my php script is not running.
I checked on console its showing warning as
This page includes a password or credit card input in a non-secure context. A warning has been added to the URL bar. For more information, see Google Online Security Blog: Moving towards a more secure web.
Blocked current origin from receiving cross-site document at https://infinityfree.net/errors/404/ with MIME type text/html.
Please help me out

hi
please enable error reporting
https://infinityfree.net/support/http-error-500/

oh you are edit post…sorry

can you give us a URL to see it?
probably javascript can not be run because it is cross-site

Can you please clarify which part of your script is “not running”. Can you explain more about what you see?

As for the console errors:

@champInteraction said:
This page includes a password or credit card input in a non-secure context. A warning has been added to the URL bar. For more information, see Google Online Security Blog: Moving towards a more secure web.

That’s a security warning because your website is not using HTTPS. As long as you are aware that your website is not using HTTPS, you can safely ignore this.

@champInteraction said:
Blocked current origin from receiving cross-site document at https://infinityfree.net/errors/404/ with MIME type text/html.

That means one of the URLs to images, CSS or Javascript files on your page is broken, because it’s redirecting you to our default 404 page.

URL- http://interaction.epizy.com/dailyUI/registration.php
In this form one dropdown is there. I am fetching values from database.
Also i checked mysql connection by echo statement, its connected successfully. but query is not getting execute.

@OxyDac said:
hi
please enable error reporting
https://infinityfree.net/support/http-error-500/

oh you are edit post…sorry

URL- http://interaction.epizy.com/dailyUI/registration.php
In this form one dropdown is there. I am fetching values from database.
Also i checked mysql connection by echo statement, its connected successfully. but query is not getting execute.

I think i found the clause.
I have one config.php file in which contain database connection

<?php //establish connection $GLOBALS[conn] = mysqli_connect("sql309.epizy.com", "epiz_22075494", "************","epiz_22075494_"); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } else{ echo "Connected successfully"; } ?>

And by using require_once “config.php”; I am trying to use $conn variable to execute the query.

In localhost its work fine. but here its not working.
Don’t know how to resolve this.

Is that the exact config you’re using? Because the name epiz_22075494_ does not look like a valid database name. Database names are in the format <account username>_<custom suffix>.

Additionally, in your database queries, make sure the database name is correct as well, or exclude the database name entirely. So queries should be written like select field from epiz_22075494_db.table or select field from table.

@Admin said:
Is that the exact config you’re using? Because the name epiz_22075494_ does not look like a valid database name. Database names are in the format <account username>_<custom suffix>.

Additionally, in your database queries, make sure the database name is correct as well, or exclude the database name entirely. So queries should be written like select field from epiz_22075494_db.table or select field from table.

Actually I am using db.table in query itself. like
select * from db.table;

btw. here you have a backslash instead of a slash


and take care that you hide the config.php file

will we go back to the beginning?
what is the difference between the stuff you run at localhost and here?

the first thing that comes to my mind is unix vs windows (if you use win)
slash vs. backslash for path

I do not know…
does your scripts see this require_once "config.php" and what is path for that

if any error from php occurs?

My issue is resolved by using include instead of require_once and add database name in config file itself.
Thanks for all your help

I’ve never seen using the $_GLOBALS like that before. That might be your issue? Isn’t the $conn supposed to be established? If you’re not defining the $conn then you’re not going to get one to build the connection. If it’s inside the required file then you wouldn’t need to have the connection regardless. It’ll be contradicting itself. This has me confused. You might want to try and fix that?

@champInteraction said:

@Admin said:
Is that the exact config you’re using? Because the name epiz_22075494_ does not look like a valid database name. Database names are in the format <account username>_<custom suffix>.

Additionally, in your database queries, make sure the database name is correct as well, or exclude the database name entirely. So queries should be written like select field from epiz_22075494_db.table or select field from table.

Actually I am using db.table in query itself. like
select * from db.table;

Yes, I saw your code. But you are not using the right database name. You are using queries like db.table, whereas you should use epiz_22075494_db.table. The database named db in that instance does not exist, because the database is named epiz_22075494_db since all database names have the username prefix.