PHP echo not working [closed] - php

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
I am learning PHP. Currently, I have:
<?php
echo "<p>This text was brought to you by PHP.</p>";
?>
What this does is outputs "This text was brought to you by PHP." and then on the next line: "; ?>
I cant figure out what i'm doing wrong, the code is seemingly correct.
PS. I made sure its a php file.

You cannot run a php file off the filesystem (file://) you need to install a web server with php enabled and then the server side code will run.

Related

php what information is by default sent when requesting ip? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
I would like to know what information that my website receives beside
$_SERVER['value']?
is there other fields can be obtained ?
Thank you
var_dump($_SERVER) or print_r($_SERVER) show you all output of $_SERVER global's

Newbie trying to understand PHP constants [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
I'm a PHP newbie trying to debug someone's code. The very first line of the code has what I think is a constant as shown below:
<?php
set_time_limit (0);
require_once (SITE_PATH. '/server/php/libs/dbase/handler.php');
I have written a debug statement and I have gotten a null.
echo "SITE_PATH"
How should PHP constants be declared. Should'nt the require statement be $SITE_PATH instead of SITE_PATH?
php constants must be defined as :
define('SITE_PATH','http://localhost/site');
and are used as :
echo SITE_PATH;
Look at this : php constants

Are GET Parameters Search Engine Indexable? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
I have coded a web directory that uses GET to generate all pages of information from a database. Is it possible for these pages to be indexed individually by a search engine?
Yes. If you can link directly to it, then a search engine can index it (unless you take other steps to explicitly exclude them).

Substitute for MySQL? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
Is there way to create database in one file?
I have a PHP script, is there possible to use PHP
syntax (as Apache) to read correct data from one
single database file?
Something like: http://www.sqlite.org/about.html But this requires more than 1 file.
You can use just simple Comma Separated Vlaues (CSV) file.
PHP has several standart function to work with CSV-files data:
fgetcsv;
fputcsv.

Php passing variable names [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
Can someone please explain to me what this piece of php code means.
echo "<a href='product.php?product_id".$product_id."'>
Is it saying that the link is taken from a variable from the product.php page and its named $product_id?
This is a GET parameter in the URL (it's also wrong btw). Say $product_id = 1.
echo "<a href='product.php?product_id".$product_id."'>
This would be "product.php?product_id1"
echo "<a href='product.php?product_id=".$product_id."'>
This would be "product.php?product_id=1", which would would handle by using
$_GET["product_id"]; //yields 1
Ths snippet outputs an HTML <a> tag. The $product_id is a variable, and echo is the command to output a string.
But I'd recommend to follow some basic Tutorials about HTML and PHP, as these are some of the most basic things.

Categories