Hello,
I would like to know how I can validate data from the form.php before using it to retreive a specific article from the $laws array on process.php
(form.php)
[php]
Chapter:
Article:
(process.php)
[php]
"; echo $laws[$group][$chapter][$article]; ?>
PREVIOUS Articles NEXT Articles
[/php]
Question 1
Before setting $_SESSION values with data from $_GET variables, how do I validate the $_GET values from the form with the following scheme?
Data in CHAPTER and ARTICLE input forms:
are not empty;
are numbers;
are not less than or greater than the existing array Chapters and Article numbers;
do not have spaces;
do not have decimals;
do not have letters;
do not have negative, positive and; or other signs;
Question 2
What PHP code should I add to the NEXT Article and PREVIOUS Article links, to echo the next article after the currently echoed article?
how should I add this code to the links;
what should be done to the page when the the last article or the first article has been echoed since the NEXT Article and PREVIOUS Article links wouldn’t access anymore non-existent arrays in a particular chapter to prevent ERRORS being echoed back.
Thank you!