0

I have problem that i want to replace a posed value of form with the correct name but not getting the proper text I am only getting the form values i.e. pbs and gs

<?php
include "connect.php";
$school=$_POST;

if ($idevice =="pbs")
{
$tb_school = "Public School";
}
else
{
$tb_device = $school
}

if ($school =="gs")
{
$tb_school = "Government School";
}
else
{
$tb_device = $school;
}
?>

<html>
<body>
<p>School: <?php print_r($tb_school); ?></p>
</body>
</html>

4
Contributors
4
Replies
7
Views
5 Years
Discussion Span
Last Post by veedeoo
0

Without the form code and a better explanation of what your problem is we can't help you. Also, use code tags and indent the code.

0

by the way, you can consolidate your statements as

<?php
include "connect.php";

if ($idevice =="pbs")
{
$tb_school = "Public School";
}

elseif ($school =="gs")
{
$tb_school = "Government School";
}

else
{
$tb_device = $school;
}

?>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.