TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,994
  • Total Topics: 21,325
  • Online today: 777
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 83
  • Total: 83

Php in html article?

Started by JCphotog, July 27, 2007, 01:59:06 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

IchBin

Both articles must be loaded on the same page to do this.

JCphotog

Thanks IchBin. 

I was thinking of having one as an intro on the front page, and the other not on the front page.    So this probably won't work.  Hell.  Maybe I'm just lazy.  I can always define the variables for each article  Any other thoughts about creating a php intro?

IchBin

You can always add that code to an invisible block as well. :D

marzi

I have the following code working fine in a standard PHP page that uses the <?php  ?>  tags:

<BR>
<FONT COLOR="#80000">__ Enter Your Name (optional):</font><BR>
<INPUT TYPE=text NAME="name" SIZE=40 MAXLENGTH=60 VALUE="<? echo $name; ?>">
<P>


and have tried to get it to work in a Tiny Portal PHP article by changing it to the following but I cannot figure out how to handle VALUE="<? echo $name; ?>" correctly. What am I doing wrong here?

echo '
<BR>
<FONT COLOR=\"#80000\">__ Enter Your Name (optional):</font><BR>
<INPUT TYPE=text NAME=name SIZE=40 MAXLENGTH=60 VALUE= echo $name;>
<P>';

feline

Quote from: marzi on August 01, 2007, 01:12:35 PM
and have tried to get it to work in a Tiny Portal PHP article by changing it to the following but I cannot figure out how to handle VALUE="<? echo $name; ?>" correctly. What am I doing wrong here?

echo '
<BR>
<FONT COLOR=\"#80000\">__ Enter Your Name (optional):</font><BR>
<INPUT TYPE=text NAME=name SIZE=40 MAXLENGTH=60 VALUE= echo $name;>
<P>';


you have to use follow:

echo '
<BR>
<FONT COLOR="#80000">__ Enter Your Name (optional):</font><BR>
<INPUT TYPE="text" NAME="name" SIZE="40" MAXLENGTH="60" VALUE="'. $name .'">
<P>';


Fel

marzi


Hobox

I use HTML in a php-article. I just started the article with ?> and entered some html and then just added <?php at the end again.

The reason I did this was to be able to use some php variables in the middle of the html block.

Worked fine for me. Maybe not the best and perfect way, but at least it did what I wanted without to much fuss.


This website is proudly hosted on Crocweb Cloud Website Hosting.