Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Help to make PHP Content Switcher work

  1. #1
    Join Date
    Jan 2016
    Posts
    23
    Thanks
    49
    Thanked 3 Times in 2 Posts

    Default Help to make PHP Content Switcher work

    Beverlyh, I have been working my way through your blog feed and would like to set up your PHP Content Switcher script to work with the Gif Player that you assisted with yesterday.

    The blog I am referring to is this http://www.dynamicdrive.com/forums/e...th-Save-Cookie

    And the Gif Player topic is this http://www.dynamicdrive.com/forums/s...-on-a-web-page

    The idea would be to use the pagination aspect of the Content Switcher script to load different chapters of an online tutorial with each chapter showing several animated Gifs as learning aids. The last loaded page will save so that users can return without losing their place.

    I can visualize how this would work but cannot get the sample code from the blog working for me. I haven't used PHP before but your tutorial reads logically. I therefor conclude that my problem lies with my web space. Are there perhaps any special requirements to run the script?

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Not really. You only need a server running PHP, which most web host accounts will be set up to provide (unless maybe you're using a really basic freebie account, but the lack of PHP still seems unlikely)

    You can check that you have PHP on your server by creating a file in Notepad with this inside;
    PHP Code:
    <?php phpinfo(); ?>
    Now save the file as "info.php" and upload it to your web server. Make sure that the file is named "info.php" and not "info.php.txt" otherwise the PHP won't parse when you view it via a web browser.

    When you view the file in a web browser (the URL will be something like http://my website.com/info.php ) you should see loads of server info with a blue PHP banner. If that's the case , you're good to go.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. The Following User Says Thank You to Beverleyh For This Useful Post:

    Ripsaw (01-04-2016)

  4. #3
    Join Date
    Jan 2016
    Posts
    23
    Thanks
    49
    Thanked 3 Times in 2 Posts

    Default

    Thank you once again for your prompt reply. The info.php page does display a huge list of server details so I am sure I can work with PHP. The file extension was probably my oversight and reason for my failed tests. Special test pages for the script using a .php file extension do work now you have pointed it out. Is there any way to have this work with pages ending with a .htm or .html extension because I have many files and links already configured that will create much work to change to .php

    Please let me know if anything is possible because I would really love to use the script.

  5. #4
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Something *may* be possible, but first, can you find out if you can use an ".htaccess" file on your server?

    There might be an option to create one in your web host control panel, or if you can't see anything obvious, a quick email to your host asking if you can use htaccess will help clear things up.

    Let me know what you find out.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  6. The Following User Says Thank You to Beverleyh For This Useful Post:

    Ripsaw (01-05-2016)

  7. #5
    Join Date
    Jan 2016
    Posts
    23
    Thanks
    49
    Thanked 3 Times in 2 Posts

    Default

    Yes I can use htaccess files. What next?

  8. #6
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    First rename the "info.php" file to "info.htm" - we're going to make some server changes so that the .htm version of the page can parse PHP. It might not work, but we'll give it a try...

    Go to http://deano.me/2015/12/php-inside-h...sing-htaccess/ and scroll down to the "Different Method" section. Apply each of the examples in turn to your ".htaccess file" at the root of your website. Between each line-test, save the ".htaccess" file and view your "info.htm" web page in a browser.

    If one of these lines allows you to view the server info with a blue PHP banner from within the "info.htm" file, it means you've made your server parse any PHP from within any htm/html page, and you should now be able to use the PHP Content Switcher Script (or any other PHP script ) in your existing .htm or .html pages.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  9. The Following User Says Thank You to Beverleyh For This Useful Post:

    Ripsaw (01-05-2016)

  10. #7
    Join Date
    Jan 2016
    Posts
    23
    Thanks
    49
    Thanked 3 Times in 2 Posts

    Default

    It works! You are my hero!

  11. #8
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    No problem. Glad it worked
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  12. The Following User Says Thank You to Beverleyh For This Useful Post:

    Ripsaw (01-05-2016)

  13. #9
    Join Date
    Jan 2016
    Posts
    23
    Thanks
    49
    Thanked 3 Times in 2 Posts

    Default

    One last thing... Will the htaccess trick affect any other scripts of have any adverse effects anywhere else?

  14. #10
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    I shouldn't affect any other scripts. The only thing that it will do is to make the server work a little harder, which may have the effect of slowing down web pages if you're using shared hosting, or if the script is resource intensive (performing a lot of iterations or querying databases, etc.). It shouldn't be perceivable with this simple script though.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  15. The Following User Says Thank You to Beverleyh For This Useful Post:

    Ripsaw (01-05-2016)

Similar Threads

  1. How to make a normal URL work inside Featured Content Glider?
    By nberidze in forum Dynamic Drive scripts help
    Replies: 17
    Last Post: 02-27-2015, 09:13 AM
  2. Resolved How to make style sheet random switcher selection apply to entire site?
    By printman55 in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 05-25-2010, 10:49 AM
  3. Content switcher
    By Schmoopy in forum Looking for such a script or service
    Replies: 4
    Last Post: 11-19-2008, 03:06 PM
  4. How to make Dock Content Script work on Safari?
    By shirster in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 11-05-2008, 07:56 PM
  5. Content Switcher II on dynamic tables
    By dioncecht in forum Dynamic Drive scripts help
    Replies: 5
    Last Post: 10-24-2005, 03:50 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •