• # January 10, 2009 at 4:00 pm

    This could probably be done a few different ways, but I want to figure out how to use PHP to accomplish this.

    So, I want to be able to have the text contained in a certain p element change when the corresponding image is clicked.

    I want to do this so that everything will happen on the one page instead of having to created x amount of pages for all the images/text I have.

    I’m probably making this harder than it really is. Any help/advice is appreciated. Thanks.

    # January 10, 2009 at 4:59 pm


    I think I figured it out.

    # January 10, 2009 at 6:15 pm

    Ok well, now I have a new issue.

    The way I got it to work is by setting different variables for each new block of text. I used a switch statement to have the blocks of text change when the corresponding image is clicked. However, when you first load the page, all you see are the images you can click to show the text.

    Now I’m trying to figure out how to have text already be on the page and then be replaced when an image is clicked and not seen again until the entire page is reloaded.

    Any ideas?

    # January 10, 2009 at 6:21 pm

    Wow, nevermind, I’m dumb..


    # January 14, 2009 at 9:25 pm

    Well, like I said before, I accomplished this by using a switch statement. However, on this same page, I have a tiny contact form that is also using PHP. My problem now is when you click "send" to submit the form, the page reloads/refreshes instead of staying in the current state.

    If anyone knows how to make the page stay at whatever is currently loaded instead of refreshing when the "send" button is pressed, please enlighten me. Thanks!

    # January 15, 2009 at 5:39 pm

    you can use ajax to send the form in the background so the user still stays on the same page without a refresh. Or you could save the current page in a session, and after you submit the form you look in the session what page you were on and go there again.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.