Welcome to Geeklog, Anonymous Friday, November 29 2024 @ 01:38 pm EST

Geeklog Forums

Php in statics page


Status: offline

manowar

Forum User
Regular Poster
Registered: 11/07/07
Posts: 81
Location:Santiago - Chile
I have this in php, I am testing PHP in staticspage,
?>php
$text = 'hello word!';
echo $text;
?> // this is correct for php

but it does not print out anything. Staticpages.PHP' is checked and "execute PHP" is select.

But if I do this,

echo "Hello";
?>,<b>world</b>,
<?php
echo "how are you?";
?> //example from Documentation

it works, I do not understand, somebody can explain to me like inserted php in staticspage correctly, I thinking about many lines of PHP code.

?????
:banghead:
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by: manowar

?>php
$text = 'hello word!';
echo $text;
?> // this is correct for php


Not sure what you expect this to do. The ?> ends the section of PHP code, so everything after that would be printed out as-is.

As the documentation tries to explain: You're in "PHP mode" inside the static page. If all you want to have there is PHP code, you don't need any <?php or ?> tags.

bye, Dirk
 Quote

Status: offline

manowar

Forum User
Regular Poster
Registered: 11/07/07
Posts: 81
Location:Santiago - Chile
Not sure what you expect this to do. The ?> ends the section of PHP code, so everything after that would be printed out as-is.


I am mistaken in writing up this ?>php in this post. But it's not works to me.
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
Your staticpage should look exactly like this.
Text Formatted Code

$text = 'hello word!';
echo $text;
 
 Quote

Status: offline

koalasoft

Forum User
Full Member
Registered: 03/09/05
Posts: 242
Location:Mexico
Quote by: manowar

I have this in php, I am testing PHP in staticspage,
?>php
$text = 'hello word!';
echo $text;
?> // this is correct for php

but it does not print out anything. Staticpages.PHP' is checked and "execute PHP" is select.

But if I do this,

echo "Hello";
?>,<b>world</b>,
<?php
echo "how are you?";
?> //example from Documentation

it works, I do not understand, somebody can explain to me like inserted php in staticspage correctly, I thinking about many lines of PHP code.

?????
:banghead:




Verifica que el grupo de administradores de paginas estáticas tengan la opción de poder ejecutar código php, y que dentro de la pagina estática donde intentas efectuar tal código este seleccionando la opción de ejecutar codigo php y obviamente que tu código funcione correctamente.


Saludos !! Mr. Green
**Cuando el Alumno esta listo, el Maestro Aparece **
::Geeklog support in Spanish::
 Quote

All times are EST. The time is now 01:38 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content