Jump to content

Using str_replace, when using html on php.


ShaKeD

Recommended Posts

Hey all

 

I`m using php file named test.php, and html file named style.sspic (sspic=my system files.).

Now on my php file I have

 

  $upframe='my php test file blah blah balh';

  $htmlpage = include 'style.sspic';

  str_replace('{upframe}',$upframe,$htmlpage);

 

and on my html file I have

<html>

<head>

<title>Untitled 1</title>

</head>

<body topmargin="0" leftmargin="0" rightmargin="0">

<table style="width: 100%" class="style1">

<tr>

echo <td align=center>{upframe}</td>

</tr>

</table>

</body>

</head>

</html>

 

how can I make it work , that when I open my php file, I will see {upframe} as $upframe ?

 

Thanks for you time and help!

Link to comment
https://forums.phpfreaks.com/topic/50413-using-str_replace-when-using-html-on-php/
Share on other sites

<?php
$upframe='my php test file blah blah balh';
  $htmlpage = file_get_conents('style.sspic');
  str_replace('{upframe}',$upframe,$htmlpage);

 

include does not get put into a variable it is ran like it was being caled itself.

 

www.php.net/file_get_contents is more of what you are looking for.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.