-2
As I do for the html created by this php instead of containing the text between the quotes, it contains information that comes from my database.
<?php
# Nome do arquivo html
$pagename = "pastatest/paginahtml.html";
# Texto a ser salvo no arquivo
$texto = "<h1>texto que vai conter no html</h1>";
#Criar o arquivo
$fp = fopen($pagename , "w");
$fw = fwrite($fp, $texto);
#Verificar se o arquivo foi salvo.
if($fw == strlen($texto)) {
echo 'Arquivo criado com sucesso!!';
}else{
echo 'falha ao criar arquivo';
}
?>
Have you made the connection to the database? this is the part that has doubt??
– rray
not I already have the connection to database, my problem is with select from, only that as you can see the variable $text only command the created text between the " " and I want this text in case comes from the database
– cadeira13
@cadeira13 If possible edit the question and put the code that makes the connection, and also the
select ..
you want to save to the file. See also the [tour]!.– stderr