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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 195,994
  • Total Topics: 21,325
  • Online today: 142
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 138
  • Total: 138

ssi,php & HTML together possible?

Started by bluedevil, February 09, 2009, 04:48:02 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mick

I'm trying to add ssi functin and add my own HTML code with it on a article page.  Is this possible?

I keep breaking the page while adding the codes.

If it's possible, what are the opening and closing codes?

G6Cad

Yes, everything is possible, but you need to have code added to separate files and call then in to your PHP code. You can mix php and html, but css and ssi i think needs to be called in from files

JPDeni

You can use straight html in a php article, but I don't normally do it. Normally I use echo commands to print out any html I want.

If you want to use straight html in an article, like you would do on a separate php page, you need to do the opposite of what you normally would do. Something like this:



?>

enter any html you want to display here

<?php

echo 'enter your php code here';

?>


enter some more html

<?php


You have to assume that the normal


<?php


to start and


?>


to end a php page are already entered. You just can't see them.

Personally, I get confused with all of the back and forth and it's just easier to keep the whole thing in php, but I understand that different people have different ways of doing things.

Calls to ssi functions from SMF are just like calls to other functions. They can easily be done within php. I do it all the time. Using css is a bit different. If you're using a stylesheet, it would necessarily have to already be loaded by the index.template.php file. But you can use inline css just like you would use it on a regular html page. Something like


echo '<div style="text-align: center;">';


is perfectly okay. Again, I do it all the time.

Mick

I knew you'd respond.  Thank you for this useful post.  I'll give it a shot.



Mick

Ok JP,.....

Now i now know how to add HTML to a PHP article.


...but what about PHP in an HTML article?

This is a PHP code that i want to add in an HTML page:

// START of "Frontpage Slideshow" settings
$nameOfSlideshowToDisplay = "avalanche"; // Enter the name of your slideshow. Slideshows are in folders inside /fpss/slideshows/.
$URLofyoursite = "http://www.chevyavalancheclub.com"; // Enter your site's URL.
$AbsoluteServerPathofyoursite = "/home/*******/public_html";                            // Enter the root path of your site on the server.

// do not edit below this line
include_once($AbsoluteServerPathofyoursite."/fpss/mod_fpslideshow.php");
// END of "Frontpage Slideshow" settings



I tried using:

<?php

before the code and...

?>

after,... but its not showing up.   Did i miss something?

JPDeni

Quote
...but what about PHP in an HTML article?

No. It has to be a php article if you have any php in it at all.

It's like when you have a separate web page. If you're mixing html and php on a page, the suffix for the file has to be .php.

Mick

Gotcha. ;)


My entire front page was made in HTML using an HTML page.

No biggie......shouldnt be hard to convert everything in a PHP article.

Very well,...thank you for the quick response.

Now i know :coolsmiley:

This website is proudly hosted on Crocweb Cloud Website Hosting.