Start New Discussion Reply to this Discussion help required
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>
hallianonline
Light Poster
28 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
hallianonline
Light Poster
28 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 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.
hag++
Junior Poster
197 posts since Jan 2010
Reputation Points: 34
Solved Threads: 31
Skill Endorsements: 0
vaultdweller123
Posting Pro
574 posts since Sep 2009
Reputation Points: 47
Solved Threads: 81
Skill Endorsements: 2
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;
}
?>
veedeoo
Master Poster
735 posts since Oct 2011
Reputation Points: 298
Solved Threads: 129
Skill Endorsements: 13
© 2013 DaniWeb® LLC
Page rendered in 0.0912 seconds
using 2.7MB