php - one script in all my HTML files that dynamically goes to the next/previous HTML page in the same folder -


Hello I have 2000 HTML files in a folder and their names run on each other in this way: < P> 01_001.html
01_002.html
01_003.html
01_004.html 02_001.html
02_002.html
02_003.html
........ .....
33_001.html
33_002.html
33_003.html
..............
33_123.html
< / P>

I would like to add a link / script to all 2000 HTML files which will dynamically move to the next / previous HTML page in the same folder

I know how to add it in PRL , But Javas Look like this kind of link / script in crypt / jQuery

I tried this script:

  & lt; A href = "#" onClick = "movePrv ();" & Gt; Previous & lt; / A & gt; End and lieutenant; A href = "#" onClick = "moveNext ();" & Gt; Next & lt; / A & gt;   

But does it work any thoughts?

Any solution in PHP may look like this:

  Lt ;? Php $ file = basename (__ file__); $ Chap = substr ($ file, 0, 2); $ Cat = substr ($ file, 3, 3); $ PrevFile = sprintf ("% 1 $ 02d_% 2 $ 03d.php", $ Arc, ($ cat-1)); $ Nextfile = sprint ("% 1 $ 02d_% 2 $ 03d.php", $ Arc, ($ Cat + 1)); Echo ($ prevFile); Echo ($ nextFile); $ IsFirst = ($ cat == "000"); $ IsLast =! File_exists ($ next file); ? & Gt;   

Use the variable $ nextFile and $ prevFile to create the link you would also like to check that the current file is first in a chapter Whether it is final or not, and then do not display the previous or next link.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -