Problems with php variables in HTML <span>

Asked

Viewed 34 times

-1

I am trying to assemble a form sender, to expedite my life and not have to pick up a file in Word and have to change several fields in various documents with the same data. I used a PDF to HTML converter and it uses a variable to reproduce the letters. The problem is, because of that, I can’t read the variable itself... It goes something like this:

<html>
<head>
<?php
session_start();
$nome = $_SESSION['nome'];
?>
</head>
<?php
print "<body>\n";
print "<div style='position:absolute;top:3.66in;left:1.73in;width:5.58in;line-height:0.20in;'></span><span style='font-style:normal;font-weight:bold;font-size:14pt;font-family:Arial-BoldMT;color:#000000'>$nome</span>";
print "</body>\n";
?>

And every time I go to see the file it’s written $name instead of the person’s name. How to solve this?

  • You saved this page with extension . php example page.php ? or saved with extension . html ?

  • The page is yes like . php

  • I tested on my server and ran well. Unico problem is Warning due to seesion start after output

  • The problem is that in mine is giving $name instead of name... I would have some way to show it?

  • I got it this time... I traded all the prints for Excerpts... They were giving me formatting problems, and between the code I mounted an echo with the variable.

  • puts these <html> <head> after the PHP tag. Let session_start on the first line of php to avoid error

  • here worked with print too. If already solved then be happy

Show 2 more comments

1 answer

0

If you put it like that maybe it’s a solution(I’m not sure)

print "<div style='position:absolute;top:3.66in;left:1.73in;width:5.58in;line-height:0.20in;'></span><span style='font-style:normal;font-weight:bold;font-size:14pt;font-family:Arial-BoldMT;color:#000000'>".$nome."</span>";

Browser other questions tagged

You are not signed in. Login or sign up in order to post.