We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,668 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
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>

4
Contributors
4
Replies
7 Hours
Discussion Span
1 Year Ago
Last Updated
5
Views
hallianonline
Light Poster
35 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

please help

hallianonline
Light Poster
35 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

where is your form?

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
767 posts since Oct 2011
Reputation Points: 298
Solved Threads: 133
Skill Endorsements: 13

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page generated in 0.0661 seconds using 2.67MB