|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
have a look at this form and tell me....
can any 1 pls tel me.what is $_isset and $_session and how is it getting called in this form.
<html> <body> <?php require($DOCUMENT_ROOT . "test50.php"); ?> <?php if (isset($_POST['id'])) { $_SESSION['id']=$_POST['id']; //echo $_POST['id']; $a=$_POST['id']; $result3= mysql_query("SELECT * FROM `student1` LIMIT $a, 10 "); if(mysql_num_rows($result3) == 0){ echo "No results Found"; } else { echo "<table border='1'>"; echo "<tr>"; echo "<th>NAME</th><th>ROLLNO</th><th>CLASS</th><th>CONTACTNO</th>"; echo "</tr>"; while($row4 = mysql_fetch_array($result3)) { echo "<tr>"; echo "<td>".$row4['name'] . "<td>" . $row4['rollno'] . "<td>" .$row4['class'] . "<td>" . $row4['contactno']; echo "</tr>"; echo "<br />"; } echo "</table>"; //callfunc($a); //echo "$a"; echo "<br />"; $a+=10; echo "<br />"; //echo "$a"; } } ?> <?php if (!isset($_POST['id'])) { $a=0; function callfunc($a) { $result2 = mysql_query("SELECT * FROM `student1` LIMIT $a, 10 "); echo "<table border='1'>"; echo "<tr>"; echo "<th>NAME</th><th>ROLLNO</th><th>CLASS</th><th>CONTACTNO</th>"; echo "</tr>"; while($row2 = mysql_fetch_array($result2)) { echo "<tr>"; echo "<td>".$row2['name'] . "<td>" . $row2['rollno'] . "<td>" .$row2['class'] . "<td>" . $row2['contactno']; echo "</tr>"; echo "<br />"; } echo "</table>"; } callfunc($a); //echo "$a"; echo "<br />"; $a+=10; echo "<br />"; //echo "$a"; //echo '<INPUT type="button" value="NEXT" onClick="callfunc($a);" />'; mysql_close($con); } ?> <form method="post" action="test55-2.php"> <!-- <INPUT type="button" value="NEXT" onClick='<?$calltofun ?>' />--> <input type="hidden" name="id" value="<?= $a ?>"> <input type="submit" value="Next"> </form> </body> </html> |
|
#2
|
|||
|
|||
|
$_SESSION is a PHP super global. The contents of the session array is stored in a file in a serialized format, to enable values you set in one page to be accessible in another. In this case an id number (presumably for a database record), is being passed via $_POST to a session variable, so that it can be carried over to other pages.
isset() (not $_isset) is a function that determines if the variable you pass to it is set (declared). If you check a value with isset, you can use what it returns, to avoid notice errors when you try to use a value from a variable in your code that does not yet exist. |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Applications > have a look at this form and tell me.... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|