Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--sample_cess.php-->
- <html>
- <body>
- <?php session_start();
- $track=$_SESSION['track_sess'];
- $sem=$_SESSION['sem_sess'];
- $strand=$_SESSION['strand_sess'];
- ?>
- <label>Track</label><br>
- <select name="track" onchange="window.location='session.php?track='+this.value">
- <option></option>
- <option value="Academic" <?php echo $track==='Academic' ? 'selected' : '' ?>>Academic</option>
- <option value="Technical-Vocational-Livelihood" <?php echo $track==='Technical-Vocational-Livelihood' ? 'selected' : '' ?>>Technical-Vocational-Livelihood</option>
- </select><br>
- <label>Semesters</label><br>
- <select name="semester" onchange="window.location='session.php?sem='+this.value">
- <option></option>
- <option value="First semester" <?php echo $sem==='First semester' ? 'selected' : '' ?>>First semester</option>
- <option value="Second semester" <?php echo $sem==='Second semester' ? 'selected' : '' ?>>Second semester</option>
- </select><br>
- <label>Strands</label><br>
- <select name="strands" onchange="window.location='session.php?strand='+this.value">
- <?php if($track=='Academic' && $sem=='First semester'){ ?>
- <option></option>
- <option value="Accountancy" <?php echo $strand==='Accountancy' ? 'selected' : '' ?>>Accountancy</option>
- <option value="Business and Management (ABM)" <?php echo $strand==='Business and Management (ABM)' ? 'selected' : '' ?>>Business and Management (ABM)</option>
- <option value="Science, Technology Engineering and Mathematics (STEM)" <?php echo $strand==='Science, Technology Engineering and Mathematics (STEM)' ? 'selected' : '' ?>>Science, Technology Engineering and Mathematics (STEM)</option>
- <option value="Humanities and Social Sciences (HUMSS)" <?php echo $strand==='Humanities and Social Sciences (HUMSS)' ? 'selected' : '' ?>>Humanities and Social Sciences (HUMSS)</option>
- <option value="General Academic (GAS)" <?php echo $strand==='General Academic (GAS)' ? 'selected' : '' ?>>General Academic (GAS)</option>
- <?php }
- if($track=='Technical-Vocational-Livelihood' && $sem=='First semester'){
- ?>
- <option></option>
- <option value="Information and Communications Technology (ICT)" <?php echo $strand==='Information and Communications Technology (ICT)' ? 'selected' : '' ?>>Information and Communications Technology (ICT)</option>
- <option value="Home Economics (HE)" <?php echo $strand==='Home Economics (HE)' ? 'selected' : '' ?>>Home Economics (HE)</option>
- <?php }
- if($track=='Academic' && $sem=='Second semester'){
- ?>
- <option></option>
- <option value="1st subject" <?php echo $strand==='1st subject' ? 'selected' : '' ?>>1st subject</option>
- <option value="2st subject" <?php echo $strand==='2st subject' ? 'selected' : '' ?>>2nd subject</option>
- <option value="3st subject" <?php echo $strand==='3st subject' ? 'selected' : '' ?>>3rd subject</option>
- <?php }
- if($track=='Technical-Vocational-Livelihood' && $sem=='Second semester'){
- ?>
- option></option>
- <option value="1st subject" <?php echo $strand==='1st subject' ? 'selected' : '' ?>>1st subject</option>
- <option value="2st subject" <?php echo $strand==='2st subject' ? 'selected' : '' ?>>2nd subject</option>
- <option value="3st subject" <?php echo $strand==='3st subject' ? 'selected' : '' ?>>3rd subject</option>
- <?php } ?>
- </select>
- <br><br><br>
- <div id="result">
- <?php
- echo $track."<br>". $_SESSION['sem_sess']."<br>". $_SESSION['strand_sess']; ?>
- </div>
- </body>
- </html>
- <!--session.php-->
- <?php
- session_start();
- $track=$_GET["track"];
- $sem=$_GET["sem"];
- $strand=$_GET["strand"];
- if(isset($track)){
- $_SESSION['track_sess']=$track;
- }
- if(isset($sem)){
- $_SESSION['sem_sess']=$sem;
- }
- if(isset($strand)){
- $_SESSION['strand_sess']=$strand;
- }
- header("location:sample_sess.php");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement