Copy link to clipboard
Copied
Hi
I have run to check error logs on my coding.
However, it appears
PHP Warning: Use of undefined constant Type
May i know does it mean?
Since the files only works in localhost, when i tried in server, error appears.
What version of php are you running on your local server and what version are you running on the remote server?
I see in the select query you are using a lower case p for your product table name whereas your database table l think uses a capital P for Products Try to be consistant otherwise any minor deviation could cause issues. Think about if youre getting the id from the url parameter. If you have problems hard code an id in the query string as a test or echo the id out to see if it contains
...Copy link to clipboard
Copied
PHP Warning: Use of undefined constant Type - assumed 'Type' (this will throw an Error in a future version of PHP)
PHP Warning: Use of undefined constant Type - a
PHP Warning: Use of undefined constant Typename - assumed 'Typename'
Copy link to clipboard
Copied
See https://stackoverflow.com/questions/2941169/what-does-the-php-error-message-notice-use-of-undefined-.... or use Bing to search.
Copy link to clipboard
Copied
i have a problem on different display between in localhost and server.
The coding seem has no error appears, the website run normal in localhost.
But when i uploaded the files in server, i dont understand why the page cannot run as normal in localhost.
Copy link to clipboard
Copied
Please supply the URL to the site.
Copy link to clipboard
Copied
japanfavorite.com
Copy link to clipboard
Copied
the problem is, when i try to put the unique product details without PHP coding, the page works normal.
so probably there are so mistakes in php coding. However, i have no idea where i did wrong
Copy link to clipboard
Copied
Here is the screenshot of the database.
the product detail is chosen from here.
Copy link to clipboard
Copied
The code is probably looking for a string ' ' Try wrapping [id] in a string in your $_GET method ['id']
$id = $_GET['id']
Copy link to clipboard
Copied
Thanks for your suggestion.
However, the coding only works in localhost. When i upload the files to the server, then the content cannot be shown.
I have asked the server side, is there any error mistake. However, they said they cannot find out any problem from server.
So im wondering is there any differnt code needed when we use under server.
Copy link to clipboard
Copied
What version of php are you running on your local server and what version are you running on the remote server?
I see in the select query you are using a lower case p for your product table name whereas your database table l think uses a capital P for Products Try to be consistant otherwise any minor deviation could cause issues. Think about if youre getting the id from the url parameter. If you have problems hard code an id in the query string as a test or echo the id out to see if it contains anything.
Also l would wrap ALL of your database column names in string tags - $row['Pic'] , $row['Pic1'] etc - php is not forgiving, anything missing and the page will usually die.
Check if the version of php on the remote server is compatible with the short php echo statement that your code uses.
The page is being parsed as it outputs the skeleton html code structure so something within the php is not correct or your remote server is not set up correctly to output php.
Copy link to clipboard
Copied
Something in that list of suggestions seems to be correct, care to share what it was?