1,105,406 Community Members

help required

Member Avatar
hallianonline
Junior Poster in Training
51 posts since Aug 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
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>

Member Avatar
hallianonline
Junior Poster in Training
51 posts since Aug 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

please help

Member Avatar
hag++
Posting Whiz in Training
239 posts since Jan 2010
Reputation Points: 24 [?]
Q&As Helped to Solve: 36 [?]
Skill Endorsements: 0 [?]
 
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.

Member Avatar
vaultdweller123
Posting Pro
577 posts since Sep 2009
Reputation Points: 32 [?]
Q&As Helped to Solve: 84 [?]
Skill Endorsements: 2 [?]
 
0
 

where is your form?

Member Avatar
veedeoo
Veteran Poster
1,016 posts since Oct 2011
Reputation Points: 314 [?]
Q&As Helped to Solve: 166 [?]
Skill Endorsements: 17 [?]
 
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 three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article