PHP line in *.html File

Status
Not open for further replies.

oregonsv

New Member
Messages
43
Reaction score
0
Points
0
Hello again,
well this time i have my page prueba.html but inside of it, i would like to put a php line. like <? echo "Hello friends"?> but when i run it, it does not show me anything.
but if i put that line in a php file like prueba.php then it show me "Hello friends"
can you help me please, i need to run the php line in my html file.

thank u again.

oregonsv
El Salvador, CA.:happysad:
 

TonnyORG

I Code Things
Community Support
Messages
5,907
Reaction score
16
Points
38
ok, i dont understand your problem at 100% but, can be caused because you have the basic php version, check it in: x10hosting.com/account and if you use the basic, solicit the intermediate php version ^^

and i have one question...
what's your main language?
XD this question is because you writte here in english but in your web say: prueba XD


grettings
salu2
 
Last edited:

oregonsv

New Member
Messages
43
Reaction score
0
Points
0
Hello, my main languge is spanish, but i don't want to use it, 'couse last time i read in the forum rules, that all treats must be written in english. thats why.
About my question, the problem that i have is in my computer not in the web server.
i'll try to explain you again, in a file .html i wrote a php line like
<?php echo "Hola Mundo"?> but when i run it, it does not show me anything, but if i write that line in a .php file. it works.

Gracias.

OREGONSV
El Salvador, SV
 

TonnyORG

I Code Things
Community Support
Messages
5,907
Reaction score
16
Points
38
Hello, my main languge is spanish, but i don't want to use it, 'couse last time i read in the forum rules, that all treats must be written in english. thats why.
but in this forum (español-spanish) you can use the spanish language XD

About your problem, mmm, its very rare, because I would think that is your php version (basic) but if you can read the php line in .php file i dont think that the problem can be caused for your php version, so, you can try to change it, and then try to use the .html file again.
The link to change the php version its: x10hosting.com/account


grettings and good luck
salu2 y buena suerte
 

oregonsv

New Member
Messages
43
Reaction score
0
Points
0
Ok,
haceme un favor, crees que podes crear un archivo cualquiera con extencion .html y luego en ese archivo pone la siguiente linea.
<?php echo "Hola mundo"?>
y me contas si te funciona.
por que ahi es donde no me funciona a mi.

Gracias por tu apoyo. y a ver si no me dicen nada por que estoy escribiendo en español.... jajaja.

Saludes.

OregonSV
El Salvador
 

TonnyORG

I Code Things
Community Support
Messages
5,907
Reaction score
16
Points
38
jaja no te preokupes para eso es el foro en español ^^ en fin dejame ver lo subo y lo miras XD


salu2


Edit:
lol ami tampoco me lo muestra jaja
mira el link aqui
pide la version advanded de php en http://x10hosting.com/account es probable ke sea por eso XD aunke kien sabe XD


salu2
 
Last edited:

eZakto

Member
Messages
782
Reaction score
1
Points
18
Para que cualquier código php sea interpretado como tal, debe estar en un archivo cuya extensión sea php, php4, php5, etc.
 

TonnyORG

I Code Things
Community Support
Messages
5,907
Reaction score
16
Points
38
no presisamente, yo eh instertado codigos php en archivos .html ^^
solo ke en otros hosters XD


salu2
 

Anna

I am just me
Staff member
Messages
11,768
Reaction score
590
Points
113
Hello, my main languge is spanish, but i don't want to use it, 'couse last time i read in the forum rules, that all treats must be written in english. thats why.
About my question, the problem that i have is in my computer not in the web server.
i'll try to explain you again, in a file .html i wrote a php line like
<?php echo "Hola Mundo"?> but when i run it, it does not show me anything, but if i write that line in a .php file. it works.

Gracias.

OREGONSV
El Salvador, SV

the webserver software would not know to use the php interperator f you have a .html file, and since <?php... ?> is NOT a valid html tag it would be skipped
 

Kansy

Community Advocate
Community Support
Prime Account
Messages
2,621
Reaction score
9
Points
38
Para que funcione la única manera es llamar al archivo con extension .php .

Si insertas php en algun html este AUTOMATICAMENTE debes cambiarlo a .php porque si es .html el explorador no reconoce las tags <? etc... del php.

Cambiale el nombre del archivo a .php y verás como funciona...
 

oregonsv

New Member
Messages
43
Reaction score
0
Points
0
Gracias por contestar,
en realidad si lo escribo en un archivo con extencion PHP si me funciona. y lo que me sugieren ustedes en llamar el archivo .php desde un archivo html en realidad ese el objetivo. pero tampoco no me funciona.
por ejemplo. desde el archivo html llamo lo siguiente d

<?php
include ("visitas.php");
?>
pero no me funciona. ya que es lo mismo como si quiciera mostrar el mensaje que anteriormente les mensionaba.
y el inconveniente es que esta llamada la necesito hacer desde un archivo HTML por que esta es mi pagina de inicio en el cual se va a mostrar un contador de visitas que me provieron aqui en el foro. es por eso no puedo convertirla en extencion PHP ya que esta relacionado a un template.

gracias nuevamente,

OREGONSV
El Salvador, CA
 

Kansy

Community Advocate
Community Support
Prime Account
Messages
2,621
Reaction score
9
Points
38
A ver si me explico mejor

Tienes actualmente tu página principal index.html (pongamos el caso) en la que estás integrando el contador de visitas en php. En un archivo .html (en este caso tu pagina principal index.html) NO puedes integrar codigo php porque el navegador no lo interpreta. La única solución es cambiar el nombre de la página principal de index.html a index.php, de esta manera SI que te interpreta el navegador el código.
 

oregonsv

New Member
Messages
43
Reaction score
0
Points
0
Me Gustaria Hacerlo pero es en un template en el que necesito pone el contador de visitas es por eso no le puedo cambiar la extencion a PHP,
al algun modo de hacerlo ?
gracias

OREGONSV
El Salvador, ca
Edit:
en el caso que sea un template ?
 
Last edited:

Kansy

Community Advocate
Community Support
Prime Account
Messages
2,621
Reaction score
9
Points
38
Especificame, template de qué CMS y como se llama el archivo que quieres editar. Si estas editando algun header.html o footer.html tendrás que buscar que parte del template te llama al archivo footer.html o header.html y cambiarlo a header.php o footer.php
 
Last edited:

TonnyORG

I Code Things
Community Support
Messages
5,907
Reaction score
16
Points
38
visita la seccion tutoriales y cheka mi script php para hacer el contador y meterlo en tu web ^^

PD: el enlace a tutos esta en mi firma XD


salu2
 

oregonsv

New Member
Messages
43
Reaction score
0
Points
0
en este caso el template es extencion .dwt y este le pasa todos los parametros a las paginas.
la siguiente direccion es a la que quiero poner el contador. en la parte de abajo del boton, "Conectar"
http://www.oregonsv.pcriot.com/
gracias.
todas las paginas a las que se hace el link, tiene el template asociado. por lo que es en el template en donde deberia de ir. la llamada a la funcion PHP

Gracias nuevamente.

OREGONSV
El Salvador, CA
Edit:
Pensandolo bien, no me conviene poner el contador en template, si no que solamente en la pagina principal, como tu me lo decias.
y le cambiare la extencion. muchas gracias por la ayuda de todos los relacionados con este tema.
infinitas gracias,

Atte,

OREGONSV
El Salvador, C.A.
Edit:
Gracias.
Edit:
GM PUNK, este es el contador que estoy utilizando en la pagina. muchas gracias.
 
Last edited:

TonnyORG

I Code Things
Community Support
Messages
5,907
Reaction score
16
Points
38
XD ^^ kuando kieras aki estamos XD


salu2
 

Kansy

Community Advocate
Community Support
Prime Account
Messages
2,621
Reaction score
9
Points
38
Un placer haberte ayudado.
 

TonnyORG

I Code Things
Community Support
Messages
5,907
Reaction score
16
Points
38
creo k ya se puede hacer close topic no? XD


salu2
 

Kansy

Community Advocate
Community Support
Prime Account
Messages
2,621
Reaction score
9
Points
38
Aqui realmente no hace falta porque se queda en el sitio en el que esta.

Pero bueno por cumplir peticiones

:lockd:

PD: oregonsv recuerda que si quieres reabrir el tema puedes hacerlo tu mismo.
 
Status
Not open for further replies.
Top