Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your form <code>onsubmit</code> seems to be wrong. <code>onsubmit</code> should be a <code>javascript function</code> not a <code>php file</code>. if you need to submit to php file you should use <code>action</code> attribute of <code>form</code>. currently you have given it as <code>report.php</code>. you may need to change it to <code>yearpdf.php</code> or redirect in the <code>report.php</code></p> <p>EDIT 1:</p> <p>the problem is you are calling the <code>window.open</code> which opens an url but doesn't submit your input value. so first time nothing will happen. but however on the next <code>window.open</code> or on the next refresh, there is the session variable from report.php and thus retrieves the data. you can follow some options</p> <ol> <li>put the code of report.php that to process the submit in yearpdf.php and change the form "action" to the yearpdf.php. and remove onclick function</li> <li>OR Redirect from report.php to yearpdf.php in the end of report.php. For redirect you can use <code>header('Location: <a href="http://www.yoursite.com/yearpdf.php" rel="nofollow">http://www.yoursite.com/yearpdf.php</a>');</code>. and remove onclick function</li> <li>OR modfiy your JavaScript code to send something like this <code>window.open("yearpdf.php" + "?course_year=" + document.getElementsByName("course_year")[0].value));</code> and change your <code>$r1=$_SESSION['year1'];</code> to <code>$r1=$_GET['course_year'];</code> in yearpdf.php</li> </ol> <p>Option 1 is the recommended and simple way. Option 2 is an overhead and won't work if you output any html before redirection. and Option 3 produces an unnecessary window. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload