1.11M Members

help required

 
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>

 
0
 

please help

 
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
 

where is your form?

 
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;
}

?>
You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article