-7

Parse error: syntax error, unexpected '<' in /home/u362231965/public_html/ucp/index.php on line 6

<?php

if (isset($_POST['submit']))
{
$result= file_get_contents('ftp://160:654fearboss@149.202.249.9/scriptfiles/users/'.$num1.'_'.$num2.'.ini');
<pre>echo $result; </pre>
}
?>
<html><body>
<form action="#" method="post">
Num1:<input name="num1"><br>
Num2:<input name="num2">
<input type="submit" name="submit">
</form>
</body></html>

What is the problem?

Pang
  • 9,564
  • 146
  • 81
  • 122

4 Answers4

1

You had a syntax error. Use this:

if (isset($_POST['submit']))
{
$result= file_get_contents('ftp://160:654fearboss@149.202.249.9/scriptfiles/users/'.$num1.'_'.$num2.'.ini');
echo "<pre>".$result."</pre>"; 
}
0
<?php
if (isset($_POST['submit'])) {
    $result= file_get_contents('ftp://160:654fearboss@149.202.249.9/scriptfiles/users/'.$num1.'_'.$num2.'.ini');
    echo '<pre>'.$result.'</pre>';
}
?>
Trịnh Tâm
  • 26
  • 1
  • 4
  • While code often speaks for itself, it's good to add some explanation to your code. This popped up in the review queue, as code-only answers tend to. – Will Jul 09 '16 at 19:22
0

What's the problem. The problem is that u are using html code inside php code, This is possible but you are doing it the whrong way.

<pre>echo $result; </pre>//this is the wrong way

echo '<pre>'.$result.'</pre>';//the good way

You can read this how to use html inside php

Rafael Shkembi
  • 786
  • 6
  • 16
0

Why if i will go link Which i made for testing with this code:

<?php
$data = file_get_contents('ftp://160:654fearboss@149.202.249.9/scriptfiles/users/Isaiah_Calayan.ini');
?>
<h1>
  Remote Data
</h1>
<pre><?php echo $data; ?></pre>

Will show the data, but the link will not show after submiting??