Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End PHP slideshow refresh

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #30873
    smathis
    Member

    I’m new to php and attempting to set up a simple php gallery, where the next and prev buttons count up and down through an array then issue a page refresh when pushed.

    I know I can do this with js, but I’m wanting just a regular php fallback if js isn’t loaded. For some reason, I cannot get this to work! I can display the array images, links, etc, I just can’t find a good reference to get the regular ole form buttons to call a refresh within a function. Any ideas how I can fix this? Thanks in advance!!


    $i = 0;
    if($i > 6){
    $i = 0;
    }
    if($i < 0){
    $i = 6;
    }
    //Next Function
    function next_funct($i) {
    if($_POST) {
    ++$i;
    echo "";
    }}

    //Prev Function
    function prev_funct ($i) {
    if($_POST) {
    --$i;
    echo "";
    }}

    $current_page = $_SERVER;

    ?>

    #71328
    Bob
    Member

    The way I see it, you’re echoing a function (prev_funct and next_funct) when you click on of the buttons (onclick).
    I don’t think it’s needed or possible to echo a function, and it therefore should just read onclick=”

    Same goes for next_funct ofcourse.
    Not sure, but this might be it.

    #71278
    smathis
    Member

    Gave it a try, and it didn’t change the output any.

    Would I need to load the meta refresh differently? I was reading somewhere that you couldn’t offer a refresh except at the head of the document? Is that correct? I’ve read some really conflicting information on this concept so I’m a bit at a loss.

    #71252
    Bob
    Member

    What does it output anyway at the moment when you click those buttons?

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Back End’ is closed to new topics and replies.