Jump to content

My code is my output :(


chico1st

Recommended Posts

Hey I have this little script it is part of a bigger program but when i run it, it pretty much just prints the php code, which is odd.

Here is my code:
<?

include "spyLib.php";

$dbConn = connectToSpy();

$fieldNames = "";
$fieldValues = "";

foreach ($_REQUEST as $fieldName => $value){
  if ($fieldName == $_POST['tableName']){
    $theTable = $value;
  } else {
    $fields[] = $fieldName;
    $values[] = $value;
  } // end if
} // end foreach

print updateRec($theTable, $fields, $values);

print mainButton();

?>

And the output is: (but all on one line)

[b]Update Record[/b]

$value){
  if ($fieldName == $_POST['tableName']){
    $theTable = $value;
  } else {
    $fields[] = $fieldName;
    $values[] = $value;
  } // end if
} // end foreach

print updateRec($theTable, $fields, $values);

print mainButton();

?>

(i also tried replacing the => with a ->... because i didnt know the difference)

Any help would be awesome.
Sincerely
THANKS!
Link to comment
https://forums.phpfreaks.com/topic/15704-my-code-is-my-output/
Share on other sites

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.