0

I am working with a php file(WAD Assignment.php) now. If a condition is satisfied, it displays a JRadiobutton option. I want the value of that JRadioButton in my php file. But the value is not coming out. How can I do it? Code is below.

<code=php>

if($row["membership_category"]=="Student member"){
?>
<html>
Enter the number of guests
<form>
<input type="radio" name="guest" value="0" checked> 0 <br />
<input type="radio" name="guest" value="1"> 1 <br />
<input type="radio" name="guest" value="2"> 2 <br />
<input type="radio" name="guest" value="3"> 3 <br />
<input type="button" value="Submit Booking" onclick="WAD Assignment.php">
</form>
</html>
<?php
echo $_GET('guest');
}
}

</code>

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by SimonMayer
0

try this:

if($row["membership_category"]=="Student member"){
?>
<html>
Enter the number of guests
<form method="get"  action="WAD Assignment.php">
<input type="radio" name="guest" value="0" checked> 0 <br />
<input type="radio" name="guest" value="1"> 1 <br />
<input type="radio" name="guest" value="2"> 2 <br />
<input type="radio" name="guest" value="3"> 3 <br />
<input type="submit" value="Submit Booking">
</form>
</html>
<?php
echo $_GET('guest');
}
}
0

try this:

if($row["membership_category"]=="Student member"){
?>
<html>
Enter the number of guests
<form method="get"  action="WAD Assignment.php">
<input type="radio" name="guest" value="0" checked> 0 <br />
<input type="radio" name="guest" value="1"> 1 <br />
<input type="radio" name="guest" value="2"> 2 <br />
<input type="radio" name="guest" value="3"> 3 <br />
<input type="submit" value="Submit Booking">
</form>
</html>
<?php
echo $_GET('guest');
}
}

Yeah the same. Error(Fatal error: Function name must be a string in /home/students/accounts/s6666167/hit3324/www/htdocs/AssignmentOne/WAD Assignment.php on line 51) is showing up on echo $_GUEST('guest'); This means guest value is not at all coming out from the JRadioButton. Right?

0

From your explanation, I didn't realise that you were getting warnings/errors. $_GUEST('guest'); should be $_GUEST['guest'];

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.